diff --git a/dist/main/index.js b/dist/main/index.js
index 2540fa0..893f588 100644
--- a/dist/main/index.js
+++ b/dist/main/index.js
@@ -1,274 +1,11 @@
-/******/ (() => { // webpackBootstrap
-/******/ var __webpack_modules__ = ({
+import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
+/******/ var __webpack_modules__ = ({
-/***/ 9018:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.create = void 0;
-const github_1 = __nccwpck_require__(5438);
-async function invalidatePreviousDeployments(octokitClient, environment) {
- const deployments = await octokitClient.rest.repos.listDeployments({
- ...github_1.context.repo,
- ref: github_1.context.ref,
- environment
- });
- await Promise.all(deployments.data.map(async (deployment) => {
- const statuses = await octokitClient.rest.repos.listDeploymentStatuses({
- ...github_1.context.repo,
- deployment_id: deployment.id
- });
- const lastStatus = statuses.data.sort((a, b) => a.id - b.id).slice(-1)[0];
- console.log(`last status for deployment_id '${deployment.id}': ${JSON.stringify(lastStatus, null, 2)}`);
- // invalidate the deployment
- if (lastStatus?.state === 'success') {
- console.log(`invalidating deployment: ${JSON.stringify(deployment, null, 2)}`);
- await octokitClient.rest.repos.createDeploymentStatus({
- ...github_1.context.repo,
- deployment_id: deployment.id,
- state: 'inactive',
- environment_url: lastStatus.environment_url,
- log_url: lastStatus.log_url
- });
- }
- }));
-}
-async function getMainSha(octokitClient, branch) {
- try {
- const response = await octokitClient.rest.repos.getBranch({ ...github_1.context.repo, branch });
- const sha = String(response.data.commit.sha);
- console.log(`${branch} branch sha: ${sha}`);
- return sha;
- }
- catch (error) {
- console.error(error.message);
- return `no_${branch}`;
- }
-}
-async function create(octokitClient, logUrl, description, initialStatus, environment, environmentUrl, mainBranch) {
- await invalidatePreviousDeployments(octokitClient, environment);
- // get main branch sha to store in payload
- const mainBranchSha = await getMainSha(octokitClient, mainBranch);
- const payload = JSON.stringify({ actor: github_1.context.actor, main_sha: mainBranchSha });
- const deployment = await octokitClient.rest.repos.createDeployment({
- ...github_1.context.repo,
- ref: github_1.context.ref,
- required_contexts: [],
- environment,
- transient_environment: true,
- auto_merge: false,
- description,
- payload
- });
- const deploymentId = deployment.data.id;
- console.log(`created deployment: ${JSON.stringify(deployment.data, null, 2)}`);
- const status = await octokitClient.rest.repos.createDeploymentStatus({
- ...github_1.context.repo,
- deployment_id: deploymentId,
- state: initialStatus,
- log_url: logUrl,
- environment_url: environmentUrl
- });
- console.log(`created deployment status: ${JSON.stringify(status.data, null, 2)}`);
- return deploymentId.toString();
-}
-exports.create = create;
-
-
-/***/ }),
-
-/***/ 9854:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.deleteAll = void 0;
-const github_1 = __nccwpck_require__(5438);
-async function deleteAll(octokitClient, environment) {
- const deployments = await octokitClient.rest.repos.listDeployments({
- ...github_1.context.repo,
- environment
- });
- await Promise.all(deployments.data.map(async (deployment) => {
- // invalidate deployment first
- // since we can't delete active deployment
- console.log(`invalidate deployment: ${deployment.id}`);
- await octokitClient.rest.repos.createDeploymentStatus({
- ...github_1.context.repo,
- deployment_id: deployment.id,
- state: 'failure'
- });
- // then delete it
- console.log(`delete deployment: ${deployment.url}`);
- await octokitClient.request(deployment.url, { method: 'DELETE' });
- }));
-}
-exports.deleteAll = deleteAll;
-
-
-/***/ }),
-
-/***/ 9645:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.deleteDeployment = void 0;
-const github_1 = __nccwpck_require__(5438);
-async function deleteDeployment(octoKitClient, deploymentId) {
- // invalidate deployment first
- // since we can't delete active deployment
- console.log(`invalidate deployment: ${deploymentId}`);
- const status = await octoKitClient.rest.repos.createDeploymentStatus({
- ...github_1.context.repo,
- deployment_id: deploymentId,
- state: 'failure'
- });
- // then delete it
- const deploymentUrl = String(status.data.deployment_url);
- console.log(`delete deployment: ${deploymentUrl}`);
- await octoKitClient.request(deploymentUrl, { method: 'DELETE' });
-}
-exports.deleteDeployment = deleteDeployment;
-
-
-/***/ }),
-
-/***/ 3109:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.run = void 0;
-const core = __importStar(__nccwpck_require__(2186));
-const github = __importStar(__nccwpck_require__(5438));
-const create_1 = __nccwpck_require__(9018);
-const delete_all_1 = __nccwpck_require__(9854);
-const delete_1 = __nccwpck_require__(9645);
-const utils_1 = __nccwpck_require__(918);
-async function run() {
- let token;
- let type;
- let logsUrl;
- let description;
- let status;
- let environment;
- let environmentUrl;
- let deploymentId;
- let mainBranch;
- const { actor, ref } = github.context;
- console.log('### main.context ###');
- console.log(`actor: ${actor}`);
- console.log(`ref: ${ref}`);
- console.log('\n');
- try {
- console.log('### main.inputs ###');
- token = (0, utils_1.getInput)('token', { required: true }) ?? '';
- type = (0, utils_1.getInput)('type', { required: true });
- console.log(`type: ${type}`);
- logsUrl = (0, utils_1.getInput)('logs') ?? '';
- console.log(`logs: ${logsUrl}`);
- description = (0, utils_1.getInput)('description') ?? `deployed by ${actor}`;
- console.log(`description: ${description}`);
- status = ((0, utils_1.getInput)('status') ?? 'in_progress');
- console.log(`status: ${status}`);
- environment = (0, utils_1.getEnvironment)(ref);
- environmentUrl = (0, utils_1.getInput)('environment_url') ?? '';
- console.log(`environmentUrl: ${environmentUrl}`);
- mainBranch = (0, utils_1.getInput)('main_branch') ?? 'master';
- console.log(`main branch: ${mainBranch}`);
- const shouldRequireDeploymentId = type === 'delete';
- deploymentId = (0, utils_1.getInput)(utils_1.DEPLOYMENT_ID_STATE_NAME, { required: shouldRequireDeploymentId }) ?? '0';
- console.log(`deploymentId: ${deploymentId}`);
- }
- catch (error) {
- core.error(error);
- core.setFailed(`Wrong parameters given: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- console.log('\n');
- const octokitClient = github.getOctokit(token, { previews: ['ant-man', 'flash'] });
- console.log('### run ###');
- switch (type) {
- case 'create':
- try {
- // If a deployment was already created on a previous job,
- // don't create one again.
- if (deploymentId === '0') {
- deploymentId = await (0, create_1.create)(octokitClient, logsUrl, description, status, environment, environmentUrl, mainBranch);
- }
- console.log(`saveState::${utils_1.DEPLOYMENT_ID_STATE_NAME}: ${deploymentId}`);
- core.saveState(utils_1.DEPLOYMENT_ID_STATE_NAME, deploymentId); // for internal use
- core.setOutput(utils_1.DEPLOYMENT_ID_STATE_NAME, deploymentId); // keep that output for external dependencies
- }
- catch (error) {
- core.error(error);
- core.setFailed(`Create deployment failed: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- break;
- case 'delete':
- try {
- await (0, delete_1.deleteDeployment)(octokitClient, Number(deploymentId));
- }
- catch (error) {
- core.error(error);
- core.setFailed(`Delete deployment failed: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- break;
- case 'delete-all':
- try {
- await (0, delete_all_1.deleteAll)(octokitClient, environment);
- }
- catch (error) {
- core.error(error);
- core.setFailed(`Delete all deployments failed: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- break;
- }
-}
-exports.run = run;
-if (process.env.NODE_ENV !== 'test')
- run(); // eslint-disable-line @typescript-eslint/no-floating-promises
-
-
-/***/ }),
-
-/***/ 918:
+/***/ 4844:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
+/* eslint-disable @typescript-eslint/no-explicit-any */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -285,210 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : 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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.postSlackNotification = exports.getEnvironment = exports.getInput = exports.DEPLOYMENT_ID_STATE_NAME = void 0;
-const core = __importStar(__nccwpck_require__(2186));
-const web_api_1 = __nccwpck_require__(431);
-exports.DEPLOYMENT_ID_STATE_NAME = 'deployment_id';
-// nullify getInput empty results
-// to allow coalescence ?? operator
-function getInput(name, options) {
- const result = core.getInput(name, options);
- if (result === '') {
- return null;
- }
- return result;
-}
-exports.getInput = getInput;
-function getEnvironment(ref) {
- // default to branch name w/o `deploy-` prefix
- const environment = getInput('environment') ?? ref.replace('refs/heads/', '').replace(/^deploy-/, '');
- console.log(`environment: ${environment}`);
- return environment;
-}
-exports.getEnvironment = getEnvironment;
-async function postSlackNotification(slackToken, slackChannel, environment, status, context, deploymentConfidenceUrl, sha) {
- if (slackToken === '' || slackChannel === '') {
- return;
- }
- const { actor, repo, payload } = context;
- try {
- const statusIcon = status === 'success' ? '✅' : '❌';
- const afterSha = sha.slice(0, 7);
- const repoUrl = `https://github.com/${repo.owner}/${repo.repo}`;
- const deploymentUrl = `${repoUrl}/deployments?environment=${environment}#activity-log`;
- const commitUrl = `${repoUrl}/commit/${sha}`;
- let commitText = `<${commitUrl}|${afterSha}>`;
- const payloadForPushes = payload;
- if (payloadForPushes?.compare !== undefined) {
- const beforeSha = payloadForPushes.before.slice(0, 7);
- const afterShaMessage = payloadForPushes.head_commit.message ?? '';
- const shortShaMessage = trimEllipsis(afterShaMessage.replace(/(\r\n|\n|\r).*$/gm, ''), 60); // keep only some first symbols of the first line
- commitText = `<${payloadForPushes.compare}|${beforeSha} ⇢ ${afterSha} ${shortShaMessage}>`;
- }
- // message formatting reference - https://api.slack.com/reference/surfaces/formatting
- let text;
- const baseText = `<${repoUrl}|${repo.repo}> deployment 🚀 to <${deploymentUrl}|${environment}> by <@${actor.toLowerCase()}> completed with ${status} ${statusIcon} - ${commitText}.`;
- if (deploymentConfidenceUrl !== '' && status === 'success') {
- text = `${baseText}\n\n:toolbox: Check out our <${deploymentConfidenceUrl}|deployment confidence dashboard> so you are the first to know if anything is broken.`;
- }
- else {
- text = baseText;
- }
- const slackClient = new web_api_1.WebClient(slackToken);
- const slackParams = {
- channel: slackChannel,
- unfurl_links: false,
- mrkdwn: true,
- text
+var __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
};
- console.log(`Posting Slack message: ${text}`);
- // API description - https://api.slack.com/methods/chat.postMessage
- await slackClient.chat.postMessage(slackParams);
- console.log(`Slack message posted to channel: ${slackChannel}`);
- }
- catch (error) {
- core.error(error);
- }
-}
-exports.postSlackNotification = postSlackNotification;
-function trimEllipsis(str, length) {
- return str.length > length ? `${str.substring(0, length)}...` : str;
-}
-
-
-/***/ }),
-
-/***/ 7351:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.issue = exports.issueCommand = void 0;
-const os = __importStar(__nccwpck_require__(2037));
-const utils_1 = __nccwpck_require__(5278);
-/**
- * Commands
- *
- * Command Format:
- * ::name key=value,key=value::message
- *
- * Examples:
- * ::warning::This is the message
- * ::set-env name=MY_VAR::some value
- */
-function issueCommand(command, properties, message) {
- const cmd = new Command(command, properties, message);
- process.stdout.write(cmd.toString() + os.EOL);
-}
-exports.issueCommand = issueCommand;
-function issue(name, message = '') {
- issueCommand(name, {}, message);
-}
-exports.issue = issue;
-const CMD_STRING = '::';
-class Command {
- constructor(command, properties, message) {
- if (!command) {
- command = 'missing.command';
- }
- this.command = command;
- this.properties = properties;
- this.message = message;
- }
- toString() {
- let cmdStr = CMD_STRING + this.command;
- if (this.properties && Object.keys(this.properties).length > 0) {
- cmdStr += ' ';
- let first = true;
- for (const key in this.properties) {
- if (this.properties.hasOwnProperty(key)) {
- const val = this.properties[key];
- if (val) {
- if (first) {
- first = false;
- }
- else {
- cmdStr += ',';
- }
- cmdStr += `${key}=${escapeProperty(val)}`;
- }
- }
- }
- }
- cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
- return cmdStr;
- }
-}
-function escapeData(s) {
- return utils_1.toCommandValue(s)
- .replace(/%/g, '%25')
- .replace(/\r/g, '%0D')
- .replace(/\n/g, '%0A');
-}
-function escapeProperty(s) {
- return utils_1.toCommandValue(s)
- .replace(/%/g, '%25')
- .replace(/\r/g, '%0D')
- .replace(/\n/g, '%0A')
- .replace(/:/g, '%3A')
- .replace(/,/g, '%2C');
-}
-//# sourceMappingURL=command.js.map
-
-/***/ }),
-
-/***/ 2186:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -499,993 +49,239 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
-const command_1 = __nccwpck_require__(7351);
-const file_command_1 = __nccwpck_require__(717);
-const utils_1 = __nccwpck_require__(5278);
-const os = __importStar(__nccwpck_require__(2037));
-const path = __importStar(__nccwpck_require__(1017));
-const oidc_utils_1 = __nccwpck_require__(8041);
-/**
- * The code to exit an action
- */
-var ExitCode;
-(function (ExitCode) {
- /**
- * A code indicating that the action was successful
- */
- ExitCode[ExitCode["Success"] = 0] = "Success";
- /**
- * A code indicating that the action was a failure
- */
- ExitCode[ExitCode["Failure"] = 1] = "Failure";
-})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
-//-----------------------------------------------------------------------
-// Variables
-//-----------------------------------------------------------------------
-/**
- * Sets env variable for this action and future actions in the job
- * @param name the name of the variable to set
- * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
- */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function exportVariable(name, val) {
- const convertedVal = utils_1.toCommandValue(val);
- process.env[name] = convertedVal;
- const filePath = process.env['GITHUB_ENV'] || '';
- if (filePath) {
- const delimiter = '_GitHubActionsFileCommandDelimeter_';
- const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
- file_command_1.issueCommand('ENV', commandValue);
- }
- else {
- command_1.issueCommand('set-env', { name }, convertedVal);
- }
-}
-exports.exportVariable = exportVariable;
+exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
+exports.getProxyUrl = getProxyUrl;
+exports.isHttps = isHttps;
+const http = __importStar(__nccwpck_require__(8611));
+const https = __importStar(__nccwpck_require__(5692));
+const pm = __importStar(__nccwpck_require__(4988));
+const tunnel = __importStar(__nccwpck_require__(770));
+const undici_1 = __nccwpck_require__(6752);
+var HttpCodes;
+(function (HttpCodes) {
+ HttpCodes[HttpCodes["OK"] = 200] = "OK";
+ HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
+ HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
+ HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
+ HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
+ HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
+ HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
+ HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
+ HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
+ HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
+ HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
+ HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
+ HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
+ HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
+ HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
+ HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
+ HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
+ HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
+ HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
+ HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
+ HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
+ HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
+ HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
+ HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
+ HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
+ HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
+ HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
+})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
+var Headers;
+(function (Headers) {
+ Headers["Accept"] = "accept";
+ Headers["ContentType"] = "content-type";
+})(Headers || (exports.Headers = Headers = {}));
+var MediaTypes;
+(function (MediaTypes) {
+ MediaTypes["ApplicationJson"] = "application/json";
+})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
/**
- * Registers a secret which will get masked from logs
- * @param secret value of the secret
+ * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
+ * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
-function setSecret(secret) {
- command_1.issueCommand('add-mask', {}, secret);
+function getProxyUrl(serverUrl) {
+ const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
+ return proxyUrl ? proxyUrl.href : '';
}
-exports.setSecret = setSecret;
-/**
- * Prepends inputPath to the PATH (for this action and future actions)
- * @param inputPath
- */
-function addPath(inputPath) {
- const filePath = process.env['GITHUB_PATH'] || '';
- if (filePath) {
- file_command_1.issueCommand('PATH', inputPath);
- }
- else {
- command_1.issueCommand('add-path', {}, inputPath);
+const HttpRedirectCodes = [
+ HttpCodes.MovedPermanently,
+ HttpCodes.ResourceMoved,
+ HttpCodes.SeeOther,
+ HttpCodes.TemporaryRedirect,
+ HttpCodes.PermanentRedirect
+];
+const HttpResponseRetryCodes = [
+ HttpCodes.BadGateway,
+ HttpCodes.ServiceUnavailable,
+ HttpCodes.GatewayTimeout
+];
+const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
+const ExponentialBackoffCeiling = 10;
+const ExponentialBackoffTimeSlice = 5;
+class HttpClientError extends Error {
+ constructor(message, statusCode) {
+ super(message);
+ this.name = 'HttpClientError';
+ this.statusCode = statusCode;
+ Object.setPrototypeOf(this, HttpClientError.prototype);
}
- process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
-exports.addPath = addPath;
-/**
- * Gets the value of an input.
- * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
- * Returns an empty string if the value is not defined.
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns string
- */
-function getInput(name, options) {
- const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
- if (options && options.required && !val) {
- throw new Error(`Input required and not supplied: ${name}`);
+exports.HttpClientError = HttpClientError;
+class HttpClientResponse {
+ constructor(message) {
+ this.message = message;
}
- if (options && options.trimWhitespace === false) {
- return val;
+ readBody() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ let output = Buffer.alloc(0);
+ this.message.on('data', (chunk) => {
+ output = Buffer.concat([output, chunk]);
+ });
+ this.message.on('end', () => {
+ resolve(output.toString());
+ });
+ }));
+ });
+ }
+ readBodyBuffer() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ const chunks = [];
+ this.message.on('data', (chunk) => {
+ chunks.push(chunk);
+ });
+ this.message.on('end', () => {
+ resolve(Buffer.concat(chunks));
+ });
+ }));
+ });
}
- return val.trim();
}
-exports.getInput = getInput;
-/**
- * Gets the values of an multiline input. Each value is also trimmed.
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns string[]
- *
- */
-function getMultilineInput(name, options) {
- const inputs = getInput(name, options)
- .split('\n')
- .filter(x => x !== '');
- return inputs;
-}
-exports.getMultilineInput = getMultilineInput;
-/**
- * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
- * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
- * The return value is also in boolean type.
- * ref: https://yaml.org/spec/1.2/spec.html#id2804923
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns boolean
- */
-function getBooleanInput(name, options) {
- const trueValue = ['true', 'True', 'TRUE'];
- const falseValue = ['false', 'False', 'FALSE'];
- const val = getInput(name, options);
- if (trueValue.includes(val))
- return true;
- if (falseValue.includes(val))
- return false;
- throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
- `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
-}
-exports.getBooleanInput = getBooleanInput;
-/**
- * Sets the value of an output.
- *
- * @param name name of the output to set
- * @param value value to store. Non-string values will be converted to a string via JSON.stringify
- */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function setOutput(name, value) {
- process.stdout.write(os.EOL);
- command_1.issueCommand('set-output', { name }, value);
-}
-exports.setOutput = setOutput;
-/**
- * Enables or disables the echoing of commands into stdout for the rest of the step.
- * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
- *
- */
-function setCommandEcho(enabled) {
- command_1.issue('echo', enabled ? 'on' : 'off');
-}
-exports.setCommandEcho = setCommandEcho;
-//-----------------------------------------------------------------------
-// Results
-//-----------------------------------------------------------------------
-/**
- * Sets the action status to failed.
- * When the action exits it will be with an exit code of 1
- * @param message add error issue message
- */
-function setFailed(message) {
- process.exitCode = ExitCode.Failure;
- error(message);
-}
-exports.setFailed = setFailed;
-//-----------------------------------------------------------------------
-// Logging Commands
-//-----------------------------------------------------------------------
-/**
- * Gets whether Actions Step Debug is on or not
- */
-function isDebug() {
- return process.env['RUNNER_DEBUG'] === '1';
-}
-exports.isDebug = isDebug;
-/**
- * Writes debug message to user log
- * @param message debug message
- */
-function debug(message) {
- command_1.issueCommand('debug', {}, message);
-}
-exports.debug = debug;
-/**
- * Adds an error issue
- * @param message error issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function error(message, properties = {}) {
- command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.error = error;
-/**
- * Adds a warning issue
- * @param message warning issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function warning(message, properties = {}) {
- command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.warning = warning;
-/**
- * Adds a notice issue
- * @param message notice issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function notice(message, properties = {}) {
- command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.notice = notice;
-/**
- * Writes info to log with console.log.
- * @param message info message
- */
-function info(message) {
- process.stdout.write(message + os.EOL);
-}
-exports.info = info;
-/**
- * Begin an output group.
- *
- * Output until the next `groupEnd` will be foldable in this group
- *
- * @param name The name of the output group
- */
-function startGroup(name) {
- command_1.issue('group', name);
-}
-exports.startGroup = startGroup;
-/**
- * End an output group.
- */
-function endGroup() {
- command_1.issue('endgroup');
+exports.HttpClientResponse = HttpClientResponse;
+function isHttps(requestUrl) {
+ const parsedUrl = new URL(requestUrl);
+ return parsedUrl.protocol === 'https:';
}
-exports.endGroup = endGroup;
-/**
- * Wrap an asynchronous function call in a group.
- *
- * Returns the same type as the function itself.
- *
- * @param name The name of the group
- * @param fn The function to wrap in the group
- */
-function group(name, fn) {
- return __awaiter(this, void 0, void 0, function* () {
- startGroup(name);
- let result;
- try {
- result = yield fn();
- }
- finally {
- endGroup();
+class HttpClient {
+ constructor(userAgent, handlers, requestOptions) {
+ this._ignoreSslError = false;
+ this._allowRedirects = true;
+ this._allowRedirectDowngrade = false;
+ this._maxRedirects = 50;
+ this._allowRetries = false;
+ this._maxRetries = 1;
+ this._keepAlive = false;
+ this._disposed = false;
+ this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
+ this.handlers = handlers || [];
+ this.requestOptions = requestOptions;
+ if (requestOptions) {
+ if (requestOptions.ignoreSslError != null) {
+ this._ignoreSslError = requestOptions.ignoreSslError;
+ }
+ this._socketTimeout = requestOptions.socketTimeout;
+ if (requestOptions.allowRedirects != null) {
+ this._allowRedirects = requestOptions.allowRedirects;
+ }
+ if (requestOptions.allowRedirectDowngrade != null) {
+ this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
+ }
+ if (requestOptions.maxRedirects != null) {
+ this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
+ }
+ if (requestOptions.keepAlive != null) {
+ this._keepAlive = requestOptions.keepAlive;
+ }
+ if (requestOptions.allowRetries != null) {
+ this._allowRetries = requestOptions.allowRetries;
+ }
+ if (requestOptions.maxRetries != null) {
+ this._maxRetries = requestOptions.maxRetries;
+ }
}
- return result;
- });
-}
-exports.group = group;
-//-----------------------------------------------------------------------
-// Wrapper action state
-//-----------------------------------------------------------------------
-/**
- * Saves state for current action, the state can only be retrieved by this action's post job execution.
- *
- * @param name name of the state to store
- * @param value value to store. Non-string values will be converted to a string via JSON.stringify
- */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function saveState(name, value) {
- command_1.issueCommand('save-state', { name }, value);
-}
-exports.saveState = saveState;
-/**
- * Gets the value of an state set by this action's main execution.
- *
- * @param name name of the state to get
- * @returns string
- */
-function getState(name) {
- return process.env[`STATE_${name}`] || '';
-}
-exports.getState = getState;
-function getIDToken(aud) {
- return __awaiter(this, void 0, void 0, function* () {
- return yield oidc_utils_1.OidcClient.getIDToken(aud);
- });
-}
-exports.getIDToken = getIDToken;
-//# sourceMappingURL=core.js.map
-
-/***/ }),
-
-/***/ 717:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-// For internal use, subject to change.
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.issueCommand = void 0;
-// We use any as a valid input type
-/* eslint-disable @typescript-eslint/no-explicit-any */
-const fs = __importStar(__nccwpck_require__(7147));
-const os = __importStar(__nccwpck_require__(2037));
-const utils_1 = __nccwpck_require__(5278);
-function issueCommand(command, message) {
- const filePath = process.env[`GITHUB_${command}`];
- if (!filePath) {
- throw new Error(`Unable to find environment variable for file command ${command}`);
- }
- if (!fs.existsSync(filePath)) {
- throw new Error(`Missing file at path: ${filePath}`);
}
- fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
- encoding: 'utf8'
- });
-}
-exports.issueCommand = issueCommand;
-//# sourceMappingURL=file-command.js.map
-
-/***/ }),
-
-/***/ 8041:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.OidcClient = void 0;
-const http_client_1 = __nccwpck_require__(9925);
-const auth_1 = __nccwpck_require__(3702);
-const core_1 = __nccwpck_require__(2186);
-class OidcClient {
- static createHttpClient(allowRetry = true, maxRetry = 10) {
- const requestOptions = {
- allowRetries: allowRetry,
- maxRetries: maxRetry
- };
- return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
+ options(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
+ });
}
- static getRequestToken() {
- const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
- if (!token) {
- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
- }
- return token;
+ get(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('GET', requestUrl, null, additionalHeaders || {});
+ });
}
- static getIDTokenUrl() {
- const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
- if (!runtimeUrl) {
- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
- }
- return runtimeUrl;
+ del(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('DELETE', requestUrl, null, additionalHeaders || {});
+ });
}
- static getCall(id_token_url) {
- var _a;
+ post(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
- const httpclient = OidcClient.createHttpClient();
- const res = yield httpclient
- .getJson(id_token_url)
- .catch(error => {
- throw new Error(`Failed to get ID Token. \n
- Error Code : ${error.statusCode}\n
- Error Message: ${error.result.message}`);
- });
- const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
- if (!id_token) {
- throw new Error('Response json body do not have ID Token field');
- }
- return id_token;
+ return this.request('POST', requestUrl, data, additionalHeaders || {});
});
}
- static getIDToken(audience) {
+ patch(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
- try {
- // New ID Token is requested from action service
- let id_token_url = OidcClient.getIDTokenUrl();
- if (audience) {
- const encodedAudience = encodeURIComponent(audience);
- id_token_url = `${id_token_url}&audience=${encodedAudience}`;
- }
- core_1.debug(`ID token url is ${id_token_url}`);
- const id_token = yield OidcClient.getCall(id_token_url);
- core_1.setSecret(id_token);
- return id_token;
- }
- catch (error) {
- throw new Error(`Error message: ${error.message}`);
- }
+ return this.request('PATCH', requestUrl, data, additionalHeaders || {});
});
}
-}
-exports.OidcClient = OidcClient;
-//# sourceMappingURL=oidc-utils.js.map
-
-/***/ }),
-
-/***/ 5278:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// We use any as a valid input type
-/* eslint-disable @typescript-eslint/no-explicit-any */
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.toCommandProperties = exports.toCommandValue = void 0;
-/**
- * Sanitizes an input into a string so it can be passed into issueCommand safely
- * @param input input to sanitize into a string
- */
-function toCommandValue(input) {
- if (input === null || input === undefined) {
- return '';
+ put(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('PUT', requestUrl, data, additionalHeaders || {});
+ });
}
- else if (typeof input === 'string' || input instanceof String) {
- return input;
+ head(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('HEAD', requestUrl, null, additionalHeaders || {});
+ });
}
- return JSON.stringify(input);
-}
-exports.toCommandValue = toCommandValue;
-/**
- *
- * @param annotationProperties
- * @returns The command properties to send with the actual annotation command
- * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
- */
-function toCommandProperties(annotationProperties) {
- if (!Object.keys(annotationProperties).length) {
- return {};
+ sendStream(verb, requestUrl, stream, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request(verb, requestUrl, stream, additionalHeaders);
+ });
}
- return {
- title: annotationProperties.title,
- file: annotationProperties.file,
- line: annotationProperties.startLine,
- endLine: annotationProperties.endLine,
- col: annotationProperties.startColumn,
- endColumn: annotationProperties.endColumn
- };
-}
-exports.toCommandProperties = toCommandProperties;
-//# sourceMappingURL=utils.js.map
-
-/***/ }),
-
-/***/ 4087:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.Context = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const os_1 = __nccwpck_require__(2037);
-class Context {
/**
- * Hydrate the context from the environment
+ * Gets a typed object from an endpoint
+ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
*/
- constructor() {
- var _a, _b, _c;
- this.payload = {};
- if (process.env.GITHUB_EVENT_PATH) {
- if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
- this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
- }
- else {
- const path = process.env.GITHUB_EVENT_PATH;
- process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
- }
- }
- this.eventName = process.env.GITHUB_EVENT_NAME;
- this.sha = process.env.GITHUB_SHA;
- this.ref = process.env.GITHUB_REF;
- this.workflow = process.env.GITHUB_WORKFLOW;
- this.action = process.env.GITHUB_ACTION;
- this.actor = process.env.GITHUB_ACTOR;
- this.job = process.env.GITHUB_JOB;
- this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
- this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
- this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
- this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
- this.graphqlUrl =
- (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
- }
- get issue() {
- const payload = this.payload;
- return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
- }
- get repo() {
- if (process.env.GITHUB_REPOSITORY) {
- const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
- return { owner, repo };
- }
- if (this.payload.repository) {
- return {
- owner: this.payload.repository.owner.login,
- repo: this.payload.repository.name
- };
- }
- throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
- }
-}
-exports.Context = Context;
-//# sourceMappingURL=context.js.map
-
-/***/ }),
-
-/***/ 5438:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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]; } };
+ getJson(requestUrl_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ const res = yield this.get(requestUrl, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- 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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getOctokit = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const utils_1 = __nccwpck_require__(3030);
-exports.context = new Context.Context();
-/**
- * Returns a hydrated octokit ready to use for GitHub Actions
- *
- * @param token the repo PAT or GITHUB_TOKEN
- * @param options other options to set
- */
-function getOctokit(token, options, ...additionalPlugins) {
- const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
- return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
-}
-exports.getOctokit = getOctokit;
-//# sourceMappingURL=github.js.map
-
-/***/ }),
-
-/***/ 7914:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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]; } };
+ postJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.post(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- 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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
-const httpClient = __importStar(__nccwpck_require__(6341));
-const undici_1 = __nccwpck_require__(1773);
-function getAuthString(token, options) {
- if (!token && !options.auth) {
- throw new Error('Parameter token or opts.auth is required');
+ putJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.put(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- else if (token && options.auth) {
- throw new Error('Parameters token and opts.auth may not both be specified');
- }
- return typeof options.auth === 'string' ? options.auth : `token ${token}`;
-}
-exports.getAuthString = getAuthString;
-function getProxyAgent(destinationUrl) {
- const hc = new httpClient.HttpClient();
- return hc.getAgent(destinationUrl);
-}
-exports.getProxyAgent = getProxyAgent;
-function getProxyAgentDispatcher(destinationUrl) {
- const hc = new httpClient.HttpClient();
- return hc.getAgentDispatcher(destinationUrl);
-}
-exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
-function getProxyFetch(destinationUrl) {
- const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
- const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
- return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
- });
- return proxyFetch;
-}
-exports.getProxyFetch = getProxyFetch;
-function getApiBaseUrl() {
- return process.env['GITHUB_API_URL'] || 'https://api.github.com';
-}
-exports.getApiBaseUrl = getApiBaseUrl;
-//# sourceMappingURL=utils.js.map
-
-/***/ }),
-
-/***/ 3030:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const Utils = __importStar(__nccwpck_require__(7914));
-// octokit + plugins
-const core_1 = __nccwpck_require__(6762);
-const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
-const plugin_paginate_rest_1 = __nccwpck_require__(4193);
-exports.context = new Context.Context();
-const baseUrl = Utils.getApiBaseUrl();
-exports.defaults = {
- baseUrl,
- request: {
- agent: Utils.getProxyAgent(baseUrl),
- fetch: Utils.getProxyFetch(baseUrl)
- }
-};
-exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
-/**
- * Convience function to correctly format Octokit Options to pass into the constructor.
- *
- * @param token the repo PAT or GITHUB_TOKEN
- * @param options other options to set
- */
-function getOctokitOptions(token, options) {
- const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
- // Auth
- const auth = Utils.getAuthString(token, opts);
- if (auth) {
- opts.auth = auth;
- }
- return opts;
-}
-exports.getOctokitOptions = getOctokitOptions;
-//# sourceMappingURL=utils.js.map
-
-/***/ }),
-
-/***/ 6341:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-/* eslint-disable @typescript-eslint/no-explicit-any */
-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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
-const http = __importStar(__nccwpck_require__(3685));
-const https = __importStar(__nccwpck_require__(5687));
-const pm = __importStar(__nccwpck_require__(3466));
-const tunnel = __importStar(__nccwpck_require__(4294));
-const undici_1 = __nccwpck_require__(1773);
-var HttpCodes;
-(function (HttpCodes) {
- HttpCodes[HttpCodes["OK"] = 200] = "OK";
- HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
- HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
- HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
- HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
- HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
- HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
- HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
- HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
- HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
- HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
- HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
- HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
- HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
- HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
- HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
- HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
- HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
- HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
- HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
- HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
- HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
- HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
- HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
- HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
- HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
-})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
-var Headers;
-(function (Headers) {
- Headers["Accept"] = "accept";
- Headers["ContentType"] = "content-type";
-})(Headers || (exports.Headers = Headers = {}));
-var MediaTypes;
-(function (MediaTypes) {
- MediaTypes["ApplicationJson"] = "application/json";
-})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
-/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
-function getProxyUrl(serverUrl) {
- const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
- return proxyUrl ? proxyUrl.href : '';
-}
-exports.getProxyUrl = getProxyUrl;
-const HttpRedirectCodes = [
- HttpCodes.MovedPermanently,
- HttpCodes.ResourceMoved,
- HttpCodes.SeeOther,
- HttpCodes.TemporaryRedirect,
- HttpCodes.PermanentRedirect
-];
-const HttpResponseRetryCodes = [
- HttpCodes.BadGateway,
- HttpCodes.ServiceUnavailable,
- HttpCodes.GatewayTimeout
-];
-const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
-const ExponentialBackoffCeiling = 10;
-const ExponentialBackoffTimeSlice = 5;
-class HttpClientError extends Error {
- constructor(message, statusCode) {
- super(message);
- this.name = 'HttpClientError';
- this.statusCode = statusCode;
- Object.setPrototypeOf(this, HttpClientError.prototype);
- }
-}
-exports.HttpClientError = HttpClientError;
-class HttpClientResponse {
- constructor(message) {
- this.message = message;
- }
- readBody() {
- return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
- let output = Buffer.alloc(0);
- this.message.on('data', (chunk) => {
- output = Buffer.concat([output, chunk]);
- });
- this.message.on('end', () => {
- resolve(output.toString());
- });
- }));
- });
- }
- readBodyBuffer() {
- return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
- const chunks = [];
- this.message.on('data', (chunk) => {
- chunks.push(chunk);
- });
- this.message.on('end', () => {
- resolve(Buffer.concat(chunks));
- });
- }));
- });
- }
-}
-exports.HttpClientResponse = HttpClientResponse;
-function isHttps(requestUrl) {
- const parsedUrl = new URL(requestUrl);
- return parsedUrl.protocol === 'https:';
-}
-exports.isHttps = isHttps;
-class HttpClient {
- constructor(userAgent, handlers, requestOptions) {
- this._ignoreSslError = false;
- this._allowRedirects = true;
- this._allowRedirectDowngrade = false;
- this._maxRedirects = 50;
- this._allowRetries = false;
- this._maxRetries = 1;
- this._keepAlive = false;
- this._disposed = false;
- this.userAgent = userAgent;
- this.handlers = handlers || [];
- this.requestOptions = requestOptions;
- if (requestOptions) {
- if (requestOptions.ignoreSslError != null) {
- this._ignoreSslError = requestOptions.ignoreSslError;
- }
- this._socketTimeout = requestOptions.socketTimeout;
- if (requestOptions.allowRedirects != null) {
- this._allowRedirects = requestOptions.allowRedirects;
- }
- if (requestOptions.allowRedirectDowngrade != null) {
- this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
- }
- if (requestOptions.maxRedirects != null) {
- this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
- }
- if (requestOptions.keepAlive != null) {
- this._keepAlive = requestOptions.keepAlive;
- }
- if (requestOptions.allowRetries != null) {
- this._allowRetries = requestOptions.allowRetries;
- }
- if (requestOptions.maxRetries != null) {
- this._maxRetries = requestOptions.maxRetries;
- }
- }
- }
- options(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
- });
- }
- get(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('GET', requestUrl, null, additionalHeaders || {});
- });
- }
- del(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('DELETE', requestUrl, null, additionalHeaders || {});
- });
- }
- post(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('POST', requestUrl, data, additionalHeaders || {});
- });
- }
- patch(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('PATCH', requestUrl, data, additionalHeaders || {});
- });
- }
- put(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('PUT', requestUrl, data, additionalHeaders || {});
- });
- }
- head(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('HEAD', requestUrl, null, additionalHeaders || {});
- });
- }
- sendStream(verb, requestUrl, stream, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request(verb, requestUrl, stream, additionalHeaders);
- });
- }
- /**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
- */
- getJson(requestUrl, additionalHeaders = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- const res = yield this.get(requestUrl, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- });
- }
- postJson(requestUrl, obj, additionalHeaders = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.post(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- });
- }
- putJson(requestUrl, obj, additionalHeaders = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.put(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- });
- }
- patchJson(requestUrl, obj, additionalHeaders = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.patch(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- });
+ patchJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.patch(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
/**
* Makes a raw http request.
@@ -1711,12 +507,73 @@ class HttpClient {
}
return lowercaseKeys(headers || {});
}
+ /**
+ * Gets an existing header value or returns a default.
+ * Handles converting number header values to strings since HTTP headers must be strings.
+ * Note: This returns string | string[] since some headers can have multiple values.
+ * For headers that must always be a single string (like Content-Type), use the
+ * specialized _getExistingOrDefaultContentTypeHeader method instead.
+ */
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
- clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[header];
+ if (headerValue) {
+ clientHeader =
+ typeof headerValue === 'number' ? headerValue.toString() : headerValue;
+ }
+ }
+ const additionalValue = additionalHeaders[header];
+ if (additionalValue !== undefined) {
+ return typeof additionalValue === 'number'
+ ? additionalValue.toString()
+ : additionalValue;
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
+ }
+ return _default;
+ }
+ /**
+ * Specialized version of _getExistingOrDefaultHeader for Content-Type header.
+ * Always returns a single string (not an array) since Content-Type should be a single value.
+ * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
+ * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
+ * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
+ */
+ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {
+ let clientHeader;
+ if (this.requestOptions && this.requestOptions.headers) {
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];
+ if (headerValue) {
+ if (typeof headerValue === 'number') {
+ clientHeader = String(headerValue);
+ }
+ else if (Array.isArray(headerValue)) {
+ clientHeader = headerValue.join(', ');
+ }
+ else {
+ clientHeader = headerValue;
+ }
+ }
+ }
+ const additionalValue = additionalHeaders[Headers.ContentType];
+ // Return the first non-undefined value, converting numbers or arrays to strings if necessary
+ if (additionalValue !== undefined) {
+ if (typeof additionalValue === 'number') {
+ return String(additionalValue);
+ }
+ else if (Array.isArray(additionalValue)) {
+ return additionalValue.join(', ');
+ }
+ else {
+ return additionalValue;
+ }
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
}
- return additionalHeaders[header] || clientHeader || _default;
+ return _default;
}
_getAgent(parsedUrl) {
let agent;
@@ -1784,7 +641,7 @@ class HttpClient {
}
const usingSsl = parsedUrl.protocol === 'https:';
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
- token: `${proxyUrl.username}:${proxyUrl.password}`
+ token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
})));
this._proxyAgentDispatcher = proxyAgent;
if (usingSsl && this._ignoreSslError) {
@@ -1797,6 +654,17 @@ class HttpClient {
}
return proxyAgent;
}
+ _getUserAgentWithOrchestrationId(userAgent) {
+ const baseUserAgent = userAgent || 'actions/http-client';
+ const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
+ if (orchId) {
+ // Sanitize the orchestration ID to ensure it contains only valid characters
+ // Valid characters: 0-9, a-z, _, -, .
+ const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
+ return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
+ }
+ return baseUserAgent;
+ }
_performExponentialBackoff(retryNumber) {
return __awaiter(this, void 0, void 0, function* () {
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
@@ -1876,13 +744,13 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa
/***/ }),
-/***/ 3466:
+/***/ 4988:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.checkBypass = exports.getProxyUrl = void 0;
+exports.getProxyUrl = getProxyUrl;
+exports.checkBypass = checkBypass;
function getProxyUrl(reqUrl) {
const usingSsl = reqUrl.protocol === 'https:';
if (checkBypass(reqUrl)) {
@@ -1898,18 +766,17 @@ function getProxyUrl(reqUrl) {
})();
if (proxyVar) {
try {
- return new URL(proxyVar);
+ return new DecodedURL(proxyVar);
}
catch (_a) {
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
- return new URL(`http://${proxyVar}`);
+ return new DecodedURL(`http://${proxyVar}`);
}
}
else {
return undefined;
}
}
-exports.getProxyUrl = getProxyUrl;
function checkBypass(reqUrl) {
if (!reqUrl.hostname) {
return false;
@@ -1953,7 +820,6 @@ function checkBypass(reqUrl) {
}
return false;
}
-exports.checkBypass = checkBypass;
function isLoopbackAddress(host) {
const hostLower = host.toLowerCase();
return (hostLower === 'localhost' ||
@@ -1961,4616 +827,554 @@ function isLoopbackAddress(host) {
hostLower.startsWith('[::1]') ||
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
}
+class DecodedURL extends URL {
+ constructor(url, base) {
+ super(url, base);
+ this._decodedUsername = decodeURIComponent(super.username);
+ this._decodedPassword = decodeURIComponent(super.password);
+ }
+ get username() {
+ return this._decodedUsername;
+ }
+ get password() {
+ return this._decodedPassword;
+ }
+}
//# sourceMappingURL=proxy.js.map
/***/ }),
-/***/ 3702:
+/***/ 9234:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
+/* eslint-disable no-console */
Object.defineProperty(exports, "__esModule", ({ value: true }));
-class BasicCredentialHandler {
- constructor(username, password) {
- this.username = username;
- this.password = password;
- }
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' +
- Buffer.from(this.username + ':' + this.password).toString('base64');
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
+exports.ConsoleLogger = exports.LogLevel = void 0;
+/**
+ * Severity levels for log entries
+ */
+var LogLevel;
+(function (LogLevel) {
+ LogLevel["ERROR"] = "error";
+ LogLevel["WARN"] = "warn";
+ LogLevel["INFO"] = "info";
+ LogLevel["DEBUG"] = "debug";
+})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
+/**
+ * Default logger which logs to stdout and stderr
+ */
+class ConsoleLogger {
+ constructor() {
+ this.level = LogLevel.INFO;
+ this.name = '';
}
-}
-exports.BasicCredentialHandler = BasicCredentialHandler;
-class BearerCredentialHandler {
- constructor(token) {
- this.token = token;
+ getLevel() {
+ return this.level;
}
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] = 'Bearer ' + this.token;
+ /**
+ * Sets the instance's log level so that only messages which are equal or more severe are output to the console.
+ */
+ setLevel(level) {
+ this.level = level;
}
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
+ /**
+ * Set the instance's name, which will appear on each log line before the message.
+ */
+ setName(name) {
+ this.name = name;
}
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
+ /**
+ * Log a debug message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ debug(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) {
+ console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg);
+ }
}
-}
-exports.BearerCredentialHandler = BearerCredentialHandler;
-class PersonalAccessTokenCredentialHandler {
- constructor(token) {
- this.token = token;
+ /**
+ * Log an info message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ info(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) {
+ console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg);
+ }
}
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
+ /**
+ * Log a warning message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ warn(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) {
+ console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg);
+ }
}
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
+ /**
+ * Log an error message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ error(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) {
+ console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg);
+ }
}
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
+ /**
+ * Helper to compare two log levels and determine if a is equal or more severe than b
+ */
+ static isMoreOrEqualSevere(a, b) {
+ return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b];
}
}
-exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
+exports.ConsoleLogger = ConsoleLogger;
+/** Map of labels for each log level */
+ConsoleLogger.labels = (() => {
+ const entries = Object.entries(LogLevel);
+ const map = entries.map(([key, value]) => [value, `[${key}] `]);
+ return new Map(map);
+})();
+/** Map of severity as comparable numbers for each log level */
+ConsoleLogger.severity = {
+ [LogLevel.ERROR]: 400,
+ [LogLevel.WARN]: 300,
+ [LogLevel.INFO]: 200,
+ [LogLevel.DEBUG]: 100,
+};
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 4591:
+/***/ ((__unused_webpack_module, exports) => {
+
+// This file contains objects documented here: https://docs.slack.dev/reference/block-kit/block-elements
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=block-elements.js.map
/***/ }),
-/***/ 9925:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 1356:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const http = __nccwpck_require__(3685);
-const https = __nccwpck_require__(5687);
-const pm = __nccwpck_require__(6443);
-let tunnel;
-var HttpCodes;
-(function (HttpCodes) {
- HttpCodes[HttpCodes["OK"] = 200] = "OK";
- HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
- HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
- HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
- HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
- HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
- HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
- HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
- HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
- HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
- HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
- HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
- HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
- HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
- HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
- HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
- HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
- HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
- HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
- HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
- HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
- HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
- HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
- HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
- HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
- HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
-})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
-var Headers;
-(function (Headers) {
- Headers["Accept"] = "accept";
- Headers["ContentType"] = "content-type";
-})(Headers = exports.Headers || (exports.Headers = {}));
-var MediaTypes;
-(function (MediaTypes) {
- MediaTypes["ApplicationJson"] = "application/json";
-})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
-/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
-function getProxyUrl(serverUrl) {
- let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
- return proxyUrl ? proxyUrl.href : '';
-}
-exports.getProxyUrl = getProxyUrl;
-const HttpRedirectCodes = [
- HttpCodes.MovedPermanently,
- HttpCodes.ResourceMoved,
- HttpCodes.SeeOther,
- HttpCodes.TemporaryRedirect,
- HttpCodes.PermanentRedirect
-];
-const HttpResponseRetryCodes = [
- HttpCodes.BadGateway,
- HttpCodes.ServiceUnavailable,
- HttpCodes.GatewayTimeout
-];
-const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
-const ExponentialBackoffCeiling = 10;
-const ExponentialBackoffTimeSlice = 5;
-class HttpClientError extends Error {
- constructor(message, statusCode) {
- super(message);
- this.name = 'HttpClientError';
- this.statusCode = statusCode;
- Object.setPrototypeOf(this, HttpClientError.prototype);
- }
-}
-exports.HttpClientError = HttpClientError;
-class HttpClientResponse {
- constructor(message) {
- this.message = message;
- }
- readBody() {
- return new Promise(async (resolve, reject) => {
- let output = Buffer.alloc(0);
- this.message.on('data', (chunk) => {
- output = Buffer.concat([output, chunk]);
- });
- this.message.on('end', () => {
- resolve(output.toString());
- });
- });
- }
-}
-exports.HttpClientResponse = HttpClientResponse;
-function isHttps(requestUrl) {
- let parsedUrl = new URL(requestUrl);
- return parsedUrl.protocol === 'https:';
-}
-exports.isHttps = isHttps;
-class HttpClient {
- constructor(userAgent, handlers, requestOptions) {
- this._ignoreSslError = false;
- this._allowRedirects = true;
- this._allowRedirectDowngrade = false;
- this._maxRedirects = 50;
- this._allowRetries = false;
- this._maxRetries = 1;
- this._keepAlive = false;
- this._disposed = false;
- this.userAgent = userAgent;
- this.handlers = handlers || [];
- this.requestOptions = requestOptions;
- if (requestOptions) {
- if (requestOptions.ignoreSslError != null) {
- this._ignoreSslError = requestOptions.ignoreSslError;
- }
- this._socketTimeout = requestOptions.socketTimeout;
- if (requestOptions.allowRedirects != null) {
- this._allowRedirects = requestOptions.allowRedirects;
- }
- if (requestOptions.allowRedirectDowngrade != null) {
- this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
- }
- if (requestOptions.maxRedirects != null) {
- this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
- }
- if (requestOptions.keepAlive != null) {
- this._keepAlive = requestOptions.keepAlive;
- }
- if (requestOptions.allowRetries != null) {
- this._allowRetries = requestOptions.allowRetries;
- }
- if (requestOptions.maxRetries != null) {
- this._maxRetries = requestOptions.maxRetries;
- }
- }
- }
- options(requestUrl, additionalHeaders) {
- return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
- }
- get(requestUrl, additionalHeaders) {
- return this.request('GET', requestUrl, null, additionalHeaders || {});
- }
- del(requestUrl, additionalHeaders) {
- return this.request('DELETE', requestUrl, null, additionalHeaders || {});
- }
- post(requestUrl, data, additionalHeaders) {
- return this.request('POST', requestUrl, data, additionalHeaders || {});
- }
- patch(requestUrl, data, additionalHeaders) {
- return this.request('PATCH', requestUrl, data, additionalHeaders || {});
- }
- put(requestUrl, data, additionalHeaders) {
- return this.request('PUT', requestUrl, data, additionalHeaders || {});
- }
- head(requestUrl, additionalHeaders) {
- return this.request('HEAD', requestUrl, null, additionalHeaders || {});
- }
- sendStream(verb, requestUrl, stream, additionalHeaders) {
- return this.request(verb, requestUrl, stream, additionalHeaders);
- }
- /**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
- */
- async getJson(requestUrl, additionalHeaders = {}) {
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- let res = await this.get(requestUrl, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async postJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.post(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async putJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.put(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async patchJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.patch(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- /**
- * Makes a raw http request.
- * All other methods such as get, post, patch, and request ultimately call this.
- * Prefer get, del, post and patch
- */
- async request(verb, requestUrl, data, headers) {
- if (this._disposed) {
- throw new Error('Client has already been disposed.');
- }
- let parsedUrl = new URL(requestUrl);
- let info = this._prepareRequest(verb, parsedUrl, headers);
- // Only perform retries on reads since writes may not be idempotent.
- let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
- ? this._maxRetries + 1
- : 1;
- let numTries = 0;
- let response;
- while (numTries < maxTries) {
- response = await this.requestRaw(info, data);
- // Check if it's an authentication challenge
- if (response &&
- response.message &&
- response.message.statusCode === HttpCodes.Unauthorized) {
- let authenticationHandler;
- for (let i = 0; i < this.handlers.length; i++) {
- if (this.handlers[i].canHandleAuthentication(response)) {
- authenticationHandler = this.handlers[i];
- break;
- }
- }
- if (authenticationHandler) {
- return authenticationHandler.handleAuthentication(this, info, data);
- }
- else {
- // We have received an unauthorized response but have no handlers to handle it.
- // Let the response return to the caller.
- return response;
- }
- }
- let redirectsRemaining = this._maxRedirects;
- while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
- this._allowRedirects &&
- redirectsRemaining > 0) {
- const redirectUrl = response.message.headers['location'];
- if (!redirectUrl) {
- // if there's no location to redirect to, we won't
- break;
- }
- let parsedRedirectUrl = new URL(redirectUrl);
- if (parsedUrl.protocol == 'https:' &&
- parsedUrl.protocol != parsedRedirectUrl.protocol &&
- !this._allowRedirectDowngrade) {
- throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
- }
- // we need to finish reading the response before reassigning response
- // which will leak the open socket.
- await response.readBody();
- // strip authorization header if redirected to a different hostname
- if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
- for (let header in headers) {
- // header names are case insensitive
- if (header.toLowerCase() === 'authorization') {
- delete headers[header];
- }
- }
- }
- // let's make the request with the new redirectUrl
- info = this._prepareRequest(verb, parsedRedirectUrl, headers);
- response = await this.requestRaw(info, data);
- redirectsRemaining--;
- }
- if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
- // If not a retry code, return immediately instead of retrying
- return response;
- }
- numTries += 1;
- if (numTries < maxTries) {
- await response.readBody();
- await this._performExponentialBackoff(numTries);
- }
- }
- return response;
- }
- /**
- * Needs to be called if keepAlive is set to true in request options.
- */
- dispose() {
- if (this._agent) {
- this._agent.destroy();
- }
- this._disposed = true;
- }
- /**
- * Raw request.
- * @param info
- * @param data
- */
- requestRaw(info, data) {
- return new Promise((resolve, reject) => {
- let callbackForResult = function (err, res) {
- if (err) {
- reject(err);
- }
- resolve(res);
- };
- this.requestRawWithCallback(info, data, callbackForResult);
- });
- }
- /**
- * Raw request with callback.
- * @param info
- * @param data
- * @param onResult
- */
- requestRawWithCallback(info, data, onResult) {
- let socket;
- if (typeof data === 'string') {
- info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
- }
- let callbackCalled = false;
- let handleResult = (err, res) => {
- if (!callbackCalled) {
- callbackCalled = true;
- onResult(err, res);
- }
- };
- let req = info.httpModule.request(info.options, (msg) => {
- let res = new HttpClientResponse(msg);
- handleResult(null, res);
- });
- req.on('socket', sock => {
- socket = sock;
- });
- // If we ever get disconnected, we want the socket to timeout eventually
- req.setTimeout(this._socketTimeout || 3 * 60000, () => {
- if (socket) {
- socket.end();
- }
- handleResult(new Error('Request timeout: ' + info.options.path), null);
- });
- req.on('error', function (err) {
- // err has statusCode property
- // res should have headers
- handleResult(err, null);
- });
- if (data && typeof data === 'string') {
- req.write(data, 'utf8');
- }
- if (data && typeof data !== 'string') {
- data.on('close', function () {
- req.end();
- });
- data.pipe(req);
- }
- else {
- req.end();
- }
- }
- /**
- * Gets an http agent. This function is useful when you need an http agent that handles
- * routing through a proxy server - depending upon the url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
- getAgent(serverUrl) {
- let parsedUrl = new URL(serverUrl);
- return this._getAgent(parsedUrl);
- }
- _prepareRequest(method, requestUrl, headers) {
- const info = {};
- info.parsedUrl = requestUrl;
- const usingSsl = info.parsedUrl.protocol === 'https:';
- info.httpModule = usingSsl ? https : http;
- const defaultPort = usingSsl ? 443 : 80;
- info.options = {};
- info.options.host = info.parsedUrl.hostname;
- info.options.port = info.parsedUrl.port
- ? parseInt(info.parsedUrl.port)
- : defaultPort;
- info.options.path =
- (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
- info.options.method = method;
- info.options.headers = this._mergeHeaders(headers);
- if (this.userAgent != null) {
- info.options.headers['user-agent'] = this.userAgent;
- }
- info.options.agent = this._getAgent(info.parsedUrl);
- // gives handlers an opportunity to participate
- if (this.handlers) {
- this.handlers.forEach(handler => {
- handler.prepareRequest(info.options);
- });
- }
- return info;
- }
- _mergeHeaders(headers) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- if (this.requestOptions && this.requestOptions.headers) {
- return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
- }
- return lowercaseKeys(headers || {});
- }
- _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- let clientHeader;
- if (this.requestOptions && this.requestOptions.headers) {
- clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
- }
- return additionalHeaders[header] || clientHeader || _default;
- }
- _getAgent(parsedUrl) {
- let agent;
- let proxyUrl = pm.getProxyUrl(parsedUrl);
- let useProxy = proxyUrl && proxyUrl.hostname;
- if (this._keepAlive && useProxy) {
- agent = this._proxyAgent;
- }
- if (this._keepAlive && !useProxy) {
- agent = this._agent;
- }
- // if agent is already assigned use that agent.
- if (!!agent) {
- return agent;
- }
- const usingSsl = parsedUrl.protocol === 'https:';
- let maxSockets = 100;
- if (!!this.requestOptions) {
- maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
- }
- if (useProxy) {
- // If using proxy, need tunnel
- if (!tunnel) {
- tunnel = __nccwpck_require__(4294);
- }
- const agentOptions = {
- maxSockets: maxSockets,
- keepAlive: this._keepAlive,
- proxy: {
- ...((proxyUrl.username || proxyUrl.password) && {
- proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
- }),
- host: proxyUrl.hostname,
- port: proxyUrl.port
- }
- };
- let tunnelAgent;
- const overHttps = proxyUrl.protocol === 'https:';
- if (usingSsl) {
- tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
- }
- else {
- tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
- }
- agent = tunnelAgent(agentOptions);
- this._proxyAgent = agent;
- }
- // if reusing agent across request and tunneling agent isn't assigned create a new agent
- if (this._keepAlive && !agent) {
- const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
- agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
- this._agent = agent;
- }
- // if not using private agent and tunnel agent isn't setup then use global agent
- if (!agent) {
- agent = usingSsl ? https.globalAgent : http.globalAgent;
- }
- if (usingSsl && this._ignoreSslError) {
- // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
- // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
- // we have to cast it to any and change it directly
- agent.options = Object.assign(agent.options || {}, {
- rejectUnauthorized: false
- });
- }
- return agent;
- }
- _performExponentialBackoff(retryNumber) {
- retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
- const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
- return new Promise(resolve => setTimeout(() => resolve(), ms));
- }
- static dateTimeDeserializer(key, value) {
- if (typeof value === 'string') {
- let a = new Date(value);
- if (!isNaN(a.valueOf())) {
- return a;
- }
- }
- return value;
- }
- async _processResponse(res, options) {
- return new Promise(async (resolve, reject) => {
- const statusCode = res.message.statusCode;
- const response = {
- statusCode: statusCode,
- result: null,
- headers: {}
- };
- // not found leads to null obj returned
- if (statusCode == HttpCodes.NotFound) {
- resolve(response);
- }
- let obj;
- let contents;
- // get the result from the body
- try {
- contents = await res.readBody();
- if (contents && contents.length > 0) {
- if (options && options.deserializeDates) {
- obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
- }
- else {
- obj = JSON.parse(contents);
- }
- response.result = obj;
- }
- response.headers = res.message.headers;
- }
- catch (err) {
- // Invalid resource (contents not json); leaving result obj null
- }
- // note that 3xx redirects are handled by the http layer.
- if (statusCode > 299) {
- let msg;
- // if exception/error in body, attempt to get better error
- if (obj && obj.message) {
- msg = obj.message;
- }
- else if (contents && contents.length > 0) {
- // it may be the case that the exception is in the body message as string
- msg = contents;
- }
- else {
- msg = 'Failed request: (' + statusCode + ')';
- }
- let err = new HttpClientError(msg, statusCode);
- err.result = response.result;
- reject(err);
- }
- else {
- resolve(response);
- }
- });
- }
-}
-exports.HttpClient = HttpClient;
-
+//# sourceMappingURL=blocks.js.map
/***/ }),
-/***/ 6443:
+/***/ 3819:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
+// This file contains objects documented here: https://docs.slack.dev/reference/block-kit/composition-objects
Object.defineProperty(exports, "__esModule", ({ value: true }));
-function getProxyUrl(reqUrl) {
- let usingSsl = reqUrl.protocol === 'https:';
- let proxyUrl;
- if (checkBypass(reqUrl)) {
- return proxyUrl;
- }
- let proxyVar;
- if (usingSsl) {
- proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
- }
- else {
- proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
- }
- if (proxyVar) {
- proxyUrl = new URL(proxyVar);
- }
- return proxyUrl;
-}
-exports.getProxyUrl = getProxyUrl;
-function checkBypass(reqUrl) {
- if (!reqUrl.hostname) {
- return false;
- }
- let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
- if (!noProxy) {
- return false;
- }
- // Determine the request port
- let reqPort;
- if (reqUrl.port) {
- reqPort = Number(reqUrl.port);
- }
- else if (reqUrl.protocol === 'http:') {
- reqPort = 80;
- }
- else if (reqUrl.protocol === 'https:') {
- reqPort = 443;
- }
- // Format the request hostname and hostname with port
- let upperReqHosts = [reqUrl.hostname.toUpperCase()];
- if (typeof reqPort === 'number') {
- upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
- }
- // Compare request host against noproxy
- for (let upperNoProxyItem of noProxy
- .split(',')
- .map(x => x.trim().toUpperCase())
- .filter(x => x)) {
- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
- return true;
- }
- }
- return false;
-}
-exports.checkBypass = checkBypass;
-
+//# sourceMappingURL=composition-objects.js.map
/***/ }),
-/***/ 334:
-/***/ ((module) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+/***/ 4148:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- createTokenAuth: () => createTokenAuth
-});
-module.exports = __toCommonJS(dist_src_exports);
-// pkg/dist-src/auth.js
-var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
-var REGEX_IS_INSTALLATION = /^ghs_/;
-var REGEX_IS_USER_TO_SERVER = /^ghu_/;
-async function auth(token) {
- const isApp = token.split(/\./).length === 3;
- const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
- const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
- const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
- return {
- type: "token",
- token,
- tokenType
- };
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=extensions.js.map
-// pkg/dist-src/with-authorization-prefix.js
-function withAuthorizationPrefix(token) {
- if (token.split(/\./).length === 3) {
- return `bearer ${token}`;
- }
- return `token ${token}`;
-}
+/***/ }),
-// pkg/dist-src/hook.js
-async function hook(token, request, route, parameters) {
- const endpoint = request.endpoint.merge(
- route,
- parameters
- );
- endpoint.headers.authorization = withAuthorizationPrefix(token);
- return request(endpoint);
-}
+/***/ 9110:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/index.js
-var createTokenAuth = function createTokenAuth2(token) {
- if (!token) {
- throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
- }
- if (typeof token !== "string") {
- throw new Error(
- "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
- );
- }
- token = token.replace(/^(token|bearer) +/i, "");
- return Object.assign(auth.bind(null, token), {
- hook: hook.bind(null, token)
- });
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+// These types represent users in Slack Calls, which is an API for showing 3rd party calls within the Slack client.
+// More information on the API guide for Calls: https://docs.slack.dev/apis/web-api/using-the-calls-api
+// and on User objects for use with Calls: https://docs.slack.dev/apis/web-api/using-the-calls-api
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=calls.js.map
/***/ }),
-/***/ 6762:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 5523:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=dialog.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- Octokit: () => Octokit
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_universal_user_agent = __nccwpck_require__(5030);
-var import_before_after_hook = __nccwpck_require__(3682);
-var import_request = __nccwpck_require__(6234);
-var import_graphql = __nccwpck_require__(8467);
-var import_auth_token = __nccwpck_require__(334);
+/***/ }),
-// pkg/dist-src/version.js
-var VERSION = "5.2.0";
+/***/ 4854:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/index.js
-var noop = () => {
-};
-var consoleWarn = console.warn.bind(console);
-var consoleError = console.error.bind(console);
-var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
-var Octokit = class {
- static {
- this.VERSION = VERSION;
- }
- static defaults(defaults) {
- const OctokitWithDefaults = class extends this {
- constructor(...args) {
- const options = args[0] || {};
- if (typeof defaults === "function") {
- super(defaults(options));
- return;
- }
- super(
- Object.assign(
- {},
- defaults,
- options,
- options.userAgent && defaults.userAgent ? {
- userAgent: `${options.userAgent} ${defaults.userAgent}`
- } : null
- )
- );
- }
- };
- return OctokitWithDefaults;
- }
- static {
- this.plugins = [];
- }
- /**
- * Attach a plugin (or many) to your Octokit instance.
- *
- * @example
- * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
- */
- static plugin(...newPlugins) {
- const currentPlugins = this.plugins;
- const NewOctokit = class extends this {
- static {
- this.plugins = currentPlugins.concat(
- newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
- );
- }
- };
- return NewOctokit;
- }
- constructor(options = {}) {
- const hook = new import_before_after_hook.Collection();
- const requestDefaults = {
- baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
- headers: {},
- request: Object.assign({}, options.request, {
- // @ts-ignore internal usage only, no need to type
- hook: hook.bind(null, "request")
- }),
- mediaType: {
- previews: [],
- format: ""
- }
- };
- requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
- if (options.baseUrl) {
- requestDefaults.baseUrl = options.baseUrl;
- }
- if (options.previews) {
- requestDefaults.mediaType.previews = options.previews;
- }
- if (options.timeZone) {
- requestDefaults.headers["time-zone"] = options.timeZone;
- }
- this.request = import_request.request.defaults(requestDefaults);
- this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
- this.log = Object.assign(
- {
- debug: noop,
- info: noop,
- warn: consoleWarn,
- error: consoleError
- },
- options.log
- );
- this.hook = hook;
- if (!options.authStrategy) {
- if (!options.auth) {
- this.auth = async () => ({
- type: "unauthenticated"
- });
- } else {
- const auth = (0, import_auth_token.createTokenAuth)(options.auth);
- hook.wrap("request", auth.hook);
- this.auth = auth;
- }
- } else {
- const { authStrategy, ...otherOptions } = options;
- const auth = authStrategy(
- Object.assign(
- {
- request: this.request,
- log: this.log,
- // we pass the current octokit instance as well as its constructor options
- // to allow for authentication strategies that return a new octokit instance
- // that shares the same internal state as the current one. The original
- // requirement for this was the "event-octokit" authentication strategy
- // of https://github.com/probot/octokit-auth-probot.
- octokit: this,
- octokitOptions: otherOptions
- },
- options.auth
- )
- );
- hook.wrap("request", auth.hook);
- this.auth = auth;
- }
- const classConstructor = this.constructor;
- for (let i = 0; i < classConstructor.plugins.length; ++i) {
- Object.assign(this, classConstructor.plugins[i](this, options));
- }
- }
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=app.js.map
/***/ }),
-/***/ 9440:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 2149:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=assistant.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- endpoint: () => endpoint
-});
-module.exports = __toCommonJS(dist_src_exports);
+/***/ }),
-// pkg/dist-src/defaults.js
-var import_universal_user_agent = __nccwpck_require__(5030);
+/***/ 6077:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/version.js
-var VERSION = "9.0.5";
-// pkg/dist-src/defaults.js
-var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
-var DEFAULTS = {
- method: "GET",
- baseUrl: "https://api.github.com",
- headers: {
- accept: "application/vnd.github.v3+json",
- "user-agent": userAgent
- },
- mediaType: {
- format: ""
- }
-};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=call.js.map
-// pkg/dist-src/util/lowercase-keys.js
-function lowercaseKeys(object) {
- if (!object) {
- return {};
- }
- return Object.keys(object).reduce((newObj, key) => {
- newObj[key.toLowerCase()] = object[key];
- return newObj;
- }, {});
-}
+/***/ }),
-// pkg/dist-src/util/is-plain-object.js
-function isPlainObject(value) {
- if (typeof value !== "object" || value === null)
- return false;
- if (Object.prototype.toString.call(value) !== "[object Object]")
- return false;
- const proto = Object.getPrototypeOf(value);
- if (proto === null)
- return true;
- const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
-}
+/***/ 674:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/util/merge-deep.js
-function mergeDeep(defaults, options) {
- const result = Object.assign({}, defaults);
- Object.keys(options).forEach((key) => {
- if (isPlainObject(options[key])) {
- if (!(key in defaults))
- Object.assign(result, { [key]: options[key] });
- else
- result[key] = mergeDeep(defaults[key], options[key]);
- } else {
- Object.assign(result, { [key]: options[key] });
- }
- });
- return result;
-}
-// pkg/dist-src/util/remove-undefined-properties.js
-function removeUndefinedProperties(obj) {
- for (const key in obj) {
- if (obj[key] === void 0) {
- delete obj[key];
- }
- }
- return obj;
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=channel.js.map
-// pkg/dist-src/merge.js
-function merge(defaults, route, options) {
- if (typeof route === "string") {
- let [method, url] = route.split(" ");
- options = Object.assign(url ? { method, url } : { url: method }, options);
- } else {
- options = Object.assign({}, route);
- }
- options.headers = lowercaseKeys(options.headers);
- removeUndefinedProperties(options);
- removeUndefinedProperties(options.headers);
- const mergedOptions = mergeDeep(defaults || {}, options);
- if (options.url === "/graphql") {
- if (defaults && defaults.mediaType.previews?.length) {
- mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
- (preview) => !mergedOptions.mediaType.previews.includes(preview)
- ).concat(mergedOptions.mediaType.previews);
- }
- mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
- }
- return mergedOptions;
-}
+/***/ }),
-// pkg/dist-src/util/add-query-parameters.js
-function addQueryParameters(url, parameters) {
- const separator = /\?/.test(url) ? "&" : "?";
- const names = Object.keys(parameters);
- if (names.length === 0) {
- return url;
- }
- return url + separator + names.map((name) => {
- if (name === "q") {
- return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
- }
- return `${name}=${encodeURIComponent(parameters[name])}`;
- }).join("&");
-}
+/***/ 3147:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/util/extract-url-variable-names.js
-var urlVariableRegex = /\{[^}]+\}/g;
-function removeNonChars(variableName) {
- return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
-}
-function extractUrlVariableNames(url) {
- const matches = url.match(urlVariableRegex);
- if (!matches) {
- return [];
- }
- return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
-}
-// pkg/dist-src/util/omit.js
-function omit(object, keysToOmit) {
- const result = { __proto__: null };
- for (const key of Object.keys(object)) {
- if (keysToOmit.indexOf(key) === -1) {
- result[key] = object[key];
- }
- }
- return result;
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=dnd.js.map
-// pkg/dist-src/util/url-template.js
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
- }
- return part;
- }).join("");
-}
-function encodeUnreserved(str) {
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
- return "%" + c.charCodeAt(0).toString(16).toUpperCase();
- });
-}
-function encodeValue(operator, value, key) {
- value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
- if (key) {
- return encodeUnreserved(key) + "=" + value;
- } else {
- return value;
- }
-}
-function isDefined(value) {
- return value !== void 0 && value !== null;
-}
-function isKeyOperator(operator) {
- return operator === ";" || operator === "&" || operator === "?";
-}
-function getValues(context, operator, key, modifier) {
- var value = context[key], result = [];
- if (isDefined(value) && value !== "") {
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
- value = value.toString();
- if (modifier && modifier !== "*") {
- value = value.substring(0, parseInt(modifier, 10));
- }
- result.push(
- encodeValue(operator, value, isKeyOperator(operator) ? key : "")
- );
- } else {
- if (modifier === "*") {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function(value2) {
- result.push(
- encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
- );
- });
- } else {
- Object.keys(value).forEach(function(k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- const tmp = [];
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function(value2) {
- tmp.push(encodeValue(operator, value2));
- });
- } else {
- Object.keys(value).forEach(function(k) {
- if (isDefined(value[k])) {
- tmp.push(encodeUnreserved(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
- if (isKeyOperator(operator)) {
- result.push(encodeUnreserved(key) + "=" + tmp.join(","));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(","));
- }
- }
- }
- } else {
- if (operator === ";") {
- if (isDefined(value)) {
- result.push(encodeUnreserved(key));
- }
- } else if (value === "" && (operator === "&" || operator === "?")) {
- result.push(encodeUnreserved(key) + "=");
- } else if (value === "") {
- result.push("");
- }
- }
- return result;
-}
-function parseUrl(template) {
- return {
- expand: expand.bind(null, template)
- };
-}
-function expand(template, context) {
- var operators = ["+", "#", ".", "/", ";", "?", "&"];
- template = template.replace(
- /\{([^\{\}]+)\}|([^\{\}]+)/g,
- function(_, expression, literal) {
- if (expression) {
- let operator = "";
- const values = [];
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
- expression.split(/,/g).forEach(function(variable) {
- var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- });
- if (operator && operator !== "+") {
- var separator = ",";
- if (operator === "?") {
- separator = "&";
- } else if (operator !== "#") {
- separator = operator;
- }
- return (values.length !== 0 ? operator : "") + values.join(separator);
- } else {
- return values.join(",");
- }
- } else {
- return encodeReserved(literal);
- }
- }
- );
- if (template === "/") {
- return template;
- } else {
- return template.replace(/\/$/, "");
- }
-}
+/***/ }),
-// pkg/dist-src/parse.js
-function parse(options) {
- let method = options.method.toUpperCase();
- let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
- let headers = Object.assign({}, options.headers);
- let body;
- let parameters = omit(options, [
- "method",
- "baseUrl",
- "url",
- "headers",
- "request",
- "mediaType"
- ]);
- const urlVariableNames = extractUrlVariableNames(url);
- url = parseUrl(url).expand(parameters);
- if (!/^http/.test(url)) {
- url = options.baseUrl + url;
- }
- const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
- const remainingParameters = omit(parameters, omittedParameters);
- const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
- if (!isBinaryRequest) {
- if (options.mediaType.format) {
- headers.accept = headers.accept.split(/,/).map(
- (format) => format.replace(
- /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
- `application/vnd$1$2.${options.mediaType.format}`
- )
- ).join(",");
- }
- if (url.endsWith("/graphql")) {
- if (options.mediaType.previews?.length) {
- const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
- headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
- const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
- return `application/vnd.github.${preview}-preview${format}`;
- }).join(",");
- }
- }
- }
- if (["GET", "HEAD"].includes(method)) {
- url = addQueryParameters(url, remainingParameters);
- } else {
- if ("data" in remainingParameters) {
- body = remainingParameters.data;
- } else {
- if (Object.keys(remainingParameters).length) {
- body = remainingParameters;
- }
- }
- }
- if (!headers["content-type"] && typeof body !== "undefined") {
- headers["content-type"] = "application/json; charset=utf-8";
- }
- if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
- body = "";
- }
- return Object.assign(
- { method, url, headers },
- typeof body !== "undefined" ? { body } : null,
- options.request ? { request: options.request } : null
- );
-}
+/***/ 245:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/endpoint-with-defaults.js
-function endpointWithDefaults(defaults, route, options) {
- return parse(merge(defaults, route, options));
-}
-// pkg/dist-src/with-defaults.js
-function withDefaults(oldDefaults, newDefaults) {
- const DEFAULTS2 = merge(oldDefaults, newDefaults);
- const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
- return Object.assign(endpoint2, {
- DEFAULTS: DEFAULTS2,
- defaults: withDefaults.bind(null, DEFAULTS2),
- merge: merge.bind(null, DEFAULTS2),
- parse
- });
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=email.js.map
-// pkg/dist-src/index.js
-var endpoint = withDefaults(null, DEFAULTS);
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+/***/ }),
+
+/***/ 9679:
+/***/ ((__unused_webpack_module, exports) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=emoji.js.map
+
/***/ }),
-/***/ 8467:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 9335:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// NOTE: `file_comment_added` and `file_comment_edited` are left out because they are discontinued
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=file.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- GraphqlResponseError: () => GraphqlResponseError,
- graphql: () => graphql2,
- withCustomRequest: () => withCustomRequest
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_request3 = __nccwpck_require__(6234);
-var import_universal_user_agent = __nccwpck_require__(5030);
+/***/ }),
-// pkg/dist-src/version.js
-var VERSION = "7.1.0";
+/***/ 365:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/with-defaults.js
-var import_request2 = __nccwpck_require__(6234);
-// pkg/dist-src/graphql.js
-var import_request = __nccwpck_require__(6234);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=function.js.map
-// pkg/dist-src/error.js
-function _buildMessageForResponseErrors(data) {
- return `Request failed due to following response errors:
-` + data.errors.map((e) => ` - ${e.message}`).join("\n");
-}
-var GraphqlResponseError = class extends Error {
- constructor(request2, headers, response) {
- super(_buildMessageForResponseErrors(response));
- this.request = request2;
- this.headers = headers;
- this.response = response;
- this.name = "GraphqlResponseError";
- this.errors = response.errors;
- this.data = response.data;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
+/***/ }),
+
+/***/ 9660:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=grid-migration.js.map
+
+/***/ }),
+
+/***/ 6850:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=group.js.map
+
+/***/ }),
+
+/***/ 7783:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=im.js.map
+
+/***/ }),
+
+/***/ 6954:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+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 }));
+__exportStar(__nccwpck_require__(4854), exports);
+__exportStar(__nccwpck_require__(2149), exports);
+__exportStar(__nccwpck_require__(6077), exports);
+__exportStar(__nccwpck_require__(674), exports);
+__exportStar(__nccwpck_require__(3147), exports);
+__exportStar(__nccwpck_require__(245), exports);
+__exportStar(__nccwpck_require__(9679), exports);
+__exportStar(__nccwpck_require__(9335), exports);
+__exportStar(__nccwpck_require__(365), exports);
+__exportStar(__nccwpck_require__(9660), exports);
+__exportStar(__nccwpck_require__(6850), exports);
+__exportStar(__nccwpck_require__(7783), exports);
+__exportStar(__nccwpck_require__(8324), exports);
+__exportStar(__nccwpck_require__(2199), exports);
+__exportStar(__nccwpck_require__(495), exports);
+__exportStar(__nccwpck_require__(6286), exports);
+__exportStar(__nccwpck_require__(1710), exports);
+__exportStar(__nccwpck_require__(5710), exports);
+__exportStar(__nccwpck_require__(4178), exports);
+__exportStar(__nccwpck_require__(7662), exports);
+__exportStar(__nccwpck_require__(7145), exports);
+__exportStar(__nccwpck_require__(8064), exports);
+__exportStar(__nccwpck_require__(8974), exports);
+__exportStar(__nccwpck_require__(5876), exports);
+__exportStar(__nccwpck_require__(6000), exports);
+__exportStar(__nccwpck_require__(5906), exports);
+//# sourceMappingURL=index.js.map
-// pkg/dist-src/graphql.js
-var NON_VARIABLE_OPTIONS = [
- "method",
- "baseUrl",
- "url",
- "headers",
- "request",
- "query",
- "mediaType"
-];
-var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
-var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
-function graphql(request2, query, options) {
- if (options) {
- if (typeof query === "string" && "query" in options) {
- return Promise.reject(
- new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
- );
- }
- for (const key in options) {
- if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
- continue;
- return Promise.reject(
- new Error(
- `[@octokit/graphql] "${key}" cannot be used as variable name`
- )
- );
- }
- }
- const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
- const requestOptions = Object.keys(
- parsedOptions
- ).reduce((result, key) => {
- if (NON_VARIABLE_OPTIONS.includes(key)) {
- result[key] = parsedOptions[key];
- return result;
- }
- if (!result.variables) {
- result.variables = {};
- }
- result.variables[key] = parsedOptions[key];
- return result;
- }, {});
- const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
- if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
- requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
- }
- return request2(requestOptions).then((response) => {
- if (response.data.errors) {
- const headers = {};
- for (const key of Object.keys(response.headers)) {
- headers[key] = response.headers[key];
- }
- throw new GraphqlResponseError(
- requestOptions,
- headers,
- response.data
- );
- }
- return response.data.data;
- });
-}
+/***/ }),
-// pkg/dist-src/with-defaults.js
-function withDefaults(request2, newDefaults) {
- const newRequest = request2.defaults(newDefaults);
- const newApi = (query, options) => {
- return graphql(newRequest, query, options);
- };
- return Object.assign(newApi, {
- defaults: withDefaults.bind(null, newRequest),
- endpoint: newRequest.endpoint
- });
-}
+/***/ 8324:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/index.js
-var graphql2 = withDefaults(import_request3.request, {
- headers: {
- "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
- },
- method: "POST",
- url: "/graphql"
-});
-function withCustomRequest(customRequest) {
- return withDefaults(customRequest, {
- method: "POST",
- url: "/graphql"
- });
-}
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=invite.js.map
/***/ }),
-/***/ 4193:
-/***/ ((module) => {
+/***/ 2199:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=link-shared.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- composePaginateRest: () => composePaginateRest,
- isPaginatingEndpoint: () => isPaginatingEndpoint,
- paginateRest: () => paginateRest,
- paginatingEndpoints: () => paginatingEndpoints
-});
-module.exports = __toCommonJS(dist_src_exports);
+/***/ }),
-// pkg/dist-src/version.js
-var VERSION = "9.2.1";
+/***/ 495:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/normalize-paginated-list-response.js
-function normalizePaginatedListResponse(response) {
- if (!response.data) {
- return {
- ...response,
- data: []
- };
- }
- const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
- if (!responseNeedsNormalization)
- return response;
- const incompleteResults = response.data.incomplete_results;
- const repositorySelection = response.data.repository_selection;
- const totalCount = response.data.total_count;
- delete response.data.incomplete_results;
- delete response.data.repository_selection;
- delete response.data.total_count;
- const namespaceKey = Object.keys(response.data)[0];
- const data = response.data[namespaceKey];
- response.data = data;
- if (typeof incompleteResults !== "undefined") {
- response.data.incomplete_results = incompleteResults;
- }
- if (typeof repositorySelection !== "undefined") {
- response.data.repository_selection = repositorySelection;
- }
- response.data.total_count = totalCount;
- return response;
-}
-// pkg/dist-src/iterator.js
-function iterator(octokit, route, parameters) {
- const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
- const requestMethod = typeof route === "function" ? route : octokit.request;
- const method = options.method;
- const headers = options.headers;
- let url = options.url;
- return {
- [Symbol.asyncIterator]: () => ({
- async next() {
- if (!url)
- return { done: true };
- try {
- const response = await requestMethod({ method, url, headers });
- const normalizedResponse = normalizePaginatedListResponse(response);
- url = ((normalizedResponse.headers.link || "").match(
- /<([^>]+)>;\s*rel="next"/
- ) || [])[1];
- return { value: normalizedResponse };
- } catch (error) {
- if (error.status !== 409)
- throw error;
- url = "";
- return {
- value: {
- status: 200,
- headers: {},
- data: []
- }
- };
- }
- }
- })
- };
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=member.js.map
-// pkg/dist-src/paginate.js
-function paginate(octokit, route, parameters, mapFn) {
- if (typeof parameters === "function") {
- mapFn = parameters;
- parameters = void 0;
- }
- return gather(
- octokit,
- [],
- iterator(octokit, route, parameters)[Symbol.asyncIterator](),
- mapFn
- );
-}
-function gather(octokit, results, iterator2, mapFn) {
- return iterator2.next().then((result) => {
- if (result.done) {
- return results;
- }
- let earlyExit = false;
- function done() {
- earlyExit = true;
- }
- results = results.concat(
- mapFn ? mapFn(result.value, done) : result.value.data
- );
- if (earlyExit) {
- return results;
- }
- return gather(octokit, results, iterator2, mapFn);
- });
-}
+/***/ }),
-// pkg/dist-src/compose-paginate.js
-var composePaginateRest = Object.assign(paginate, {
- iterator
-});
+/***/ 1710:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/generated/paginating-endpoints.js
-var paginatingEndpoints = [
- "GET /advisories",
- "GET /app/hook/deliveries",
- "GET /app/installation-requests",
- "GET /app/installations",
- "GET /assignments/{assignment_id}/accepted_assignments",
- "GET /classrooms",
- "GET /classrooms/{classroom_id}/assignments",
- "GET /enterprises/{enterprise}/dependabot/alerts",
- "GET /enterprises/{enterprise}/secret-scanning/alerts",
- "GET /events",
- "GET /gists",
- "GET /gists/public",
- "GET /gists/starred",
- "GET /gists/{gist_id}/comments",
- "GET /gists/{gist_id}/commits",
- "GET /gists/{gist_id}/forks",
- "GET /installation/repositories",
- "GET /issues",
- "GET /licenses",
- "GET /marketplace_listing/plans",
- "GET /marketplace_listing/plans/{plan_id}/accounts",
- "GET /marketplace_listing/stubbed/plans",
- "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
- "GET /networks/{owner}/{repo}/events",
- "GET /notifications",
- "GET /organizations",
- "GET /orgs/{org}/actions/cache/usage-by-repository",
- "GET /orgs/{org}/actions/permissions/repositories",
- "GET /orgs/{org}/actions/runners",
- "GET /orgs/{org}/actions/secrets",
- "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/actions/variables",
- "GET /orgs/{org}/actions/variables/{name}/repositories",
- "GET /orgs/{org}/blocks",
- "GET /orgs/{org}/code-scanning/alerts",
- "GET /orgs/{org}/codespaces",
- "GET /orgs/{org}/codespaces/secrets",
- "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/copilot/billing/seats",
- "GET /orgs/{org}/dependabot/alerts",
- "GET /orgs/{org}/dependabot/secrets",
- "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/events",
- "GET /orgs/{org}/failed_invitations",
- "GET /orgs/{org}/hooks",
- "GET /orgs/{org}/hooks/{hook_id}/deliveries",
- "GET /orgs/{org}/installations",
- "GET /orgs/{org}/invitations",
- "GET /orgs/{org}/invitations/{invitation_id}/teams",
- "GET /orgs/{org}/issues",
- "GET /orgs/{org}/members",
- "GET /orgs/{org}/members/{username}/codespaces",
- "GET /orgs/{org}/migrations",
- "GET /orgs/{org}/migrations/{migration_id}/repositories",
- "GET /orgs/{org}/organization-roles/{role_id}/teams",
- "GET /orgs/{org}/organization-roles/{role_id}/users",
- "GET /orgs/{org}/outside_collaborators",
- "GET /orgs/{org}/packages",
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
- "GET /orgs/{org}/personal-access-token-requests",
- "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
- "GET /orgs/{org}/personal-access-tokens",
- "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
- "GET /orgs/{org}/projects",
- "GET /orgs/{org}/properties/values",
- "GET /orgs/{org}/public_members",
- "GET /orgs/{org}/repos",
- "GET /orgs/{org}/rulesets",
- "GET /orgs/{org}/rulesets/rule-suites",
- "GET /orgs/{org}/secret-scanning/alerts",
- "GET /orgs/{org}/security-advisories",
- "GET /orgs/{org}/teams",
- "GET /orgs/{org}/teams/{team_slug}/discussions",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
- "GET /orgs/{org}/teams/{team_slug}/invitations",
- "GET /orgs/{org}/teams/{team_slug}/members",
- "GET /orgs/{org}/teams/{team_slug}/projects",
- "GET /orgs/{org}/teams/{team_slug}/repos",
- "GET /orgs/{org}/teams/{team_slug}/teams",
- "GET /projects/columns/{column_id}/cards",
- "GET /projects/{project_id}/collaborators",
- "GET /projects/{project_id}/columns",
- "GET /repos/{owner}/{repo}/actions/artifacts",
- "GET /repos/{owner}/{repo}/actions/caches",
- "GET /repos/{owner}/{repo}/actions/organization-secrets",
- "GET /repos/{owner}/{repo}/actions/organization-variables",
- "GET /repos/{owner}/{repo}/actions/runners",
- "GET /repos/{owner}/{repo}/actions/runs",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
- "GET /repos/{owner}/{repo}/actions/secrets",
- "GET /repos/{owner}/{repo}/actions/variables",
- "GET /repos/{owner}/{repo}/actions/workflows",
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
- "GET /repos/{owner}/{repo}/activity",
- "GET /repos/{owner}/{repo}/assignees",
- "GET /repos/{owner}/{repo}/branches",
- "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
- "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
- "GET /repos/{owner}/{repo}/code-scanning/alerts",
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
- "GET /repos/{owner}/{repo}/code-scanning/analyses",
- "GET /repos/{owner}/{repo}/codespaces",
- "GET /repos/{owner}/{repo}/codespaces/devcontainers",
- "GET /repos/{owner}/{repo}/codespaces/secrets",
- "GET /repos/{owner}/{repo}/collaborators",
- "GET /repos/{owner}/{repo}/comments",
- "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/commits",
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
- "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
- "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
- "GET /repos/{owner}/{repo}/commits/{ref}/status",
- "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
- "GET /repos/{owner}/{repo}/contributors",
- "GET /repos/{owner}/{repo}/dependabot/alerts",
- "GET /repos/{owner}/{repo}/dependabot/secrets",
- "GET /repos/{owner}/{repo}/deployments",
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
- "GET /repos/{owner}/{repo}/environments",
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
- "GET /repos/{owner}/{repo}/events",
- "GET /repos/{owner}/{repo}/forks",
- "GET /repos/{owner}/{repo}/hooks",
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
- "GET /repos/{owner}/{repo}/invitations",
- "GET /repos/{owner}/{repo}/issues",
- "GET /repos/{owner}/{repo}/issues/comments",
- "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/issues/events",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
- "GET /repos/{owner}/{repo}/keys",
- "GET /repos/{owner}/{repo}/labels",
- "GET /repos/{owner}/{repo}/milestones",
- "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
- "GET /repos/{owner}/{repo}/notifications",
- "GET /repos/{owner}/{repo}/pages/builds",
- "GET /repos/{owner}/{repo}/projects",
- "GET /repos/{owner}/{repo}/pulls",
- "GET /repos/{owner}/{repo}/pulls/comments",
- "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
- "GET /repos/{owner}/{repo}/releases",
- "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
- "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
- "GET /repos/{owner}/{repo}/rules/branches/{branch}",
- "GET /repos/{owner}/{repo}/rulesets",
- "GET /repos/{owner}/{repo}/rulesets/rule-suites",
- "GET /repos/{owner}/{repo}/secret-scanning/alerts",
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
- "GET /repos/{owner}/{repo}/security-advisories",
- "GET /repos/{owner}/{repo}/stargazers",
- "GET /repos/{owner}/{repo}/subscribers",
- "GET /repos/{owner}/{repo}/tags",
- "GET /repos/{owner}/{repo}/teams",
- "GET /repos/{owner}/{repo}/topics",
- "GET /repositories",
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
- "GET /repositories/{repository_id}/environments/{environment_name}/variables",
- "GET /search/code",
- "GET /search/commits",
- "GET /search/issues",
- "GET /search/labels",
- "GET /search/repositories",
- "GET /search/topics",
- "GET /search/users",
- "GET /teams/{team_id}/discussions",
- "GET /teams/{team_id}/discussions/{discussion_number}/comments",
- "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
- "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
- "GET /teams/{team_id}/invitations",
- "GET /teams/{team_id}/members",
- "GET /teams/{team_id}/projects",
- "GET /teams/{team_id}/repos",
- "GET /teams/{team_id}/teams",
- "GET /user/blocks",
- "GET /user/codespaces",
- "GET /user/codespaces/secrets",
- "GET /user/emails",
- "GET /user/followers",
- "GET /user/following",
- "GET /user/gpg_keys",
- "GET /user/installations",
- "GET /user/installations/{installation_id}/repositories",
- "GET /user/issues",
- "GET /user/keys",
- "GET /user/marketplace_purchases",
- "GET /user/marketplace_purchases/stubbed",
- "GET /user/memberships/orgs",
- "GET /user/migrations",
- "GET /user/migrations/{migration_id}/repositories",
- "GET /user/orgs",
- "GET /user/packages",
- "GET /user/packages/{package_type}/{package_name}/versions",
- "GET /user/public_emails",
- "GET /user/repos",
- "GET /user/repository_invitations",
- "GET /user/social_accounts",
- "GET /user/ssh_signing_keys",
- "GET /user/starred",
- "GET /user/subscriptions",
- "GET /user/teams",
- "GET /users",
- "GET /users/{username}/events",
- "GET /users/{username}/events/orgs/{org}",
- "GET /users/{username}/events/public",
- "GET /users/{username}/followers",
- "GET /users/{username}/following",
- "GET /users/{username}/gists",
- "GET /users/{username}/gpg_keys",
- "GET /users/{username}/keys",
- "GET /users/{username}/orgs",
- "GET /users/{username}/packages",
- "GET /users/{username}/projects",
- "GET /users/{username}/received_events",
- "GET /users/{username}/received_events/public",
- "GET /users/{username}/repos",
- "GET /users/{username}/social_accounts",
- "GET /users/{username}/ssh_signing_keys",
- "GET /users/{username}/starred",
- "GET /users/{username}/subscriptions"
-];
-// pkg/dist-src/paginating-endpoints.js
-function isPaginatingEndpoint(arg) {
- if (typeof arg === "string") {
- return paginatingEndpoints.includes(arg);
- } else {
- return false;
- }
-}
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=message-metadata.js.map
-// pkg/dist-src/index.js
-function paginateRest(octokit) {
- return {
- paginate: Object.assign(paginate.bind(null, octokit), {
- iterator: iterator.bind(null, octokit)
- })
- };
-}
-paginateRest.VERSION = VERSION;
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
+/***/ }),
+
+/***/ 6286:
+/***/ ((__unused_webpack_module, exports) => {
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=message.js.map
+
/***/ }),
-/***/ 3044:
-/***/ ((module) => {
+/***/ 5710:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=pin.js.map
+
+/***/ }),
+
+/***/ 4178:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=reaction.js.map
+
+/***/ }),
+
+/***/ 7662:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=shared-channel.js.map
+
+/***/ }),
+
+/***/ 7145:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=star.js.map
+
+/***/ }),
+
+/***/ 8064:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=steps-from-apps.js.map
+
+/***/ }),
+
+/***/ 8974:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=subteam.js.map
+
+/***/ }),
+
+/***/ 5876:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=team.js.map
+
+/***/ }),
+
+/***/ 6000:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=token.js.map
+
+/***/ }),
+
+/***/ 5906:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=user.js.map
+
+/***/ }),
+
+/***/ 4775:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+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);
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+__exportStar(__nccwpck_require__(4591), exports);
+__exportStar(__nccwpck_require__(1356), exports);
+__exportStar(__nccwpck_require__(3819), exports);
+__exportStar(__nccwpck_require__(4148), exports);
+__exportStar(__nccwpck_require__(9110), exports);
+__exportStar(__nccwpck_require__(5523), exports);
+__exportStar(__nccwpck_require__(6954), exports);
+__exportStar(__nccwpck_require__(5723), exports);
+__exportStar(__nccwpck_require__(9380), exports);
+__exportStar(__nccwpck_require__(7445), exports);
+//# sourceMappingURL=index.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- legacyRestEndpointMethods: () => legacyRestEndpointMethods,
- restEndpointMethods: () => restEndpointMethods
-});
-module.exports = __toCommonJS(dist_src_exports);
+/***/ }),
-// pkg/dist-src/version.js
-var VERSION = "10.4.1";
+/***/ 5723:
+/***/ ((__unused_webpack_module, exports) => {
-// pkg/dist-src/generated/endpoints.js
-var Endpoints = {
- actions: {
- addCustomLabelsToSelfHostedRunnerForOrg: [
- "POST /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- addCustomLabelsToSelfHostedRunnerForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
- ],
- addSelectedRepoToOrgVariable: [
- "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
- ],
- approveWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
- ],
- cancelWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
- ],
- createEnvironmentVariable: [
- "POST /repositories/{repository_id}/environments/{environment_name}/variables"
- ],
- createOrUpdateEnvironmentSecret: [
- "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
- ],
- createOrgVariable: ["POST /orgs/{org}/actions/variables"],
- createRegistrationTokenForOrg: [
- "POST /orgs/{org}/actions/runners/registration-token"
- ],
- createRegistrationTokenForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/registration-token"
- ],
- createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
- createRemoveTokenForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/remove-token"
- ],
- createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
- createWorkflowDispatch: [
- "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
- ],
- deleteActionsCacheById: [
- "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
- ],
- deleteActionsCacheByKey: [
- "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
- ],
- deleteArtifact: [
- "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
- ],
- deleteEnvironmentSecret: [
- "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- deleteEnvironmentVariable: [
- "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
- deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
- ],
- deleteRepoVariable: [
- "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
- ],
- deleteSelfHostedRunnerFromOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}"
- ],
- deleteSelfHostedRunnerFromRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
- ],
- deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
- deleteWorkflowRunLogs: [
- "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
- ],
- disableSelectedRepositoryGithubActionsOrganization: [
- "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
- ],
- disableWorkflow: [
- "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
- ],
- downloadArtifact: [
- "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
- ],
- downloadJobLogsForWorkflowRun: [
- "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
- ],
- downloadWorkflowRunAttemptLogs: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
- ],
- downloadWorkflowRunLogs: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
- ],
- enableSelectedRepositoryGithubActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
- ],
- enableWorkflow: [
- "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
- ],
- forceCancelWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
- ],
- generateRunnerJitconfigForOrg: [
- "POST /orgs/{org}/actions/runners/generate-jitconfig"
- ],
- generateRunnerJitconfigForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
- ],
- getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
- getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
- getActionsCacheUsageByRepoForOrg: [
- "GET /orgs/{org}/actions/cache/usage-by-repository"
- ],
- getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
- getAllowedActionsOrganization: [
- "GET /orgs/{org}/actions/permissions/selected-actions"
- ],
- getAllowedActionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
- ],
- getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
- getCustomOidcSubClaimForRepo: [
- "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
- ],
- getEnvironmentPublicKey: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
- ],
- getEnvironmentSecret: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- getEnvironmentVariable: [
- "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- getGithubActionsDefaultWorkflowPermissionsOrganization: [
- "GET /orgs/{org}/actions/permissions/workflow"
- ],
- getGithubActionsDefaultWorkflowPermissionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/workflow"
- ],
- getGithubActionsPermissionsOrganization: [
- "GET /orgs/{org}/actions/permissions"
- ],
- getGithubActionsPermissionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions"
- ],
- getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
- getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
- getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
- getPendingDeploymentsForRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
- ],
- getRepoPermissions: [
- "GET /repos/{owner}/{repo}/actions/permissions",
- {},
- { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
- ],
- getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
- getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
- getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
- getReviewsForRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
- ],
- getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
- getSelfHostedRunnerForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
- ],
- getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
- getWorkflowAccessToRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/access"
- ],
- getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
- getWorkflowRunAttempt: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
- ],
- getWorkflowRunUsage: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
- ],
- getWorkflowUsage: [
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
- ],
- listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
- listEnvironmentSecrets: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
- ],
- listEnvironmentVariables: [
- "GET /repositories/{repository_id}/environments/{environment_name}/variables"
- ],
- listJobsForWorkflowRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
- ],
- listJobsForWorkflowRunAttempt: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
- ],
- listLabelsForSelfHostedRunnerForOrg: [
- "GET /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- listLabelsForSelfHostedRunnerForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
- listOrgVariables: ["GET /orgs/{org}/actions/variables"],
- listRepoOrganizationSecrets: [
- "GET /repos/{owner}/{repo}/actions/organization-secrets"
- ],
- listRepoOrganizationVariables: [
- "GET /repos/{owner}/{repo}/actions/organization-variables"
- ],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
- listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
- listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
- listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
- listRunnerApplicationsForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/downloads"
- ],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
- ],
- listSelectedReposForOrgVariable: [
- "GET /orgs/{org}/actions/variables/{name}/repositories"
- ],
- listSelectedRepositoriesEnabledGithubActionsOrganization: [
- "GET /orgs/{org}/actions/permissions/repositories"
- ],
- listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
- listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
- listWorkflowRunArtifacts: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
- ],
- listWorkflowRuns: [
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
- ],
- listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
- reRunJobForWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
- ],
- reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
- reRunWorkflowFailedJobs: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
- ],
- removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- removeCustomLabelFromSelfHostedRunnerForOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
- ],
- removeCustomLabelFromSelfHostedRunnerForRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
- ],
- removeSelectedRepoFromOrgVariable: [
- "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
- ],
- reviewCustomGatesForRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
- ],
- reviewPendingDeploymentsForRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
- ],
- setAllowedActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/selected-actions"
- ],
- setAllowedActionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
- ],
- setCustomLabelsForSelfHostedRunnerForOrg: [
- "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- setCustomLabelsForSelfHostedRunnerForRepo: [
- "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- setCustomOidcSubClaimForRepo: [
- "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
- ],
- setGithubActionsDefaultWorkflowPermissionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/workflow"
- ],
- setGithubActionsDefaultWorkflowPermissionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
- ],
- setGithubActionsPermissionsOrganization: [
- "PUT /orgs/{org}/actions/permissions"
- ],
- setGithubActionsPermissionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
- ],
- setSelectedReposForOrgVariable: [
- "PUT /orgs/{org}/actions/variables/{name}/repositories"
- ],
- setSelectedRepositoriesEnabledGithubActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/repositories"
- ],
- setWorkflowAccessToRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/access"
- ],
- updateEnvironmentVariable: [
- "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
- updateRepoVariable: [
- "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
- ]
- },
- activity: {
- checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
- deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
- deleteThreadSubscription: [
- "DELETE /notifications/threads/{thread_id}/subscription"
- ],
- getFeeds: ["GET /feeds"],
- getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
- getThread: ["GET /notifications/threads/{thread_id}"],
- getThreadSubscriptionForAuthenticatedUser: [
- "GET /notifications/threads/{thread_id}/subscription"
- ],
- listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
- listNotificationsForAuthenticatedUser: ["GET /notifications"],
- listOrgEventsForAuthenticatedUser: [
- "GET /users/{username}/events/orgs/{org}"
- ],
- listPublicEvents: ["GET /events"],
- listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
- listPublicEventsForUser: ["GET /users/{username}/events/public"],
- listPublicOrgEvents: ["GET /orgs/{org}/events"],
- listReceivedEventsForUser: ["GET /users/{username}/received_events"],
- listReceivedPublicEventsForUser: [
- "GET /users/{username}/received_events/public"
- ],
- listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
- listRepoNotificationsForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/notifications"
- ],
- listReposStarredByAuthenticatedUser: ["GET /user/starred"],
- listReposStarredByUser: ["GET /users/{username}/starred"],
- listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
- listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
- listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
- listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
- markNotificationsAsRead: ["PUT /notifications"],
- markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
- markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
- markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
- setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
- setThreadSubscription: [
- "PUT /notifications/threads/{thread_id}/subscription"
- ],
- starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
- unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
- },
- apps: {
- addRepoToInstallation: [
- "PUT /user/installations/{installation_id}/repositories/{repository_id}",
- {},
- { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
- ],
- addRepoToInstallationForAuthenticatedUser: [
- "PUT /user/installations/{installation_id}/repositories/{repository_id}"
- ],
- checkToken: ["POST /applications/{client_id}/token"],
- createFromManifest: ["POST /app-manifests/{code}/conversions"],
- createInstallationAccessToken: [
- "POST /app/installations/{installation_id}/access_tokens"
- ],
- deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
- deleteInstallation: ["DELETE /app/installations/{installation_id}"],
- deleteToken: ["DELETE /applications/{client_id}/token"],
- getAuthenticated: ["GET /app"],
- getBySlug: ["GET /apps/{app_slug}"],
- getInstallation: ["GET /app/installations/{installation_id}"],
- getOrgInstallation: ["GET /orgs/{org}/installation"],
- getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
- getSubscriptionPlanForAccount: [
- "GET /marketplace_listing/accounts/{account_id}"
- ],
- getSubscriptionPlanForAccountStubbed: [
- "GET /marketplace_listing/stubbed/accounts/{account_id}"
- ],
- getUserInstallation: ["GET /users/{username}/installation"],
- getWebhookConfigForApp: ["GET /app/hook/config"],
- getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
- listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
- listAccountsForPlanStubbed: [
- "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
- ],
- listInstallationReposForAuthenticatedUser: [
- "GET /user/installations/{installation_id}/repositories"
- ],
- listInstallationRequestsForAuthenticatedApp: [
- "GET /app/installation-requests"
- ],
- listInstallations: ["GET /app/installations"],
- listInstallationsForAuthenticatedUser: ["GET /user/installations"],
- listPlans: ["GET /marketplace_listing/plans"],
- listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
- listReposAccessibleToInstallation: ["GET /installation/repositories"],
- listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
- listSubscriptionsForAuthenticatedUserStubbed: [
- "GET /user/marketplace_purchases/stubbed"
- ],
- listWebhookDeliveries: ["GET /app/hook/deliveries"],
- redeliverWebhookDelivery: [
- "POST /app/hook/deliveries/{delivery_id}/attempts"
- ],
- removeRepoFromInstallation: [
- "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
- {},
- { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
- ],
- removeRepoFromInstallationForAuthenticatedUser: [
- "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
- ],
- resetToken: ["PATCH /applications/{client_id}/token"],
- revokeInstallationAccessToken: ["DELETE /installation/token"],
- scopeToken: ["POST /applications/{client_id}/token/scoped"],
- suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
- unsuspendInstallation: [
- "DELETE /app/installations/{installation_id}/suspended"
- ],
- updateWebhookConfigForApp: ["PATCH /app/hook/config"]
- },
- billing: {
- getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
- getGithubActionsBillingUser: [
- "GET /users/{username}/settings/billing/actions"
- ],
- getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
- getGithubPackagesBillingUser: [
- "GET /users/{username}/settings/billing/packages"
- ],
- getSharedStorageBillingOrg: [
- "GET /orgs/{org}/settings/billing/shared-storage"
- ],
- getSharedStorageBillingUser: [
- "GET /users/{username}/settings/billing/shared-storage"
- ]
- },
- checks: {
- create: ["POST /repos/{owner}/{repo}/check-runs"],
- createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
- get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
- getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
- listAnnotations: [
- "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
- ],
- listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
- listForSuite: [
- "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
- ],
- listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
- rerequestRun: [
- "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
- ],
- rerequestSuite: [
- "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
- ],
- setSuitesPreferences: [
- "PATCH /repos/{owner}/{repo}/check-suites/preferences"
- ],
- update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
- },
- codeScanning: {
- deleteAnalysis: [
- "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
- ],
- getAlert: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
- {},
- { renamedParameters: { alert_id: "alert_number" } }
- ],
- getAnalysis: [
- "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
- ],
- getCodeqlDatabase: [
- "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
- ],
- getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
- getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
- listAlertInstances: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
- listAlertsInstances: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
- {},
- { renamed: ["codeScanning", "listAlertInstances"] }
- ],
- listCodeqlDatabases: [
- "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
- ],
- listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
- ],
- updateDefaultSetup: [
- "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
- ],
- uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
- },
- codesOfConduct: {
- getAllCodesOfConduct: ["GET /codes_of_conduct"],
- getConductCode: ["GET /codes_of_conduct/{key}"]
- },
- codespaces: {
- addRepositoryForSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- checkPermissionsForDevcontainer: [
- "GET /repos/{owner}/{repo}/codespaces/permissions_check"
- ],
- codespaceMachinesForAuthenticatedUser: [
- "GET /user/codespaces/{codespace_name}/machines"
- ],
- createForAuthenticatedUser: ["POST /user/codespaces"],
- createOrUpdateOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
- ],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- createOrUpdateSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}"
- ],
- createWithPrForAuthenticatedUser: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
- ],
- createWithRepoForAuthenticatedUser: [
- "POST /repos/{owner}/{repo}/codespaces"
- ],
- deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
- deleteFromOrganization: [
- "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- deleteSecretForAuthenticatedUser: [
- "DELETE /user/codespaces/secrets/{secret_name}"
- ],
- exportForAuthenticatedUser: [
- "POST /user/codespaces/{codespace_name}/exports"
- ],
- getCodespacesForUserInOrg: [
- "GET /orgs/{org}/members/{username}/codespaces"
- ],
- getExportDetailsForAuthenticatedUser: [
- "GET /user/codespaces/{codespace_name}/exports/{export_id}"
- ],
- getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
- getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
- getPublicKeyForAuthenticatedUser: [
- "GET /user/codespaces/secrets/public-key"
- ],
- getRepoPublicKey: [
- "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
- ],
- getRepoSecret: [
- "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- getSecretForAuthenticatedUser: [
- "GET /user/codespaces/secrets/{secret_name}"
- ],
- listDevcontainersInRepositoryForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/devcontainers"
- ],
- listForAuthenticatedUser: ["GET /user/codespaces"],
- listInOrganization: [
- "GET /orgs/{org}/codespaces",
- {},
- { renamedParameters: { org_id: "org" } }
- ],
- listInRepositoryForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces"
- ],
- listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
- listRepositoriesForSecretForAuthenticatedUser: [
- "GET /user/codespaces/secrets/{secret_name}/repositories"
- ],
- listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
- ],
- preFlightWithRepoForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/new"
- ],
- publishForAuthenticatedUser: [
- "POST /user/codespaces/{codespace_name}/publish"
- ],
- removeRepositoryForSecretForAuthenticatedUser: [
- "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- repoMachinesForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/machines"
- ],
- setRepositoriesForSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}/repositories"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
- ],
- startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
- stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
- stopInOrganization: [
- "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
- ],
- updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
- },
- copilot: {
- addCopilotSeatsForTeams: [
- "POST /orgs/{org}/copilot/billing/selected_teams"
- ],
- addCopilotSeatsForUsers: [
- "POST /orgs/{org}/copilot/billing/selected_users"
- ],
- cancelCopilotSeatAssignmentForTeams: [
- "DELETE /orgs/{org}/copilot/billing/selected_teams"
- ],
- cancelCopilotSeatAssignmentForUsers: [
- "DELETE /orgs/{org}/copilot/billing/selected_users"
- ],
- getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
- getCopilotSeatDetailsForUser: [
- "GET /orgs/{org}/members/{username}/copilot"
- ],
- listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
- },
- dependabot: {
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
- ],
- createOrUpdateOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
- ],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
- getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
- getRepoPublicKey: [
- "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
- ],
- getRepoSecret: [
- "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- listAlertsForEnterprise: [
- "GET /enterprises/{enterprise}/dependabot/alerts"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
- listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
- ],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
- ]
- },
- dependencyGraph: {
- createRepositorySnapshot: [
- "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
- ],
- diffRange: [
- "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
- ],
- exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
- },
- emojis: { get: ["GET /emojis"] },
- gists: {
- checkIsStarred: ["GET /gists/{gist_id}/star"],
- create: ["POST /gists"],
- createComment: ["POST /gists/{gist_id}/comments"],
- delete: ["DELETE /gists/{gist_id}"],
- deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
- fork: ["POST /gists/{gist_id}/forks"],
- get: ["GET /gists/{gist_id}"],
- getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
- getRevision: ["GET /gists/{gist_id}/{sha}"],
- list: ["GET /gists"],
- listComments: ["GET /gists/{gist_id}/comments"],
- listCommits: ["GET /gists/{gist_id}/commits"],
- listForUser: ["GET /users/{username}/gists"],
- listForks: ["GET /gists/{gist_id}/forks"],
- listPublic: ["GET /gists/public"],
- listStarred: ["GET /gists/starred"],
- star: ["PUT /gists/{gist_id}/star"],
- unstar: ["DELETE /gists/{gist_id}/star"],
- update: ["PATCH /gists/{gist_id}"],
- updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
- },
- git: {
- createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
- createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
- createRef: ["POST /repos/{owner}/{repo}/git/refs"],
- createTag: ["POST /repos/{owner}/{repo}/git/tags"],
- createTree: ["POST /repos/{owner}/{repo}/git/trees"],
- deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
- getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
- getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
- getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
- getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
- getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
- listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
- updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
- },
- gitignore: {
- getAllTemplates: ["GET /gitignore/templates"],
- getTemplate: ["GET /gitignore/templates/{name}"]
- },
- interactions: {
- getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
- getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
- getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
- getRestrictionsForYourPublicRepos: [
- "GET /user/interaction-limits",
- {},
- { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
- ],
- removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
- removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
- removeRestrictionsForRepo: [
- "DELETE /repos/{owner}/{repo}/interaction-limits"
- ],
- removeRestrictionsForYourPublicRepos: [
- "DELETE /user/interaction-limits",
- {},
- { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
- ],
- setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
- setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
- setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
- setRestrictionsForYourPublicRepos: [
- "PUT /user/interaction-limits",
- {},
- { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
- ]
- },
- issues: {
- addAssignees: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
- ],
- addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
- checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
- checkUserCanBeAssignedToIssue: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
- ],
- create: ["POST /repos/{owner}/{repo}/issues"],
- createComment: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
- ],
- createLabel: ["POST /repos/{owner}/{repo}/labels"],
- createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
- deleteComment: [
- "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
- ],
- deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
- deleteMilestone: [
- "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
- ],
- get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
- getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
- getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
- getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
- getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
- list: ["GET /issues"],
- listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
- listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
- listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
- listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
- listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
- listEventsForTimeline: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
- ],
- listForAuthenticatedUser: ["GET /user/issues"],
- listForOrg: ["GET /orgs/{org}/issues"],
- listForRepo: ["GET /repos/{owner}/{repo}/issues"],
- listLabelsForMilestone: [
- "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
- ],
- listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
- listLabelsOnIssue: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
- ],
- listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
- lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
- removeAllLabels: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
- ],
- removeAssignees: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
- ],
- removeLabel: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
- ],
- setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
- unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
- update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
- updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
- updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
- updateMilestone: [
- "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
- ]
- },
- licenses: {
- get: ["GET /licenses/{license}"],
- getAllCommonlyUsed: ["GET /licenses"],
- getForRepo: ["GET /repos/{owner}/{repo}/license"]
- },
- markdown: {
- render: ["POST /markdown"],
- renderRaw: [
- "POST /markdown/raw",
- { headers: { "content-type": "text/plain; charset=utf-8" } }
- ]
- },
- meta: {
- get: ["GET /meta"],
- getAllVersions: ["GET /versions"],
- getOctocat: ["GET /octocat"],
- getZen: ["GET /zen"],
- root: ["GET /"]
- },
- migrations: {
- cancelImport: [
- "DELETE /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
- }
- ],
- deleteArchiveForAuthenticatedUser: [
- "DELETE /user/migrations/{migration_id}/archive"
- ],
- deleteArchiveForOrg: [
- "DELETE /orgs/{org}/migrations/{migration_id}/archive"
- ],
- downloadArchiveForOrg: [
- "GET /orgs/{org}/migrations/{migration_id}/archive"
- ],
- getArchiveForAuthenticatedUser: [
- "GET /user/migrations/{migration_id}/archive"
- ],
- getCommitAuthors: [
- "GET /repos/{owner}/{repo}/import/authors",
- {},
- {
- deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
- }
- ],
- getImportStatus: [
- "GET /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
- }
- ],
- getLargeFiles: [
- "GET /repos/{owner}/{repo}/import/large_files",
- {},
- {
- deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
- }
- ],
- getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
- getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
- listForAuthenticatedUser: ["GET /user/migrations"],
- listForOrg: ["GET /orgs/{org}/migrations"],
- listReposForAuthenticatedUser: [
- "GET /user/migrations/{migration_id}/repositories"
- ],
- listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
- listReposForUser: [
- "GET /user/migrations/{migration_id}/repositories",
- {},
- { renamed: ["migrations", "listReposForAuthenticatedUser"] }
- ],
- mapCommitAuthor: [
- "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
- {},
- {
- deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
- }
- ],
- setLfsPreference: [
- "PATCH /repos/{owner}/{repo}/import/lfs",
- {},
- {
- deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
- }
- ],
- startForAuthenticatedUser: ["POST /user/migrations"],
- startForOrg: ["POST /orgs/{org}/migrations"],
- startImport: [
- "PUT /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
- }
- ],
- unlockRepoForAuthenticatedUser: [
- "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
- ],
- unlockRepoForOrg: [
- "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
- ],
- updateImport: [
- "PATCH /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
- }
- ]
- },
- oidc: {
- getOidcCustomSubTemplateForOrg: [
- "GET /orgs/{org}/actions/oidc/customization/sub"
- ],
- updateOidcCustomSubTemplateForOrg: [
- "PUT /orgs/{org}/actions/oidc/customization/sub"
- ]
- },
- orgs: {
- addSecurityManagerTeam: [
- "PUT /orgs/{org}/security-managers/teams/{team_slug}"
- ],
- assignTeamToOrgRole: [
- "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
- ],
- assignUserToOrgRole: [
- "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
- ],
- blockUser: ["PUT /orgs/{org}/blocks/{username}"],
- cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
- checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
- checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
- checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
- convertMemberToOutsideCollaborator: [
- "PUT /orgs/{org}/outside_collaborators/{username}"
- ],
- createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
- createInvitation: ["POST /orgs/{org}/invitations"],
- createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
- createOrUpdateCustomPropertiesValuesForRepos: [
- "PATCH /orgs/{org}/properties/values"
- ],
- createOrUpdateCustomProperty: [
- "PUT /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- createWebhook: ["POST /orgs/{org}/hooks"],
- delete: ["DELETE /orgs/{org}"],
- deleteCustomOrganizationRole: [
- "DELETE /orgs/{org}/organization-roles/{role_id}"
- ],
- deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
- enableOrDisableSecurityProductOnAllOrgRepos: [
- "POST /orgs/{org}/{security_product}/{enablement}"
- ],
- get: ["GET /orgs/{org}"],
- getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
- getCustomProperty: [
- "GET /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
- getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
- getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
- getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
- getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
- getWebhookDelivery: [
- "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
- ],
- list: ["GET /organizations"],
- listAppInstallations: ["GET /orgs/{org}/installations"],
- listBlockedUsers: ["GET /orgs/{org}/blocks"],
- listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
- listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
- listForAuthenticatedUser: ["GET /user/orgs"],
- listForUser: ["GET /users/{username}/orgs"],
- listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
- listMembers: ["GET /orgs/{org}/members"],
- listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
- listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
- listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
- listOrgRoles: ["GET /orgs/{org}/organization-roles"],
- listOrganizationFineGrainedPermissions: [
- "GET /orgs/{org}/organization-fine-grained-permissions"
- ],
- listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
- listPatGrantRepositories: [
- "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
- ],
- listPatGrantRequestRepositories: [
- "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
- ],
- listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
- listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
- listPendingInvitations: ["GET /orgs/{org}/invitations"],
- listPublicMembers: ["GET /orgs/{org}/public_members"],
- listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
- listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
- listWebhooks: ["GET /orgs/{org}/hooks"],
- patchCustomOrganizationRole: [
- "PATCH /orgs/{org}/organization-roles/{role_id}"
- ],
- pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
- redeliverWebhookDelivery: [
- "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
- ],
- removeCustomProperty: [
- "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- removeMember: ["DELETE /orgs/{org}/members/{username}"],
- removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
- removeOutsideCollaborator: [
- "DELETE /orgs/{org}/outside_collaborators/{username}"
- ],
- removePublicMembershipForAuthenticatedUser: [
- "DELETE /orgs/{org}/public_members/{username}"
- ],
- removeSecurityManagerTeam: [
- "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
- ],
- reviewPatGrantRequest: [
- "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
- ],
- reviewPatGrantRequestsInBulk: [
- "POST /orgs/{org}/personal-access-token-requests"
- ],
- revokeAllOrgRolesTeam: [
- "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
- ],
- revokeAllOrgRolesUser: [
- "DELETE /orgs/{org}/organization-roles/users/{username}"
- ],
- revokeOrgRoleTeam: [
- "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
- ],
- revokeOrgRoleUser: [
- "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
- ],
- setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
- setPublicMembershipForAuthenticatedUser: [
- "PUT /orgs/{org}/public_members/{username}"
- ],
- unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
- update: ["PATCH /orgs/{org}"],
- updateMembershipForAuthenticatedUser: [
- "PATCH /user/memberships/orgs/{org}"
- ],
- updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
- updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
- updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
- updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
- },
- packages: {
- deletePackageForAuthenticatedUser: [
- "DELETE /user/packages/{package_type}/{package_name}"
- ],
- deletePackageForOrg: [
- "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
- ],
- deletePackageForUser: [
- "DELETE /users/{username}/packages/{package_type}/{package_name}"
- ],
- deletePackageVersionForAuthenticatedUser: [
- "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- deletePackageVersionForOrg: [
- "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- deletePackageVersionForUser: [
- "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getAllPackageVersionsForAPackageOwnedByAnOrg: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
- {},
- { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
- ],
- getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions",
- {},
- {
- renamed: [
- "packages",
- "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
- ]
- }
- ],
- getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions"
- ],
- getAllPackageVersionsForPackageOwnedByOrg: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
- ],
- getAllPackageVersionsForPackageOwnedByUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}/versions"
- ],
- getPackageForAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}"
- ],
- getPackageForOrganization: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}"
- ],
- getPackageForUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}"
- ],
- getPackageVersionForAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getPackageVersionForOrganization: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getPackageVersionForUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- listDockerMigrationConflictingPackagesForAuthenticatedUser: [
- "GET /user/docker/conflicts"
- ],
- listDockerMigrationConflictingPackagesForOrganization: [
- "GET /orgs/{org}/docker/conflicts"
- ],
- listDockerMigrationConflictingPackagesForUser: [
- "GET /users/{username}/docker/conflicts"
- ],
- listPackagesForAuthenticatedUser: ["GET /user/packages"],
- listPackagesForOrganization: ["GET /orgs/{org}/packages"],
- listPackagesForUser: ["GET /users/{username}/packages"],
- restorePackageForAuthenticatedUser: [
- "POST /user/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageForOrg: [
- "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageForUser: [
- "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageVersionForAuthenticatedUser: [
- "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ],
- restorePackageVersionForOrg: [
- "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ],
- restorePackageVersionForUser: [
- "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ]
- },
- projects: {
- addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
- createCard: ["POST /projects/columns/{column_id}/cards"],
- createColumn: ["POST /projects/{project_id}/columns"],
- createForAuthenticatedUser: ["POST /user/projects"],
- createForOrg: ["POST /orgs/{org}/projects"],
- createForRepo: ["POST /repos/{owner}/{repo}/projects"],
- delete: ["DELETE /projects/{project_id}"],
- deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
- deleteColumn: ["DELETE /projects/columns/{column_id}"],
- get: ["GET /projects/{project_id}"],
- getCard: ["GET /projects/columns/cards/{card_id}"],
- getColumn: ["GET /projects/columns/{column_id}"],
- getPermissionForUser: [
- "GET /projects/{project_id}/collaborators/{username}/permission"
- ],
- listCards: ["GET /projects/columns/{column_id}/cards"],
- listCollaborators: ["GET /projects/{project_id}/collaborators"],
- listColumns: ["GET /projects/{project_id}/columns"],
- listForOrg: ["GET /orgs/{org}/projects"],
- listForRepo: ["GET /repos/{owner}/{repo}/projects"],
- listForUser: ["GET /users/{username}/projects"],
- moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
- moveColumn: ["POST /projects/columns/{column_id}/moves"],
- removeCollaborator: [
- "DELETE /projects/{project_id}/collaborators/{username}"
- ],
- update: ["PATCH /projects/{project_id}"],
- updateCard: ["PATCH /projects/columns/cards/{card_id}"],
- updateColumn: ["PATCH /projects/columns/{column_id}"]
- },
- pulls: {
- checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
- create: ["POST /repos/{owner}/{repo}/pulls"],
- createReplyForReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
- ],
- createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
- createReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
- ],
- deletePendingReview: [
- "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- deleteReviewComment: [
- "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
- ],
- dismissReview: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
- ],
- get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
- getReview: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
- list: ["GET /repos/{owner}/{repo}/pulls"],
- listCommentsForReview: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
- ],
- listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
- listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
- listRequestedReviewers: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- listReviewComments: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
- ],
- listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
- listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
- merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
- removeRequestedReviewers: [
- "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- requestReviewers: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- submitReview: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
- ],
- update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
- updateBranch: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
- ],
- updateReview: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- updateReviewComment: [
- "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
- ]
- },
- rateLimit: { get: ["GET /rate_limit"] },
- reactions: {
- createForCommitComment: [
- "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
- ],
- createForIssue: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
- ],
- createForIssueComment: [
- "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
- ],
- createForPullRequestReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
- ],
- createForRelease: [
- "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
- ],
- createForTeamDiscussionCommentInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
- ],
- createForTeamDiscussionInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
- ],
- deleteForCommitComment: [
- "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForIssue: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
- ],
- deleteForIssueComment: [
- "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForPullRequestComment: [
- "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForRelease: [
- "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
- ],
- deleteForTeamDiscussion: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
- ],
- deleteForTeamDiscussionComment: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
- ],
- listForCommitComment: [
- "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
- ],
- listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
- listForIssueComment: [
- "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
- ],
- listForPullRequestReviewComment: [
- "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
- ],
- listForRelease: [
- "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
- ],
- listForTeamDiscussionCommentInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
- ],
- listForTeamDiscussionInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
- ]
- },
- repos: {
- acceptInvitation: [
- "PATCH /user/repository_invitations/{invitation_id}",
- {},
- { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
- ],
- acceptInvitationForAuthenticatedUser: [
- "PATCH /user/repository_invitations/{invitation_id}"
- ],
- addAppAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
- addStatusCheckContexts: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- addTeamAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- addUserAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- cancelPagesDeployment: [
- "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
- ],
- checkAutomatedSecurityFixes: [
- "GET /repos/{owner}/{repo}/automated-security-fixes"
- ],
- checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
- checkVulnerabilityAlerts: [
- "GET /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
- compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
- compareCommitsWithBasehead: [
- "GET /repos/{owner}/{repo}/compare/{basehead}"
- ],
- createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
- createCommitComment: [
- "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
- ],
- createCommitSignatureProtection: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
- createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
- createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
- createDeploymentBranchPolicy: [
- "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
- ],
- createDeploymentProtectionRule: [
- "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
- ],
- createDeploymentStatus: [
- "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
- ],
- createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
- createForAuthenticatedUser: ["POST /user/repos"],
- createFork: ["POST /repos/{owner}/{repo}/forks"],
- createInOrg: ["POST /orgs/{org}/repos"],
- createOrUpdateCustomPropertiesValues: [
- "PATCH /repos/{owner}/{repo}/properties/values"
- ],
- createOrUpdateEnvironment: [
- "PUT /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
- createOrgRuleset: ["POST /orgs/{org}/rulesets"],
- createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
- createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
- createRelease: ["POST /repos/{owner}/{repo}/releases"],
- createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
- createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
- createUsingTemplate: [
- "POST /repos/{template_owner}/{template_repo}/generate"
- ],
- createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
- declineInvitation: [
- "DELETE /user/repository_invitations/{invitation_id}",
- {},
- { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
- ],
- declineInvitationForAuthenticatedUser: [
- "DELETE /user/repository_invitations/{invitation_id}"
- ],
- delete: ["DELETE /repos/{owner}/{repo}"],
- deleteAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
- ],
- deleteAdminBranchProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- deleteAnEnvironment: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
- deleteBranchProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
- deleteCommitSignatureProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
- deleteDeployment: [
- "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
- ],
- deleteDeploymentBranchPolicy: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
- deleteInvitation: [
- "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
- ],
- deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
- deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
- deletePullRequestReviewProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
- deleteReleaseAsset: [
- "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
- ],
- deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- deleteTagProtection: [
- "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
- ],
- deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
- disableAutomatedSecurityFixes: [
- "DELETE /repos/{owner}/{repo}/automated-security-fixes"
- ],
- disableDeploymentProtectionRule: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
- ],
- disablePrivateVulnerabilityReporting: [
- "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
- ],
- disableVulnerabilityAlerts: [
- "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- downloadArchive: [
- "GET /repos/{owner}/{repo}/zipball/{ref}",
- {},
- { renamed: ["repos", "downloadZipballArchive"] }
- ],
- downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
- downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
- enableAutomatedSecurityFixes: [
- "PUT /repos/{owner}/{repo}/automated-security-fixes"
- ],
- enablePrivateVulnerabilityReporting: [
- "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
- ],
- enableVulnerabilityAlerts: [
- "PUT /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- generateReleaseNotes: [
- "POST /repos/{owner}/{repo}/releases/generate-notes"
- ],
- get: ["GET /repos/{owner}/{repo}"],
- getAccessRestrictions: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
- ],
- getAdminBranchProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- getAllDeploymentProtectionRules: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
- ],
- getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
- getAllStatusCheckContexts: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
- ],
- getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
- getAppsWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
- ],
- getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
- getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
- getBranchProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
- getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
- getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
- getCollaboratorPermissionLevel: [
- "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
- ],
- getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
- getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
- getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
- getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
- getCommitSignatureProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
- getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
- getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
- getCustomDeploymentProtectionRule: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
- ],
- getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
- getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
- getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
- getDeploymentBranchPolicy: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- getDeploymentStatus: [
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
- ],
- getEnvironment: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
- getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
- getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
- getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
- getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
- getOrgRulesets: ["GET /orgs/{org}/rulesets"],
- getPages: ["GET /repos/{owner}/{repo}/pages"],
- getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
- getPagesDeployment: [
- "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
- ],
- getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
- getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
- getPullRequestReviewProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
- getReadme: ["GET /repos/{owner}/{repo}/readme"],
- getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
- getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
- getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
- getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
- getRepoRuleSuite: [
- "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
- ],
- getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
- getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
- getStatusChecksProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- getTeamsWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
- ],
- getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
- getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
- getUsersWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
- ],
- getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
- getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
- getWebhookConfigForRepo: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
- ],
- getWebhookDelivery: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
- ],
- listActivities: ["GET /repos/{owner}/{repo}/activity"],
- listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
- listBranches: ["GET /repos/{owner}/{repo}/branches"],
- listBranchesForHeadCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
- ],
- listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
- listCommentsForCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
- ],
- listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
- listCommitStatusesForRef: [
- "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
- ],
- listCommits: ["GET /repos/{owner}/{repo}/commits"],
- listContributors: ["GET /repos/{owner}/{repo}/contributors"],
- listCustomDeploymentRuleIntegrations: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
- ],
- listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
- listDeploymentBranchPolicies: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
- ],
- listDeploymentStatuses: [
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
- ],
- listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
- listForAuthenticatedUser: ["GET /user/repos"],
- listForOrg: ["GET /orgs/{org}/repos"],
- listForUser: ["GET /users/{username}/repos"],
- listForks: ["GET /repos/{owner}/{repo}/forks"],
- listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
- listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
- listLanguages: ["GET /repos/{owner}/{repo}/languages"],
- listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
- listPublic: ["GET /repositories"],
- listPullRequestsAssociatedWithCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
- ],
- listReleaseAssets: [
- "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
- ],
- listReleases: ["GET /repos/{owner}/{repo}/releases"],
- listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
- listTags: ["GET /repos/{owner}/{repo}/tags"],
- listTeams: ["GET /repos/{owner}/{repo}/teams"],
- listWebhookDeliveries: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
- ],
- listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
- merge: ["POST /repos/{owner}/{repo}/merges"],
- mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
- pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
- redeliverWebhookDelivery: [
- "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
- ],
- removeAppAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- removeCollaborator: [
- "DELETE /repos/{owner}/{repo}/collaborators/{username}"
- ],
- removeStatusCheckContexts: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- removeStatusCheckProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- removeTeamAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- removeUserAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
- replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
- requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
- setAdminBranchProtection: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- setAppAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- setStatusCheckContexts: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- setTeamAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- setUserAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
- transfer: ["POST /repos/{owner}/{repo}/transfer"],
- update: ["PATCH /repos/{owner}/{repo}"],
- updateBranchProtection: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
- updateDeploymentBranchPolicy: [
- "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
- updateInvitation: [
- "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
- ],
- updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
- updatePullRequestReviewProtection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
- updateReleaseAsset: [
- "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
- ],
- updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- updateStatusCheckPotection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
- {},
- { renamed: ["repos", "updateStatusCheckProtection"] }
- ],
- updateStatusCheckProtection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
- updateWebhookConfigForRepo: [
- "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
- ],
- uploadReleaseAsset: [
- "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
- { baseUrl: "https://uploads.github.com" }
- ]
- },
- search: {
- code: ["GET /search/code"],
- commits: ["GET /search/commits"],
- issuesAndPullRequests: ["GET /search/issues"],
- labels: ["GET /search/labels"],
- repos: ["GET /search/repositories"],
- topics: ["GET /search/topics"],
- users: ["GET /search/users"]
- },
- secretScanning: {
- getAlert: [
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
- ],
- listAlertsForEnterprise: [
- "GET /enterprises/{enterprise}/secret-scanning/alerts"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
- listLocationsForAlert: [
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
- ],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
- ]
- },
- securityAdvisories: {
- createFork: [
- "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
- ],
- createPrivateVulnerabilityReport: [
- "POST /repos/{owner}/{repo}/security-advisories/reports"
- ],
- createRepositoryAdvisory: [
- "POST /repos/{owner}/{repo}/security-advisories"
- ],
- createRepositoryAdvisoryCveRequest: [
- "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
- ],
- getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
- getRepositoryAdvisory: [
- "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
- ],
- listGlobalAdvisories: ["GET /advisories"],
- listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
- listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
- updateRepositoryAdvisory: [
- "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
- ]
- },
- teams: {
- addOrUpdateMembershipForUserInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- addOrUpdateProjectPermissionsInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- addOrUpdateRepoPermissionsInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- checkPermissionsForProjectInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- checkPermissionsForRepoInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- create: ["POST /orgs/{org}/teams"],
- createDiscussionCommentInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
- ],
- createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
- deleteDiscussionCommentInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- deleteDiscussionInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
- getByName: ["GET /orgs/{org}/teams/{team_slug}"],
- getDiscussionCommentInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- getDiscussionInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- getMembershipForUserInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- list: ["GET /orgs/{org}/teams"],
- listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
- listDiscussionCommentsInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
- ],
- listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
- listForAuthenticatedUser: ["GET /user/teams"],
- listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
- listPendingInvitationsInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/invitations"
- ],
- listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
- listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
- removeMembershipForUserInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- removeProjectInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- removeRepoInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- updateDiscussionCommentInOrg: [
- "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- updateDiscussionInOrg: [
- "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
- },
- users: {
- addEmailForAuthenticated: [
- "POST /user/emails",
- {},
- { renamed: ["users", "addEmailForAuthenticatedUser"] }
- ],
- addEmailForAuthenticatedUser: ["POST /user/emails"],
- addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
- block: ["PUT /user/blocks/{username}"],
- checkBlocked: ["GET /user/blocks/{username}"],
- checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
- checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
- createGpgKeyForAuthenticated: [
- "POST /user/gpg_keys",
- {},
- { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
- ],
- createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
- createPublicSshKeyForAuthenticated: [
- "POST /user/keys",
- {},
- { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
- ],
- createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
- createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
- deleteEmailForAuthenticated: [
- "DELETE /user/emails",
- {},
- { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
- ],
- deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
- deleteGpgKeyForAuthenticated: [
- "DELETE /user/gpg_keys/{gpg_key_id}",
- {},
- { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
- ],
- deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
- deletePublicSshKeyForAuthenticated: [
- "DELETE /user/keys/{key_id}",
- {},
- { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
- ],
- deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
- deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
- deleteSshSigningKeyForAuthenticatedUser: [
- "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
- ],
- follow: ["PUT /user/following/{username}"],
- getAuthenticated: ["GET /user"],
- getByUsername: ["GET /users/{username}"],
- getContextForUser: ["GET /users/{username}/hovercard"],
- getGpgKeyForAuthenticated: [
- "GET /user/gpg_keys/{gpg_key_id}",
- {},
- { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
- ],
- getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
- getPublicSshKeyForAuthenticated: [
- "GET /user/keys/{key_id}",
- {},
- { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
- ],
- getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
- getSshSigningKeyForAuthenticatedUser: [
- "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
- ],
- list: ["GET /users"],
- listBlockedByAuthenticated: [
- "GET /user/blocks",
- {},
- { renamed: ["users", "listBlockedByAuthenticatedUser"] }
- ],
- listBlockedByAuthenticatedUser: ["GET /user/blocks"],
- listEmailsForAuthenticated: [
- "GET /user/emails",
- {},
- { renamed: ["users", "listEmailsForAuthenticatedUser"] }
- ],
- listEmailsForAuthenticatedUser: ["GET /user/emails"],
- listFollowedByAuthenticated: [
- "GET /user/following",
- {},
- { renamed: ["users", "listFollowedByAuthenticatedUser"] }
- ],
- listFollowedByAuthenticatedUser: ["GET /user/following"],
- listFollowersForAuthenticatedUser: ["GET /user/followers"],
- listFollowersForUser: ["GET /users/{username}/followers"],
- listFollowingForUser: ["GET /users/{username}/following"],
- listGpgKeysForAuthenticated: [
- "GET /user/gpg_keys",
- {},
- { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
- ],
- listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
- listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
- listPublicEmailsForAuthenticated: [
- "GET /user/public_emails",
- {},
- { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
- ],
- listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
- listPublicKeysForUser: ["GET /users/{username}/keys"],
- listPublicSshKeysForAuthenticated: [
- "GET /user/keys",
- {},
- { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
- ],
- listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
- listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
- listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
- listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
- listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
- setPrimaryEmailVisibilityForAuthenticated: [
- "PATCH /user/email/visibility",
- {},
- { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
- ],
- setPrimaryEmailVisibilityForAuthenticatedUser: [
- "PATCH /user/email/visibility"
- ],
- unblock: ["DELETE /user/blocks/{username}"],
- unfollow: ["DELETE /user/following/{username}"],
- updateAuthenticated: ["PATCH /user"]
- }
-};
-var endpoints_default = Endpoints;
-
-// pkg/dist-src/endpoints-to-methods.js
-var endpointMethodsMap = /* @__PURE__ */ new Map();
-for (const [scope, endpoints] of Object.entries(endpoints_default)) {
- for (const [methodName, endpoint] of Object.entries(endpoints)) {
- const [route, defaults, decorations] = endpoint;
- const [method, url] = route.split(/ /);
- const endpointDefaults = Object.assign(
- {
- method,
- url
- },
- defaults
- );
- if (!endpointMethodsMap.has(scope)) {
- endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
- }
- endpointMethodsMap.get(scope).set(methodName, {
- scope,
- methodName,
- endpointDefaults,
- decorations
- });
- }
-}
-var handler = {
- has({ scope }, methodName) {
- return endpointMethodsMap.get(scope).has(methodName);
- },
- getOwnPropertyDescriptor(target, methodName) {
- return {
- value: this.get(target, methodName),
- // ensures method is in the cache
- configurable: true,
- writable: true,
- enumerable: true
- };
- },
- defineProperty(target, methodName, descriptor) {
- Object.defineProperty(target.cache, methodName, descriptor);
- return true;
- },
- deleteProperty(target, methodName) {
- delete target.cache[methodName];
- return true;
- },
- ownKeys({ scope }) {
- return [...endpointMethodsMap.get(scope).keys()];
- },
- set(target, methodName, value) {
- return target.cache[methodName] = value;
- },
- get({ octokit, scope, cache }, methodName) {
- if (cache[methodName]) {
- return cache[methodName];
- }
- const method = endpointMethodsMap.get(scope).get(methodName);
- if (!method) {
- return void 0;
- }
- const { endpointDefaults, decorations } = method;
- if (decorations) {
- cache[methodName] = decorate(
- octokit,
- scope,
- methodName,
- endpointDefaults,
- decorations
- );
- } else {
- cache[methodName] = octokit.request.defaults(endpointDefaults);
- }
- return cache[methodName];
- }
-};
-function endpointsToMethods(octokit) {
- const newMethods = {};
- for (const scope of endpointMethodsMap.keys()) {
- newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
- }
- return newMethods;
-}
-function decorate(octokit, scope, methodName, defaults, decorations) {
- const requestWithDefaults = octokit.request.defaults(defaults);
- function withDecorations(...args) {
- let options = requestWithDefaults.endpoint.merge(...args);
- if (decorations.mapToData) {
- options = Object.assign({}, options, {
- data: options[decorations.mapToData],
- [decorations.mapToData]: void 0
- });
- return requestWithDefaults(options);
- }
- if (decorations.renamed) {
- const [newScope, newMethodName] = decorations.renamed;
- octokit.log.warn(
- `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
- );
- }
- if (decorations.deprecated) {
- octokit.log.warn(decorations.deprecated);
- }
- if (decorations.renamedParameters) {
- const options2 = requestWithDefaults.endpoint.merge(...args);
- for (const [name, alias] of Object.entries(
- decorations.renamedParameters
- )) {
- if (name in options2) {
- octokit.log.warn(
- `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
- );
- if (!(alias in options2)) {
- options2[alias] = options2[name];
- }
- delete options2[name];
- }
- }
- return requestWithDefaults(options2);
- }
- return requestWithDefaults(...args);
- }
- return Object.assign(withDecorations, requestWithDefaults);
-}
-
-// pkg/dist-src/index.js
-function restEndpointMethods(octokit) {
- const api = endpointsToMethods(octokit);
- return {
- rest: api
- };
-}
-restEndpointMethods.VERSION = VERSION;
-function legacyRestEndpointMethods(octokit) {
- const api = endpointsToMethods(octokit);
- return {
- ...api,
- rest: api
- };
-}
-legacyRestEndpointMethods.VERSION = VERSION;
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 537:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- RequestError: () => RequestError
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_deprecation = __nccwpck_require__(8932);
-var import_once = __toESM(__nccwpck_require__(1223));
-var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
-var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
-var RequestError = class extends Error {
- constructor(message, statusCode, options) {
- super(message);
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- }
- this.name = "HttpError";
- this.status = statusCode;
- let headers;
- if ("headers" in options && typeof options.headers !== "undefined") {
- headers = options.headers;
- }
- if ("response" in options) {
- this.response = options.response;
- headers = options.response.headers;
- }
- const requestCopy = Object.assign({}, options.request);
- if (options.request.headers.authorization) {
- requestCopy.headers = Object.assign({}, options.request.headers, {
- authorization: options.request.headers.authorization.replace(
- / .*$/,
- " [REDACTED]"
- )
- });
- }
- requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
- this.request = requestCopy;
- Object.defineProperty(this, "code", {
- get() {
- logOnceCode(
- new import_deprecation.Deprecation(
- "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
- )
- );
- return statusCode;
- }
- });
- Object.defineProperty(this, "headers", {
- get() {
- logOnceHeaders(
- new import_deprecation.Deprecation(
- "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
- )
- );
- return headers || {};
- }
- });
- }
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 6234:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- request: () => request
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_endpoint = __nccwpck_require__(9440);
-var import_universal_user_agent = __nccwpck_require__(5030);
-
-// pkg/dist-src/version.js
-var VERSION = "8.4.0";
-
-// pkg/dist-src/is-plain-object.js
-function isPlainObject(value) {
- if (typeof value !== "object" || value === null)
- return false;
- if (Object.prototype.toString.call(value) !== "[object Object]")
- return false;
- const proto = Object.getPrototypeOf(value);
- if (proto === null)
- return true;
- const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
-}
-
-// pkg/dist-src/fetch-wrapper.js
-var import_request_error = __nccwpck_require__(537);
-
-// pkg/dist-src/get-buffer-response.js
-function getBufferResponse(response) {
- return response.arrayBuffer();
-}
-
-// pkg/dist-src/fetch-wrapper.js
-function fetchWrapper(requestOptions) {
- var _a, _b, _c, _d;
- const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
- const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
- if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
- requestOptions.body = JSON.stringify(requestOptions.body);
- }
- let headers = {};
- let status;
- let url;
- let { fetch } = globalThis;
- if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
- fetch = requestOptions.request.fetch;
- }
- if (!fetch) {
- throw new Error(
- "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
- );
- }
- return fetch(requestOptions.url, {
- method: requestOptions.method,
- body: requestOptions.body,
- redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
- headers: requestOptions.headers,
- signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
- // duplex must be set if request.body is ReadableStream or Async Iterables.
- // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
- ...requestOptions.body && { duplex: "half" }
- }).then(async (response) => {
- url = response.url;
- status = response.status;
- for (const keyAndValue of response.headers) {
- headers[keyAndValue[0]] = keyAndValue[1];
- }
- if ("deprecation" in headers) {
- const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
- const deprecationLink = matches && matches.pop();
- log.warn(
- `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
- );
- }
- if (status === 204 || status === 205) {
- return;
- }
- if (requestOptions.method === "HEAD") {
- if (status < 400) {
- return;
- }
- throw new import_request_error.RequestError(response.statusText, status, {
- response: {
- url,
- status,
- headers,
- data: void 0
- },
- request: requestOptions
- });
- }
- if (status === 304) {
- throw new import_request_error.RequestError("Not modified", status, {
- response: {
- url,
- status,
- headers,
- data: await getResponseData(response)
- },
- request: requestOptions
- });
- }
- if (status >= 400) {
- const data = await getResponseData(response);
- const error = new import_request_error.RequestError(toErrorMessage(data), status, {
- response: {
- url,
- status,
- headers,
- data
- },
- request: requestOptions
- });
- throw error;
- }
- return parseSuccessResponseBody ? await getResponseData(response) : response.body;
- }).then((data) => {
- return {
- status,
- url,
- headers,
- data
- };
- }).catch((error) => {
- if (error instanceof import_request_error.RequestError)
- throw error;
- else if (error.name === "AbortError")
- throw error;
- let message = error.message;
- if (error.name === "TypeError" && "cause" in error) {
- if (error.cause instanceof Error) {
- message = error.cause.message;
- } else if (typeof error.cause === "string") {
- message = error.cause;
- }
- }
- throw new import_request_error.RequestError(message, 500, {
- request: requestOptions
- });
- });
-}
-async function getResponseData(response) {
- const contentType = response.headers.get("content-type");
- if (/application\/json/.test(contentType)) {
- return response.json().catch(() => response.text()).catch(() => "");
- }
- if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
- return response.text();
- }
- return getBufferResponse(response);
-}
-function toErrorMessage(data) {
- if (typeof data === "string")
- return data;
- let suffix;
- if ("documentation_url" in data) {
- suffix = ` - ${data.documentation_url}`;
- } else {
- suffix = "";
- }
- if ("message" in data) {
- if (Array.isArray(data.errors)) {
- return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
- }
- return `${data.message}${suffix}`;
- }
- return `Unknown error: ${JSON.stringify(data)}`;
-}
-
-// pkg/dist-src/with-defaults.js
-function withDefaults(oldEndpoint, newDefaults) {
- const endpoint2 = oldEndpoint.defaults(newDefaults);
- const newApi = function(route, parameters) {
- const endpointOptions = endpoint2.merge(route, parameters);
- if (!endpointOptions.request || !endpointOptions.request.hook) {
- return fetchWrapper(endpoint2.parse(endpointOptions));
- }
- const request2 = (route2, parameters2) => {
- return fetchWrapper(
- endpoint2.parse(endpoint2.merge(route2, parameters2))
- );
- };
- Object.assign(request2, {
- endpoint: endpoint2,
- defaults: withDefaults.bind(null, endpoint2)
- });
- return endpointOptions.request.hook(request2, endpointOptions);
- };
- return Object.assign(newApi, {
- endpoint: endpoint2,
- defaults: withDefaults.bind(null, endpoint2)
- });
-}
-
-// pkg/dist-src/index.js
-var request = withDefaults(import_endpoint.endpoint, {
- headers: {
- "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
- }
-});
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 2704:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-/* eslint-disable no-console */
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.ConsoleLogger = exports.LogLevel = void 0;
-/**
- * Severity levels for log entries
- */
-var LogLevel;
-(function (LogLevel) {
- LogLevel["ERROR"] = "error";
- LogLevel["WARN"] = "warn";
- LogLevel["INFO"] = "info";
- LogLevel["DEBUG"] = "debug";
-})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
-/**
- * Default logger which logs to stdout and stderr
- */
-class ConsoleLogger {
- constructor() {
- this.level = LogLevel.INFO;
- this.name = '';
- }
- getLevel() {
- return this.level;
- }
- /**
- * Sets the instance's log level so that only messages which are equal or more severe are output to the console.
- */
- setLevel(level) {
- this.level = level;
- }
- /**
- * Set the instance's name, which will appear on each log line before the message.
- */
- setName(name) {
- this.name = name;
- }
- /**
- * Log a debug message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- debug(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) {
- console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg);
- }
- }
- /**
- * Log an info message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- info(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) {
- console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg);
- }
- }
- /**
- * Log a warning message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- warn(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) {
- console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg);
- }
- }
- /**
- * Log an error message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- error(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) {
- console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg);
- }
- }
- /**
- * Helper to compare two log levels and determine if a is equal or more severe than b
- */
- static isMoreOrEqualSevere(a, b) {
- return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b];
- }
-}
-exports.ConsoleLogger = ConsoleLogger;
-/** Map of labels for each log level */
-ConsoleLogger.labels = (() => {
- const entries = Object.entries(LogLevel);
- const map = entries.map(([key, value]) => [value, `[${key}] `]);
- return new Map(map);
-})();
-/** Map of severity as comparable numbers for each log level */
-ConsoleLogger.severity = {
- [LogLevel.ERROR]: 400,
- [LogLevel.WARN]: 300,
- [LogLevel.INFO]: 200,
- [LogLevel.DEBUG]: 100,
-};
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 1338:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/block-elements
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=block-elements.js.map
-
-/***/ }),
-
-/***/ 5357:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/blocks
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=blocks.js.map
-
-/***/ }),
-
-/***/ 5548:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/composition-objects
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=composition-objects.js.map
-
-/***/ }),
-
-/***/ 8111:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=extensions.js.map
-
-/***/ }),
-
-/***/ 4700:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// These types represent users in Slack Calls, which is an API for showing 3rd party calls within the Slack client.
-// More information on the API guide for Calls: https://api.slack.com/apis/calls
-// and on User objects for use with Calls: https://api.slack.com/apis/calls#users
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=calls.js.map
-
-/***/ }),
-
-/***/ 9067:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=dialog.js.map
-
-/***/ }),
-
-/***/ 4380:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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 }));
-__exportStar(__nccwpck_require__(4700), exports);
-__exportStar(__nccwpck_require__(9067), exports);
-__exportStar(__nccwpck_require__(4870), exports);
-__exportStar(__nccwpck_require__(8658), exports);
-__exportStar(__nccwpck_require__(9599), exports);
-__exportStar(__nccwpck_require__(5357), exports);
-__exportStar(__nccwpck_require__(5548), exports);
-__exportStar(__nccwpck_require__(1338), exports);
-__exportStar(__nccwpck_require__(8111), exports);
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 8658:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=message-attachments.js.map
/***/ }),
-/***/ 4870:
+/***/ 9380:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.CustomFieldType = exports.EntityType = void 0;
+var EntityType;
+(function (EntityType) {
+ EntityType["Task"] = "slack#/entities/task";
+ EntityType["File"] = "slack#/entities/file";
+ EntityType["Item"] = "slack#/entities/item";
+ EntityType["Incident"] = "slack#/entities/incident";
+ EntityType["ContentItem"] = "slack#/entities/content_item";
+})(EntityType || (exports.EntityType = EntityType = {}));
+var CustomFieldType;
+(function (CustomFieldType) {
+ CustomFieldType["Integer"] = "integer";
+ CustomFieldType["String"] = "string";
+ CustomFieldType["Array"] = "array";
+ CustomFieldType["Date"] = "slack#/types/date";
+ CustomFieldType["Timestamp"] = "slack#/types/timestamp";
+ CustomFieldType["Image"] = "slack#/types/image";
+ CustomFieldType["ChannelId"] = "slack#/types/channel_id";
+ CustomFieldType["User"] = "slack#/types/user";
+ CustomFieldType["EntityRef"] = "slack#/types/entity_ref";
+ CustomFieldType["Boolean"] = "boolean";
+ CustomFieldType["Link"] = "slack#/types/link";
+ CustomFieldType["Email"] = "slack#/types/email";
+})(CustomFieldType || (exports.CustomFieldType = CustomFieldType = {}));
//# sourceMappingURL=message-metadata.js.map
/***/ }),
-/***/ 9599:
+/***/ 7445:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
//# sourceMappingURL=views.js.map
/***/ }),
-/***/ 1424:
+/***/ 4048:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
@@ -6588,13 +1392,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : 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 __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -6608,7 +1422,7 @@ var __await = (this && this.__await) || function (v) { return this instanceof __
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
@@ -6624,63 +1438,93 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
};
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.buildThreadTsWarningMessage = exports.WebClient = exports.WebClientEvent = void 0;
-const querystring_1 = __nccwpck_require__(3477);
-const path_1 = __nccwpck_require__(1017);
-const zlib_1 = __importDefault(__nccwpck_require__(9796));
-const util_1 = __nccwpck_require__(3837);
-const is_stream_1 = __importDefault(__nccwpck_require__(1554));
-const p_queue_1 = __importDefault(__nccwpck_require__(8983));
-const p_retry_1 = __importStar(__nccwpck_require__(2548));
-const axios_1 = __importDefault(__nccwpck_require__(8757));
-const form_data_1 = __importDefault(__nccwpck_require__(4334));
-const is_electron_1 = __importDefault(__nccwpck_require__(4293));
-const methods_1 = __nccwpck_require__(1571);
-const instrument_1 = __nccwpck_require__(7763);
-const errors_1 = __nccwpck_require__(9781);
-const logger_1 = __nccwpck_require__(1336);
-const retry_policies_1 = __nccwpck_require__(2156);
-const helpers_1 = __importDefault(__nccwpck_require__(2500));
-const file_upload_1 = __nccwpck_require__(2482);
+exports.WebClient = exports.WebClientEvent = void 0;
+exports.buildThreadTsWarningMessage = buildThreadTsWarningMessage;
+const node_path_1 = __nccwpck_require__(6760);
+const node_querystring_1 = __nccwpck_require__(1792);
+const node_util_1 = __nccwpck_require__(7975);
+const node_zlib_1 = __importDefault(__nccwpck_require__(8522));
+const axios_1 = __importDefault(__nccwpck_require__(7269));
+const form_data_1 = __importDefault(__nccwpck_require__(6454));
+const is_electron_1 = __importDefault(__nccwpck_require__(201));
+const is_stream_1 = __importDefault(__nccwpck_require__(6543));
+const p_queue_1 = __importDefault(__nccwpck_require__(6459));
+const p_retry_1 = __importStar(__nccwpck_require__(2103));
+const chat_stream_1 = __nccwpck_require__(7760);
+const errors_1 = __nccwpck_require__(8486);
+const file_upload_1 = __nccwpck_require__(2577);
+const helpers_1 = __importDefault(__nccwpck_require__(4060));
+const instrument_1 = __nccwpck_require__(9224);
+const logger_1 = __nccwpck_require__(4385);
+const methods_1 = __nccwpck_require__(9339);
+const retry_policies_1 = __nccwpck_require__(1766);
/*
* Helpers
*/
// Props on axios default headers object to ignore when retrieving full list of actual headers sent in any HTTP requests
-const axiosHeaderPropsToIgnore = ['delete', 'common', 'get', 'put', 'head', 'post', 'link', 'patch', 'purge', 'unlink', 'options'];
+const axiosHeaderPropsToIgnore = [
+ 'delete',
+ 'common',
+ 'get',
+ 'put',
+ 'head',
+ 'post',
+ 'link',
+ 'patch',
+ 'purge',
+ 'unlink',
+ 'options',
+];
const defaultFilename = 'Untitled';
const defaultPageSize = 200;
const noopPageReducer = () => undefined;
var WebClientEvent;
(function (WebClientEvent) {
// TODO: safe to rename this to conform to PascalCase enum type naming convention?
- // eslint-disable-next-line @typescript-eslint/naming-convention
WebClientEvent["RATE_LIMITED"] = "rate_limited";
})(WebClientEvent || (exports.WebClientEvent = WebClientEvent = {}));
/**
* A client for Slack's Web API
*
- * This client provides an alias for each {@link https://api.slack.com/methods|Web API method}. Each method is
+ * This client provides an alias for each {@link https://docs.slack.dev/reference/methods|Web API method}. Each method is
* a convenience wrapper for calling the {@link WebClient#apiCall} method using the method name as the first parameter.
*/
class WebClient extends methods_1.Methods {
/**
* @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`)
+ * @param {Object} [webClientOptions] - Configuration options.
+ * @param {Function} [webClientOptions.requestInterceptor] - An interceptor to mutate outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptors}
+ * @param {Function} [webClientOptions.adapter] - An adapter to allow custom handling of requests. Useful if you would like to use a pre-configured http client. See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter}
*/
- constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, attachOriginalToWebAPIRequestError = true, } = {}) {
+ constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, allowAbsoluteUrls = true, attachOriginalToWebAPIRequestError = true, requestInterceptor = undefined, adapter = undefined, } = {}) {
super();
this.token = token;
this.slackApiUrl = slackApiUrl;
+ if (!this.slackApiUrl.endsWith('/')) {
+ this.slackApiUrl += '/';
+ }
this.retryConfig = retryConfig;
- // eslint-disable-next-line new-cap
this.requestQueue = new p_queue_1.default({ concurrency: maxRequestConcurrency });
// NOTE: may want to filter the keys to only those acceptable for TLS options
this.tlsConfig = tls !== undefined ? tls : {};
this.rejectRateLimitedCalls = rejectRateLimitedCalls;
this.teamId = teamId;
+ this.allowAbsoluteUrls = allowAbsoluteUrls;
this.attachOriginalToWebAPIRequestError = attachOriginalToWebAPIRequestError;
// Logging
if (typeof logger !== 'undefined') {
@@ -6692,17 +1536,15 @@ class WebClient extends methods_1.Methods {
else {
this.logger = (0, logger_1.getLogger)(WebClient.loggerName, logLevel !== null && logLevel !== void 0 ? logLevel : logger_1.LogLevel.INFO, logger);
}
- // eslint-disable-next-line no-param-reassign
if (this.token && !headers.Authorization)
headers.Authorization = `Bearer ${this.token}`;
this.axios = axios_1.default.create({
+ adapter: adapter ? (config) => adapter(Object.assign(Object.assign({}, config), { adapter: undefined })) : undefined,
timeout,
- baseURL: slackApiUrl,
- // eslint-disable-next-line @typescript-eslint/naming-convention
+ baseURL: this.slackApiUrl,
headers: (0, is_electron_1.default)() ? headers : Object.assign({ 'User-Agent': (0, instrument_1.getUserAgent)() }, headers),
httpAgent: agent,
httpsAgent: agent,
- transformRequest: [this.serializeApiCallOptions.bind(this)],
validateStatus: () => true, // all HTTP status codes should result in a resolved promise (as opposed to only 2xx)
maxRedirects: 0,
// disabling axios' automatic proxy support:
@@ -6711,17 +1553,23 @@ class WebClient extends methods_1.Methods {
// protocols), users of this package should use the `agent` option to configure a proxy.
proxy: false,
});
- // serializeApiCallOptions will always determine the appropriate content-type
- delete this.axios.defaults.headers.post['Content-Type'];
+ // serializeApiCallData will always determine the appropriate content-type
+ this.axios.defaults.headers.post['Content-Type'] = undefined;
+ // request interceptors have reversed execution order
+ // see: https://github.com/axios/axios/blob/v1.x/test/specs/interceptors.spec.js#L88
+ if (requestInterceptor) {
+ this.axios.interceptors.request.use(requestInterceptor, null);
+ }
+ this.axios.interceptors.request.use(this.serializeApiCallData.bind(this), null);
this.logger.debug('initialized');
}
/**
* Generic method for calling a Web API method
- * @param method - the Web API method to call {@link https://api.slack.com/methods}
+ * @param method - the Web API method to call {@link https://docs.slack.dev/reference/methods}
* @param options - options
*/
- apiCall(method, options = {}) {
- return __awaiter(this, void 0, void 0, function* () {
+ apiCall(method_1) {
+ return __awaiter(this, arguments, void 0, function* (method, options = {}) {
this.logger.debug(`apiCall('${method}') start`);
warnDeprecations(method, this.logger);
warnIfFallbackIsMissing(method, this.logger, options);
@@ -6730,14 +1578,14 @@ class WebClient extends methods_1.Methods {
throw new TypeError(`Expected an options argument but instead received a ${typeof options}`);
}
(0, file_upload_1.warnIfNotUsingFilesUploadV2)(method, this.logger);
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
+ // @ts-expect-error insufficient overlap between Record and FilesUploadV2Arguments
if (method === 'files.uploadV2')
return this.filesUploadV2(options);
const headers = {};
if (options.token)
headers.Authorization = `Bearer ${options.token}`;
- const response = yield this.makeRequest(method, Object.assign({ team_id: this.teamId }, options), headers);
+ const url = this.deriveRequestUrl(method);
+ const response = yield this.makeRequest(url, Object.assign({ team_id: this.teamId }, options), headers);
const result = yield this.buildResult(response);
this.logger.debug(`http request result: ${JSON.stringify(result)}`);
// log warnings in response metadata
@@ -6745,9 +1593,9 @@ class WebClient extends methods_1.Methods {
result.response_metadata.warnings.forEach(this.logger.warn.bind(this.logger));
}
// log warnings and errors in response metadata messages
- // related to https://api.slack.com/changelog/2016-09-28-response-metadata-is-on-the-way
+ // related to https://docs.slack.dev/changelog/2016/09/28/response-metadata-is-on-the-way
if (result.response_metadata !== undefined && result.response_metadata.messages !== undefined) {
- result.response_metadata.messages.forEach((msg) => {
+ for (const msg of result.response_metadata.messages) {
const errReg = /\[ERROR\](.*)/;
const warnReg = /\[WARN\](.*)/;
if (errReg.test(msg)) {
@@ -6762,15 +1610,15 @@ class WebClient extends methods_1.Methods {
this.logger.warn(warnMatch[1].trim());
}
}
- });
+ }
}
// If result's content is gzip, "ok" property is not returned with successful response
// TODO: look into simplifying this code block to only check for the second condition
// if an { ok: false } body applies for all API errors
- if (!result.ok && (response.headers['content-type'] !== 'application/gzip')) {
+ if (!result.ok && response.headers['content-type'] !== 'application/gzip') {
throw (0, errors_1.platformErrorFromResult)(result);
}
- else if ('ok' in result && result.ok === false) {
+ if ('ok' in result && result.ok === false) {
throw (0, errors_1.platformErrorFromResult)(result);
}
this.logger.debug(`apiCall('${method}') end`);
@@ -6781,8 +1629,7 @@ class WebClient extends methods_1.Methods {
const pageSize = (() => {
if (options !== undefined && typeof options.limit === 'number') {
const { limit } = options;
- // eslint-disable-next-line no-param-reassign
- delete options.limit;
+ options.limit = undefined;
return limit;
}
return defaultPageSize;
@@ -6800,7 +1647,6 @@ class WebClient extends methods_1.Methods {
}
// NOTE: test for the situation where you're resuming a pagination using and existing cursor
while (result === undefined || paginationOptions !== undefined) {
- // eslint-disable-next-line no-await-in-loop
result = yield __await(this.apiCall(method, Object.assign(options !== undefined ? options : {}, paginationOptions)));
yield yield __await(result);
paginationOptions = paginationOptionsForNextPage(result, pageSize);
@@ -6810,7 +1656,7 @@ class WebClient extends methods_1.Methods {
if (shouldStop === undefined) {
return generatePages.call(this);
}
- const pageReducer = (reduce !== undefined) ? reduce : noopPageReducer;
+ const pageReducer = reduce !== undefined ? reduce : noopPageReducer;
let index = 0;
return (() => __awaiter(this, void 0, void 0, function* () {
// Unroll the first iteration of the iterator
@@ -6830,7 +1676,6 @@ class WebClient extends methods_1.Methods {
}
try {
// Continue iteration
- // eslint-disable-next-line no-restricted-syntax
for (var _d = true, pageIterator_1 = __asyncValues(pageIterator), pageIterator_1_1; pageIterator_1_1 = yield pageIterator_1.next(), _a = pageIterator_1_1.done, !_a; _d = true) {
_c = pageIterator_1_1.value;
_d = false;
@@ -6852,17 +1697,50 @@ class WebClient extends methods_1.Methods {
return accumulator;
}))();
}
+ /**
+ * Stream markdown text into a conversation.
+ *
+ * @description The "chatStream" method starts a new chat stream in a conversation that can be appended to. After appending an entire message, the stream can be stopped with concluding arguments such as "blocks" for gathering feedback.
+ *
+ * The "markdown_text" content is appended to a buffer before being sent to the recipient, with a default buffer size of "256" characters. Setting the "buffer_size" value to a smaller number sends more frequent updates for the same amount of characters, but might reach rate limits more often.
+ *
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello wo",
+ * });
+ * await streamer.append({
+ * markdown_text: "rld!**",
+ * });
+ * await streamer.stop();
+ *
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ chatStream(params) {
+ const { buffer_size } = params, args = __rest(params, ["buffer_size"]);
+ const options = {
+ buffer_size,
+ };
+ return new chat_stream_1.ChatStreamer(this, this.logger, args, options);
+ }
/**
* This wrapper method provides an easy way to upload files using the following endpoints:
*
* **#1**: For each file submitted with this method, submit filenames
- * and file metadata to {@link https://api.slack.com/methods/files.getUploadURLExternal files.getUploadURLExternal} to request a URL to
+ * and file metadata to {@link https://docs.slack.dev/reference/methods/files.getuploadurlexternal files.getUploadURLExternal} to request a URL to
* which to send the file data to and an id for the file
*
* **#2**: for each returned file `upload_url`, upload corresponding file to
* URLs returned from step 1 (e.g. https://files.slack.com/upload/v1/...\")
*
- * **#3**: Complete uploads {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal}
+ * **#3**: Complete uploads {@link https://docs.slack.dev/reference/methods/files.completeuploadexternal files.completeUploadExternal}
* @param options
*/
filesUploadV2(options) {
@@ -6892,7 +1770,6 @@ class WebClient extends methods_1.Methods {
fetchAllUploadURLExternal(fileUploads) {
return __awaiter(this, void 0, void 0, function* () {
return Promise.all(fileUploads.map((upload) => {
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
const options = {
filename: upload.filename,
length: upload.length,
@@ -6967,13 +1844,12 @@ class WebClient extends methods_1.Methods {
/**
* Low-level function to make a single API request. handles queuing, retries, and http-level errors
*/
- makeRequest(url, body, headers = {}) {
- return __awaiter(this, void 0, void 0, function* () {
+ makeRequest(url_1, body_1) {
+ return __awaiter(this, arguments, void 0, function* (url, body, headers = {}) {
// TODO: better input types - remove any
const task = () => this.requestQueue.add(() => __awaiter(this, void 0, void 0, function* () {
- const requestURL = (url.startsWith('https' || 0)) ? url : `${this.axios.getUri() + url}`;
try {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: TODO: type this
const config = Object.assign({ headers }, this.tlsConfig);
// admin.analytics.getFile returns a binary response
// To be able to parse it, it should be read as an ArrayBuffer
@@ -6983,14 +1859,12 @@ class WebClient extends methods_1.Methods {
// apps.event.authorizations.list will reject HTTP requests that send token in the body
// TODO: consider applying this change to all methods - though that will require thorough integration testing
if (url.endsWith('apps.event.authorizations.list')) {
- // eslint-disable-next-line no-param-reassign
- delete body.token;
+ body.token = undefined;
}
- this.logger.debug(`http request url: ${requestURL}`);
+ this.logger.debug(`http request url: ${url}`);
this.logger.debug(`http request body: ${JSON.stringify(redact(body))}`);
// compile all headers - some set by default under the hood by axios - that will be sent along
- let allHeaders = Object.keys(this.axios.defaults.headers)
- .reduce((acc, cur) => {
+ let allHeaders = Object.keys(this.axios.defaults.headers).reduce((acc, cur) => {
if (!axiosHeaderPropsToIgnore.includes(cur)) {
acc[cur] = this.axios.defaults.headers[cur];
}
@@ -7022,10 +1896,8 @@ class WebClient extends methods_1.Methods {
// TODO: We may want to have more detailed info such as team_id, params except tokens, and so on.
throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
}
- else {
- // TODO: turn this into some CodedError
- throw new p_retry_1.AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));
- }
+ // TODO: turn this into some CodedError
+ throw new p_retry_1.AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));
}
// Slack's Web API doesn't use meaningful status codes besides 429 and 200
if (response.status !== 200) {
@@ -7035,7 +1907,7 @@ class WebClient extends methods_1.Methods {
}
catch (error) {
// To make this compatible with tsd, casting here instead of `catch (error: any)`
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: errors can be anything
const e = error;
this.logger.warn('http request failed', e.message);
if (e.request) {
@@ -7044,24 +1916,35 @@ class WebClient extends methods_1.Methods {
throw error;
}
}));
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: http responses can be anything
return (0, p_retry_1.default)(task, this.retryConfig);
});
}
+ /**
+ * Get the complete request URL for the provided URL.
+ * @param url - The resource to POST to. Either a Slack API method or absolute URL.
+ */
+ deriveRequestUrl(url) {
+ const isAbsoluteURL = url.startsWith('https://') || url.startsWith('http://');
+ if (isAbsoluteURL && this.allowAbsoluteUrls) {
+ return url;
+ }
+ return `${this.axios.getUri() + url}`;
+ }
/**
* Transforms options (a simple key-value object) into an acceptable value for a body. This can be either
* a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
* when the options contain a binary (a stream or a buffer) and the upload should be done with content-type
* multipart/form-data.
- * @param options - arguments for the Web API method
- * @param headers - a mutable object representing the HTTP headers for the outgoing request
+ * @param config - The Axios request configuration object
*/
- serializeApiCallOptions(options, headers) {
+ serializeApiCallData(config) {
+ const { data, headers } = config;
// The following operation both flattens complex objects into a JSON-encoded strings and searches the values for
// binary content
let containsBinaryData = false;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const flattened = Object.entries(options).map(([key, value]) => {
+ // biome-ignore lint/suspicious/noExplicitAny: HTTP request data can be anything
+ const flattened = Object.entries(data).map(([key, value]) => {
if (value === undefined || value === null) {
return [];
}
@@ -7087,13 +1970,13 @@ class WebClient extends methods_1.Methods {
// https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230
// formidable and the browser add a name property
// fs- and request- streams have path property
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: form values can be anything
const streamOrBuffer = value;
if (typeof streamOrBuffer.name === 'string') {
- return (0, path_1.basename)(streamOrBuffer.name);
+ return (0, node_path_1.basename)(streamOrBuffer.name);
}
if (typeof streamOrBuffer.path === 'string') {
- return (0, path_1.basename)(streamOrBuffer.path);
+ return (0, node_path_1.basename)(streamOrBuffer.path);
}
return defaultFilename;
})();
@@ -7107,32 +1990,33 @@ class WebClient extends methods_1.Methods {
if (headers) {
// Copying FormData-generated headers into headers param
// not reassigning to headers param since it is passed by reference and behaves as an inout param
- Object.entries(form.getHeaders()).forEach(([header, value]) => {
- // eslint-disable-next-line no-param-reassign
+ for (const [header, value] of Object.entries(form.getHeaders())) {
headers[header] = value;
- });
+ }
}
- return form;
+ config.data = form;
+ config.headers = headers;
+ return config;
}
// Otherwise, a simple key-value object is returned
- // eslint-disable-next-line no-param-reassign
if (headers)
headers['Content-Type'] = 'application/x-www-form-urlencoded';
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: form values can be anything
const initialValue = {};
- return (0, querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
+ config.data = (0, node_querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
if (key !== undefined && value !== undefined) {
accumulator[key] = value;
}
return accumulator;
}, initialValue));
+ config.headers = headers;
+ return config;
}
/**
* Processes an HTTP response into a WebAPICallResult by performing JSON parsing on the body and merging relevant
* HTTP headers into the object.
* @param response - an http response
*/
- // eslint-disable-next-line class-methods-use-this
buildResult(response) {
return __awaiter(this, void 0, void 0, function* () {
let { data } = response;
@@ -7142,23 +2026,24 @@ class WebClient extends methods_1.Methods {
// admin.analytics.getFile will return a Buffer that can be unzipped
try {
const unzippedData = yield new Promise((resolve, reject) => {
- zlib_1.default.unzip(data, (err, buf) => {
+ node_zlib_1.default.unzip(data, (err, buf) => {
if (err) {
return reject(err);
}
return resolve(buf.toString().split('\n'));
});
- }).then((res) => res)
+ })
+ .then((res) => res)
.catch((err) => {
throw err;
});
const fileData = [];
if (Array.isArray(unzippedData)) {
- unzippedData.forEach((dataset) => {
+ for (const dataset of unzippedData) {
if (dataset && dataset.length > 0) {
fileData.push(JSON.parse(dataset));
}
- });
+ }
}
data = { file_data: fileData };
}
@@ -7169,7 +2054,7 @@ class WebClient extends methods_1.Methods {
else if (!isGzipResponse && response.request.path === '/api/admin.analytics.getFile') {
// if it isn't a Gzip response but is from the admin.analytics.getFile request,
// decode the ArrayBuffer to JSON read the error
- data = JSON.parse(new util_1.TextDecoder().decode(data));
+ data = JSON.parse(new node_util_1.TextDecoder().decode(data));
}
if (typeof data === 'string') {
// response.data can be a string, not an object for some reason
@@ -7189,7 +2074,9 @@ class WebClient extends methods_1.Methods {
data.response_metadata.scopes = response.headers['x-oauth-scopes'].trim().split(/\s*,\s*/);
}
if (response.headers['x-accepted-oauth-scopes'] !== undefined) {
- data.response_metadata.acceptedScopes = response.headers['x-accepted-oauth-scopes'].trim().split(/\s*,\s*/);
+ data.response_metadata.acceptedScopes = response.headers['x-accepted-oauth-scopes']
+ .trim()
+ .split(/\s*,\s*/);
}
// add retry metadata from headers
const retrySec = parseRetryHeaders(response);
@@ -7229,7 +2116,7 @@ function paginationOptionsForNextPage(previousResult, pageSize) {
*/
function parseRetryHeaders(response) {
if (response.headers['retry-after'] !== undefined) {
- const retryAfter = parseInt(response.headers['retry-after'], 10);
+ const retryAfter = Number.parseInt(response.headers['retry-after'], 10);
if (!Number.isNaN(retryAfter)) {
return retryAfter;
}
@@ -7242,13 +2129,13 @@ function parseRetryHeaders(response) {
* @param logger instance of web clients logger
*/
function warnDeprecations(method, logger) {
- const deprecatedMethods = ['workflows.'];
+ const deprecatedMethods = ['workflows.stepCompleted', 'workflows.stepFailed', 'workflows.updateStep'];
const isDeprecated = deprecatedMethods.some((depMethod) => {
const re = new RegExp(`^${depMethod}`);
return re.test(method);
});
if (isDeprecated) {
- logger.warn(`${method} is deprecated. Please check on https://api.slack.com/methods for an alternative.`);
+ logger.warn(`${method} is deprecated. Please check on https://docs.slack.dev/reference/methods for an alternative.`);
}
}
/**
@@ -7263,14 +2150,10 @@ function warnIfFallbackIsMissing(method, logger, options) {
const hasAttachments = (args) => Array.isArray(args.attachments) && args.attachments.length;
const missingAttachmentFallbackDetected = (args) => Array.isArray(args.attachments) &&
args.attachments.some((attachment) => !attachment.fallback || attachment.fallback.trim() === '');
- const isEmptyText = (args) => args.text === undefined || args.text === null || args.text === '';
- const buildMissingTextWarning = () => `The top-level \`text\` argument is missing in the request payload for a ${method} call - ` +
- 'It\'s a best practice to always provide a `text` argument when posting a message. ' +
- 'The `text` is used in places where the content cannot be rendered such as: ' +
- 'system push notifications, assistive technology such as screen readers, etc.';
- const buildMissingFallbackWarning = () => `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - ` +
- 'To avoid this warning, it is recommended to always provide a top-level `text` argument when posting a message. ' +
- 'Alternatively, you can provide an attachment-level `fallback` argument, though this is now considered a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details).';
+ const isEmptyText = (args) => (args.text === undefined || args.text === null || args.text === '') &&
+ (args.markdown_text === undefined || args.markdown === null || args.markdown_text === '');
+ const buildMissingTextWarning = () => `The top-level \`text\` argument is missing in the request payload for a ${method} call - It's a best practice to always provide a \`text\` argument when posting a message. The \`text\` is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.`;
+ const buildMissingFallbackWarning = () => `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - To avoid this warning, it is recommended to always provide a top-level \`text\` argument when posting a message. Alternatively, you can provide an attachment-level \`fallback\` argument, though this is now considered a legacy field (see https://docs.slack.dev/legacy/legacy-messaging/legacy-secondary-message-attachments for more details).`;
if (isTargetMethod && typeof options === 'object') {
if (hasAttachments(options)) {
if (missingAttachmentFallbackDetected(options) && isEmptyText(options)) {
@@ -7299,14 +2182,13 @@ function warnIfThreadTsIsNotString(method, logger, options) {
function buildThreadTsWarningMessage(method) {
return `The given thread_ts value in the request payload for a ${method} call is a float value. We highly recommend using a string value instead.`;
}
-exports.buildThreadTsWarningMessage = buildThreadTsWarningMessage;
/**
* Takes an object and redacts specific items
* @param body
* @returns
*/
function redact(body) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // biome-ignore lint/suspicious/noExplicitAny: objects can be anything
const flattened = Object.entries(body).map(([key, value]) => {
// no value provided
if (value === undefined || value === null) {
@@ -7339,13 +2221,172 @@ function redact(body) {
/***/ }),
-/***/ 9781:
+/***/ 7760:
+/***/ (function(__unused_webpack_module, exports) {
+
+
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.ChatStreamer = void 0;
+class ChatStreamer {
+ /**
+ * Instantiate a new chat streamer.
+ *
+ * @description The "constructor" method creates a unique {@link ChatStreamer} instance that keeps track of one chat stream.
+ * @example
+ * const client = new WebClient(process.env.SLACK_BOT_TOKEN);
+ * const logger = new ConsoleLogger();
+ * const args = {
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * };
+ * const streamer = new ChatStreamer(client, logger, args, { buffer_size: 512 });
+ * await streamer.append({
+ * markdown_text: "**hello world!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ constructor(client, logger, args, options) {
+ var _a;
+ this.buffer = '';
+ this.client = client;
+ this.logger = logger;
+ this.options = {
+ buffer_size: (_a = options.buffer_size) !== null && _a !== void 0 ? _a : 256,
+ };
+ this.state = 'starting';
+ this.streamArgs = args;
+ }
+ /**
+ * Append to the stream.
+ *
+ * @description The "append" method appends to the chat stream being used. This method can be called multiple times. After the stream is stopped this method cannot be called.
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello wo",
+ * });
+ * await streamer.append({
+ * markdown_text: "rld!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ */
+ append(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.state === 'completed') {
+ throw new Error(`failed to append stream: stream state is ${this.state}`);
+ }
+ if (args.token) {
+ this.token = args.token;
+ }
+ this.buffer += args.markdown_text;
+ if (this.buffer.length >= this.options.buffer_size) {
+ return yield this.flushBuffer(args);
+ }
+ const details = {
+ bufferLength: this.buffer.length,
+ bufferSize: this.options.buffer_size,
+ channel: this.streamArgs.channel,
+ recipientTeamId: this.streamArgs.recipient_team_id,
+ recipientUserId: this.streamArgs.recipient_user_id,
+ threadTs: this.streamArgs.thread_ts,
+ };
+ this.logger.debug(`ChatStreamer appended to buffer: ${JSON.stringify(details)}`);
+ return null;
+ });
+ }
+ /**
+ * Stop the stream and finalize the message.
+ *
+ * @description The "stop" method stops the chat stream being used. This method can be called once to end the stream. Additional "blocks" and "metadata" can be provided.
+ *
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello world!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ stop(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.state === 'completed') {
+ throw new Error(`failed to stop stream: stream state is ${this.state}`);
+ }
+ if (args === null || args === void 0 ? void 0 : args.token) {
+ this.token = args.token;
+ }
+ if (args === null || args === void 0 ? void 0 : args.markdown_text) {
+ this.buffer += args.markdown_text;
+ }
+ if (!this.streamTs) {
+ const response = yield this.client.chat.startStream(Object.assign(Object.assign({}, this.streamArgs), { token: this.token }));
+ if (!response.ts) {
+ throw new Error('failed to stop stream: stream not started');
+ }
+ this.streamTs = response.ts;
+ this.state = 'in_progress';
+ }
+ const response = yield this.client.chat.stopStream(Object.assign(Object.assign({ token: this.token, channel: this.streamArgs.channel, ts: this.streamTs }, args), { markdown_text: this.buffer }));
+ this.state = 'completed';
+ return response;
+ });
+ }
+ flushBuffer(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (!this.streamTs) {
+ const response = yield this.client.chat.startStream(Object.assign(Object.assign(Object.assign(Object.assign({}, this.streamArgs), { token: this.token }), args), { markdown_text: this.buffer }));
+ this.buffer = '';
+ this.streamTs = response.ts;
+ this.state = 'in_progress';
+ return response;
+ }
+ const response = yield this.client.chat.appendStream(Object.assign(Object.assign({ token: this.token, channel: this.streamArgs.channel, ts: this.streamTs }, args), { markdown_text: this.buffer }));
+ this.buffer = '';
+ return response;
+ });
+ }
+}
+exports.ChatStreamer = ChatStreamer;
+//# sourceMappingURL=chat-stream.js.map
+
+/***/ }),
+
+/***/ 8486:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.rateLimitedErrorWithDelay = exports.platformErrorFromResult = exports.httpErrorFromResponse = exports.requestErrorWithOriginal = exports.errorWithCode = exports.ErrorCode = void 0;
+exports.ErrorCode = void 0;
+exports.errorWithCode = errorWithCode;
+exports.requestErrorWithOriginal = requestErrorWithOriginal;
+exports.httpErrorFromResponse = httpErrorFromResponse;
+exports.platformErrorFromResult = platformErrorFromResult;
+exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay;
/**
* A dictionary of codes for errors produced by this package
*/
@@ -7369,7 +2410,6 @@ function errorWithCode(error, code) {
codedError.code = code;
return codedError;
}
-exports.errorWithCode = errorWithCode;
/**
* A factory to create WebAPIRequestError objects
* @param original - original error
@@ -7382,7 +2422,6 @@ function requestErrorWithOriginal(original, attachOriginal) {
}
return error;
}
-exports.requestErrorWithOriginal = requestErrorWithOriginal;
/**
* A factory to create WebAPIHTTPError objects
* @param response - original error
@@ -7392,16 +2431,15 @@ function httpErrorFromResponse(response) {
error.statusCode = response.status;
error.statusMessage = response.statusText;
const nonNullHeaders = {};
- Object.keys(response.headers).forEach((k) => {
+ for (const k of Object.keys(response.headers)) {
if (k && response.headers[k]) {
nonNullHeaders[k] = response.headers[k];
}
- });
+ }
error.headers = nonNullHeaders;
error.body = response.data;
return error;
}
-exports.httpErrorFromResponse = httpErrorFromResponse;
/**
* A factory to create WebAPIPlatformError objects
* @param result - Web API call result
@@ -7411,7 +2449,6 @@ function platformErrorFromResult(result) {
error.data = result;
return error;
}
-exports.platformErrorFromResult = platformErrorFromResult;
/**
* A factory to create WebAPIRateLimitedError objects
* @param retrySec - Number of seconds that the request can be retried in
@@ -7421,15 +2458,13 @@ function rateLimitedErrorWithDelay(retrySec) {
error.retryAfter = retrySec;
return error;
}
-exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay;
//# sourceMappingURL=errors.js.map
/***/ }),
-/***/ 2482:
+/***/ 2577:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -7441,13 +2476,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.buildInvalidFilesUploadParamError = exports.buildMultipleChannelsErrorMsg = exports.buildChannelsWarning = exports.buildFilesUploadMissingMessage = exports.buildGeneralFilesUploadWarning = exports.buildLegacyMethodWarning = exports.buildMissingExtensionWarning = exports.buildMissingFileNameWarning = exports.buildLegacyFileTypeWarning = exports.buildFileSizeErrorMsg = exports.buildMissingFileIdError = exports.warnIfLegacyFileType = exports.warnIfMissingOrInvalidFileNameAndDefault = exports.errorIfInvalidOrMissingFileData = exports.errorIfChannelsCsv = exports.warnIfChannels = exports.warnIfNotUsingFilesUploadV2 = exports.getAllFileUploadsToComplete = exports.getFileDataAsStream = exports.getFileDataLength = exports.getFileData = exports.getMultipleFileUploadJobs = exports.getFileUploadJob = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const stream_1 = __nccwpck_require__(2781);
-const errors_1 = __nccwpck_require__(9781);
+exports.getFileUploadJob = getFileUploadJob;
+exports.getMultipleFileUploadJobs = getMultipleFileUploadJobs;
+exports.getFileData = getFileData;
+exports.getFileDataLength = getFileDataLength;
+exports.getFileDataAsStream = getFileDataAsStream;
+exports.getAllFileUploadsToComplete = getAllFileUploadsToComplete;
+exports.warnIfNotUsingFilesUploadV2 = warnIfNotUsingFilesUploadV2;
+exports.warnIfChannels = warnIfChannels;
+exports.errorIfChannelsCsv = errorIfChannelsCsv;
+exports.errorIfInvalidOrMissingFileData = errorIfInvalidOrMissingFileData;
+exports.warnIfMissingOrInvalidFileNameAndDefault = warnIfMissingOrInvalidFileNameAndDefault;
+exports.warnIfLegacyFileType = warnIfLegacyFileType;
+exports.buildMissingFileIdError = buildMissingFileIdError;
+exports.buildFileSizeErrorMsg = buildFileSizeErrorMsg;
+exports.buildLegacyFileTypeWarning = buildLegacyFileTypeWarning;
+exports.buildMissingFileNameWarning = buildMissingFileNameWarning;
+exports.buildMissingExtensionWarning = buildMissingExtensionWarning;
+exports.buildLegacyMethodWarning = buildLegacyMethodWarning;
+exports.buildGeneralFilesUploadWarning = buildGeneralFilesUploadWarning;
+exports.buildFilesUploadMissingMessage = buildFilesUploadMissingMessage;
+exports.buildChannelsWarning = buildChannelsWarning;
+exports.buildMultipleChannelsErrorMsg = buildMultipleChannelsErrorMsg;
+exports.buildInvalidFilesUploadParamError = buildInvalidFilesUploadParamError;
+const node_fs_1 = __nccwpck_require__(3024);
+const node_stream_1 = __nccwpck_require__(7075);
+const errors_1 = __nccwpck_require__(8486);
function getFileUploadJob(options, logger) {
- var _a, _b, _c, _d;
return __awaiter(this, void 0, void 0, function* () {
+ var _a, _b, _c, _d;
// Validate parameters
warnIfLegacyFileType(options, logger);
warnIfChannels(options, logger);
@@ -7458,11 +2515,12 @@ function getFileUploadJob(options, logger) {
const fileUploadJob = {
// supplied by user
alt_text: options.alt_text,
+ blocks: options.blocks,
channel_id: (_a = options.channels) !== null && _a !== void 0 ? _a : options.channel_id,
filename: (_b = options.filename) !== null && _b !== void 0 ? _b : fileName,
initial_comment: options.initial_comment,
snippet_type: options.snippet_type,
- title: (_c = options.title) !== null && _c !== void 0 ? _c : ((_d = options.filename) !== null && _d !== void 0 ? _d : fileName), // default title to filename unless otherwise specified
+ title: (_d = (_c = options.title) !== null && _c !== void 0 ? _c : options.filename) !== null && _d !== void 0 ? _d : fileName, // default title to filename unless otherwise specified
// calculated
data: fileData,
length: fileDataBytesLength,
@@ -7482,7 +2540,6 @@ function getFileUploadJob(options, logger) {
throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You must supply one'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
});
}
-exports.getFileUploadJob = getFileUploadJob;
/**
* Returns an array of files upload entries when `file_uploads` is supplied.
* **Note**
@@ -7507,7 +2564,7 @@ exports.getFileUploadJob = getFileUploadJob;
* });
* ```
* @param options provided by user
-*/
+ */
function getMultipleFileUploadJobs(options, logger) {
return __awaiter(this, void 0, void 0, function* () {
if ('file_uploads' in options) {
@@ -7516,13 +2573,13 @@ function getMultipleFileUploadJobs(options, logger) {
// ensure no omitted properties included in files_upload entry
// these properties are valid only at the top-level, not
// inside file_uploads.
- const { channel_id, channels, initial_comment, thread_ts } = upload;
- if (channel_id || channels || initial_comment || thread_ts) {
+ const { blocks, channel_id, channels, initial_comment, thread_ts } = upload;
+ if (blocks || channel_id || channels || initial_comment || thread_ts) {
throw (0, errors_1.errorWithCode)(new Error(buildInvalidFilesUploadParamError()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
// takes any channel_id, initial_comment and thread_ts
// supplied at the top level.
- const uploadJobArgs = Object.assign(Object.assign({}, upload), { channels: options.channels, channel_id: options.channel_id, initial_comment: options.initial_comment });
+ const uploadJobArgs = Object.assign(Object.assign({}, upload), { blocks: options.blocks, channels: options.channels, channel_id: options.channel_id, initial_comment: options.initial_comment });
if ('thread_ts' in options) {
uploadJobArgs.thread_ts = options.thread_ts;
}
@@ -7541,7 +2598,6 @@ function getMultipleFileUploadJobs(options, logger) {
throw new Error(buildFilesUploadMissingMessage());
});
}
-exports.getMultipleFileUploadJobs = getMultipleFileUploadJobs;
// Helpers to build the FileUploadJob
/**
* Returns a single file upload's data
@@ -7560,10 +2616,10 @@ function getFileData(options) {
if (typeof file === 'string') {
// try to read file as if the string was a file path
try {
- const dataBuffer = (0, fs_1.readFileSync)(file);
+ const dataBuffer = (0, node_fs_1.readFileSync)(file);
return dataBuffer;
}
- catch (error) {
+ catch (_err) {
throw (0, errors_1.errorWithCode)(new Error(`Unable to resolve file data for ${file}. Please supply a filepath string, or binary data Buffer or String directly.`), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
}
@@ -7578,23 +2634,21 @@ function getFileData(options) {
throw (0, errors_1.errorWithCode)(new Error('There was an issue getting the file data for the file or content supplied'), errors_1.ErrorCode.FileUploadReadFileDataError);
});
}
-exports.getFileData = getFileData;
function getFileDataLength(data) {
if (data) {
return Buffer.byteLength(data, 'utf8');
}
throw (0, errors_1.errorWithCode)(new Error(buildFileSizeErrorMsg()), errors_1.ErrorCode.FileUploadReadFileDataError);
}
-exports.getFileDataLength = getFileDataLength;
function getFileDataAsStream(readable) {
return __awaiter(this, void 0, void 0, function* () {
const chunks = [];
return new Promise((resolve, reject) => {
readable.on('readable', () => {
- let chunk;
- /* eslint-disable no-cond-assign */
- while ((chunk = readable.read()) !== null) {
+ let chunk = readable.read();
+ while (chunk !== null) {
chunks.push(chunk);
+ chunk = readable.read();
}
});
readable.on('end', () => {
@@ -7609,11 +2663,10 @@ function getFileDataAsStream(readable) {
});
});
}
-exports.getFileDataAsStream = getFileDataAsStream;
/**
* Filters through all fileUploads and groups them into jobs for completion
- * based on combination of channel_id, thread_ts, initial_comment.
- * {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal} allows for multiple
+ * based on combination of channel_id, thread_ts, initial_comment, blocks.
+ * {@link https://docs.slack.dev/reference/methods/files.completeUploadExternal files.completeUploadExternal} allows for multiple
* files to be uploaded with a message (`initial_comment`), and as a threaded message (`thread_ts`)
* In order to be grouped together, file uploads must have like properties.
* @param fileUploads
@@ -7621,18 +2674,24 @@ exports.getFileDataAsStream = getFileDataAsStream;
*/
function getAllFileUploadsToComplete(fileUploads) {
const toComplete = {};
- fileUploads.forEach((upload) => {
- const { channel_id, thread_ts, initial_comment, file_id, title } = upload;
+ for (const upload of fileUploads) {
+ const { blocks, channel_id, thread_ts, initial_comment, file_id, title } = upload;
if (file_id) {
- const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}`;
+ const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}:::${JSON.stringify(blocks)}`;
+ // biome-ignore lint/suspicious/noPrototypeBuiltins: TODO use hasOwn instead of hasOwnProperty
if (!Object.prototype.hasOwnProperty.call(toComplete, compareString)) {
toComplete[compareString] = {
files: [{ id: file_id, title }],
channel_id,
+ blocks,
initial_comment,
};
- if (thread_ts) {
- toComplete[compareString].thread_ts = upload.thread_ts;
+ if (thread_ts && channel_id) {
+ const fileThreadDestinationArgument = {
+ channel_id,
+ thread_ts,
+ };
+ toComplete[compareString] = Object.assign(Object.assign({}, toComplete[compareString]), fileThreadDestinationArgument);
}
if ('token' in upload) {
toComplete[compareString].token = upload.token;
@@ -7648,17 +2707,16 @@ function getAllFileUploadsToComplete(fileUploads) {
else {
throw new Error(buildMissingFileIdError());
}
- });
+ }
return toComplete;
}
-exports.getAllFileUploadsToComplete = getAllFileUploadsToComplete;
// Validation
/**
* Advise to use the files.uploadV2 method over legacy files.upload method and over
* lower-level utilities.
* @param method
* @param logger
-*/
+ */
function warnIfNotUsingFilesUploadV2(method, logger) {
const targetMethods = ['files.upload'];
const isTargetMethod = targetMethods.includes(method);
@@ -7667,7 +2725,6 @@ function warnIfNotUsingFilesUploadV2(method, logger) {
if (isTargetMethod)
logger.info(buildGeneralFilesUploadWarning());
}
-exports.warnIfNotUsingFilesUploadV2 = warnIfNotUsingFilesUploadV2;
/**
* `channels` param is supported but only when a single channel is specified.
* @param options
@@ -7677,7 +2734,6 @@ function warnIfChannels(options, logger) {
if (options.channels)
logger.warn(buildChannelsWarning());
}
-exports.warnIfChannels = warnIfChannels;
/**
* v1 files.upload supported `channels` parameter provided as a comma-separated
* string of values, e.g. 'C1234,C5678'. V2 no longer supports this csv value.
@@ -7691,7 +2747,6 @@ function errorIfChannelsCsv(options) {
throw (0, errors_1.errorWithCode)(new Error(buildMultipleChannelsErrorMsg()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
}
-exports.errorIfChannelsCsv = errorIfChannelsCsv;
/**
* Checks for either a file or content property and errors if missing
* @param options
@@ -7702,10 +2757,9 @@ function errorIfInvalidOrMissingFileData(options) {
if (!(hasFile || hasContent) || (hasFile && hasContent)) {
throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You cannot supply both'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- /* eslint-disable @typescript-eslint/no-explicit-any */
if ('file' in options) {
const { file } = options;
- if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || file instanceof stream_1.Readable)) {
+ if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || file instanceof node_stream_1.Readable)) {
throw (0, errors_1.errorWithCode)(new Error('file must be a valid string path, buffer or Readable'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
}
@@ -7713,7 +2767,6 @@ function errorIfInvalidOrMissingFileData(options) {
throw (0, errors_1.errorWithCode)(new Error('content must be a string'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
}
-exports.errorIfInvalidOrMissingFileData = errorIfInvalidOrMissingFileData;
/**
* @param options
* @param logger
@@ -7735,7 +2788,6 @@ function warnIfMissingOrInvalidFileNameAndDefault(options, logger) {
}
return filename;
}
-exports.warnIfMissingOrInvalidFileNameAndDefault = warnIfMissingOrInvalidFileNameAndDefault;
/**
* `filetype` param is no longer supported and will be ignored
* @param options
@@ -7746,69 +2798,57 @@ function warnIfLegacyFileType(options, logger) {
logger.warn(buildLegacyFileTypeWarning());
}
}
-exports.warnIfLegacyFileType = warnIfLegacyFileType;
// Validation message utilities
function buildMissingFileIdError() {
return 'Missing required file id for file upload completion';
}
-exports.buildMissingFileIdError = buildMissingFileIdError;
function buildFileSizeErrorMsg() {
return 'There was an issue calculating the size of your file';
}
-exports.buildFileSizeErrorMsg = buildFileSizeErrorMsg;
function buildLegacyFileTypeWarning() {
- return 'filetype is no longer a supported field in files.uploadV2.' +
+ return ('filetype is no longer a supported field in files.uploadV2.' +
' \nPlease remove this field. To indicate file type, please do so via the required filename property' +
- ' using the appropriate file extension, e.g. image.png, text.txt';
+ ' using the appropriate file extension, e.g. image.png, text.txt');
}
-exports.buildLegacyFileTypeWarning = buildLegacyFileTypeWarning;
function buildMissingFileNameWarning() {
- return 'filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' +
+ return ('filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' +
'defaulting the filename. For best experience and consistent unfurl behavior, you' +
- ' should set the filename property with correct file extension, e.g. image.png, text.txt';
+ ' should set the filename property with correct file extension, e.g. image.png, text.txt');
}
-exports.buildMissingFileNameWarning = buildMissingFileNameWarning;
function buildMissingExtensionWarning(filename) {
return `filename supplied '${filename}' may be missing a proper extension. Missing extenions may result in unexpected unfurl behavior when shared`;
}
-exports.buildMissingExtensionWarning = buildMissingExtensionWarning;
function buildLegacyMethodWarning(method) {
return `${method} may cause some issues like timeouts for relatively large files.`;
}
-exports.buildLegacyMethodWarning = buildLegacyMethodWarning;
function buildGeneralFilesUploadWarning() {
- return 'Our latest recommendation is to use client.files.uploadV2() method, ' +
- 'which is mostly compatible and much stabler, instead.';
+ return ('Our latest recommendation is to use client.files.uploadV2() method, ' +
+ 'which is mostly compatible and much stabler, instead.');
}
-exports.buildGeneralFilesUploadWarning = buildGeneralFilesUploadWarning;
function buildFilesUploadMissingMessage() {
return 'Something went wrong with processing file_uploads';
}
-exports.buildFilesUploadMissingMessage = buildFilesUploadMissingMessage;
function buildChannelsWarning() {
- return 'Although the \'channels\' parameter is still supported for smoother migration from legacy files.upload, ' +
- 'we recommend using the new channel_id parameter with a single str value instead (e.g. \'C12345\').';
+ return ("Although the 'channels' parameter is still supported for smoother migration from legacy files.upload, " +
+ "we recommend using the new channel_id parameter with a single str value instead (e.g. 'C12345').");
}
-exports.buildChannelsWarning = buildChannelsWarning;
function buildMultipleChannelsErrorMsg() {
return 'Sharing files with multiple channels is no longer supported in v2. Share files in each channel separately instead.';
}
-exports.buildMultipleChannelsErrorMsg = buildMultipleChannelsErrorMsg;
function buildInvalidFilesUploadParamError() {
- return 'You may supply file_uploads only for a single channel, comment, thread respectively. ' +
- 'Therefore, please supply any channel_id, initial_comment, thread_ts in the top-layer.';
+ return ('You may supply file_uploads only for a single channel, message, or thread respectively. ' +
+ 'Therefore, please supply any channel_id, initial_comment or blocks, or thread_ts in the top-layer.');
}
-exports.buildInvalidFilesUploadParamError = buildInvalidFilesUploadParamError;
//# sourceMappingURL=file-upload.js.map
/***/ }),
-/***/ 2500:
+/***/ 4060:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports["default"] = delay;
/**
* Build a Promise that will resolve after the specified number of milliseconds.
* @param ms milliseconds to wait
@@ -7819,15 +2859,13 @@ function delay(ms) {
setTimeout(resolve, ms);
});
}
-exports["default"] = delay;
//# sourceMappingURL=helpers.js.map
/***/ }),
-/***/ 431:
+/***/ 5105:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
///
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -7848,29 +2886,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.addAppMetadata = exports.retryPolicies = exports.ErrorCode = exports.LogLevel = exports.WebClientEvent = exports.WebClient = void 0;
-var WebClient_1 = __nccwpck_require__(1424);
-Object.defineProperty(exports, "WebClient", ({ enumerable: true, get: function () { return WebClient_1.WebClient; } }));
-Object.defineProperty(exports, "WebClientEvent", ({ enumerable: true, get: function () { return WebClient_1.WebClientEvent; } }));
-var logger_1 = __nccwpck_require__(1336);
-Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_1.LogLevel; } }));
-var errors_1 = __nccwpck_require__(9781);
+exports.WebClientEvent = exports.WebClient = exports.retryPolicies = exports.LogLevel = exports.addAppMetadata = exports.ErrorCode = void 0;
+var errors_1 = __nccwpck_require__(8486);
Object.defineProperty(exports, "ErrorCode", ({ enumerable: true, get: function () { return errors_1.ErrorCode; } }));
-var retry_policies_1 = __nccwpck_require__(2156);
-Object.defineProperty(exports, "retryPolicies", ({ enumerable: true, get: function () { return __importDefault(retry_policies_1).default; } }));
-var instrument_1 = __nccwpck_require__(7763);
+var instrument_1 = __nccwpck_require__(9224);
Object.defineProperty(exports, "addAppMetadata", ({ enumerable: true, get: function () { return instrument_1.addAppMetadata; } }));
-__exportStar(__nccwpck_require__(1571), exports);
-__exportStar(__nccwpck_require__(1099), exports);
-__exportStar(__nccwpck_require__(2888), exports);
+var logger_1 = __nccwpck_require__(4385);
+Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_1.LogLevel; } }));
+var retry_policies_1 = __nccwpck_require__(1766);
+Object.defineProperty(exports, "retryPolicies", ({ enumerable: true, get: function () { return __importDefault(retry_policies_1).default; } }));
+__exportStar(__nccwpck_require__(381), exports);
+__exportStar(__nccwpck_require__(5591), exports);
+var WebClient_1 = __nccwpck_require__(4048);
+Object.defineProperty(exports, "WebClient", ({ enumerable: true, get: function () { return WebClient_1.WebClient; } }));
+Object.defineProperty(exports, "WebClientEvent", ({ enumerable: true, get: function () { return WebClient_1.WebClientEvent; } }));
+// methods must be exported after WebClient
+__exportStar(__nccwpck_require__(9339), exports);
//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 7763:
+/***/ 9224:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
@@ -7888,19 +2926,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : 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 __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getUserAgent = exports.addAppMetadata = void 0;
-const os = __importStar(__nccwpck_require__(2037));
-const path_1 = __nccwpck_require__(1017);
-// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
-const packageJson = __nccwpck_require__(9087);
+exports.addAppMetadata = addAppMetadata;
+exports.getUserAgent = getUserAgent;
+const os = __importStar(__nccwpck_require__(8161));
+const node_path_1 = __nccwpck_require__(6760);
+const packageJson = __nccwpck_require__(6734);
/**
* Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.
*/
@@ -7914,7 +2962,7 @@ function replaceSlashes(s) {
// the `os` module deno shim to correctly report operating system from a deno runtime. Until then, the below `os`-
// based code will report "browser/undefined" from a deno runtime.
const baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` +
- `${(0, path_1.basename)(process.title)}/${process.version.replace('v', '')} ` +
+ `${(0, node_path_1.basename)(process.title)}/${process.version.replace('v', '')} ` +
`${os.platform()}/${os.release()}`;
const appMetadata = {};
/**
@@ -7925,29 +2973,29 @@ const appMetadata = {};
function addAppMetadata({ name, version }) {
appMetadata[replaceSlashes(name)] = version;
}
-exports.addAppMetadata = addAppMetadata;
/**
* Returns the current User-Agent value for instrumentation
*/
function getUserAgent() {
- const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' ');
- // only prepend the appIdentifier when its not empty
- return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent;
+ const appIdentifier = Object.entries(appMetadata)
+ .map(([name, version]) => `${name}/${version}`)
+ .join(' ');
+ // only prepend the appIdentifier when it's not empty
+ return (appIdentifier.length > 0 ? `${appIdentifier} ` : '') + baseUserAgent;
}
-exports.getUserAgent = getUserAgent;
//# sourceMappingURL=instrument.js.map
/***/ }),
-/***/ 1336:
+/***/ 4385:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getLogger = exports.LogLevel = void 0;
-const logger_1 = __nccwpck_require__(2704);
-var logger_2 = __nccwpck_require__(2704);
+exports.LogLevel = void 0;
+exports.getLogger = getLogger;
+const logger_1 = __nccwpck_require__(9234);
+var logger_2 = __nccwpck_require__(9234);
Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_2.LogLevel; } }));
let instanceCount = 0;
/**
@@ -7970,15 +3018,13 @@ function getLogger(name, level, existingLogger) {
}
return logger;
}
-exports.getLogger = getLogger;
//# sourceMappingURL=logger.js.map
/***/ }),
-/***/ 1571:
+/***/ 9339:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
@@ -7996,15 +3042,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Methods = void 0;
-const eventemitter3_1 = __nccwpck_require__(1848);
-const WebClient_1 = __nccwpck_require__(1424);
+const eventemitter3_1 = __nccwpck_require__(2415);
+const WebClient_1 = __nccwpck_require__(4048);
/**
- * Binds a certain `method` and its arguments and result types to the `apiCall` method in `WebClient`.
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`.
*/
function bindApiCall(self, method) {
- // We have to 'assert' that the bound method does indeed return the more specific `Result` type instead of just
- // `WebAPICallResult`
- return self.apiCall.bind(self, method);
+ const apiMethod = self.apiCall.bind(self, method);
+ return apiMethod;
+}
+/**
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`.
+ */
+function bindApiCallWithOptionalArgument(self, method) {
+ const apiMethod = self.apiCall.bind(self, method);
+ return apiMethod;
}
function bindFilesUploadV2(self) {
return self.filesUploadV2.bind(self);
@@ -8020,7 +3072,7 @@ class Methods extends eventemitter3_1.EventEmitter {
analytics: {
/**
* @description Retrieve analytics data for a given date, presented as a compressed JSON file.
- * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/api.test `api.test` API reference}.
*/
getFile: bindApiCall(this, 'admin.analytics.getFile'),
},
@@ -8028,66 +3080,66 @@ class Methods extends eventemitter3_1.EventEmitter {
activities: {
/**
* @description Get logs for a specified team/org.
- * @see {@link https://api.slack.com/methods/admin.apps.activities.list `admin.apps.activities.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.activities.list `admin.apps.activities.list` API reference}.
*/
- list: bindApiCall(this, 'admin.apps.activities.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.apps.activities.list'),
},
/**
* @description Approve an app for installation on a workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.approve `admin.apps.approve` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.approve `admin.apps.approve` API reference}.
*/
approve: bindApiCall(this, 'admin.apps.approve'),
approved: {
/**
* @description List approved apps for an org or workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.approved.list `admin.apps.approved.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.approved.list `admin.apps.approved.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.approved.list'),
},
/**
* @description Clear an app resolution.
- * @see {@link https://api.slack.com/methods/admin.apps.clearResolution `admin.apps.clearResolution` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.clearResolution `admin.apps.clearResolution` API reference}.
*/
clearResolution: bindApiCall(this, 'admin.apps.clearResolution'),
config: {
/**
* @description Look up the app config for connectors by their IDs.
- * @see {@link https://api.slack.com/methods/admin.apps.config.lookup `admin.apps.config.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.config.lookup `admin.apps.config.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.apps.config.lookup'),
/**
* @description Set the app config for a connector.
- * @see {@link https://api.slack.com/methods/admin.apps.config.set `admin.apps.config.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.config.set `admin.apps.config.set` API reference}.
*/
set: bindApiCall(this, 'admin.apps.config.set'),
},
requests: {
/**
* @description Cancel app request for team.
- * @see {@link https://api.slack.com/methods/admin.apps.requests.cancel `admin.apps.requests.cancel` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.requests.cancel `admin.apps.requests.cancel` API reference}.
*/
cancel: bindApiCall(this, 'admin.apps.requests.cancel'),
/**
* @description List app requests for a team/workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.requests.list `admin.apps.requests.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.requests.list `admin.apps.requests.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.requests.list'),
},
/**
* @description Restrict an app for installation on a workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.restrict `admin.apps.restrict` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.restrict `admin.apps.restrict` API reference}.
*/
restrict: bindApiCall(this, 'admin.apps.restrict'),
restricted: {
/**
* @description List restricted apps for an org or workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.restricted.list `admin.apps.restricted.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.restricted.list `admin.apps.restricted.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.restricted.list'),
},
/**
* @description Uninstall an app from one or many workspaces, or an entire enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.apps.uninstall `admin.apps.uninstall` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.uninstall `admin.apps.uninstall` API reference}.
*/
uninstall: bindApiCall(this, 'admin.apps.uninstall'),
},
@@ -8095,17 +3147,17 @@ class Methods extends eventemitter3_1.EventEmitter {
policy: {
/**
* @description Assign entities to a particular authentication policy.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.assignEntities `admin.auth.policy.assignEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities `admin.auth.policy.assignEntities` API reference}.
*/
assignEntities: bindApiCall(this, 'admin.auth.policy.assignEntities'),
/**
* @description Fetch all the entities assigned to a particular authentication policy by name.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.getEntities `admin.auth.policy.getEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities `admin.auth.policy.getEntities` API reference}.
*/
getEntities: bindApiCall(this, 'admin.auth.policy.getEntities'),
/**
* @description Remove specified entities from a specified authentication policy.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.removeEntities `admin.auth.policy.removeEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities `admin.auth.policy.removeEntities` API reference}.
*/
removeEntities: bindApiCall(this, 'admin.auth.policy.removeEntities'),
},
@@ -8113,202 +3165,202 @@ class Methods extends eventemitter3_1.EventEmitter {
barriers: {
/**
* @description Create an Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.create `admin.barriers.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.create `admin.barriers.create` API reference}.
*/
create: bindApiCall(this, 'admin.barriers.create'),
/**
* @description Delete an existing Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.delete `admin.barriers.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.delete `admin.barriers.delete` API reference}.
*/
delete: bindApiCall(this, 'admin.barriers.delete'),
/**
* @description Get all Information Barriers for your organization.
- * @see {@link https://api.slack.com/methods/admin.barriers.list `admin.barriers.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.list `admin.barriers.list` API reference}.
*/
- list: bindApiCall(this, 'admin.barriers.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.barriers.list'),
/**
* @description Update an existing Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.update `admin.barriers.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.update `admin.barriers.update` API reference}.
*/
update: bindApiCall(this, 'admin.barriers.update'),
},
conversations: {
/**
* @description Archive a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.archive `admin.conversations.archive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.archive `admin.conversations.archive` API reference}.
*/
archive: bindApiCall(this, 'admin.conversations.archive'),
/**
* @description Archive public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkArchive `admin.conversations.bulkArchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive `admin.conversations.bulkArchive` API reference}.
*/
bulkArchive: bindApiCall(this, 'admin.conversations.bulkArchive'),
/**
* @description Delete public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkDelet `admin.conversations.bulkDelete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete `admin.conversations.bulkDelete` API reference}.
*/
bulkDelete: bindApiCall(this, 'admin.conversations.bulkDelete'),
/**
* @description Move public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkMove `admin.conversations.bulkMove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkMove `admin.conversations.bulkMove` API reference}.
*/
bulkMove: bindApiCall(this, 'admin.conversations.bulkMove'),
/**
* @description Convert a public channel to a private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.convertToPrivate `admin.conversations.convertToPrivate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate `admin.conversations.convertToPrivate` API reference}.
*/
convertToPrivate: bindApiCall(this, 'admin.conversations.convertToPrivate'),
/**
* @description Convert a private channel to a public channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.convertToPublic `admin.conversations.convertToPublic` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic `admin.conversations.convertToPublic` API reference}.
*/
convertToPublic: bindApiCall(this, 'admin.conversations.convertToPublic'),
/**
* @description Create a public or private channel-based conversation.
- * @see {@link https://api.slack.com/methods/admin.conversations.create `admin.conversations.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.create `admin.conversations.create` API reference}.
*/
create: bindApiCall(this, 'admin.conversations.create'),
/**
* @description Delete a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.delete `admin.conversations.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.delete `admin.conversations.delete` API reference}.
*/
delete: bindApiCall(this, 'admin.conversations.delete'),
/**
* @description Disconnect a connected channel from one or more workspaces.
- * @see {@link https://api.slack.com/methods/admin.conversations.disconnectShared `admin.conversations.disconnectShared` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared `admin.conversations.disconnectShared` API reference}.
*/
disconnectShared: bindApiCall(this, 'admin.conversations.disconnectShared'),
ekm: {
/**
* @description List all disconnected channels — i.e., channels that were once connected to other workspaces
* and then disconnected — and the corresponding original channel IDs for key revocation with EKM.
- * @see {@link https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo `admin.conversations.ekm.listOriginalConnectedChannelInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo `admin.conversations.ekm.listOriginalConnectedChannelInfo` API reference}.
*/
- listOriginalConnectedChannelInfo: bindApiCall(this, 'admin.conversations.ekm.listOriginalConnectedChannelInfo'),
+ listOriginalConnectedChannelInfo: bindApiCallWithOptionalArgument(this, 'admin.conversations.ekm.listOriginalConnectedChannelInfo'),
},
/**
* @description Get conversation preferences for a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.getConversationPrefs `admin.conversations.getConversationPrefs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs `admin.conversations.getConversationPrefs` API reference}.
*/
getConversationPrefs: bindApiCall(this, 'admin.conversations.getConversationPrefs'),
/**
* @description Get a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.getCustomRetention `admin.conversations.getCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention `admin.conversations.getCustomRetention` API reference}.
*/
getCustomRetention: bindApiCall(this, 'admin.conversations.getCustomRetention'),
/**
* @description Get all the workspaces a given public or private channel is connected to within
* this Enterprise org.
- * @see {@link https://api.slack.com/methods/admin.conversations.getTeams `admin.conversations.getTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getTeams `admin.conversations.getTeams` API reference}.
*/
getTeams: bindApiCall(this, 'admin.conversations.getTeams'),
/**
* @description Invite a user to a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.invite `admin.conversations.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.invite `admin.conversations.invite` API reference}.
*/
invite: bindApiCall(this, 'admin.conversations.invite'),
/**
* @description Returns channels on the given team using the filters.
- * @see {@link https://api.slack.com/methods/admin.conversations.lookup `admin.conversations.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.lookup `admin.conversations.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.conversations.lookup'),
/**
* @description Remove a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.removeCustomRetention `admin.conversations.removeCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention `admin.conversations.removeCustomRetention` API reference}.
*/
removeCustomRetention: bindApiCall(this, 'admin.conversations.removeCustomRetention'),
/**
* @description Rename a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.rename `admin.conversations.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.rename `admin.conversations.rename` API reference}.
*/
rename: bindApiCall(this, 'admin.conversations.rename'),
restrictAccess: {
/**
* @description Add an allowlist of IDP groups for accessing a channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup `admin.conversations.restrictAccess.addGroup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup `admin.conversations.restrictAccess.addGroup` API reference}.
*/
addGroup: bindApiCall(this, 'admin.conversations.restrictAccess.addGroup'),
/**
* @description List all IDP Groups linked to a channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups `admin.conversations.restrictAccess.listGroups` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups `admin.conversations.restrictAccess.listGroups` API reference}.
*/
listGroups: bindApiCall(this, 'admin.conversations.restrictAccess.listGroups'),
/**
* @description Remove a linked IDP group linked from a private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup `admin.conversations.restrictAccess.removeGroup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup `admin.conversations.restrictAccess.removeGroup` API reference}.
*/
removeGroup: bindApiCall(this, 'admin.conversations.restrictAccess.removeGroup'),
},
/**
* @description Search for public or private channels in an Enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.conversations.search `admin.conversations.search` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.search `admin.conversations.search` API reference}.
*/
- search: bindApiCall(this, 'admin.conversations.search'),
+ search: bindApiCallWithOptionalArgument(this, 'admin.conversations.search'),
/**
* @description Set the posting permissions for a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.setConversationPrefs `admin.conversations.setConversationPrefs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs `admin.conversations.setConversationPrefs` API reference}.
*/
setConversationPrefs: bindApiCall(this, 'admin.conversations.setConversationPrefs'),
/**
* @description Set a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.setCustomRetention `admin.conversations.setCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention `admin.conversations.setCustomRetention` API reference}.
*/
setCustomRetention: bindApiCall(this, 'admin.conversations.setCustomRetention'),
/**
* @description Set the workspaces in an Enterprise grid org that connect to a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.setTeams `admin.conversations.setTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setTeams `admin.conversations.setTeams` API reference}.
*/
setTeams: bindApiCall(this, 'admin.conversations.setTeams'),
/**
* @description Unarchive a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.unarchive `admin.conversations.unarchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.unarchive `admin.conversations.unarchive` API reference}.
*/
unarchive: bindApiCall(this, 'admin.conversations.unarchive'),
},
emoji: {
/**
* @description Add an emoji.
- * @see {@link https://api.slack.com/methods/admin.emoji.add `admin.emoji.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.add `admin.emoji.add` API reference}.
*/
add: bindApiCall(this, 'admin.emoji.add'),
/**
* @description Add an emoji alias.
- * @see {@link https://api.slack.com/methods/admin.emoji.addAlias `admin.emoji.addAlias` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.addAlias `admin.emoji.addAlias` API reference}.
*/
addAlias: bindApiCall(this, 'admin.emoji.addAlias'),
/**
* @description List emoji for an Enterprise Grid organization.
- * @see {@link https://api.slack.com/methods/admin.emoji.list `admin.emoji.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.list `admin.emoji.list` API reference}.
*/
- list: bindApiCall(this, 'admin.emoji.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.emoji.list'),
/**
* @description Remove an emoji across an Enterprise Grid organization.
- * @see {@link https://api.slack.com/methods/admin.emoji.remove `admin.emoji.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.remove `admin.emoji.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.emoji.remove'),
/**
* @description Rename an emoji.
- * @see {@link https://api.slack.com/methods/admin.emoji.rename `admin.emoji.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.rename `admin.emoji.rename` API reference}.
*/
rename: bindApiCall(this, 'admin.emoji.rename'),
},
functions: {
/**
* @description Look up functions by a set of apps.
- * @see {@link https://api.slack.com/methods/admin.functions.list `admin.functions.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.list `admin.functions.list` API reference}.
*/
list: bindApiCall(this, 'admin.functions.list'),
permissions: {
/**
* @description Lookup the visibility of multiple Slack functions and include the users if
* it is limited to particular named entities.
- * @see {@link https://api.slack.com/methods/admin.functions.permissions.lookup `admin.functions.permissions.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup `admin.functions.permissions.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.functions.permissions.lookup'),
/**
* @description Set the visibility of a Slack function and define the users or workspaces if
* it is set to named_entities.
- * @see {@link https://api.slack.com/methods/admin.functions.permissions.set `admin.functions.permissions.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.permissions.set `admin.functions.permissions.set` API reference}.
*/
set: bindApiCall(this, 'admin.functions.permissions.set'),
},
@@ -8316,49 +3368,49 @@ class Methods extends eventemitter3_1.EventEmitter {
inviteRequests: {
/**
* @description Approve a workspace invite request.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.approve `admin.inviteRequests.approve` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.approve `admin.inviteRequests.approve` API reference}.
*/
approve: bindApiCall(this, 'admin.inviteRequests.approve'),
approved: {
/**
* @description List all approved workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.approved.list `admin.inviteRequests.approved.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list `admin.inviteRequests.approved.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.approved.list'),
},
denied: {
/**
* @description List all denied workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.denied.list `admin.inviteRequests.denied.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list `admin.inviteRequests.denied.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.denied.list'),
},
/**
* @description Deny a workspace invite request.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.deny `admin.inviteRequests.deny` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.deny `admin.inviteRequests.deny` API reference}.
*/
deny: bindApiCall(this, 'admin.inviteRequests.deny'),
/**
* @description List all pending workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.list `admin.inviteRequests.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.list `admin.inviteRequests.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.list'),
},
roles: {
/**
* @description Adds members to the specified role with the specified scopes.
- * @see {@link https://api.slack.com/methods/admin.roles.addAssignments `admin.roles.addAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.addAssignments `admin.roles.addAssignments` API reference}.
*/
addAssignments: bindApiCall(this, 'admin.roles.addAssignments'),
/**
* @description Lists assignments for all roles across entities.
* Options to scope results by any combination of roles or entities.
- * @see {@link https://api.slack.com/methods/admin.roles.listAssignments `admin.roles.listAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.listAssignments `admin.roles.listAssignments` API reference}.
*/
- listAssignments: bindApiCall(this, 'admin.roles.listAssignments'),
+ listAssignments: bindApiCallWithOptionalArgument(this, 'admin.roles.listAssignments'),
/**
* @description Removes a set of users from a role for the given scopes and entities.
- * @see {@link https://api.slack.com/methods/admin.roles.removeAssignments `admin.roles.removeAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.removeAssignments `admin.roles.removeAssignments` API reference}.
*/
removeAssignments: bindApiCall(this, 'admin.roles.removeAssignments'),
},
@@ -8366,56 +3418,56 @@ class Methods extends eventemitter3_1.EventEmitter {
admins: {
/**
* @description List all of the admins on a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.admins.list `admin.teams.admins.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.admins.list `admin.teams.admins.list` API reference}.
*/
list: bindApiCall(this, 'admin.teams.admins.list'),
},
/**
* @description Create an Enterprise team.
- * @see {@link https://api.slack.com/methods/admin.teams.create `admin.teams.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.create `admin.teams.create` API reference}.
*/
create: bindApiCall(this, 'admin.teams.create'),
/**
* @description List all teams on an Enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.teams.list `admin.teams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.list `admin.teams.list` API reference}.
*/
- list: bindApiCall(this, 'admin.teams.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.teams.list'),
owners: {
/**
* @description List all of the owners on a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
*/
list: bindApiCall(this, 'admin.teams.owners.list'),
},
settings: {
/**
* @description Fetch information about settings in a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.info `admin.teams.settings.info` API reference}.
*/
info: bindApiCall(this, 'admin.teams.settings.info'),
/**
* @description Set the default channels of a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDefaultChannels `admin.teams.settings.setDefaultChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels `admin.teams.settings.setDefaultChannels` API reference}.
*/
setDefaultChannels: bindApiCall(this, 'admin.teams.settings.setDefaultChannels'),
/**
* @description Set the description of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDescription `admin.teams.settings.setDescription` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription `admin.teams.settings.setDescription` API reference}.
*/
setDescription: bindApiCall(this, 'admin.teams.settings.setDescription'),
/**
* @description Set the discoverability of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDiscoverability `admin.teams.settings.setDiscoverability` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability `admin.teams.settings.setDiscoverability` API reference}.
*/
setDiscoverability: bindApiCall(this, 'admin.teams.settings.setDiscoverability'),
/**
* @description Sets the icon of a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setIcon `admin.teams.settings.setIcon` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon `admin.teams.settings.setIcon` API reference}.
*/
setIcon: bindApiCall(this, 'admin.teams.settings.setIcon'),
/**
* @description Set the name of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setName `admin.teams.settings.setName` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setName `admin.teams.settings.setName` API reference}.
*/
setName: bindApiCall(this, 'admin.teams.settings.setName'),
},
@@ -8423,111 +3475,111 @@ class Methods extends eventemitter3_1.EventEmitter {
usergroups: {
/**
* @description Add up to one hundred default channels to an IDP group.
- * @see {@link https://api.slack.com/methods/admin.usergroups.addChannels `admin.teams.usergroups.addChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.addChannels `admin.teams.usergroups.addChannels` API reference}.
*/
addChannels: bindApiCall(this, 'admin.usergroups.addChannels'),
/**
* @description Associate one or more default workspaces with an organization-wide IDP group.
- * @see {@link https://api.slack.com/methods/admin.usergroups.addTeams `admin.teams.usergroups.addTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.addTeams `admin.teams.usergroups.addTeams` API reference}.
*/
addTeams: bindApiCall(this, 'admin.usergroups.addTeams'),
/**
* @description List the channels linked to an org-level IDP group (user group).
- * @see {@link https://api.slack.com/methods/admin.usergroups.listChannels `admin.teams.usergroups.listChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.listChannels `admin.teams.usergroups.listChannels` API reference}.
*/
listChannels: bindApiCall(this, 'admin.usergroups.listChannels'),
/**
* @description Remove one or more default channels from an org-level IDP group (user group).
- * @see {@link https://api.slack.com/methods/admin.usergroups.removeChannels `admin.teams.usergroups.removeChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels `admin.teams.usergroups.removeChannels` API reference}.
*/
removeChannels: bindApiCall(this, 'admin.usergroups.removeChannels'),
},
users: {
/**
* @description Add an Enterprise user to a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.assign `admin.users.assign` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.assign `admin.users.assign` API reference}.
*/
assign: bindApiCall(this, 'admin.users.assign'),
/**
* @description Invite a user to a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.invite `admin.users.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.invite `admin.users.invite` API reference}.
*/
invite: bindApiCall(this, 'admin.users.invite'),
/**
* @description List users on a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.list `admin.users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.list `admin.users.list` API reference}.
*/
- list: bindApiCall(this, 'admin.users.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.users.list'),
/**
* @description Remove a user from a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.remove `admin.users.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.remove `admin.users.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.users.remove'),
session: {
/**
* @description Clear user-specific session settings—the session duration and what happens when the client
* closes—for a list of users.
- * @see {@link https://api.slack.com/methods/admin.users.session.clearSettings `admin.users.session.clearSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.clearSettings `admin.users.session.clearSettings` API reference}.
*/
clearSettings: bindApiCall(this, 'admin.users.session.clearSettings'),
/**
* @description Get user-specific session settings—the session duration and what happens when the client
* closes—given a list of users.
- * @see {@link https://api.slack.com/methods/admin.users.session.getSettings `admin.users.session.getSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.getSettings `admin.users.session.getSettings` API reference}.
*/
getSettings: bindApiCall(this, 'admin.users.session.getSettings'),
/**
* @description Revoke a single session for a user. The user will be forced to login to Slack.
- * @see {@link https://api.slack.com/methods/admin.users.session.invalidate `admin.users.session.invalidate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.invalidate `admin.users.session.invalidate` API reference}.
*/
invalidate: bindApiCall(this, 'admin.users.session.invalidate'),
/**
* @description List active user sessions for an organization.
- * @see {@link https://api.slack.com/methods/admin.users.session.list `admin.users.session.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.list `admin.users.session.list` API reference}.
*/
- list: bindApiCall(this, 'admin.users.session.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.users.session.list'),
/**
* @description Wipes all valid sessions on all devices for a given user.
- * @see {@link https://api.slack.com/methods/admin.users.session.reset `admin.users.session.reset` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.reset `admin.users.session.reset` API reference}.
*/
reset: bindApiCall(this, 'admin.users.session.reset'),
/**
* @description Enqueues an asynchronous job to wipe all valid sessions on all devices for a given user list.
- * @see {@link https://api.slack.com/methods/admin.users.session.resetBulk `admin.users.session.resetBulk` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.resetBulk `admin.users.session.resetBulk` API reference}.
*/
resetBulk: bindApiCall(this, 'admin.users.session.resetBulk'),
/**
* @description Configure the user-level session settings—the session duration and what happens when the client
* closes—for one or more users.
- * @see {@link https://api.slack.com/methods/admin.users.session.setSettings `admin.users.session.setSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.setSettings `admin.users.session.setSettings` API reference}.
*/
setSettings: bindApiCall(this, 'admin.users.session.setSettings'),
},
/**
* @description Set an existing guest, regular user, or owner to be an admin user.
- * @see {@link https://api.slack.com/methods/admin.users.setAdmin `admin.users.setAdmin` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setAdmin `admin.users.setAdmin` API reference}.
*/
setAdmin: bindApiCall(this, 'admin.users.setAdmin'),
/**
* @description Set an expiration for a guest user.
- * @see {@link https://api.slack.com/methods/admin.users.setExpiration `admin.users.setExpiration` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setExpiration `admin.users.setExpiration` API reference}.
*/
setExpiration: bindApiCall(this, 'admin.users.setExpiration'),
/**
* @description Set an existing guest, regular user, or admin user to be a workspace owner.
- * @see {@link https://api.slack.com/methods/admin.users.setOwner `admin.users.setOwner` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setOwner `admin.users.setOwner` API reference}.
*/
setOwner: bindApiCall(this, 'admin.users.setOwner'),
/**
* @description Set an existing guest user, admin user, or owner to be a regular user.
- * @see {@link https://api.slack.com/methods/admin.users.setRegular `admin.users.setRegular` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setRegular `admin.users.setRegular` API reference}.
*/
setRegular: bindApiCall(this, 'admin.users.setRegular'),
unsupportedVersions: {
/**
* @description Ask Slackbot to send you an export listing all workspace members using unsupported software,
* presented as a zipped CSV file.
- * @see {@link https://api.slack.com/methods/admin.users.unsupportedVersions.export `admin.users.unsupportedVersions.export` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export `admin.users.unsupportedVersions.export` API reference}.
*/
export: bindApiCall(this, 'admin.users.unsupportedVersions.export'),
},
@@ -8536,30 +3588,30 @@ class Methods extends eventemitter3_1.EventEmitter {
collaborators: {
/**
* @description Add collaborators to workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.add `admin.workflows.collaborators.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add `admin.workflows.collaborators.add` API reference}.
*/
add: bindApiCall(this, 'admin.workflows.collaborators.add'),
/**
* @description Remove collaborators from workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.remove `admin.workflows.collaborators.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove `admin.workflows.collaborators.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.workflows.collaborators.remove'),
},
permissions: {
/**
* @description Look up the permissions for a set of workflows.
- * @see {@link https://api.slack.com/methods/admin.workflows.permissions.lookup `admin.workflows.permissions.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup `admin.workflows.permissions.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.workflows.permissions.lookup'),
},
/**
* @description Search workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.search `admin.workflows.search` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.search `admin.workflows.search` API reference}.
*/
- search: bindApiCall(this, 'admin.workflows.search'),
+ search: bindApiCallWithOptionalArgument(this, 'admin.workflows.search'),
/**
* @description Unpublish workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.unpublish `admin.workflows.unpublish` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.unpublish `admin.workflows.unpublish` API reference}.
*/
unpublish: bindApiCall(this, 'admin.workflows.unpublish'),
},
@@ -8567,25 +3619,44 @@ class Methods extends eventemitter3_1.EventEmitter {
this.api = {
/**
* @description Checks API calling code.
- * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/api.test `api.test` API reference}.
*/
- test: bindApiCall(this, 'api.test'),
+ test: bindApiCallWithOptionalArgument(this, 'api.test'),
+ };
+ this.assistant = {
+ threads: {
+ /**
+ * @description Set loading status to indicate that the app is building a response.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setStatus `assistant.threads.setStatus` API reference}.
+ */
+ setStatus: bindApiCall(this, 'assistant.threads.setStatus'),
+ /**
+ * @description Set suggested prompts for the user. Can suggest up to four prompts.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts `assistant.threads.setSuggestedPrompts` API reference}.
+ */
+ setSuggestedPrompts: bindApiCall(this, 'assistant.threads.setSuggestedPrompts'),
+ /**
+ * @description Set the title of the thread. This is shown when a user views the app's chat history.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setTitle `assistant.threads.setTitle` API reference}.
+ */
+ setTitle: bindApiCall(this, 'assistant.threads.setTitle'),
+ },
};
this.apps = {
connections: {
/**
* @description Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive
* events and interactive payloads over.
- * @see {@link https://api.slack.com/methods/apps.connections.open `apps.connections.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.connections.open `apps.connections.open` API reference}.
*/
- open: bindApiCall(this, 'apps.connections.open'),
+ open: bindApiCallWithOptionalArgument(this, 'apps.connections.open'),
},
event: {
authorizations: {
/**
* @description Get a list of authorizations for the given event context.
* Each authorization represents an app installation that the event is visible to.
- * @see {@link https://api.slack.com/methods/apps.event.authorizations.list `apps.event.authorizations.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.event.authorizations.list `apps.event.authorizations.list` API reference}.
*/
list: bindApiCall(this, 'apps.event.authorizations.list'),
},
@@ -8593,105 +3664,105 @@ class Methods extends eventemitter3_1.EventEmitter {
manifest: {
/**
* @description Create an app from an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.create `apps.manifest.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.create `apps.manifest.create` API reference}.
*/
create: bindApiCall(this, 'apps.manifest.create'),
/**
* @description Permanently deletes an app created through app manifests.
- * @see {@link https://api.slack.com/methods/apps.manifest.delete `apps.manifest.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.delete `apps.manifest.delete` API reference}.
*/
delete: bindApiCall(this, 'apps.manifest.delete'),
/**
* @description Export an app manifest from an existing app.
- * @see {@link https://api.slack.com/methods/apps.manifest.export `apps.manifest.export` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.export `apps.manifest.export` API reference}.
*/
export: bindApiCall(this, 'apps.manifest.export'),
/**
* @description Update an app from an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.update `apps.manifest.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.update `apps.manifest.update` API reference}.
*/
update: bindApiCall(this, 'apps.manifest.update'),
/**
* @description Validate an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.validate `apps.manifest.validate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.validate `apps.manifest.validate` API reference}.
*/
validate: bindApiCall(this, 'apps.manifest.validate'),
},
/**
* @description Uninstalls your app from a workspace.
- * @see {@link https://api.slack.com/methods/apps.uninstall `apps.uninstall` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.uninstall `apps.uninstall` API reference}.
*/
uninstall: bindApiCall(this, 'apps.uninstall'),
};
this.auth = {
/**
* @description Revokes a token.
- * @see {@link https://api.slack.com/methods/auth.revoke `auth.revoke` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/auth.revoke `auth.revoke` API reference}.
*/
- revoke: bindApiCall(this, 'auth.revoke'),
+ revoke: bindApiCallWithOptionalArgument(this, 'auth.revoke'),
teams: {
/**
* @description Obtain a full list of workspaces your org-wide app has been approved for.
- * @see {@link https://api.slack.com/methods/auth.teams.list `auth.teams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/auth.teams.list `auth.teams.list` API reference}.
*/
- list: bindApiCall(this, 'auth.teams.list'),
+ list: bindApiCallWithOptionalArgument(this, 'auth.teams.list'),
},
- test: bindApiCall(this, 'auth.test'),
+ test: bindApiCallWithOptionalArgument(this, 'auth.test'),
};
this.bookmarks = {
/**
* @description Add bookmark to a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.add `bookmarks.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.add `bookmarks.add` API reference}.
*/
add: bindApiCall(this, 'bookmarks.add'),
/**
* @description Edit bookmark.
- * @see {@link https://api.slack.com/methods/bookmarks.edit `bookmarks.edit` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.edit `bookmarks.edit` API reference}.
*/
edit: bindApiCall(this, 'bookmarks.edit'),
/**
* @description List bookmarks for a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.list `bookmarks.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.list `bookmarks.list` API reference}.
*/
list: bindApiCall(this, 'bookmarks.list'),
/**
* @description Remove bookmark from a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.remove `bookmarks.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.remove `bookmarks.remove` API reference}.
*/
remove: bindApiCall(this, 'bookmarks.remove'),
};
this.bots = {
/**
* @description Gets information about a bot user.
- * @see {@link https://api.slack.com/methods/bots.info `bots.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bots.info `bots.info` API reference}.
*/
- info: bindApiCall(this, 'bots.info'),
+ info: bindApiCallWithOptionalArgument(this, 'bots.info'),
};
this.calls = {
/**
* @description Registers a new Call.
- * @see {@link https://api.slack.com/methods/calls.add `calls.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.add `calls.add` API reference}.
*/
add: bindApiCall(this, 'calls.add'),
/**
* @description Ends a Call.
- * @see {@link https://api.slack.com/methods/calls.end `calls.end` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.end `calls.end` API reference}.
*/
end: bindApiCall(this, 'calls.end'),
/**
* @description Returns information about a Call.
- * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.info `calls.info` API reference}.
*/
info: bindApiCall(this, 'calls.info'),
/**
* @description Updates information about a Call.
- * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.update `calls.update` API reference}.
*/
update: bindApiCall(this, 'calls.update'),
participants: {
/**
* @description Registers new participants added to a Call.
- * @see {@link https://api.slack.com/methods/calls.participants.add `calls.participants.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.participants.add `calls.participants.add` API reference}.
*/
add: bindApiCall(this, 'calls.participants.add'),
remove: bindApiCall(this, 'calls.participants.remove'),
@@ -8701,298 +3772,345 @@ class Methods extends eventemitter3_1.EventEmitter {
access: {
/**
* @description Remove access to a canvas for specified entities.
- * @see {@link https://api.slack.com/methods/canvases.access.delete `canvases.access.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.access.delete `canvases.access.delete` API reference}.
*/
delete: bindApiCall(this, 'canvases.access.delete'),
/**
* @description Sets the access level to a canvas for specified entities.
- * @see {@link https://api.slack.com/methods/canvases.access.set `canvases.access.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.access.set `canvases.access.set` API reference}.
*/
set: bindApiCall(this, 'canvases.access.set'),
},
/**
* @description Create Canvas for a user.
- * @see {@link https://api.slack.com/methods/canvases.create `canvases.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.create `canvases.create` API reference}.
*/
- create: bindApiCall(this, 'canvases.create'),
+ create: bindApiCallWithOptionalArgument(this, 'canvases.create'),
/**
* @description Deletes a canvas.
- * @see {@link https://api.slack.com/methods/canvases.delete `canvases.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.delete `canvases.delete` API reference}.
*/
delete: bindApiCall(this, 'canvases.delete'),
/**
* @description Update an existing canvas.
- * @see {@link https://api.slack.com/methods/canvases.edit `canvases.edit` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.edit `canvases.edit` API reference}.
*/
edit: bindApiCall(this, 'canvases.edit'),
sections: {
/**
* @description Find sections matching the provided criteria.
- * @see {@link https://api.slack.com/methods/canvases.sections.lookup `canvases.sections.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.sections.lookup `canvases.sections.lookup` API reference}.
*/
lookup: bindApiCall(this, 'canvases.sections.lookup'),
},
};
this.chat = {
+ /**
+ * @description Appends text to an existing streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream `chat.appendStream` API reference}.
+ */
+ appendStream: bindApiCall(this, 'chat.appendStream'),
/**
* @description Deletes a message.
- * @see {@link https://api.slack.com/methods/chat.delete `chat.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.delete `chat.delete` API reference}.
*/
delete: bindApiCall(this, 'chat.delete'),
/**
* @description Deletes a pending scheduled message from the queue.
- * @see {@link https://api.slack.com/methods/chat.deleteScheduledMessage `chat.deleteScheduledMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage `chat.deleteScheduledMessage` API reference}.
*/
deleteScheduledMessage: bindApiCall(this, 'chat.deleteScheduledMessage'),
/**
* @description Retrieve a permalink URL for a specific extant message.
- * @see {@link https://api.slack.com/methods/chat.getPermalink `chat.getPermalink` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.getPermalink `chat.getPermalink` API reference}.
*/
getPermalink: bindApiCall(this, 'chat.getPermalink'),
/**
* @description Share a me message into a channel.
- * @see {@link https://api.slack.com/methods/chat.meMessage `chat.meMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.meMessage `chat.meMessage` API reference}.
*/
meMessage: bindApiCall(this, 'chat.meMessage'),
/**
* @description Sends an ephemeral message to a user in a channel.
- * @see {@link https://api.slack.com/methods/chat.postEphemeral `chat.postEphemeral` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.postEphemeral `chat.postEphemeral` API reference}.
*/
postEphemeral: bindApiCall(this, 'chat.postEphemeral'),
/**
* @description Sends a message to a channel.
- * @see {@link https://api.slack.com/methods/chat.postMessage `chat.postMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.postMessage `chat.postMessage` API reference}.
*/
postMessage: bindApiCall(this, 'chat.postMessage'),
/**
* @description Schedules a message to be sent to a channel.
- * @see {@link https://api.slack.com/methods/chat.scheduleMessage `chat.scheduleMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.scheduleMessage `chat.scheduleMessage` API reference}.
*/
scheduleMessage: bindApiCall(this, 'chat.scheduleMessage'),
scheduledMessages: {
/**
* @description Returns a list of scheduled messages.
- * @see {@link https://api.slack.com/methods/chat.scheduledMessages.list `chat.scheduledMessages.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.scheduledMessages.list `chat.scheduledMessages.list` API reference}.
*/
- list: bindApiCall(this, 'chat.scheduledMessages.list'),
+ list: bindApiCallWithOptionalArgument(this, 'chat.scheduledMessages.list'),
},
+ /**
+ * @description Starts a new streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream `chat.startStream` API reference}.
+ */
+ startStream: bindApiCall(this, 'chat.startStream'),
+ /**
+ * @description Stops a streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream `chat.stopStream` API reference}.
+ */
+ stopStream: bindApiCall(this, 'chat.stopStream'),
/**
* @description Provide custom unfurl behavior for user-posted URLs.
- * @see {@link https://api.slack.com/methods/chat.unfurl `chat.unfurl` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.unfurl `chat.unfurl` API reference}.
*/
unfurl: bindApiCall(this, 'chat.unfurl'),
/**
* @description Updates a message.
- * @see {@link https://api.slack.com/methods/chat.update `chat.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.update `chat.update` API reference}.
*/
update: bindApiCall(this, 'chat.update'),
};
this.conversations = {
/**
* @description Accepts an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.acceptSharedInvite `conversations.acceptSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite `conversations.acceptSharedInvite` API reference}.
*/
acceptSharedInvite: bindApiCall(this, 'conversations.acceptSharedInvite'),
/**
* @description Approves an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.approveSharedInvite `conversations.approveSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.approveSharedInvite `conversations.approveSharedInvite` API reference}.
*/
approveSharedInvite: bindApiCall(this, 'conversations.approveSharedInvite'),
/**
* @description Archives a conversation.
- * @see {@link https://api.slack.com/methods/conversations.archive `conversations.archive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.archive `conversations.archive` API reference}.
*/
archive: bindApiCall(this, 'conversations.archive'),
canvases: {
/**
* @description Create a Channel Canvas for a channel.
- * @see {@link https://api.slack.com/methods/conversations.canvases.create `conversations.canvases.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.canvases.create `conversations.canvases.create` API reference}.
*/
create: bindApiCall(this, 'conversations.canvases.create'),
},
/**
* @description Closes a direct message or multi-person direct message.
- * @see {@link https://api.slack.com/methods/conversations.close `conversations.close` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.close `conversations.close` API reference}.
*/
close: bindApiCall(this, 'conversations.close'),
/**
* @description Initiates a public or private channel-based conversation.
- * @see {@link https://api.slack.com/methods/conversations.create `conversations.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.create `conversations.create` API reference}.
*/
create: bindApiCall(this, 'conversations.create'),
/**
* @description Declines an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.declineSharedInvite `conversations.declineSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.declineSharedInvite `conversations.declineSharedInvite` API reference}.
*/
declineSharedInvite: bindApiCall(this, 'conversations.declineSharedInvite'),
+ externalInvitePermissions: {
+ /**
+ * @description Convert a team in a shared channel from an External Limited channel to a fully shared Slack
+ * Connect channel or vice versa.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set `conversations.externalInvitePermissions.set` API reference}.
+ */
+ set: bindApiCall(this, 'conversations.externalInvitePermissions.set'),
+ },
/**
* @description Fetches a conversation's history of messages and events.
- * @see {@link https://api.slack.com/methods/conversations.history `conversations.history` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.history `conversations.history` API reference}.
*/
history: bindApiCall(this, 'conversations.history'),
/**
* @description Retrieve information about a conversation.
- * @see {@link https://api.slack.com/methods/conversations.info `conversations.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.info `conversations.info` API reference}.
*/
info: bindApiCall(this, 'conversations.info'),
/**
* @description Invites users to a channel.
- * @see {@link https://api.slack.com/methods/conversations.invite `conversations.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.invite `conversations.invite` API reference}.
*/
invite: bindApiCall(this, 'conversations.invite'),
/**
* @description Sends an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.inviteShared `conversations.inviteShared` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.inviteShared `conversations.inviteShared` API reference}.
*/
inviteShared: bindApiCall(this, 'conversations.inviteShared'),
/**
* @description Joins an existing conversation.
- * @see {@link https://api.slack.com/methods/conversations.join `conversations.join` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.join `conversations.join` API reference}.
*/
join: bindApiCall(this, 'conversations.join'),
/**
* @description Removes a user from a conversation.
- * @see {@link https://api.slack.com/methods/conversations.kick `conversations.kick` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.kick `conversations.kick` API reference}.
*/
kick: bindApiCall(this, 'conversations.kick'),
/**
* @description Leaves a conversation.
- * @see {@link https://api.slack.com/methods/conversations.leave `conversations.leave` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.leave `conversations.leave` API reference}.
*/
leave: bindApiCall(this, 'conversations.leave'),
/**
* @description List all channels in a Slack team.
- * @see {@link https://api.slack.com/methods/conversations.list `conversations.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.list `conversations.list` API reference}.
*/
- list: bindApiCall(this, 'conversations.list'),
+ list: bindApiCallWithOptionalArgument(this, 'conversations.list'),
/**
* @description Lists shared channel invites that have been generated or received but have not been approved by
* all parties.
- * @see {@link https://api.slack.com/methods/conversations.listConnectInvites `conversations.listConnectInvites` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.listConnectInvites `conversations.listConnectInvites` API reference}.
*/
- listConnectInvites: bindApiCall(this, 'conversations.listConnectInvites'),
+ listConnectInvites: bindApiCallWithOptionalArgument(this, 'conversations.listConnectInvites'),
/**
* @description Sets the read cursor in a channel.
- * @see {@link https://api.slack.com/methods/conversations.mark `conversations.mark` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.mark `conversations.mark` API reference}.
*/
mark: bindApiCall(this, 'conversations.mark'),
/**
* @description Retrieve members of a conversation.
- * @see {@link https://api.slack.com/methods/conversations.members `conversations.members` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.members `conversations.members` API reference}.
*/
members: bindApiCall(this, 'conversations.members'),
/**
* @description Opens or resumes a direct message or multi-person direct message.
- * @see {@link https://api.slack.com/methods/conversations.open `conversations.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.open `conversations.open` API reference}.
*/
open: bindApiCall(this, 'conversations.open'),
/**
* @description Renames a conversation.
- * @see {@link https://api.slack.com/methods/conversations.rename `conversations.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.rename `conversations.rename` API reference}.
*/
rename: bindApiCall(this, 'conversations.rename'),
/**
* @description Retrieve a thread of messages posted to a conversation.
- * @see {@link https://api.slack.com/methods/conversations.replies `conversations.replies` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.replies `conversations.replies` API reference}.
*/
replies: bindApiCall(this, 'conversations.replies'),
+ requestSharedInvite: {
+ /**
+ * @description Approves a request to add an external user to a channel and sends them a Slack Connect invite.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve `conversations.requestSharedInvite.approve` API reference}.
+ */
+ approve: bindApiCall(this, 'conversations.requestSharedInvite.approve'),
+ /**
+ * @description Denies a request to invite an external user to a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny `conversations.requestSharedInvite.deny` API reference}.
+ */
+ deny: bindApiCall(this, 'conversations.requestSharedInvite.deny'),
+ /**
+ * @description Lists requests to add external users to channels with ability to filter.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list `conversations.requestSharedInvite.list` API reference}.
+ */
+ list: bindApiCallWithOptionalArgument(this, 'conversations.requestSharedInvite.list'),
+ },
/**
* @description Sets the purpose for a conversation.
- * @see {@link https://api.slack.com/methods/conversations.setPurpose `conversations.setPurpose` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.setPurpose `conversations.setPurpose` API reference}.
*/
setPurpose: bindApiCall(this, 'conversations.setPurpose'),
/**
* @description Sets the topic for a conversation.
- * @see {@link https://api.slack.com/methods/conversations.setTopic `conversations.setTopic` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.setTopic `conversations.setTopic` API reference}.
*/
setTopic: bindApiCall(this, 'conversations.setTopic'),
/**
* @description Reverses conversation archival.
- * @see {@link https://api.slack.com/methods/conversations.unarchive `conversations.unarchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.unarchive `conversations.unarchive` API reference}.
*/
unarchive: bindApiCall(this, 'conversations.unarchive'),
};
this.dialog = {
/**
* @description Open a dialog with a user.
- * @see {@link https://api.slack.com/methods/dialog.open `dialog.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dialog.open `dialog.open` API reference}.
*/
open: bindApiCall(this, 'dialog.open'),
};
this.dnd = {
/**
* @description Ends the current user's Do Not Disturb session immediately.
- * @see {@link https://api.slack.com/methods/dnd.endDnd `dnd.endDnd` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.endDnd `dnd.endDnd` API reference}.
*/
- endDnd: bindApiCall(this, 'dnd.endDnd'),
+ endDnd: bindApiCallWithOptionalArgument(this, 'dnd.endDnd'),
/**
* @description Ends the current user's snooze mode immediately.
- * @see {@link https://api.slack.com/methods/dnd.endSnooze `dnd.endSnooze` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.endSnooze `dnd.endSnooze` API reference}.
*/
- endSnooze: bindApiCall(this, 'dnd.endSnooze'),
+ endSnooze: bindApiCallWithOptionalArgument(this, 'dnd.endSnooze'),
/**
* @description Retrieves a user's current Do Not Disturb status.
- * @see {@link https://api.slack.com/methods/dnd.info `dnd.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.info `dnd.info` API reference}.
*/
- info: bindApiCall(this, 'dnd.info'),
+ info: bindApiCallWithOptionalArgument(this, 'dnd.info'),
/**
* @description Turns on Do Not Disturb mode for the current user, or changes its duration.
- * @see {@link https://api.slack.com/methods/dnd.setSnooze `dnd.setSnooze` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.setSnooze `dnd.setSnooze` API reference}.
*/
setSnooze: bindApiCall(this, 'dnd.setSnooze'),
/**
* @description Retrieves the Do Not Disturb status for up to 50 users on a team.
- * @see {@link https://api.slack.com/methods/dnd.teamInfo `dnd.teamInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.teamInfo `dnd.teamInfo` API reference}.
*/
teamInfo: bindApiCall(this, 'dnd.teamInfo'),
};
this.emoji = {
/**
* @description Lists custom emoji for a team.
- * @see {@link https://api.slack.com/methods/emoji.list `emoji.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/emoji.list `emoji.list` API reference}.
*/
- list: bindApiCall(this, 'emoji.list'),
+ list: bindApiCallWithOptionalArgument(this, 'emoji.list'),
+ };
+ this.entity = {
+ /**
+ * @description Provide information about the entity to be displayed in the flexpane.
+ * @see {@link https://docs.slack.dev/reference/methods/entity.presentDetails}
+ */
+ presentDetails: bindApiCall(this, 'entity.presentDetails'),
};
this.files = {
/**
- * @description Finishes an upload started with {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal`}.
- * @see {@link https://api.slack.com/methods/files.completeUploadExternal `files.completeUploadExternal` API reference}.
+ * @description Finishes an upload started with {@link https://docs.slack.dev/reference/methods/files.getUploadURLExternal `files.getUploadURLExternal`}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.completeUploadExternal `files.completeUploadExternal` API reference}.
*/
completeUploadExternal: bindApiCall(this, 'files.completeUploadExternal'),
/**
* @description Deletes a file.
- * @see {@link https://api.slack.com/methods/files.delete `files.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.delete `files.delete` API reference}.
*/
delete: bindApiCall(this, 'files.delete'),
/**
* @description Gets a URL for an edge external file upload.
- * @see {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.getUploadURLExternal `files.getUploadURLExternal` API reference}.
*/
getUploadURLExternal: bindApiCall(this, 'files.getUploadURLExternal'),
/**
* @description Gets information about a file.
- * @see {@link https://api.slack.com/methods/files.info `files.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.info `files.info` API reference}.
*/
info: bindApiCall(this, 'files.info'),
/**
* @description List files for a team, in a channel, or from a user with applied filters.
- * @see {@link https://api.slack.com/methods/files.list `files.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.list `files.list` API reference}.
*/
list: bindApiCall(this, 'files.list'),
/**
* @description Revokes public/external sharing access for a file.
- * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
*/
revokePublicURL: bindApiCall(this, 'files.revokePublicURL'),
/**
* @description Enables a file for public/external sharing.
- * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.sharedPublicURL `files.sharedPublicURL` API reference}.
*/
sharedPublicURL: bindApiCall(this, 'files.sharedPublicURL'),
/**
* @description Uploads or creates a file.
- * @deprecated Use `uploadV2` instead. See {@link https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay our post on retiring `files.upload`}.
- * @see {@link https://api.slack.com/methods/files.upload `files.upload` API reference}.
+ * @deprecated Use `uploadV2` instead. See {@link https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay our post on retiring `files.upload`}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.upload `files.upload` API reference}.
*/
upload: bindApiCall(this, 'files.upload'),
/**
@@ -9006,45 +4124,45 @@ class Methods extends eventemitter3_1.EventEmitter {
* - multiple upload_files
* Will try to honor both single file or content data supplied as well
* as multiple file uploads property.
- * @see {@link https://slack.dev/node-slack-sdk/web-api#upload-a-file `@slack/web-api` Upload a file documentation}.
- */
+ * @see {@link https://docs.slack.dev/tools/node-slack-sdk/web-api/#upload-a-file `@slack/web-api` Upload a file documentation}.
+ */
uploadV2: bindFilesUploadV2(this),
comments: {
/**
* @description Deletes an existing comment on a file.
- * @see {@link https://api.slack.com/methods/files.comments.delete `files.comments.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.comments.delete `files.comments.delete` API reference}.
*/
delete: bindApiCall(this, 'files.comments.delete'),
},
remote: {
/**
* @description Adds a file from a remote service.
- * @see {@link https://api.slack.com/methods/files.remote.add `files.remote.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.add `files.remote.add` API reference}.
*/
add: bindApiCall(this, 'files.remote.add'),
/**
* @description Retrieve information about a remote file added to Slack.
- * @see {@link https://api.slack.com/methods/files.remote.info `files.remote.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.info `files.remote.info` API reference}.
*/
info: bindApiCall(this, 'files.remote.info'),
/**
* @description List remote files added to Slack.
- * @see {@link https://api.slack.com/methods/files.remote.list `files.remote.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.list `files.remote.list` API reference}.
*/
list: bindApiCall(this, 'files.remote.list'),
/**
* @description Remove a remote file.
- * @see {@link https://api.slack.com/methods/files.remote.remove `files.remote.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.remove `files.remote.remove` API reference}.
*/
remove: bindApiCall(this, 'files.remote.remove'),
/**
* @description Share a remote file into a channel.
- * @see {@link https://api.slack.com/methods/files.remote.share `files.remote.share` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.share `files.remote.share` API reference}.
*/
share: bindApiCall(this, 'files.remote.share'),
/**
* @description Updates an existing remote file.
- * @see {@link https://api.slack.com/methods/files.remote.update `files.remote.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.update `files.remote.update` API reference}.
*/
update: bindApiCall(this, 'files.remote.update'),
},
@@ -9052,19 +4170,19 @@ class Methods extends eventemitter3_1.EventEmitter {
this.functions = {
/**
* @description Signal the failure to execute a Custom Function.
- * @see {@link https://api.slack.com/methods/functions.completeError `functions.completeError` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/functions.completeError `functions.completeError` API reference}.
*/
completeError: bindApiCall(this, 'functions.completeError'),
/**
* @description Signal the successful completion of a Custom Function.
- * @see {@link https://api.slack.com/methods/functions.completeSuccess `functions.completeSuccess` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/functions.completeSuccess `functions.completeSuccess` API reference}.
*/
completeSuccess: bindApiCall(this, 'functions.completeSuccess'),
};
this.migration = {
/**
* @description For Enterprise Grid workspaces, map local user IDs to global user IDs.
- * @see {@link https://api.slack.com/methods/migration.exchange `migration.exchange` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/migration.exchange `migration.exchange` API reference}.
*/
exchange: bindApiCall(this, 'migration.exchange'),
};
@@ -9072,18 +4190,18 @@ class Methods extends eventemitter3_1.EventEmitter {
/**
* @description Exchanges a temporary OAuth verifier code for an access token.
* @deprecated This is a legacy method only used by classic Slack apps. Use `oauth.v2.access` for new Slack apps.
- * @see {@link https://api.slack.com/methods/oauth.access `oauth.access` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.access `oauth.access` API reference}.
*/
access: bindApiCall(this, 'oauth.access'),
v2: {
/**
* @description Exchanges a temporary OAuth verifier code for an access token.
- * @see {@link https://api.slack.com/methods/oauth.v2.access `oauth.v2.access` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.v2.access `oauth.v2.access` API reference}.
*/
access: bindApiCall(this, 'oauth.v2.access'),
/**
* @description Exchanges a legacy access token for a new expiring access token and refresh token.
- * @see {@link https://api.slack.com/methods/oauth.v2.exchange `oauth.v2.exchange` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.v2.exchange `oauth.v2.exchange` API reference}.
*/
exchange: bindApiCall(this, 'oauth.v2.exchange'),
},
@@ -9091,170 +4209,243 @@ class Methods extends eventemitter3_1.EventEmitter {
this.openid = {
connect: {
/**
- * @description Exchanges a temporary OAuth verifier code for an access token for {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}.
- * @see {@link https://api.slack.com/methods/openid.connect.token `openid.connect.token` API reference}.
+ * @description Exchanges a temporary OAuth verifier code for an access token for {@link https://docs.slack.dev/authentication/sign-in-with-slack Sign in with Slack}.
+ * @see {@link https://docs.slack.dev/reference/methods/openid.connect.token `openid.connect.token` API reference}.
*/
token: bindApiCall(this, 'openid.connect.token'),
/**
- * @description Get the identity of a user who has authorized {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}.
- * @see {@link https://api.slack.com/methods/openid.connect.userInfo `openid.connect.userInfo` API reference}.
+ * @description Get the identity of a user who has authorized {@link https://docs.slack.dev/authentication/sign-in-with-slack Sign in with Slack}.
+ * @see {@link https://docs.slack.dev/reference/methods/openid.connect.userInfo `openid.connect.userInfo` API reference}.
*/
- userInfo: bindApiCall(this, 'openid.connect.userInfo'),
+ userInfo: bindApiCallWithOptionalArgument(this, 'openid.connect.userInfo'),
},
};
this.pins = {
/**
* @description Pins an item to a channel.
- * @see {@link https://api.slack.com/methods/pins.add `pins.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.add `pins.add` API reference}.
*/
add: bindApiCall(this, 'pins.add'),
/**
* @description Lists items pinned to a channel.
- * @see {@link https://api.slack.com/methods/pins.list `pins.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.list `pins.list` API reference}.
*/
list: bindApiCall(this, 'pins.list'),
/**
* @description Un-pins an item from a channel.
- * @see {@link https://api.slack.com/methods/pins.remove `pins.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.remove `pins.remove` API reference}.
*/
remove: bindApiCall(this, 'pins.remove'),
};
this.reactions = {
/**
* @description Adds a reaction to an item.
- * @see {@link https://api.slack.com/methods/reactions.add `reactions.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.add `reactions.add` API reference}.
*/
add: bindApiCall(this, 'reactions.add'),
/**
* @description Gets reactions for an item.
- * @see {@link https://api.slack.com/methods/reactions.get `reactions.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.get `reactions.get` API reference}.
*/
get: bindApiCall(this, 'reactions.get'),
/**
* @description List reactions made by a user.
- * @see {@link https://api.slack.com/methods/reactions.list `reactions.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.list `reactions.list` API reference}.
*/
- list: bindApiCall(this, 'reactions.list'),
+ list: bindApiCallWithOptionalArgument(this, 'reactions.list'),
/**
* @description Removes a reaction from an item.
- * @see {@link https://api.slack.com/methods/reactions.remove `reactions.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.remove `reactions.remove` API reference}.
*/
remove: bindApiCall(this, 'reactions.remove'),
};
// TODO: keep tabs on reminders APIs, may be deprecated once Later list APIs land
- // See: https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders
+ // See: https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
this.reminders = {
/**
* @description Creates a reminder.
- * @see {@link https://api.slack.com/methods/reminders.add `reminders.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.add `reminders.add` API reference}.
*/
add: bindApiCall(this, 'reminders.add'),
/**
* @description Marks a reminder as complete.
- * @see {@link https://api.slack.com/methods/reminders.complete `reminders.complete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.complete `reminders.complete` API reference}.
*/
complete: bindApiCall(this, 'reminders.complete'),
/**
* @description Deletes a reminder.
- * @see {@link https://api.slack.com/methods/reminders.delete `reminders.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.delete `reminders.delete` API reference}.
*/
delete: bindApiCall(this, 'reminders.delete'),
/**
* @description Gets information about a reminder.
- * @see {@link https://api.slack.com/methods/reminders.info `reminders.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.info `reminders.info` API reference}.
*/
info: bindApiCall(this, 'reminders.info'),
/**
* @description Lists all reminders created by or for a given user.
- * @see {@link https://api.slack.com/methods/reminders.list `reminders.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.list `reminders.list` API reference}.
*/
- list: bindApiCall(this, 'reminders.list'),
+ list: bindApiCallWithOptionalArgument(this, 'reminders.list'),
};
this.rtm = {
/**
* @description Starts a Real Time Messaging session.
- * @see {@link https://api.slack.com/methods/rtm.connect `rtm.connect` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/rtm.connect `rtm.connect` API reference}.
*/
- connect: bindApiCall(this, 'rtm.connect'),
+ connect: bindApiCallWithOptionalArgument(this, 'rtm.connect'),
/**
* @description Starts a Real Time Messaging session.
- * @deprecated Use `rtm.connect` instead. See {@link https://api.slack.com/changelog/2021-10-rtm-start-to-stop our post on retiring `rtm.start`}.
- * @see {@link https://api.slack.com/methods/rtm.start `rtm.start` API reference}.
+ * @deprecated Use `rtm.connect` instead. See {@link https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop our post on retiring `rtm.start`}.
+ * @see {@link https://docs.slack.dev/reference/methods/rtm.start `rtm.start` API reference}.
*/
- start: bindApiCall(this, 'rtm.start'),
+ start: bindApiCallWithOptionalArgument(this, 'rtm.start'),
};
this.search = {
/**
* @description Searches for messages and files matching a query.
- * @see {@link https://api.slack.com/methods/search.all search.all` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.all search.all` API reference}.
*/
all: bindApiCall(this, 'search.all'),
/**
* @description Searches for files matching a query.
- * @see {@link https://api.slack.com/methods/search.files search.files` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.files search.files` API reference}.
*/
files: bindApiCall(this, 'search.files'),
/**
* @description Searches for messages matching a query.
- * @see {@link https://api.slack.com/methods/search.messages search.messages` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.messages search.messages` API reference}.
*/
messages: bindApiCall(this, 'search.messages'),
};
+ this.slackLists = {
+ access: {
+ /**
+ * @description Delete access for specified entities.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.access.delete `slackLists.access.delete` API reference}.
+ */
+ delete: bindApiCall(this, 'slackLists.access.delete'),
+ /**
+ * @description Set access level for specified entities.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.access.set `slackLists.access.set` API reference}.
+ */
+ set: bindApiCall(this, 'slackLists.access.set'),
+ },
+ /**
+ * @description Create a List.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.create `slackLists.create` API reference}.
+ */
+ create: bindApiCall(this, 'slackLists.create'),
+ download: {
+ /**
+ * @description Get download job status.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.download.get `slackLists.download.get` API reference}.
+ */
+ get: bindApiCall(this, 'slackLists.download.get'),
+ /**
+ * @description Start a download job for a list.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.download.start `slackLists.download.start` API reference}.
+ */
+ start: bindApiCall(this, 'slackLists.download.start'),
+ },
+ items: {
+ /**
+ * @description Create a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.create `slackLists.items.create` API reference}.
+ */
+ create: bindApiCall(this, 'slackLists.items.create'),
+ /**
+ * @description Delete a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.delete `slackLists.items.delete` API reference}.
+ */
+ delete: bindApiCall(this, 'slackLists.items.delete'),
+ /**
+ * @description Delete multiple list items.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple `slackLists.items.deleteMultiple` API reference}.
+ */
+ deleteMultiple: bindApiCall(this, 'slackLists.items.deleteMultiple'),
+ /**
+ * @description Get info about a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.info `slackLists.items.info` API reference}.
+ */
+ info: bindApiCall(this, 'slackLists.items.info'),
+ /**
+ * @description Get records from a List.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.list `slackLists.items.list` API reference}.
+ */
+ list: bindApiCall(this, 'slackLists.items.list'),
+ /**
+ * @description Update a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.update `slackLists.items.update` API reference}.
+ */
+ update: bindApiCall(this, 'slackLists.items.update'),
+ },
+ /**
+ * @description Update a list.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.update `slackLists.update` API reference}.
+ */
+ update: bindApiCall(this, 'slackLists.update'),
+ };
this.team = {
/**
* @description Gets the access logs for the current team.
- * @see {@link https://api.slack.com/methods/team.accessLogs `team.accessLogs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.accessLogs `team.accessLogs` API reference}.
*/
- accessLogs: bindApiCall(this, 'team.accessLogs'),
+ accessLogs: bindApiCallWithOptionalArgument(this, 'team.accessLogs'),
/**
* @description Gets billable users information for the current team.
- * @see {@link https://api.slack.com/methods/team.billableInfo `team.billableInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.billableInfo `team.billableInfo` API reference}.
*/
- billableInfo: bindApiCall(this, 'team.billableInfo'),
+ billableInfo: bindApiCallWithOptionalArgument(this, 'team.billableInfo'),
billing: {
/**
* @description Reads a workspace's billing plan information.
- * @see {@link https://api.slack.com/methods/team.billing.info `team.billing.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.billing.info `team.billing.info` API reference}.
*/
info: bindApiCall(this, 'team.billing.info'),
},
externalTeams: {
+ /**
+ * @description Disconnect an external organization.
+ * @see {@link https://docs.slack.dev/reference/methods/team.externalTeams.disconnect `team.externalTeams.disconnect` API reference}.
+ */
+ disconnect: bindApiCall(this, 'team.externalTeams.disconnect'),
/**
* @description Returns a list of all the external teams connected and details about the connection.
- * @see {@link https://api.slack.com/methods/team.externalTeams.list `team.externalTeams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.externalTeams.list `team.externalTeams.list` API reference}.
*/
- lookup: bindApiCall(this, 'team.externalTeams.list'),
+ list: bindApiCall(this, 'team.externalTeams.list'),
},
/**
* @description Gets information about the current team.
- * @see {@link https://api.slack.com/methods/team.info `team.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.info `team.info` API reference}.
*/
- info: bindApiCall(this, 'team.info'),
+ info: bindApiCallWithOptionalArgument(this, 'team.info'),
/**
* @description Gets the integration logs for the current team.
- * @see {@link https://api.slack.com/methods/team.integrationLogs `team.integrationLogs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.integrationLogs `team.integrationLogs` API reference}.
*/
- integrationLogs: bindApiCall(this, 'team.integrationLogs'),
+ integrationLogs: bindApiCallWithOptionalArgument(this, 'team.integrationLogs'),
preferences: {
/**
* @description Retrieve a list of a workspace's team preferences.
- * @see {@link https://api.slack.com/methods/team.preferences.list `team.preferences.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.preferences.list `team.preferences.list` API reference}.
*/
- list: bindApiCall(this, 'team.preferences.list'),
+ list: bindApiCallWithOptionalArgument(this, 'team.preferences.list'),
},
profile: {
/**
* @description Retrieve a team's profile.
- * @see {@link https://api.slack.com/methods/team.profile.get `team.profile.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.profile.get `team.profile.get` API reference}.
*/
- get: bindApiCall(this, 'team.profile.get'),
+ get: bindApiCallWithOptionalArgument(this, 'team.profile.get'),
},
};
this.tooling = {
tokens: {
/**
* @description Exchanges a refresh token for a new app configuration token.
- * @see {@link https://api.slack.com/methods/tooling.tokens.rotate `tooling.tokens.rotate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/tooling.tokens.rotate `tooling.tokens.rotate` API reference}.
*/
rotate: bindApiCall(this, 'tooling.tokens.rotate'),
},
@@ -9262,38 +4453,38 @@ class Methods extends eventemitter3_1.EventEmitter {
this.usergroups = {
/**
* @description Create a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.create `usergroups.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.create `usergroups.create` API reference}.
*/
create: bindApiCall(this, 'usergroups.create'),
/**
* @description Disable an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.disable `usergroups.disable` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.disable `usergroups.disable` API reference}.
*/
disable: bindApiCall(this, 'usergroups.disable'),
/**
* @description Enable an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.enable `usergroups.enable` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.enable `usergroups.enable` API reference}.
*/
enable: bindApiCall(this, 'usergroups.enable'),
/**
* @description List all User Groups for a team.
- * @see {@link https://api.slack.com/methods/usergroups.list `usergroups.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.list `usergroups.list` API reference}.
*/
- list: bindApiCall(this, 'usergroups.list'),
+ list: bindApiCallWithOptionalArgument(this, 'usergroups.list'),
/**
* @description Update an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.update `usergroups.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.update `usergroups.update` API reference}.
*/
update: bindApiCall(this, 'usergroups.update'),
users: {
/**
* @description List all users in a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.users.list `usergroups.users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.users.list `usergroups.users.list` API reference}.
*/
list: bindApiCall(this, 'usergroups.users.list'),
/**
* @description Update the list of users in a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.users.update `usergroups.users.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.users.update `usergroups.users.update` API reference}.
*/
update: bindApiCall(this, 'usergroups.users.update'),
},
@@ -9301,65 +4492,65 @@ class Methods extends eventemitter3_1.EventEmitter {
this.users = {
/**
* @description List conversations the calling user may access.
- * @see {@link https://api.slack.com/methods/users.conversations `users.conversations` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.conversations `users.conversations` API reference}.
*/
conversations: bindApiCall(this, 'users.conversations'),
/**
* @description Delete the user profile photo.
- * @see {@link https://api.slack.com/methods/users.deletePhoto `users.deletePhoto` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.deletePhoto `users.deletePhoto` API reference}.
*/
deletePhoto: bindApiCall(this, 'users.deletePhoto'),
discoverableContacts: {
/**
* @description Lookup an email address to see if someone is on Slack.
- * @see {@link https://api.slack.com/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}.
*/
lookup: bindApiCall(this, 'users.discoverableContacts.lookup'),
},
/**
* @description Gets user presence information.
- * @see {@link https://api.slack.com/methods/users.getPresence `users.getPresence` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.getPresence `users.getPresence` API reference}.
*/
getPresence: bindApiCall(this, 'users.getPresence'),
/**
* @description Get a user's identity.
- * @see {@link https://api.slack.com/methods/users.identity `users.identity` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.identity `users.identity` API reference}.
*/
identity: bindApiCall(this, 'users.identity'),
/**
* @description Gets information about a user.
- * @see {@link https://api.slack.com/methods/users.info `users.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.info `users.info` API reference}.
*/
info: bindApiCall(this, 'users.info'),
/**
* @description Lists all users in a Slack team.
- * @see {@link https://api.slack.com/methods/users.list `users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.list `users.list` API reference}.
*/
list: bindApiCall(this, 'users.list'),
/**
* @description Find a user with an email address.
- * @see {@link https://api.slack.com/methods/users.lookupByEmail `users.lookupByEmail` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.lookupByEmail `users.lookupByEmail` API reference}.
*/
lookupByEmail: bindApiCall(this, 'users.lookupByEmail'),
/**
* @description Set the user profile photo.
- * @see {@link https://api.slack.com/methods/users.setPhoto `users.setPhoto` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.setPhoto `users.setPhoto` API reference}.
*/
setPhoto: bindApiCall(this, 'users.setPhoto'),
/**
* @description Manually sets user presence.
- * @see {@link https://api.slack.com/methods/users.setPresence `users.setPresence` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.setPresence `users.setPresence` API reference}.
*/
setPresence: bindApiCall(this, 'users.setPresence'),
profile: {
/**
* @description Retrieve a user's profile information, including their custom status.
- * @see {@link https://api.slack.com/methods/users.profile.get `users.profile.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.profile.get `users.profile.get` API reference}.
*/
get: bindApiCall(this, 'users.profile.get'),
/**
* @description Set a user's profile information, including custom status.
- * @see {@link https://api.slack.com/methods/users.profile.set `users.profile.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.profile.set `users.profile.set` API reference}.
*/
set: bindApiCall(this, 'users.profile.set'),
},
@@ -9367,22 +4558,22 @@ class Methods extends eventemitter3_1.EventEmitter {
this.views = {
/**
* @description Open a view for a user.
- * @see {@link https://api.slack.com/methods/views.open `views.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.open `views.open` API reference}.
*/
open: bindApiCall(this, 'views.open'),
/**
* @description Publish a static view for a user.
- * @see {@link https://api.slack.com/methods/views.publish `views.publish` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.publish `views.publish` API reference}.
*/
publish: bindApiCall(this, 'views.publish'),
/**
* @description Push a view onto the stack of a root view.
- * @see {@link https://api.slack.com/methods/views.push `views.push` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.push `views.push` API reference}.
*/
push: bindApiCall(this, 'views.push'),
/**
* @description Update an existing view.
- * @see {@link https://api.slack.com/methods/views.update `views.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.update `views.update` API reference}.
*/
update: bindApiCall(this, 'views.update'),
};
@@ -9391,13807 +4582,21517 @@ class Methods extends eventemitter3_1.EventEmitter {
// ------------------
// TODO: breaking changes for future majors:
// - stars.* methods are marked as deprecated; once Later has APIs, these will see an official sunsetting timeline
- // - workflows.* methods, Sep 12 2024: https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back
+ // - workflows.* methods, Sep 12 2024: https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back
this.stars = {
/**
* @description Save an item for later. Formerly known as adding a star.
* @deprecated Stars can still be added but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.add `stars.add` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.add `stars.add` API reference}.
*/
add: bindApiCall(this, 'stars.add'),
/**
* @description List a user's saved items, formerly known as stars.
* @deprecated Stars can still be listed but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.list `stars.list` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.list `stars.list` API reference}.
*/
list: bindApiCall(this, 'stars.list'),
/**
* @description Remove a saved item from a user's saved items, formerly known as stars.
* @deprecated Stars can still be removed but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.remove `stars.remove` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.remove `stars.remove` API reference}.
*/
remove: bindApiCall(this, 'stars.remove'),
};
this.workflows = {
+ featured: {
+ /**
+ * @description Add featured workflows to a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.add `workflows.featured.add` API reference}.
+ */
+ add: bindApiCall(this, 'workflows.featured.add'),
+ /**
+ * @description List the featured workflows for specified channels.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.list `workflows.featured.list` API reference}.
+ */
+ list: bindApiCall(this, 'workflows.featured.list'),
+ /**
+ * @description Remove featured workflows from a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.remove `workflows.featured.remove` API reference}.
+ */
+ remove: bindApiCall(this, 'workflows.featured.remove'),
+ /**
+ * @description Set featured workflows for a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.set `workflows.featured.set` API reference}.
+ */
+ set: bindApiCall(this, 'workflows.featured.set'),
+ },
/**
* @description Indicate that an app's step in a workflow completed execution.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.stepCompleted `workflows.stepCompleted` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.stepCompleted` API reference}.
*/
stepCompleted: bindApiCall(this, 'workflows.stepCompleted'),
/**
* @description Indicate that an app's step in a workflow failed to execute.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.stepFailed `workflows.stepFailed` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.stepFailed` API reference}.
*/
stepFailed: bindApiCall(this, 'workflows.stepFailed'),
/**
* @description Update the configuration for a workflow step.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.updateStep `workflows.updateStep` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.updateStep` API reference}.
*/
updateStep: bindApiCall(this, 'workflows.updateStep'),
};
- // Check that the class being created extends from `WebClient` rather than this class
- if (new.target !== WebClient_1.WebClient && !(new.target.prototype instanceof WebClient_1.WebClient)) {
- throw new Error('Attempt to inherit from WebClient methods without inheriting from WebClient');
+ // Check that the class being created extends from `WebClient` rather than this class
+ if (new.target !== WebClient_1.WebClient && !(new.target.prototype instanceof WebClient_1.WebClient)) {
+ throw new Error('Attempt to inherit from WebClient methods without inheriting from WebClient');
+ }
+ }
+}
+exports.Methods = Methods;
+__exportStar(__nccwpck_require__(4775), exports);
+//# sourceMappingURL=methods.js.map
+
+/***/ }),
+
+/***/ 1766:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.rapidRetryPolicy = exports.fiveRetriesInFiveMinutes = exports.tenRetriesInAboutThirtyMinutes = void 0;
+/**
+ * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because
+ * randomization has been added to prevent a stampeding herd problem (if all instances in your application are retrying
+ * a request at the exact same intervals, they are more likely to cause failures for each other).
+ */
+exports.tenRetriesInAboutThirtyMinutes = {
+ retries: 10,
+ factor: 1.96821,
+ randomize: true,
+};
+/**
+ * Short & sweet, five retries in five minutes and then bail.
+ */
+exports.fiveRetriesInFiveMinutes = {
+ retries: 5,
+ factor: 3.86,
+};
+/**
+ * This policy is just to keep the tests running fast.
+ */
+exports.rapidRetryPolicy = {
+ minTimeout: 0,
+ maxTimeout: 1,
+};
+const policies = {
+ tenRetriesInAboutThirtyMinutes: exports.tenRetriesInAboutThirtyMinutes,
+ fiveRetriesInFiveMinutes: exports.fiveRetriesInFiveMinutes,
+ rapidRetryPolicy: exports.rapidRetryPolicy,
+};
+exports["default"] = policies;
+//# sourceMappingURL=retry-policies.js.map
+
+/***/ }),
+
+/***/ 381:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 5591:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 8207:
+/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+const events_1 = __nccwpck_require__(4434);
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const promisify_1 = __importDefault(__nccwpck_require__(8067));
+const debug = debug_1.default('agent-base');
+function isAgent(v) {
+ return Boolean(v) && typeof v.addRequest === 'function';
+}
+function isSecureEndpoint() {
+ const { stack } = new Error();
+ if (typeof stack !== 'string')
+ return false;
+ return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
+}
+function createAgent(callback, opts) {
+ return new createAgent.Agent(callback, opts);
+}
+(function (createAgent) {
+ /**
+ * Base `http.Agent` implementation.
+ * No pooling/keep-alive is implemented by default.
+ *
+ * @param {Function} callback
+ * @api public
+ */
+ class Agent extends events_1.EventEmitter {
+ constructor(callback, _opts) {
+ super();
+ let opts = _opts;
+ if (typeof callback === 'function') {
+ this.callback = callback;
+ }
+ else if (callback) {
+ opts = callback;
+ }
+ // Timeout for the socket to be returned from the callback
+ this.timeout = null;
+ if (opts && typeof opts.timeout === 'number') {
+ this.timeout = opts.timeout;
+ }
+ // These aren't actually used by `agent-base`, but are required
+ // for the TypeScript definition files in `@types/node` :/
+ this.maxFreeSockets = 1;
+ this.maxSockets = 1;
+ this.maxTotalSockets = Infinity;
+ this.sockets = {};
+ this.freeSockets = {};
+ this.requests = {};
+ this.options = {};
+ }
+ get defaultPort() {
+ if (typeof this.explicitDefaultPort === 'number') {
+ return this.explicitDefaultPort;
+ }
+ return isSecureEndpoint() ? 443 : 80;
+ }
+ set defaultPort(v) {
+ this.explicitDefaultPort = v;
+ }
+ get protocol() {
+ if (typeof this.explicitProtocol === 'string') {
+ return this.explicitProtocol;
+ }
+ return isSecureEndpoint() ? 'https:' : 'http:';
+ }
+ set protocol(v) {
+ this.explicitProtocol = v;
+ }
+ callback(req, opts, fn) {
+ throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
+ }
+ /**
+ * Called by node-core's "_http_client.js" module when creating
+ * a new HTTP request with this Agent instance.
+ *
+ * @api public
+ */
+ addRequest(req, _opts) {
+ const opts = Object.assign({}, _opts);
+ if (typeof opts.secureEndpoint !== 'boolean') {
+ opts.secureEndpoint = isSecureEndpoint();
+ }
+ if (opts.host == null) {
+ opts.host = 'localhost';
+ }
+ if (opts.port == null) {
+ opts.port = opts.secureEndpoint ? 443 : 80;
+ }
+ if (opts.protocol == null) {
+ opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
+ }
+ if (opts.host && opts.path) {
+ // If both a `host` and `path` are specified then it's most
+ // likely the result of a `url.parse()` call... we need to
+ // remove the `path` portion so that `net.connect()` doesn't
+ // attempt to open that as a unix socket file.
+ delete opts.path;
+ }
+ delete opts.agent;
+ delete opts.hostname;
+ delete opts._defaultAgent;
+ delete opts.defaultPort;
+ delete opts.createConnection;
+ // Hint to use "Connection: close"
+ // XXX: non-documented `http` module API :(
+ req._last = true;
+ req.shouldKeepAlive = false;
+ let timedOut = false;
+ let timeoutId = null;
+ const timeoutMs = opts.timeout || this.timeout;
+ const onerror = (err) => {
+ if (req._hadError)
+ return;
+ req.emit('error', err);
+ // For Safety. Some additional errors might fire later on
+ // and we need to make sure we don't double-fire the error event.
+ req._hadError = true;
+ };
+ const ontimeout = () => {
+ timeoutId = null;
+ timedOut = true;
+ const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
+ err.code = 'ETIMEOUT';
+ onerror(err);
+ };
+ const callbackError = (err) => {
+ if (timedOut)
+ return;
+ if (timeoutId !== null) {
+ clearTimeout(timeoutId);
+ timeoutId = null;
+ }
+ onerror(err);
+ };
+ const onsocket = (socket) => {
+ if (timedOut)
+ return;
+ if (timeoutId != null) {
+ clearTimeout(timeoutId);
+ timeoutId = null;
+ }
+ if (isAgent(socket)) {
+ // `socket` is actually an `http.Agent` instance, so
+ // relinquish responsibility for this `req` to the Agent
+ // from here on
+ debug('Callback returned another Agent instance %o', socket.constructor.name);
+ socket.addRequest(req, opts);
+ return;
+ }
+ if (socket) {
+ socket.once('free', () => {
+ this.freeSocket(socket, opts);
+ });
+ req.onSocket(socket);
+ return;
+ }
+ const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
+ onerror(err);
+ };
+ if (typeof this.callback !== 'function') {
+ onerror(new Error('`callback` is not defined'));
+ return;
+ }
+ if (!this.promisifiedCallback) {
+ if (this.callback.length >= 3) {
+ debug('Converting legacy callback function to promise');
+ this.promisifiedCallback = promisify_1.default(this.callback);
+ }
+ else {
+ this.promisifiedCallback = this.callback;
+ }
+ }
+ if (typeof timeoutMs === 'number' && timeoutMs > 0) {
+ timeoutId = setTimeout(ontimeout, timeoutMs);
+ }
+ if ('port' in opts && typeof opts.port !== 'number') {
+ opts.port = Number(opts.port);
+ }
+ try {
+ debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
+ Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
+ }
+ catch (err) {
+ Promise.reject(err).catch(callbackError);
+ }
+ }
+ freeSocket(socket, opts) {
+ debug('Freeing socket %o %o', socket.constructor.name, opts);
+ socket.destroy();
+ }
+ destroy() {
+ debug('Destroying agent %o', this.constructor.name);
+ }
+ }
+ createAgent.Agent = Agent;
+ // So that `instanceof` works correctly
+ createAgent.prototype = createAgent.Agent.prototype;
+})(createAgent || (createAgent = {}));
+module.exports = createAgent;
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 8067:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+function promisify(fn) {
+ return function (req, opts) {
+ return new Promise((resolve, reject) => {
+ fn.call(this, req, opts, (err, rtn) => {
+ if (err) {
+ reject(err);
+ }
+ else {
+ resolve(rtn);
+ }
+ });
+ });
+ };
+}
+exports["default"] = promisify;
+//# sourceMappingURL=promisify.js.map
+
+/***/ }),
+
+/***/ 1324:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+module.exports =
+{
+ parallel : __nccwpck_require__(3857),
+ serial : __nccwpck_require__(1054),
+ serialOrdered : __nccwpck_require__(3961)
+};
+
+
+/***/ }),
+
+/***/ 4818:
+/***/ ((module) => {
+
+// API
+module.exports = abort;
+
+/**
+ * Aborts leftover active jobs
+ *
+ * @param {object} state - current state object
+ */
+function abort(state)
+{
+ Object.keys(state.jobs).forEach(clean.bind(state));
+
+ // reset leftover jobs
+ state.jobs = {};
+}
+
+/**
+ * Cleans up leftover job by invoking abort function for the provided job id
+ *
+ * @this state
+ * @param {string|number} key - job id to abort
+ */
+function clean(key)
+{
+ if (typeof this.jobs[key] == 'function')
+ {
+ this.jobs[key]();
+ }
+}
+
+
+/***/ }),
+
+/***/ 8452:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var defer = __nccwpck_require__(9200);
+
+// API
+module.exports = async;
+
+/**
+ * Runs provided callback asynchronously
+ * even if callback itself is not
+ *
+ * @param {function} callback - callback to invoke
+ * @returns {function} - augmented callback
+ */
+function async(callback)
+{
+ var isAsync = false;
+
+ // check if async happened
+ defer(function() { isAsync = true; });
+
+ return function async_callback(err, result)
+ {
+ if (isAsync)
+ {
+ callback(err, result);
+ }
+ else
+ {
+ defer(function nextTick_callback()
+ {
+ callback(err, result);
+ });
+ }
+ };
+}
+
+
+/***/ }),
+
+/***/ 9200:
+/***/ ((module) => {
+
+module.exports = defer;
+
+/**
+ * Runs provided function on next iteration of the event loop
+ *
+ * @param {function} fn - function to run
+ */
+function defer(fn)
+{
+ var nextTick = typeof setImmediate == 'function'
+ ? setImmediate
+ : (
+ typeof process == 'object' && typeof process.nextTick == 'function'
+ ? process.nextTick
+ : null
+ );
+
+ if (nextTick)
+ {
+ nextTick(fn);
+ }
+ else
+ {
+ setTimeout(fn, 0);
+ }
+}
+
+
+/***/ }),
+
+/***/ 4902:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var async = __nccwpck_require__(8452)
+ , abort = __nccwpck_require__(4818)
+ ;
+
+// API
+module.exports = iterate;
+
+/**
+ * Iterates over each job object
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {object} state - current job status
+ * @param {function} callback - invoked when all elements processed
+ */
+function iterate(list, iterator, state, callback)
+{
+ // store current index
+ var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
+ {
+ // don't repeat yourself
+ // skip secondary callbacks
+ if (!(key in state.jobs))
+ {
+ return;
+ }
+
+ // clean up jobs
+ delete state.jobs[key];
+
+ if (error)
+ {
+ // don't process rest of the results
+ // stop still active jobs
+ // and reset the list
+ abort(state);
+ }
+ else
+ {
+ state.results[key] = output;
+ }
+
+ // return salvaged results
+ callback(error, state.results);
+ });
+}
+
+/**
+ * Runs iterator over provided job element
+ *
+ * @param {function} iterator - iterator to invoke
+ * @param {string|number} key - key/index of the element in the list of jobs
+ * @param {mixed} item - job description
+ * @param {function} callback - invoked after iterator is done with the job
+ * @returns {function|mixed} - job abort function or something else
+ */
+function runJob(iterator, key, item, callback)
+{
+ var aborter;
+
+ // allow shortcut if iterator expects only two arguments
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, async(callback));
+ }
+ // otherwise go with full three arguments
+ else
+ {
+ aborter = iterator(item, key, async(callback));
+ }
+
+ return aborter;
+}
+
+
+/***/ }),
+
+/***/ 1721:
+/***/ ((module) => {
+
+// API
+module.exports = state;
+
+/**
+ * Creates initial state object
+ * for iteration over list
+ *
+ * @param {array|object} list - list to iterate over
+ * @param {function|null} sortMethod - function to use for keys sort,
+ * or `null` to keep them as is
+ * @returns {object} - initial state object
+ */
+function state(list, sortMethod)
+{
+ var isNamedList = !Array.isArray(list)
+ , initState =
+ {
+ index : 0,
+ keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
+ jobs : {},
+ results : isNamedList ? {} : [],
+ size : isNamedList ? Object.keys(list).length : list.length
+ }
+ ;
+
+ if (sortMethod)
+ {
+ // sort array keys based on it's values
+ // sort object's keys just on own merit
+ initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
+ {
+ return sortMethod(list[a], list[b]);
+ });
+ }
+
+ return initState;
+}
+
+
+/***/ }),
+
+/***/ 3351:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var abort = __nccwpck_require__(4818)
+ , async = __nccwpck_require__(8452)
+ ;
+
+// API
+module.exports = terminator;
+
+/**
+ * Terminates jobs in the attached state context
+ *
+ * @this AsyncKitState#
+ * @param {function} callback - final callback to invoke after termination
+ */
+function terminator(callback)
+{
+ if (!Object.keys(this.jobs).length)
+ {
+ return;
+ }
+
+ // fast forward iteration index
+ this.index = this.size;
+
+ // abort jobs
+ abort(this);
+
+ // send back results we have so far
+ async(callback)(null, this.results);
+}
+
+
+/***/ }),
+
+/***/ 3857:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var iterate = __nccwpck_require__(4902)
+ , initState = __nccwpck_require__(1721)
+ , terminator = __nccwpck_require__(3351)
+ ;
+
+// Public API
+module.exports = parallel;
+
+/**
+ * Runs iterator over provided array elements in parallel
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function parallel(list, iterator, callback)
+{
+ var state = initState(list);
+
+ while (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, function(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ // looks like it's the last one
+ if (Object.keys(state.jobs).length === 0)
+ {
+ callback(null, state.results);
+ return;
+ }
+ });
+
+ state.index++;
+ }
+
+ return terminator.bind(state, callback);
+}
+
+
+/***/ }),
+
+/***/ 1054:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var serialOrdered = __nccwpck_require__(3961);
+
+// Public API
+module.exports = serial;
+
+/**
+ * Runs iterator over provided array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serial(list, iterator, callback)
+{
+ return serialOrdered(list, iterator, null, callback);
+}
+
+
+/***/ }),
+
+/***/ 3961:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var iterate = __nccwpck_require__(4902)
+ , initState = __nccwpck_require__(1721)
+ , terminator = __nccwpck_require__(3351)
+ ;
+
+// Public API
+module.exports = serialOrdered;
+// sorting helpers
+module.exports.ascending = ascending;
+module.exports.descending = descending;
+
+/**
+ * Runs iterator over provided sorted array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serialOrdered(list, iterator, sortMethod, callback)
+{
+ var state = initState(list, sortMethod);
+
+ iterate(list, iterator, state, function iteratorHandler(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ state.index++;
+
+ // are we there yet?
+ if (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, iteratorHandler);
+ return;
+ }
+
+ // done here
+ callback(null, state.results);
+ });
+
+ return terminator.bind(state, callback);
+}
+
+/*
+ * -- Sort methods
+ */
+
+/**
+ * sort helper to sort array elements in ascending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function ascending(a, b)
+{
+ return a < b ? -1 : a > b ? 1 : 0;
+}
+
+/**
+ * sort helper to sort array elements in descending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function descending(a, b)
+{
+ return -1 * ascending(a, b);
+}
+
+
+/***/ }),
+
+/***/ 2639:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(7564);
+
+var $apply = __nccwpck_require__(3945);
+var $call = __nccwpck_require__(8093);
+var $reflectApply = __nccwpck_require__(1330);
+
+/** @type {import('./actualApply')} */
+module.exports = $reflectApply || bind.call($call, $apply);
+
+
+/***/ }),
+
+/***/ 3945:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionApply')} */
+module.exports = Function.prototype.apply;
+
+
+/***/ }),
+
+/***/ 8093:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionCall')} */
+module.exports = Function.prototype.call;
+
+
+/***/ }),
+
+/***/ 8705:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(7564);
+var $TypeError = __nccwpck_require__(3314);
+
+var $call = __nccwpck_require__(8093);
+var $actualApply = __nccwpck_require__(2639);
+
+/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
+module.exports = function callBindBasic(args) {
+ if (args.length < 1 || typeof args[0] !== 'function') {
+ throw new $TypeError('a function is required');
+ }
+ return $actualApply(bind, $call, args);
+};
+
+
+/***/ }),
+
+/***/ 1330:
+/***/ ((module) => {
+
+
+
+/** @type {import('./reflectApply')} */
+module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
+
+
+/***/ }),
+
+/***/ 5630:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var util = __nccwpck_require__(9023);
+var Stream = (__nccwpck_require__(2203).Stream);
+var DelayedStream = __nccwpck_require__(2710);
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+ this._insideLoop = false;
+ this._pendingNext = false;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+
+ if (this._insideLoop) {
+ this._pendingNext = true;
+ return; // defer call
+ }
+
+ this._insideLoop = true;
+ try {
+ do {
+ this._pendingNext = false;
+ this._realGetNext();
+ } while (this._pendingNext);
+ } finally {
+ this._insideLoop = false;
+ }
+};
+
+CombinedStream.prototype._realGetNext = function() {
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
+
+
+/***/ }),
+
+/***/ 6110:
+/***/ ((module, exports, __nccwpck_require__) => {
+
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ let m;
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ // eslint-disable-next-line no-return-assign
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = __nccwpck_require__(897)(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
+
+
+/***/ }),
+
+/***/ 897:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = __nccwpck_require__(744);
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ const split = (typeof namespaces === 'string' ? namespaces : '')
+ .trim()
+ .replace(/\s+/g, ',')
+ .split(',')
+ .filter(Boolean);
+
+ for (const ns of split) {
+ if (ns[0] === '-') {
+ createDebug.skips.push(ns.slice(1));
+ } else {
+ createDebug.names.push(ns);
+ }
+ }
+ }
+
+ /**
+ * Checks if the given string matches a namespace template, honoring
+ * asterisks as wildcards.
+ *
+ * @param {String} search
+ * @param {String} template
+ * @return {Boolean}
+ */
+ function matchesTemplate(search, template) {
+ let searchIndex = 0;
+ let templateIndex = 0;
+ let starIndex = -1;
+ let matchIndex = 0;
+
+ while (searchIndex < search.length) {
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
+ // Match character or proceed with wildcard
+ if (template[templateIndex] === '*') {
+ starIndex = templateIndex;
+ matchIndex = searchIndex;
+ templateIndex++; // Skip the '*'
+ } else {
+ searchIndex++;
+ templateIndex++;
+ }
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
+ // Backtrack to the last '*' and try to match more characters
+ templateIndex = starIndex + 1;
+ matchIndex++;
+ searchIndex = matchIndex;
+ } else {
+ return false; // No match
+ }
+ }
+
+ // Handle trailing '*' in template
+ while (templateIndex < template.length && template[templateIndex] === '*') {
+ templateIndex++;
+ }
+
+ return templateIndex === template.length;
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names,
+ ...createDebug.skips.map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ for (const skip of createDebug.skips) {
+ if (matchesTemplate(name, skip)) {
+ return false;
+ }
+ }
+
+ for (const ns of createDebug.names) {
+ if (matchesTemplate(name, ns)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
+
+
+/***/ }),
+
+/***/ 2830:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+ module.exports = __nccwpck_require__(6110);
+} else {
+ module.exports = __nccwpck_require__(5108);
+}
+
+
+/***/ }),
+
+/***/ 5108:
+/***/ ((module, exports, __nccwpck_require__) => {
+
+/**
+ * Module dependencies.
+ */
+
+const tty = __nccwpck_require__(2018);
+const util = __nccwpck_require__(9023);
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+);
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = __nccwpck_require__(1450);
+
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+} catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+}).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
+ }
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ const {namespace: name, useColors} = this;
+
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
+ }
+}
+
+function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
+ }
+ return new Date().toISOString() + ' ';
+}
+
+/**
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+ */
+
+function log(...args) {
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+module.exports = __nccwpck_require__(897)(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+};
+
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
+
+
+/***/ }),
+
+/***/ 2710:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var Stream = (__nccwpck_require__(2203).Stream);
+var util = __nccwpck_require__(9023);
+
+module.exports = DelayedStream;
+function DelayedStream() {
+ this.source = null;
+ this.dataSize = 0;
+ this.maxDataSize = 1024 * 1024;
+ this.pauseStream = true;
+
+ this._maxDataSizeExceeded = false;
+ this._released = false;
+ this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+ var delayedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ delayedStream[option] = options[option];
+ }
+
+ delayedStream.source = source;
+
+ var realEmit = source.emit;
+ source.emit = function() {
+ delayedStream._handleEmit(arguments);
+ return realEmit.apply(source, arguments);
+ };
+
+ source.on('error', function() {});
+ if (delayedStream.pauseStream) {
+ source.pause();
+ }
+
+ return delayedStream;
+};
+
+Object.defineProperty(DelayedStream.prototype, 'readable', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return this.source.readable;
+ }
+});
+
+DelayedStream.prototype.setEncoding = function() {
+ return this.source.setEncoding.apply(this.source, arguments);
+};
+
+DelayedStream.prototype.resume = function() {
+ if (!this._released) {
+ this.release();
+ }
+
+ this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+ this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+ this._released = true;
+
+ this._bufferedEvents.forEach(function(args) {
+ this.emit.apply(this, args);
+ }.bind(this));
+ this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+ var r = Stream.prototype.pipe.apply(this, arguments);
+ this.resume();
+ return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+ if (this._released) {
+ this.emit.apply(this, args);
+ return;
+ }
+
+ if (args[0] === 'data') {
+ this.dataSize += args[1].length;
+ this._checkIfMaxDataSizeExceeded();
+ }
+
+ this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+ if (this._maxDataSizeExceeded) {
+ return;
+ }
+
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ this._maxDataSizeExceeded = true;
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ this.emit('error', new Error(message));
+};
+
+
+/***/ }),
+
+/***/ 6669:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var callBind = __nccwpck_require__(8705);
+var gOPD = __nccwpck_require__(3170);
+
+var hasProtoAccessor;
+try {
+ // eslint-disable-next-line no-extra-parens, no-proto
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
+} catch (e) {
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
+ throw e;
+ }
+}
+
+// eslint-disable-next-line no-extra-parens
+var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
+
+var $Object = Object;
+var $getPrototypeOf = $Object.getPrototypeOf;
+
+/** @type {import('./get')} */
+module.exports = desc && typeof desc.get === 'function'
+ ? callBind([desc.get])
+ : typeof $getPrototypeOf === 'function'
+ ? /** @type {import('./get')} */ function getDunder(value) {
+ // eslint-disable-next-line eqeqeq
+ return $getPrototypeOf(value == null ? value : $Object(value));
+ }
+ : false;
+
+
+/***/ }),
+
+/***/ 9094:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+var $defineProperty = Object.defineProperty || false;
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = false;
+ }
+}
+
+module.exports = $defineProperty;
+
+
+/***/ }),
+
+/***/ 3056:
+/***/ ((module) => {
+
+
+
+/** @type {import('./eval')} */
+module.exports = EvalError;
+
+
+/***/ }),
+
+/***/ 1620:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+module.exports = Error;
+
+
+/***/ }),
+
+/***/ 4585:
+/***/ ((module) => {
+
+
+
+/** @type {import('./range')} */
+module.exports = RangeError;
+
+
+/***/ }),
+
+/***/ 6905:
+/***/ ((module) => {
+
+
+
+/** @type {import('./ref')} */
+module.exports = ReferenceError;
+
+
+/***/ }),
+
+/***/ 105:
+/***/ ((module) => {
+
+
+
+/** @type {import('./syntax')} */
+module.exports = SyntaxError;
+
+
+/***/ }),
+
+/***/ 3314:
+/***/ ((module) => {
+
+
+
+/** @type {import('./type')} */
+module.exports = TypeError;
+
+
+/***/ }),
+
+/***/ 2578:
+/***/ ((module) => {
+
+
+
+/** @type {import('./uri')} */
+module.exports = URIError;
+
+
+/***/ }),
+
+/***/ 5399:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+module.exports = Object;
+
+
+/***/ }),
+
+/***/ 8700:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var GetIntrinsic = __nccwpck_require__(470);
+
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+
+var hasToStringTag = __nccwpck_require__(5479)();
+var hasOwn = __nccwpck_require__(4076);
+var $TypeError = __nccwpck_require__(3314);
+
+var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
+
+/** @type {import('.')} */
+module.exports = function setToStringTag(object, value) {
+ var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
+ var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
+ if (
+ (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
+ || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
+ ) {
+ throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
+ }
+ if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
+ if ($defineProperty) {
+ $defineProperty(object, toStringTag, {
+ configurable: !nonConfigurable,
+ enumerable: false,
+ value: value,
+ writable: false
+ });
+ } else {
+ object[toStringTag] = value; // eslint-disable-line no-param-reassign
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ 2415:
+/***/ ((module) => {
+
+
+
+var has = Object.prototype.hasOwnProperty
+ , prefix = '~';
+
+/**
+ * Constructor to create a storage for our `EE` objects.
+ * An `Events` instance is a plain object whose properties are event names.
+ *
+ * @constructor
+ * @private
+ */
+function Events() {}
+
+//
+// We try to not inherit from `Object.prototype`. In some engines creating an
+// instance in this way is faster than calling `Object.create(null)` directly.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// character to make sure that the built-in object properties are not
+// overridden or used as an attack vector.
+//
+if (Object.create) {
+ Events.prototype = Object.create(null);
+
+ //
+ // This hack is needed because the `__proto__` property is still inherited in
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
+ //
+ if (!new Events().__proto__) prefix = false;
+}
+
+/**
+ * Representation of a single event listener.
+ *
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
+ * @constructor
+ * @private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} once Specify if the listener is a one-time listener.
+ * @returns {EventEmitter}
+ * @private
+ */
+function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== 'function') {
+ throw new TypeError('The listener must be a function');
+ }
+
+ var listener = new EE(fn, context || emitter, once)
+ , evt = prefix ? prefix + event : event;
+
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
+ else emitter._events[evt] = [emitter._events[evt], listener];
+
+ return emitter;
+}
+
+/**
+ * Clear event by name.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} evt The Event name.
+ * @private
+ */
+function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
+ else delete emitter._events[evt];
+}
+
+/**
+ * Minimal `EventEmitter` interface that is molded against the Node.js
+ * `EventEmitter` interface.
+ *
+ * @constructor
+ * @public
+ */
+function EventEmitter() {
+ this._events = new Events();
+ this._eventsCount = 0;
+}
+
+/**
+ * Return an array listing the events for which the emitter has registered
+ * listeners.
+ *
+ * @returns {Array}
+ * @public
+ */
+EventEmitter.prototype.eventNames = function eventNames() {
+ var names = []
+ , events
+ , name;
+
+ if (this._eventsCount === 0) return names;
+
+ for (name in (events = this._events)) {
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ }
+
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+
+ return names;
+};
+
+/**
+ * Return the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Array} The registered listeners.
+ * @public
+ */
+EventEmitter.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event
+ , handlers = this._events[evt];
+
+ if (!handlers) return [];
+ if (handlers.fn) return [handlers.fn];
+
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Return the number of listeners listening to a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Number} The number of listeners.
+ * @public
+ */
+EventEmitter.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event
+ , listeners = this._events[evt];
+
+ if (!listeners) return 0;
+ if (listeners.fn) return 1;
+ return listeners.length;
+};
+
+/**
+ * Calls each of the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
+ * @public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if (listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+};
+
+/**
+ * Add a one-time listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+};
+
+/**
+ * Remove the listeners of a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn Only remove the listeners that match this function.
+ * @param {*} context Only remove the listeners that have this context.
+ * @param {Boolean} once Only remove one-time listeners.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+
+ var listeners = this._events[evt];
+
+ if (listeners.fn) {
+ if (
+ listeners.fn === fn &&
+ (!once || listeners.once) &&
+ (!context || listeners.context === context)
+ ) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn ||
+ (once && !listeners[i].once) ||
+ (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
+ else clearEvent(this, evt);
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners, or those of the specified event.
+ *
+ * @param {(String|Symbol)} [event] The event name.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt]) clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Allow `EventEmitter` to be imported as module namespace.
+//
+EventEmitter.EventEmitter = EventEmitter;
+
+//
+// Expose the module.
+//
+if (true) {
+ module.exports = EventEmitter;
+}
+
+
+/***/ }),
+
+/***/ 4778:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var debug;
+
+module.exports = function () {
+ if (!debug) {
+ try {
+ /* eslint global-require: off */
+ debug = __nccwpck_require__(2830)("follow-redirects");
+ }
+ catch (error) { /* */ }
+ if (typeof debug !== "function") {
+ debug = function () { /* */ };
+ }
+ }
+ debug.apply(null, arguments);
+};
+
+
+/***/ }),
+
+/***/ 1573:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var url = __nccwpck_require__(7016);
+var URL = url.URL;
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var Writable = (__nccwpck_require__(2203).Writable);
+var assert = __nccwpck_require__(2613);
+var debug = __nccwpck_require__(4778);
+
+// Preventive platform detection
+// istanbul ignore next
+(function detectUnsupportedEnvironment() {
+ var looksLikeNode = typeof process !== "undefined";
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
+ console.warn("The follow-redirects package should be excluded from browser builds.");
+ }
+}());
+
+// Whether to use the native URL object or the legacy url module
+var useNativeURL = false;
+try {
+ assert(new URL(""));
+}
+catch (error) {
+ useNativeURL = error.code === "ERR_INVALID_URL";
+}
+
+// HTTP headers to drop across HTTP/HTTPS and domain boundaries
+var sensitiveHeaders = [
+ "Authorization",
+ "Proxy-Authorization",
+ "Cookie",
+];
+
+// URL fields to preserve in copy operations
+var preservedUrlFields = [
+ "auth",
+ "host",
+ "hostname",
+ "href",
+ "path",
+ "pathname",
+ "port",
+ "protocol",
+ "query",
+ "search",
+ "hash",
+];
+
+// Create handlers that pass events from native requests
+var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
+var eventHandlers = Object.create(null);
+events.forEach(function (event) {
+ eventHandlers[event] = function (arg1, arg2, arg3) {
+ this._redirectable.emit(event, arg1, arg2, arg3);
+ };
+});
+
+// Error types with codes
+var InvalidUrlError = createErrorType(
+ "ERR_INVALID_URL",
+ "Invalid URL",
+ TypeError
+);
+var RedirectionError = createErrorType(
+ "ERR_FR_REDIRECTION_FAILURE",
+ "Redirected request failed"
+);
+var TooManyRedirectsError = createErrorType(
+ "ERR_FR_TOO_MANY_REDIRECTS",
+ "Maximum number of redirects exceeded",
+ RedirectionError
+);
+var MaxBodyLengthExceededError = createErrorType(
+ "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
+ "Request body larger than maxBodyLength limit"
+);
+var WriteAfterEndError = createErrorType(
+ "ERR_STREAM_WRITE_AFTER_END",
+ "write after end"
+);
+
+// istanbul ignore next
+var destroy = Writable.prototype.destroy || noop;
+
+// An HTTP(S) request that can be redirected
+function RedirectableRequest(options, responseCallback) {
+ // Initialize the request
+ Writable.call(this);
+ this._sanitizeOptions(options);
+ this._options = options;
+ this._ended = false;
+ this._ending = false;
+ this._redirectCount = 0;
+ this._redirects = [];
+ this._requestBodyLength = 0;
+ this._requestBodyBuffers = [];
+
+ // Attach a callback if passed
+ if (responseCallback) {
+ this.on("response", responseCallback);
+ }
+
+ // React to responses of native requests
+ var self = this;
+ this._onNativeResponse = function (response) {
+ try {
+ self._processResponse(response);
+ }
+ catch (cause) {
+ self.emit("error", cause instanceof RedirectionError ?
+ cause : new RedirectionError({ cause: cause }));
+ }
+ };
+
+ // Create filter for sensitive HTTP headers
+ this._headerFilter = new RegExp("^(?:" +
+ sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") +
+ ")$", "i");
+
+ // Perform the first request
+ this._performRequest();
+}
+RedirectableRequest.prototype = Object.create(Writable.prototype);
+
+RedirectableRequest.prototype.abort = function () {
+ destroyRequest(this._currentRequest);
+ this._currentRequest.abort();
+ this.emit("abort");
+};
+
+RedirectableRequest.prototype.destroy = function (error) {
+ destroyRequest(this._currentRequest, error);
+ destroy.call(this, error);
+ return this;
+};
+
+// Writes buffered data to the current native request
+RedirectableRequest.prototype.write = function (data, encoding, callback) {
+ // Writing is not allowed if end has been called
+ if (this._ending) {
+ throw new WriteAfterEndError();
+ }
+
+ // Validate input and shift parameters if necessary
+ if (!isString(data) && !isBuffer(data)) {
+ throw new TypeError("data should be a string, Buffer or Uint8Array");
+ }
+ if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Ignore empty buffers, since writing them doesn't invoke the callback
+ // https://github.com/nodejs/node/issues/22066
+ if (data.length === 0) {
+ if (callback) {
+ callback();
+ }
+ return;
+ }
+ // Only write when we don't exceed the maximum body length
+ if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
+ this._requestBodyLength += data.length;
+ this._requestBodyBuffers.push({ data: data, encoding: encoding });
+ this._currentRequest.write(data, encoding, callback);
+ }
+ // Error when we exceed the maximum body length
+ else {
+ this.emit("error", new MaxBodyLengthExceededError());
+ this.abort();
+ }
+};
+
+// Ends the current native request
+RedirectableRequest.prototype.end = function (data, encoding, callback) {
+ // Shift parameters if necessary
+ if (isFunction(data)) {
+ callback = data;
+ data = encoding = null;
+ }
+ else if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Write data if needed and end
+ if (!data) {
+ this._ended = this._ending = true;
+ this._currentRequest.end(null, null, callback);
+ }
+ else {
+ var self = this;
+ var currentRequest = this._currentRequest;
+ this.write(data, encoding, function () {
+ self._ended = true;
+ currentRequest.end(null, null, callback);
+ });
+ this._ending = true;
+ }
+};
+
+// Sets a header value on the current native request
+RedirectableRequest.prototype.setHeader = function (name, value) {
+ this._options.headers[name] = value;
+ this._currentRequest.setHeader(name, value);
+};
+
+// Clears a header value on the current native request
+RedirectableRequest.prototype.removeHeader = function (name) {
+ delete this._options.headers[name];
+ this._currentRequest.removeHeader(name);
+};
+
+// Global timeout for all underlying requests
+RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
+ var self = this;
+
+ // Destroys the socket on timeout
+ function destroyOnTimeout(socket) {
+ socket.setTimeout(msecs);
+ socket.removeListener("timeout", socket.destroy);
+ socket.addListener("timeout", socket.destroy);
+ }
+
+ // Sets up a timer to trigger a timeout event
+ function startTimer(socket) {
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ }
+ self._timeout = setTimeout(function () {
+ self.emit("timeout");
+ clearTimer();
+ }, msecs);
+ destroyOnTimeout(socket);
+ }
+
+ // Stops a timeout from triggering
+ function clearTimer() {
+ // Clear the timeout
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ self._timeout = null;
+ }
+
+ // Clean up all attached listeners
+ self.removeListener("abort", clearTimer);
+ self.removeListener("error", clearTimer);
+ self.removeListener("response", clearTimer);
+ self.removeListener("close", clearTimer);
+ if (callback) {
+ self.removeListener("timeout", callback);
+ }
+ if (!self.socket) {
+ self._currentRequest.removeListener("socket", startTimer);
+ }
+ }
+
+ // Attach callback if passed
+ if (callback) {
+ this.on("timeout", callback);
+ }
+
+ // Start the timer if or when the socket is opened
+ if (this.socket) {
+ startTimer(this.socket);
+ }
+ else {
+ this._currentRequest.once("socket", startTimer);
+ }
+
+ // Clean up on events
+ this.on("socket", destroyOnTimeout);
+ this.on("abort", clearTimer);
+ this.on("error", clearTimer);
+ this.on("response", clearTimer);
+ this.on("close", clearTimer);
+
+ return this;
+};
+
+// Proxy all other public ClientRequest methods
+[
+ "flushHeaders", "getHeader",
+ "setNoDelay", "setSocketKeepAlive",
+].forEach(function (method) {
+ RedirectableRequest.prototype[method] = function (a, b) {
+ return this._currentRequest[method](a, b);
+ };
+});
+
+// Proxy all public ClientRequest properties
+["aborted", "connection", "socket"].forEach(function (property) {
+ Object.defineProperty(RedirectableRequest.prototype, property, {
+ get: function () { return this._currentRequest[property]; },
+ });
+});
+
+RedirectableRequest.prototype._sanitizeOptions = function (options) {
+ // Ensure headers are always present
+ if (!options.headers) {
+ options.headers = {};
+ }
+ if (!isArray(options.sensitiveHeaders)) {
+ options.sensitiveHeaders = [];
+ }
+
+ // Since http.request treats host as an alias of hostname,
+ // but the url module interprets host as hostname plus port,
+ // eliminate the host property to avoid confusion.
+ if (options.host) {
+ // Use hostname if set, because it has precedence
+ if (!options.hostname) {
+ options.hostname = options.host;
+ }
+ delete options.host;
+ }
+
+ // Complete the URL object when necessary
+ if (!options.pathname && options.path) {
+ var searchPos = options.path.indexOf("?");
+ if (searchPos < 0) {
+ options.pathname = options.path;
+ }
+ else {
+ options.pathname = options.path.substring(0, searchPos);
+ options.search = options.path.substring(searchPos);
+ }
+ }
+};
+
+
+// Executes the next native request (initial or redirect)
+RedirectableRequest.prototype._performRequest = function () {
+ // Load the native protocol
+ var protocol = this._options.protocol;
+ var nativeProtocol = this._options.nativeProtocols[protocol];
+ if (!nativeProtocol) {
+ throw new TypeError("Unsupported protocol " + protocol);
+ }
+
+ // If specified, use the agent corresponding to the protocol
+ // (HTTP and HTTPS use different types of agents)
+ if (this._options.agents) {
+ var scheme = protocol.slice(0, -1);
+ this._options.agent = this._options.agents[scheme];
+ }
+
+ // Create the native request and set up its event handlers
+ var request = this._currentRequest =
+ nativeProtocol.request(this._options, this._onNativeResponse);
+ request._redirectable = this;
+ for (var event of events) {
+ request.on(event, eventHandlers[event]);
+ }
+
+ // RFC7230§5.3.1: When making a request directly to an origin server, […]
+ // a client MUST send only the absolute path […] as the request-target.
+ this._currentUrl = /^\//.test(this._options.path) ?
+ url.format(this._options) :
+ // When making a request to a proxy, […]
+ // a client MUST send the target URI in absolute-form […].
+ this._options.path;
+
+ // End a redirected request
+ // (The first request must be ended explicitly with RedirectableRequest#end)
+ if (this._isRedirect) {
+ // Write the request entity and end
+ var i = 0;
+ var self = this;
+ var buffers = this._requestBodyBuffers;
+ (function writeNext(error) {
+ // Only write if this request has not been redirected yet
+ // istanbul ignore else
+ if (request === self._currentRequest) {
+ // Report any write errors
+ // istanbul ignore if
+ if (error) {
+ self.emit("error", error);
+ }
+ // Write the next buffer if there are still left
+ else if (i < buffers.length) {
+ var buffer = buffers[i++];
+ // istanbul ignore else
+ if (!request.finished) {
+ request.write(buffer.data, buffer.encoding, writeNext);
+ }
+ }
+ // End the request if `end` has been called on us
+ else if (self._ended) {
+ request.end();
+ }
+ }
+ }());
+ }
+};
+
+// Processes a response from the current native request
+RedirectableRequest.prototype._processResponse = function (response) {
+ // Store the redirected response
+ var statusCode = response.statusCode;
+ if (this._options.trackRedirects) {
+ this._redirects.push({
+ url: this._currentUrl,
+ headers: response.headers,
+ statusCode: statusCode,
+ });
+ }
+
+ // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
+ // that further action needs to be taken by the user agent in order to
+ // fulfill the request. If a Location header field is provided,
+ // the user agent MAY automatically redirect its request to the URI
+ // referenced by the Location field value,
+ // even if the specific status code is not understood.
+
+ // If the response is not a redirect; return it as-is
+ var location = response.headers.location;
+ if (!location || this._options.followRedirects === false ||
+ statusCode < 300 || statusCode >= 400) {
+ response.responseUrl = this._currentUrl;
+ response.redirects = this._redirects;
+ this.emit("response", response);
+
+ // Clean up
+ this._requestBodyBuffers = [];
+ return;
+ }
+
+ // The response is a redirect, so abort the current request
+ destroyRequest(this._currentRequest);
+ // Discard the remainder of the response to avoid waiting for data
+ response.destroy();
+
+ // RFC7231§6.4: A client SHOULD detect and intervene
+ // in cyclical redirections (i.e., "infinite" redirection loops).
+ if (++this._redirectCount > this._options.maxRedirects) {
+ throw new TooManyRedirectsError();
+ }
+
+ // Store the request headers if applicable
+ var requestHeaders;
+ var beforeRedirect = this._options.beforeRedirect;
+ if (beforeRedirect) {
+ requestHeaders = Object.assign({
+ // The Host header was set by nativeProtocol.request
+ Host: response.req.getHeader("host"),
+ }, this._options.headers);
+ }
+
+ // RFC7231§6.4: Automatic redirection needs to done with
+ // care for methods not known to be safe, […]
+ // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
+ // the request method from POST to GET for the subsequent request.
+ var method = this._options.method;
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
+ // RFC7231§6.4.4: The 303 (See Other) status code indicates that
+ // the server is redirecting the user agent to a different resource […]
+ // A user agent can perform a retrieval request targeting that URI
+ // (a GET or HEAD request if using HTTP) […]
+ (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
+ this._options.method = "GET";
+ // Drop a possible entity and headers related to it
+ this._requestBodyBuffers = [];
+ removeMatchingHeaders(/^content-/i, this._options.headers);
+ }
+
+ // Drop the Host header, as the redirect might lead to a different host
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+
+ // If the redirect is relative, carry over the host of the last request
+ var currentUrlParts = parseUrl(this._currentUrl);
+ var currentHost = currentHostHeader || currentUrlParts.host;
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
+ url.format(Object.assign(currentUrlParts, { host: currentHost }));
+
+ // Create the redirected request
+ var redirectUrl = resolveUrl(location, currentUrl);
+ debug("redirecting to", redirectUrl.href);
+ this._isRedirect = true;
+ spreadUrlObject(redirectUrl, this._options);
+
+ // Drop confidential headers when redirecting to a less secure protocol
+ // or to a different domain that is not a superdomain
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
+ redirectUrl.protocol !== "https:" ||
+ redirectUrl.host !== currentHost &&
+ !isSubdomain(redirectUrl.host, currentHost)) {
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
+ }
+
+ // Evaluate the beforeRedirect callback
+ if (isFunction(beforeRedirect)) {
+ var responseDetails = {
+ headers: response.headers,
+ statusCode: statusCode,
+ };
+ var requestDetails = {
+ url: currentUrl,
+ method: method,
+ headers: requestHeaders,
+ };
+ beforeRedirect(this._options, responseDetails, requestDetails);
+ this._sanitizeOptions(this._options);
+ }
+
+ // Perform the redirected request
+ this._performRequest();
+};
+
+// Wraps the key/value object of protocols with redirect functionality
+function wrap(protocols) {
+ // Default settings
+ var exports = {
+ maxRedirects: 21,
+ maxBodyLength: 10 * 1024 * 1024,
+ };
+
+ // Wrap each protocol
+ var nativeProtocols = {};
+ Object.keys(protocols).forEach(function (scheme) {
+ var protocol = scheme + ":";
+ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
+ var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+
+ // Executes a request, following redirects
+ function request(input, options, callback) {
+ // Parse parameters, ensuring that input is an object
+ if (isURL(input)) {
+ input = spreadUrlObject(input);
+ }
+ else if (isString(input)) {
+ input = spreadUrlObject(parseUrl(input));
+ }
+ else {
+ callback = options;
+ options = validateUrl(input);
+ input = { protocol: protocol };
+ }
+ if (isFunction(options)) {
+ callback = options;
+ options = null;
+ }
+
+ // Set defaults
+ options = Object.assign({
+ maxRedirects: exports.maxRedirects,
+ maxBodyLength: exports.maxBodyLength,
+ }, input, options);
+ options.nativeProtocols = nativeProtocols;
+ if (!isString(options.host) && !isString(options.hostname)) {
+ options.hostname = "::1";
+ }
+
+ assert.equal(options.protocol, protocol, "protocol mismatch");
+ debug("options", options);
+ return new RedirectableRequest(options, callback);
+ }
+
+ // Executes a GET request, following redirects
+ function get(input, options, callback) {
+ var wrappedRequest = wrappedProtocol.request(input, options, callback);
+ wrappedRequest.end();
+ return wrappedRequest;
+ }
+
+ // Expose the properties on the wrapped protocol
+ Object.defineProperties(wrappedProtocol, {
+ request: { value: request, configurable: true, enumerable: true, writable: true },
+ get: { value: get, configurable: true, enumerable: true, writable: true },
+ });
+ });
+ return exports;
+}
+
+function noop() { /* empty */ }
+
+function parseUrl(input) {
+ var parsed;
+ // istanbul ignore else
+ if (useNativeURL) {
+ parsed = new URL(input);
+ }
+ else {
+ // Ensure the URL is valid and absolute
+ parsed = validateUrl(url.parse(input));
+ if (!isString(parsed.protocol)) {
+ throw new InvalidUrlError({ input });
+ }
+ }
+ return parsed;
+}
+
+function resolveUrl(relative, base) {
+ // istanbul ignore next
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
+}
+
+function validateUrl(input) {
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ return input;
+}
+
+function spreadUrlObject(urlObject, target) {
+ var spread = target || {};
+ for (var key of preservedUrlFields) {
+ spread[key] = urlObject[key];
+ }
+
+ // Fix IPv6 hostname
+ if (spread.hostname.startsWith("[")) {
+ spread.hostname = spread.hostname.slice(1, -1);
+ }
+ // Ensure port is a number
+ if (spread.port !== "") {
+ spread.port = Number(spread.port);
+ }
+ // Concatenate path
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
+
+ return spread;
+}
+
+function removeMatchingHeaders(regex, headers) {
+ var lastValue;
+ for (var header in headers) {
+ if (regex.test(header)) {
+ lastValue = headers[header];
+ delete headers[header];
+ }
+ }
+ return (lastValue === null || typeof lastValue === "undefined") ?
+ undefined : String(lastValue).trim();
+}
+
+function createErrorType(code, message, baseClass) {
+ // Create constructor
+ function CustomError(properties) {
+ // istanbul ignore else
+ if (isFunction(Error.captureStackTrace)) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+ Object.assign(this, properties || {});
+ this.code = code;
+ this.message = this.cause ? message + ": " + this.cause.message : message;
+ }
+
+ // Attach constructor and set default properties
+ CustomError.prototype = new (baseClass || Error)();
+ Object.defineProperties(CustomError.prototype, {
+ constructor: {
+ value: CustomError,
+ enumerable: false,
+ },
+ name: {
+ value: "Error [" + code + "]",
+ enumerable: false,
+ },
+ });
+ return CustomError;
+}
+
+function destroyRequest(request, error) {
+ for (var event of events) {
+ request.removeListener(event, eventHandlers[event]);
+ }
+ request.on("error", noop);
+ request.destroy(error);
+}
+
+function isSubdomain(subdomain, domain) {
+ assert(isString(subdomain) && isString(domain));
+ var dot = subdomain.length - domain.length - 1;
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
+}
+
+function isArray(value) {
+ return value instanceof Array;
+}
+
+function isString(value) {
+ return typeof value === "string" || value instanceof String;
+}
+
+function isFunction(value) {
+ return typeof value === "function";
+}
+
+function isBuffer(value) {
+ return typeof value === "object" && ("length" in value);
+}
+
+function isURL(value) {
+ return URL && value instanceof URL;
+}
+
+function escapeRegex(regex) {
+ return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
+}
+
+// Exports
+module.exports = wrap({ http: http, https: https });
+module.exports.wrap = wrap;
+
+
+/***/ }),
+
+/***/ 6454:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var CombinedStream = __nccwpck_require__(5630);
+var util = __nccwpck_require__(9023);
+var path = __nccwpck_require__(6928);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var parseUrl = (__nccwpck_require__(7016).parse);
+var fs = __nccwpck_require__(9896);
+var Stream = (__nccwpck_require__(2203).Stream);
+var crypto = __nccwpck_require__(6982);
+var mime = __nccwpck_require__(4096);
+var asynckit = __nccwpck_require__(1324);
+var setToStringTag = __nccwpck_require__(8700);
+var hasOwn = __nccwpck_require__(4076);
+var populate = __nccwpck_require__(1835);
+
+/**
+ * Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field
+ * name or filename can not break out of its header line to inject headers or
+ * smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding.
+ *
+ * @param {string} str - the parameter value to escape
+ * @returns {string} the escaped value
+ */
+function escapeHeaderParam(str) {
+ return String(str).replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/"/g, '%22');
+}
+
+/**
+ * Create readable "multipart/form-data" streams.
+ * Can be used to submit forms
+ * and file uploads to other web applications.
+ *
+ * @constructor
+ * @param {object} options - Properties to be added/overriden for FormData and CombinedStream
+ */
+function FormData(options) {
+ if (!(this instanceof FormData)) {
+ return new FormData(options);
+ }
+
+ this._overheadLength = 0;
+ this._valueLength = 0;
+ this._valuesToMeasure = [];
+
+ CombinedStream.call(this);
+
+ options = options || {}; // eslint-disable-line no-param-reassign
+ for (var option in options) { // eslint-disable-line no-restricted-syntax
+ this[option] = options[option];
+ }
+}
+
+// make it a Stream
+util.inherits(FormData, CombinedStream);
+
+FormData.LINE_BREAK = '\r\n';
+FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+
+FormData.prototype.append = function (field, value, options) {
+ options = options || {}; // eslint-disable-line no-param-reassign
+
+ // allow filename as single option
+ if (typeof options === 'string') {
+ options = { filename: options }; // eslint-disable-line no-param-reassign
+ }
+
+ var append = CombinedStream.prototype.append.bind(this);
+
+ // all that streamy business can't handle numbers
+ if (typeof value === 'number' || value == null) {
+ value = String(value); // eslint-disable-line no-param-reassign
+ }
+
+ // https://github.com/felixge/node-form-data/issues/38
+ if (Array.isArray(value)) {
+ /*
+ * Please convert your array into string
+ * the way web server expects it
+ */
+ this._error(new Error('Arrays are not supported.'));
+ return;
+ }
+
+ var header = this._multiPartHeader(field, value, options);
+ var footer = this._multiPartFooter();
+
+ append(header);
+ append(value);
+ append(footer);
+
+ // pass along options.knownLength
+ this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function (header, value, options) {
+ var valueLength = 0;
+
+ /*
+ * used w/ getLengthSync(), when length is known.
+ * e.g. for streaming directly from a remote server,
+ * w/ a known file a size, and not wanting to wait for
+ * incoming file to finish to get its size.
+ */
+ if (options.knownLength != null) {
+ valueLength += Number(options.knownLength);
+ } else if (Buffer.isBuffer(value)) {
+ valueLength = value.length;
+ } else if (typeof value === 'string') {
+ valueLength = Buffer.byteLength(value);
+ }
+
+ this._valueLength += valueLength;
+
+ // @check why add CRLF? does this account for custom/multiple CRLFs?
+ this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
+
+ // empty or either doesn't have path or not an http response or not a stream
+ if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
+ return;
+ }
+
+ // no need to bother with the length
+ if (!options.knownLength) {
+ this._valuesToMeasure.push(value);
+ }
+};
+
+FormData.prototype._lengthRetriever = function (value, callback) {
+ if (hasOwn(value, 'fd')) {
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function (err, stat) {
+ if (err) {
+ callback(err);
+ return;
+ }
+
+ // update final size based on the range options
+ var fileSize = stat.size - (value.start ? value.start : 0);
+ callback(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (hasOwn(value, 'httpVersion')) {
+ callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
+
+ // or request stream http://github.com/mikeal/request
+ } else if (hasOwn(value, 'httpModule')) {
+ // wait till response come back
+ value.on('response', function (response) {
+ value.pause();
+ callback(null, Number(response.headers['content-length']));
+ });
+ value.resume();
+
+ // something else
+ } else {
+ callback('Unknown stream'); // eslint-disable-line callback-return
+ }
+};
+
+FormData.prototype._multiPartHeader = function (field, value, options) {
+ /*
+ * custom header specified (as string)?
+ * it becomes responsible for boundary
+ * (e.g. to handle extra CRLFs on .NET servers)
+ */
+ if (typeof options.header === 'string') {
+ return options.header;
+ }
+
+ var contentDisposition = this._getContentDisposition(value, options);
+ var contentType = this._getContentType(value, options);
+
+ var contents = '';
+ var headers = {
+ // add custom disposition as third element or keep it two elements if not
+ 'Content-Disposition': ['form-data', 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
+ // if no content type. allow it to be empty array
+ 'Content-Type': [].concat(contentType || [])
+ };
+
+ // allow custom headers.
+ if (typeof options.header === 'object') {
+ populate(headers, options.header);
+ }
+
+ var header;
+ for (var prop in headers) { // eslint-disable-line no-restricted-syntax
+ if (hasOwn(headers, prop)) {
+ header = headers[prop];
+
+ // skip nullish headers.
+ if (header == null) {
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ }
+
+ // convert all headers to arrays.
+ if (!Array.isArray(header)) {
+ header = [header];
+ }
+
+ // add non-empty headers.
+ if (header.length) {
+ contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
+ }
+ }
+ }
+
+ return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
+};
+
+FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
+ var filename;
+
+ if (typeof options.filepath === 'string') {
+ // custom filepath for relative paths
+ filename = path.normalize(options.filepath).replace(/\\/g, '/');
+ } else if (options.filename || (value && (value.name || value.path))) {
+ /*
+ * custom filename take precedence
+ * formidable and the browser add a name property
+ * fs- and request- streams have path property
+ */
+ filename = path.basename(options.filename || (value && (value.name || value.path)));
+ } else if (value && value.readable && hasOwn(value, 'httpVersion')) {
+ // or try http response
+ filename = path.basename(value.client._httpMessage.path || '');
+ }
+
+ if (filename) {
+ return 'filename="' + escapeHeaderParam(filename) + '"';
+ }
+};
+
+FormData.prototype._getContentType = function (value, options) {
+ // use custom content-type above all
+ var contentType = options.contentType;
+
+ // or try `name` from formidable, browser
+ if (!contentType && value && value.name) {
+ contentType = mime.lookup(value.name);
+ }
+
+ // or try `path` from fs-, request- streams
+ if (!contentType && value && value.path) {
+ contentType = mime.lookup(value.path);
+ }
+
+ // or if it's http-reponse
+ if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
+ contentType = value.headers['content-type'];
+ }
+
+ // or guess it from the filepath or filename
+ if (!contentType && (options.filepath || options.filename)) {
+ contentType = mime.lookup(options.filepath || options.filename);
+ }
+
+ // fallback to the default content type if `value` is not simple value
+ if (!contentType && value && typeof value === 'object') {
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
+ }
+
+ return contentType;
+};
+
+FormData.prototype._multiPartFooter = function () {
+ return function (next) {
+ var footer = FormData.LINE_BREAK;
+
+ var lastPart = this._streams.length === 0;
+ if (lastPart) {
+ footer += this._lastBoundary();
+ }
+
+ next(footer);
+ }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function () {
+ return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
+};
+
+FormData.prototype.getHeaders = function (userHeaders) {
+ var header;
+ var formHeaders = {
+ 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+ };
+
+ for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
+ if (hasOwn(userHeaders, header)) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
+ }
+
+ return formHeaders;
+};
+
+FormData.prototype.setBoundary = function (boundary) {
+ if (typeof boundary !== 'string') {
+ throw new TypeError('FormData boundary must be a string');
+ }
+ this._boundary = boundary;
+};
+
+FormData.prototype.getBoundary = function () {
+ if (!this._boundary) {
+ this._generateBoundary();
+ }
+
+ return this._boundary;
+};
+
+FormData.prototype.getBuffer = function () {
+ var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
+ var boundary = this.getBoundary();
+
+ // Create the form content. Add Line breaks to the end of data.
+ for (var i = 0, len = this._streams.length; i < len; i++) {
+ if (typeof this._streams[i] !== 'function') {
+ // Add content to the buffer.
+ if (Buffer.isBuffer(this._streams[i])) {
+ dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
+ } else {
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
+ }
+
+ // Add break after content.
+ if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
+ }
+ }
+ }
+
+ // Add the footer and return the Buffer object.
+ return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
+};
+
+FormData.prototype._generateBoundary = function () {
+ // This generates a 50 character boundary similar to those used by Firefox.
+
+ // They are optimized for boyer-moore parsing.
+ this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually and add it as knownLength option
+FormData.prototype.getLengthSync = function () {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ // https://github.com/form-data/form-data/issues/40
+ if (!this.hasKnownLength()) {
+ /*
+ * Some async length retrievers are present
+ * therefore synchronous length calculation is false.
+ * Please use getLength(callback) to get proper length
+ */
+ this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ }
+
+ return knownLength;
+};
+
+// Public API to check if length of added values is known
+// https://github.com/form-data/form-data/issues/196
+// https://github.com/form-data/form-data/issues/262
+FormData.prototype.hasKnownLength = function () {
+ var hasKnownLength = true;
+
+ if (this._valuesToMeasure.length) {
+ hasKnownLength = false;
+ }
+
+ return hasKnownLength;
+};
+
+FormData.prototype.getLength = function (cb) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ if (!this._valuesToMeasure.length) {
+ process.nextTick(cb.bind(this, null, knownLength));
+ return;
+ }
+
+ asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
+ if (err) {
+ cb(err);
+ return;
+ }
+
+ values.forEach(function (length) {
+ knownLength += length;
+ });
+
+ cb(null, knownLength);
+ });
+};
+
+FormData.prototype.submit = function (params, cb) {
+ var request;
+ var options;
+ var defaults = { method: 'post' };
+
+ // parse provided url if it's string or treat it as options object
+ if (typeof params === 'string') {
+ params = parseUrl(params); // eslint-disable-line no-param-reassign
+ /* eslint sort-keys: 0 */
+ options = populate({
+ port: params.port,
+ path: params.pathname,
+ host: params.hostname,
+ protocol: params.protocol
+ }, defaults);
+ } else { // use custom params
+ options = populate(params, defaults);
+ // if no port provided use default one
+ if (!options.port) {
+ options.port = options.protocol === 'https:' ? 443 : 80;
+ }
+ }
+
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
+ // https if specified, fallback to http in any other case
+ if (options.protocol === 'https:') {
+ request = https.request(options);
+ } else {
+ request = http.request(options);
+ }
+
+ // get content length and fire away
+ this.getLength(function (err, length) {
+ if (err && err !== 'Unknown stream') {
+ this._error(err);
+ return;
+ }
+
+ // add content length
+ if (length) {
+ request.setHeader('Content-Length', length);
+ }
+
+ this.pipe(request);
+ if (cb) {
+ var onResponse;
+
+ var callback = function (error, responce) {
+ request.removeListener('error', callback);
+ request.removeListener('response', onResponse);
+
+ return cb.call(this, error, responce);
+ };
+
+ onResponse = callback.bind(this, null);
+
+ request.on('error', callback);
+ request.on('response', onResponse);
+ }
+ }.bind(this));
+
+ return request;
+};
+
+FormData.prototype._error = function (err) {
+ if (!this.error) {
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
+ }
+};
+
+FormData.prototype.toString = function () {
+ return '[object FormData]';
+};
+setToStringTag(FormData.prototype, 'FormData');
+
+// Public API
+module.exports = FormData;
+
+
+/***/ }),
+
+/***/ 1835:
+/***/ ((module) => {
+
+
+
+// populates missing values
+module.exports = function (dst, src) {
+ Object.keys(src).forEach(function (prop) {
+ dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
+ });
+
+ return dst;
+};
+
+
+/***/ }),
+
+/***/ 9808:
+/***/ ((module) => {
+
+
+
+/* eslint no-invalid-this: 1 */
+
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var toStr = Object.prototype.toString;
+var max = Math.max;
+var funcType = '[object Function]';
+
+var concatty = function concatty(a, b) {
+ var arr = [];
+
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
+
+ return arr;
+};
+
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
+
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
+ }
+ }
+ return str;
+};
+
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slicy(arguments, 1);
+
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ concatty(args, arguments)
+ );
+ if (Object(result) === result) {
+ return result;
+ }
+ return this;
+ }
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
+
+ };
+
+ var boundLength = max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs[i] = '$' + i;
+ }
+
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
+
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
+
+ return bound;
+};
+
+
+/***/ }),
+
+/***/ 7564:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var implementation = __nccwpck_require__(9808);
+
+module.exports = Function.prototype.bind || implementation;
+
+
+/***/ }),
+
+/***/ 470:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var undefined;
+
+var $Object = __nccwpck_require__(5399);
+
+var $Error = __nccwpck_require__(1620);
+var $EvalError = __nccwpck_require__(3056);
+var $RangeError = __nccwpck_require__(4585);
+var $ReferenceError = __nccwpck_require__(6905);
+var $SyntaxError = __nccwpck_require__(105);
+var $TypeError = __nccwpck_require__(3314);
+var $URIError = __nccwpck_require__(2578);
+
+var abs = __nccwpck_require__(5641);
+var floor = __nccwpck_require__(6171);
+var max = __nccwpck_require__(7147);
+var min = __nccwpck_require__(1017);
+var pow = __nccwpck_require__(6947);
+var round = __nccwpck_require__(2621);
+var sign = __nccwpck_require__(156);
+
+var $Function = Function;
+
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
+
+var $gOPD = __nccwpck_require__(3170);
+var $defineProperty = __nccwpck_require__(9094);
+
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
+
+var hasSymbols = __nccwpck_require__(3336)();
+
+var getProto = __nccwpck_require__(1967);
+var $ObjectGPO = __nccwpck_require__(1311);
+var $ReflectGPO = __nccwpck_require__(8681);
+
+var $apply = __nccwpck_require__(3945);
+var $call = __nccwpck_require__(8093);
+
+var needsEval = {};
+
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ __proto__: null,
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': $Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': $EvalError,
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': $Object,
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': $URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
+
+ '%Function.prototype.call%': $call,
+ '%Function.prototype.apply%': $apply,
+ '%Object.defineProperty%': $defineProperty,
+ '%Object.getPrototypeOf%': $ObjectGPO,
+ '%Math.abs%': abs,
+ '%Math.floor%': floor,
+ '%Math.max%': max,
+ '%Math.min%': min,
+ '%Math.pow%': pow,
+ '%Math.round%': round,
+ '%Math.sign%': sign,
+ '%Reflect.getPrototypeOf%': $ReflectGPO
+};
+
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
+}
+
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen && getProto) {
+ value = getProto(gen.prototype);
+ }
+ }
+
+ INTRINSICS[name] = value;
+
+ return value;
+};
+
+var LEGACY_ALIASES = {
+ __proto__: null,
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
+
+var bind = __nccwpck_require__(7564);
+var hasOwn = __nccwpck_require__(4076);
+var $concat = bind.call($call, Array.prototype.concat);
+var $spliceApply = bind.call($apply, Array.prototype.splice);
+var $replace = bind.call($call, String.prototype.replace);
+var $strSlice = bind.call($call, String.prototype.slice);
+var $exec = bind.call($call, RegExp.prototype.exec);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
+
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
+
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
+
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
+
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
+
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
+
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
+
+
+/***/ }),
+
+/***/ 1311:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var $Object = __nccwpck_require__(5399);
+
+/** @type {import('./Object.getPrototypeOf')} */
+module.exports = $Object.getPrototypeOf || null;
+
+
+/***/ }),
+
+/***/ 8681:
+/***/ ((module) => {
+
+
+
+/** @type {import('./Reflect.getPrototypeOf')} */
+module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
+
+
+/***/ }),
+
+/***/ 1967:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var reflectGetProto = __nccwpck_require__(8681);
+var originalGetProto = __nccwpck_require__(1311);
+
+var getDunderProto = __nccwpck_require__(6669);
+
+/** @type {import('.')} */
+module.exports = reflectGetProto
+ ? function getProto(O) {
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return reflectGetProto(O);
+ }
+ : originalGetProto
+ ? function getProto(O) {
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
+ throw new TypeError('getProto: not an object');
+ }
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return originalGetProto(O);
+ }
+ : getDunderProto
+ ? function getProto(O) {
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return getDunderProto(O);
+ }
+ : null;
+
+
+/***/ }),
+
+/***/ 1174:
+/***/ ((module) => {
+
+
+
+/** @type {import('./gOPD')} */
+module.exports = Object.getOwnPropertyDescriptor;
+
+
+/***/ }),
+
+/***/ 3170:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+/** @type {import('.')} */
+var $gOPD = __nccwpck_require__(1174);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
+}
+
+module.exports = $gOPD;
+
+
+/***/ }),
+
+/***/ 3813:
+/***/ ((module) => {
+
+
+
+module.exports = (flag, argv = process.argv) => {
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
+ const position = argv.indexOf(prefix + flag);
+ const terminatorPosition = argv.indexOf('--');
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
+};
+
+
+/***/ }),
+
+/***/ 3336:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = __nccwpck_require__(1114);
+
+/** @type {import('.')} */
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
+
+ return hasSymbolSham();
+};
+
+
+/***/ }),
+
+/***/ 1114:
+/***/ ((module) => {
+
+
+
+/** @type {import('./shams')} */
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
+
+ /** @type {{ [k in symbol]?: unknown }} */
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
+
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
+
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
+
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
+
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
+
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
+
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
+
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
+
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ // eslint-disable-next-line no-extra-parens
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
+
+ return true;
+};
+
+
+/***/ }),
+
+/***/ 5479:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var hasSymbols = __nccwpck_require__(1114);
+
+/** @type {import('.')} */
+module.exports = function hasToStringTagShams() {
+ return hasSymbols() && !!Symbol.toStringTag;
+};
+
+
+/***/ }),
+
+/***/ 4076:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = __nccwpck_require__(7564);
+
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
+
+
+/***/ }),
+
+/***/ 6904:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const net_1 = __importDefault(__nccwpck_require__(9278));
+const tls_1 = __importDefault(__nccwpck_require__(4756));
+const url_1 = __importDefault(__nccwpck_require__(7016));
+const assert_1 = __importDefault(__nccwpck_require__(2613));
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const agent_base_1 = __nccwpck_require__(8207);
+const parse_proxy_response_1 = __importDefault(__nccwpck_require__(7943));
+const debug = debug_1.default('https-proxy-agent:agent');
+/**
+ * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
+ * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
+ *
+ * Outgoing HTTP requests are first tunneled through the proxy server using the
+ * `CONNECT` HTTP request method to establish a connection to the proxy server,
+ * and then the proxy server connects to the destination target and issues the
+ * HTTP request from the proxy server.
+ *
+ * `https:` requests have their socket connection upgraded to TLS once
+ * the connection to the proxy server has been established.
+ *
+ * @api public
+ */
+class HttpsProxyAgent extends agent_base_1.Agent {
+ constructor(_opts) {
+ let opts;
+ if (typeof _opts === 'string') {
+ opts = url_1.default.parse(_opts);
+ }
+ else {
+ opts = _opts;
+ }
+ if (!opts) {
+ throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
+ }
+ debug('creating new HttpsProxyAgent instance: %o', opts);
+ super(opts);
+ const proxy = Object.assign({}, opts);
+ // If `true`, then connect to the proxy server over TLS.
+ // Defaults to `false`.
+ this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
+ // Prefer `hostname` over `host`, and set the `port` if needed.
+ proxy.host = proxy.hostname || proxy.host;
+ if (typeof proxy.port === 'string') {
+ proxy.port = parseInt(proxy.port, 10);
+ }
+ if (!proxy.port && proxy.host) {
+ proxy.port = this.secureProxy ? 443 : 80;
+ }
+ // ALPN is supported by Node.js >= v5.
+ // attempt to negotiate http/1.1 for proxy servers that support http/2
+ if (this.secureProxy && !('ALPNProtocols' in proxy)) {
+ proxy.ALPNProtocols = ['http 1.1'];
+ }
+ if (proxy.host && proxy.path) {
+ // If both a `host` and `path` are specified then it's most likely
+ // the result of a `url.parse()` call... we need to remove the
+ // `path` portion so that `net.connect()` doesn't attempt to open
+ // that as a Unix socket file.
+ delete proxy.path;
+ delete proxy.pathname;
+ }
+ this.proxy = proxy;
+ }
+ /**
+ * Called when the node-core HTTP client library is creating a
+ * new HTTP request.
+ *
+ * @api protected
+ */
+ callback(req, opts) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { proxy, secureProxy } = this;
+ // Create a socket connection to the proxy server.
+ let socket;
+ if (secureProxy) {
+ debug('Creating `tls.Socket`: %o', proxy);
+ socket = tls_1.default.connect(proxy);
+ }
+ else {
+ debug('Creating `net.Socket`: %o', proxy);
+ socket = net_1.default.connect(proxy);
+ }
+ const headers = Object.assign({}, proxy.headers);
+ const hostname = `${opts.host}:${opts.port}`;
+ let payload = `CONNECT ${hostname} HTTP/1.1\r\n`;
+ // Inject the `Proxy-Authorization` header if necessary.
+ if (proxy.auth) {
+ headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;
+ }
+ // The `Host` header should only include the port
+ // number when it is not the default port.
+ let { host, port, secureEndpoint } = opts;
+ if (!isDefaultPort(port, secureEndpoint)) {
+ host += `:${port}`;
+ }
+ headers.Host = host;
+ headers.Connection = 'close';
+ for (const name of Object.keys(headers)) {
+ payload += `${name}: ${headers[name]}\r\n`;
+ }
+ const proxyResponsePromise = parse_proxy_response_1.default(socket);
+ socket.write(`${payload}\r\n`);
+ const { statusCode, buffered } = yield proxyResponsePromise;
+ if (statusCode === 200) {
+ req.once('socket', resume);
+ if (opts.secureEndpoint) {
+ // The proxy is connecting to a TLS server, so upgrade
+ // this socket connection to a TLS connection.
+ debug('Upgrading socket connection to TLS');
+ const servername = opts.servername || opts.host;
+ return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
+ servername }));
+ }
+ return socket;
+ }
+ // Some other status code that's not 200... need to re-play the HTTP
+ // header "data" events onto the socket once the HTTP machinery is
+ // attached so that the node core `http` can parse and handle the
+ // error status code.
+ // Close the original socket, and a new "fake" socket is returned
+ // instead, so that the proxy doesn't get the HTTP request
+ // written to it (which may contain `Authorization` headers or other
+ // sensitive data).
+ //
+ // See: https://hackerone.com/reports/541502
+ socket.destroy();
+ const fakeSocket = new net_1.default.Socket({ writable: false });
+ fakeSocket.readable = true;
+ // Need to wait for the "socket" event to re-play the "data" events.
+ req.once('socket', (s) => {
+ debug('replaying proxy buffer for failed request');
+ assert_1.default(s.listenerCount('data') > 0);
+ // Replay the "buffered" Buffer onto the fake `socket`, since at
+ // this point the HTTP module machinery has been hooked up for
+ // the user.
+ s.push(buffered);
+ s.push(null);
+ });
+ return fakeSocket;
+ });
+ }
+}
+exports["default"] = HttpsProxyAgent;
+function resume(socket) {
+ socket.resume();
+}
+function isDefaultPort(port, secure) {
+ return Boolean((!secure && port === 80) || (secure && port === 443));
+}
+function isHTTPS(protocol) {
+ return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
+}
+function omit(obj, ...keys) {
+ const ret = {};
+ let key;
+ for (key in obj) {
+ if (!keys.includes(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+}
+//# sourceMappingURL=agent.js.map
+
+/***/ }),
+
+/***/ 3669:
+/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+const agent_1 = __importDefault(__nccwpck_require__(6904));
+function createHttpsProxyAgent(opts) {
+ return new agent_1.default(opts);
+}
+(function (createHttpsProxyAgent) {
+ createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
+ createHttpsProxyAgent.prototype = agent_1.default.prototype;
+})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
+module.exports = createHttpsProxyAgent;
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 7943:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const debug = debug_1.default('https-proxy-agent:parse-proxy-response');
+function parseProxyResponse(socket) {
+ return new Promise((resolve, reject) => {
+ // we need to buffer any HTTP traffic that happens with the proxy before we get
+ // the CONNECT response, so that if the response is anything other than an "200"
+ // response code, then we can re-play the "data" events on the socket once the
+ // HTTP parser is hooked up...
+ let buffersLength = 0;
+ const buffers = [];
+ function read() {
+ const b = socket.read();
+ if (b)
+ ondata(b);
+ else
+ socket.once('readable', read);
+ }
+ function cleanup() {
+ socket.removeListener('end', onend);
+ socket.removeListener('error', onerror);
+ socket.removeListener('close', onclose);
+ socket.removeListener('readable', read);
+ }
+ function onclose(err) {
+ debug('onclose had error %o', err);
+ }
+ function onend() {
+ debug('onend');
+ }
+ function onerror(err) {
+ cleanup();
+ debug('onerror %o', err);
+ reject(err);
+ }
+ function ondata(b) {
+ buffers.push(b);
+ buffersLength += b.length;
+ const buffered = Buffer.concat(buffers, buffersLength);
+ const endOfHeaders = buffered.indexOf('\r\n\r\n');
+ if (endOfHeaders === -1) {
+ // keep buffering
+ debug('have not received end of HTTP headers yet...');
+ read();
+ return;
+ }
+ const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
+ const statusCode = +firstLine.split(' ')[1];
+ debug('got proxy server response: %o', firstLine);
+ resolve({
+ statusCode,
+ buffered
+ });
+ }
+ socket.on('error', onerror);
+ socket.on('close', onclose);
+ socket.on('end', onend);
+ read();
+ });
+}
+exports["default"] = parseProxyResponse;
+//# sourceMappingURL=parse-proxy-response.js.map
+
+/***/ }),
+
+/***/ 201:
+/***/ ((module) => {
+
+// https://github.com/electron/electron/issues/2288
+function isElectron() {
+ // Renderer process
+ if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
+ return true;
+ }
+
+ // Main process
+ if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
+ return true;
+ }
+
+ // Detect the user agent when the `nodeIntegration` option is set to false
+ if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
+ return true;
+ }
+
+ return false;
+}
+
+module.exports = isElectron;
+
+
+/***/ }),
+
+/***/ 6543:
+/***/ ((module) => {
+
+
+
+const isStream = stream =>
+ stream !== null &&
+ typeof stream === 'object' &&
+ typeof stream.pipe === 'function';
+
+isStream.writable = stream =>
+ isStream(stream) &&
+ stream.writable !== false &&
+ typeof stream._write === 'function' &&
+ typeof stream._writableState === 'object';
+
+isStream.readable = stream =>
+ isStream(stream) &&
+ stream.readable !== false &&
+ typeof stream._read === 'function' &&
+ typeof stream._readableState === 'object';
+
+isStream.duplex = stream =>
+ isStream.writable(stream) &&
+ isStream.readable(stream);
+
+isStream.transform = stream =>
+ isStream.duplex(stream) &&
+ typeof stream._transform === 'function';
+
+module.exports = isStream;
+
+
+/***/ }),
+
+/***/ 5641:
+/***/ ((module) => {
+
+
+
+/** @type {import('./abs')} */
+module.exports = Math.abs;
+
+
+/***/ }),
+
+/***/ 6171:
+/***/ ((module) => {
+
+
+
+/** @type {import('./floor')} */
+module.exports = Math.floor;
+
+
+/***/ }),
+
+/***/ 7044:
+/***/ ((module) => {
+
+
+
+/** @type {import('./isNaN')} */
+module.exports = Number.isNaN || function isNaN(a) {
+ return a !== a;
+};
+
+
+/***/ }),
+
+/***/ 7147:
+/***/ ((module) => {
+
+
+
+/** @type {import('./max')} */
+module.exports = Math.max;
+
+
+/***/ }),
+
+/***/ 1017:
+/***/ ((module) => {
+
+
+
+/** @type {import('./min')} */
+module.exports = Math.min;
+
+
+/***/ }),
+
+/***/ 6947:
+/***/ ((module) => {
+
+
+
+/** @type {import('./pow')} */
+module.exports = Math.pow;
+
+
+/***/ }),
+
+/***/ 2621:
+/***/ ((module) => {
+
+
+
+/** @type {import('./round')} */
+module.exports = Math.round;
+
+
+/***/ }),
+
+/***/ 156:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var $isNaN = __nccwpck_require__(7044);
+
+/** @type {import('./sign')} */
+module.exports = function sign(number) {
+ if ($isNaN(number) || number === 0) {
+ return number;
+ }
+ return number < 0 ? -1 : +1;
+};
+
+
+/***/ }),
+
+/***/ 9829:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = __nccwpck_require__(1813)
+
+
+/***/ }),
+
+/***/ 4096:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = __nccwpck_require__(9829)
+var extname = (__nccwpck_require__(6928).extname)
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
+var TEXT_TYPE_REGEXP = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
+
+ if (mime && mime.charset) {
+ return mime.charset
+ }
+
+ // default text/* to utf-8
+ if (match && TEXT_TYPE_REGEXP.test(match[1])) {
+ return 'UTF-8'
+ }
+
+ return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType (str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
+ }
+
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
+
+ if (!mime) {
+ return false
+ }
+
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
+ }
+
+ return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
+ }
+
+ return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup (path) {
+ if (!path || typeof path !== 'string') {
+ return false
+ }
+
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
+
+ if (!extension) {
+ return false
+ }
+
+ return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps (extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
+
+ Object.keys(db).forEach(function forEachMimeType (type) {
+ var mime = db[type]
+ var exts = mime.extensions
+
+ if (!exts || !exts.length) {
+ return
+ }
+
+ // mime -> extensions
+ extensions[type] = exts
+
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
+
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
+
+ if (types[extension] !== 'application/octet-stream' &&
+ (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
+ // skip the remapping
+ continue
+ }
+ }
+
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
+
+
+/***/ }),
+
+/***/ 744:
+/***/ ((module) => {
+
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function (val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isFinite(val)) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'weeks':
+ case 'week':
+ case 'w':
+ return n * w;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (msAbs >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (msAbs >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (msAbs >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return plural(ms, msAbs, d, 'day');
+ }
+ if (msAbs >= h) {
+ return plural(ms, msAbs, h, 'hour');
+ }
+ if (msAbs >= m) {
+ return plural(ms, msAbs, m, 'minute');
+ }
+ if (msAbs >= s) {
+ return plural(ms, msAbs, s, 'second');
+ }
+ return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+ var isPlural = msAbs >= n * 1.5;
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
+
+
+/***/ }),
+
+/***/ 2766:
+/***/ ((module) => {
+
+
+module.exports = (promise, onFinally) => {
+ onFinally = onFinally || (() => {});
+
+ return promise.then(
+ val => new Promise(resolve => {
+ resolve(onFinally());
+ }).then(() => val),
+ err => new Promise(resolve => {
+ resolve(onFinally());
+ }).then(() => {
+ throw err;
+ })
+ );
+};
+
+
+/***/ }),
+
+/***/ 6459:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const EventEmitter = __nccwpck_require__(301);
+const p_timeout_1 = __nccwpck_require__(4802);
+const priority_queue_1 = __nccwpck_require__(5905);
+// eslint-disable-next-line @typescript-eslint/no-empty-function
+const empty = () => { };
+const timeoutError = new p_timeout_1.TimeoutError();
+/**
+Promise queue with concurrency control.
+*/
+class PQueue extends EventEmitter {
+ constructor(options) {
+ var _a, _b, _c, _d;
+ super();
+ this._intervalCount = 0;
+ this._intervalEnd = 0;
+ this._pendingCount = 0;
+ this._resolveEmpty = empty;
+ this._resolveIdle = empty;
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+ options = Object.assign({ carryoverConcurrencyCount: false, intervalCap: Infinity, interval: 0, concurrency: Infinity, autoStart: true, queueClass: priority_queue_1.default }, options);
+ if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`);
+ }
+ if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`);
+ }
+ this._carryoverConcurrencyCount = options.carryoverConcurrencyCount;
+ this._isIntervalIgnored = options.intervalCap === Infinity || options.interval === 0;
+ this._intervalCap = options.intervalCap;
+ this._interval = options.interval;
+ this._queue = new options.queueClass();
+ this._queueClass = options.queueClass;
+ this.concurrency = options.concurrency;
+ this._timeout = options.timeout;
+ this._throwOnTimeout = options.throwOnTimeout === true;
+ this._isPaused = options.autoStart === false;
+ }
+ get _doesIntervalAllowAnother() {
+ return this._isIntervalIgnored || this._intervalCount < this._intervalCap;
+ }
+ get _doesConcurrentAllowAnother() {
+ return this._pendingCount < this._concurrency;
+ }
+ _next() {
+ this._pendingCount--;
+ this._tryToStartAnother();
+ this.emit('next');
+ }
+ _resolvePromises() {
+ this._resolveEmpty();
+ this._resolveEmpty = empty;
+ if (this._pendingCount === 0) {
+ this._resolveIdle();
+ this._resolveIdle = empty;
+ this.emit('idle');
+ }
+ }
+ _onResumeInterval() {
+ this._onInterval();
+ this._initializeIntervalIfNeeded();
+ this._timeoutId = undefined;
+ }
+ _isIntervalPaused() {
+ const now = Date.now();
+ if (this._intervalId === undefined) {
+ const delay = this._intervalEnd - now;
+ if (delay < 0) {
+ // Act as the interval was done
+ // We don't need to resume it here because it will be resumed on line 160
+ this._intervalCount = (this._carryoverConcurrencyCount) ? this._pendingCount : 0;
+ }
+ else {
+ // Act as the interval is pending
+ if (this._timeoutId === undefined) {
+ this._timeoutId = setTimeout(() => {
+ this._onResumeInterval();
+ }, delay);
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ _tryToStartAnother() {
+ if (this._queue.size === 0) {
+ // We can clear the interval ("pause")
+ // Because we can redo it later ("resume")
+ if (this._intervalId) {
+ clearInterval(this._intervalId);
+ }
+ this._intervalId = undefined;
+ this._resolvePromises();
+ return false;
+ }
+ if (!this._isPaused) {
+ const canInitializeInterval = !this._isIntervalPaused();
+ if (this._doesIntervalAllowAnother && this._doesConcurrentAllowAnother) {
+ const job = this._queue.dequeue();
+ if (!job) {
+ return false;
+ }
+ this.emit('active');
+ job();
+ if (canInitializeInterval) {
+ this._initializeIntervalIfNeeded();
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ _initializeIntervalIfNeeded() {
+ if (this._isIntervalIgnored || this._intervalId !== undefined) {
+ return;
+ }
+ this._intervalId = setInterval(() => {
+ this._onInterval();
+ }, this._interval);
+ this._intervalEnd = Date.now() + this._interval;
+ }
+ _onInterval() {
+ if (this._intervalCount === 0 && this._pendingCount === 0 && this._intervalId) {
+ clearInterval(this._intervalId);
+ this._intervalId = undefined;
+ }
+ this._intervalCount = this._carryoverConcurrencyCount ? this._pendingCount : 0;
+ this._processQueue();
+ }
+ /**
+ Executes all queued functions until it reaches the limit.
+ */
+ _processQueue() {
+ // eslint-disable-next-line no-empty
+ while (this._tryToStartAnother()) { }
+ }
+ get concurrency() {
+ return this._concurrency;
+ }
+ set concurrency(newConcurrency) {
+ if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {
+ throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
+ }
+ this._concurrency = newConcurrency;
+ this._processQueue();
+ }
+ /**
+ Adds a sync or async task to the queue. Always returns a promise.
+ */
+ async add(fn, options = {}) {
+ return new Promise((resolve, reject) => {
+ const run = async () => {
+ this._pendingCount++;
+ this._intervalCount++;
+ try {
+ const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {
+ if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {
+ reject(timeoutError);
+ }
+ return undefined;
+ });
+ resolve(await operation);
+ }
+ catch (error) {
+ reject(error);
+ }
+ this._next();
+ };
+ this._queue.enqueue(run, options);
+ this._tryToStartAnother();
+ this.emit('add');
+ });
+ }
+ /**
+ Same as `.add()`, but accepts an array of sync or async functions.
+
+ @returns A promise that resolves when all functions are resolved.
+ */
+ async addAll(functions, options) {
+ return Promise.all(functions.map(async (function_) => this.add(function_, options)));
+ }
+ /**
+ Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
+ */
+ start() {
+ if (!this._isPaused) {
+ return this;
+ }
+ this._isPaused = false;
+ this._processQueue();
+ return this;
+ }
+ /**
+ Put queue execution on hold.
+ */
+ pause() {
+ this._isPaused = true;
+ }
+ /**
+ Clear the queue.
+ */
+ clear() {
+ this._queue = new this._queueClass();
+ }
+ /**
+ Can be called multiple times. Useful if you for example add additional items at a later time.
+
+ @returns A promise that settles when the queue becomes empty.
+ */
+ async onEmpty() {
+ // Instantly resolve if the queue is empty
+ if (this._queue.size === 0) {
+ return;
+ }
+ return new Promise(resolve => {
+ const existingResolve = this._resolveEmpty;
+ this._resolveEmpty = () => {
+ existingResolve();
+ resolve();
+ };
+ });
+ }
+ /**
+ The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
+
+ @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
+ */
+ async onIdle() {
+ // Instantly resolve if none pending and if nothing else is queued
+ if (this._pendingCount === 0 && this._queue.size === 0) {
+ return;
+ }
+ return new Promise(resolve => {
+ const existingResolve = this._resolveIdle;
+ this._resolveIdle = () => {
+ existingResolve();
+ resolve();
+ };
+ });
+ }
+ /**
+ Size of the queue.
+ */
+ get size() {
+ return this._queue.size;
+ }
+ /**
+ Size of the queue, filtered by the given options.
+
+ For example, this can be used to find the number of items remaining in the queue with a specific priority level.
+ */
+ sizeBy(options) {
+ // eslint-disable-next-line unicorn/no-fn-reference-in-iterator
+ return this._queue.filter(options).length;
+ }
+ /**
+ Number of pending promises.
+ */
+ get pending() {
+ return this._pendingCount;
+ }
+ /**
+ Whether the queue is currently paused.
+ */
+ get isPaused() {
+ return this._isPaused;
+ }
+ get timeout() {
+ return this._timeout;
+ }
+ /**
+ Set the timeout for future operations.
+ */
+ set timeout(milliseconds) {
+ this._timeout = milliseconds;
+ }
+}
+exports["default"] = PQueue;
+
+
+/***/ }),
+
+/***/ 9015:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
+// Used to compute insertion index to keep queue sorted after insertion
+function lowerBound(array, value, comparator) {
+ let first = 0;
+ let count = array.length;
+ while (count > 0) {
+ const step = (count / 2) | 0;
+ let it = first + step;
+ if (comparator(array[it], value) <= 0) {
+ first = ++it;
+ count -= step + 1;
+ }
+ else {
+ count = step;
+ }
+ }
+ return first;
+}
+exports["default"] = lowerBound;
+
+
+/***/ }),
+
+/***/ 5905:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const lower_bound_1 = __nccwpck_require__(9015);
+class PriorityQueue {
+ constructor() {
+ this._queue = [];
+ }
+ enqueue(run, options) {
+ options = Object.assign({ priority: 0 }, options);
+ const element = {
+ priority: options.priority,
+ run
+ };
+ if (this.size && this._queue[this.size - 1].priority >= options.priority) {
+ this._queue.push(element);
+ return;
+ }
+ const index = lower_bound_1.default(this._queue, element, (a, b) => b.priority - a.priority);
+ this._queue.splice(index, 0, element);
+ }
+ dequeue() {
+ const item = this._queue.shift();
+ return item === null || item === void 0 ? void 0 : item.run;
+ }
+ filter(options) {
+ return this._queue.filter((element) => element.priority === options.priority).map((element) => element.run);
+ }
+ get size() {
+ return this._queue.length;
+ }
+}
+exports["default"] = PriorityQueue;
+
+
+/***/ }),
+
+/***/ 301:
+/***/ ((module) => {
+
+
+
+var has = Object.prototype.hasOwnProperty
+ , prefix = '~';
+
+/**
+ * Constructor to create a storage for our `EE` objects.
+ * An `Events` instance is a plain object whose properties are event names.
+ *
+ * @constructor
+ * @private
+ */
+function Events() {}
+
+//
+// We try to not inherit from `Object.prototype`. In some engines creating an
+// instance in this way is faster than calling `Object.create(null)` directly.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// character to make sure that the built-in object properties are not
+// overridden or used as an attack vector.
+//
+if (Object.create) {
+ Events.prototype = Object.create(null);
+
+ //
+ // This hack is needed because the `__proto__` property is still inherited in
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
+ //
+ if (!new Events().__proto__) prefix = false;
+}
+
+/**
+ * Representation of a single event listener.
+ *
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
+ * @constructor
+ * @private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} once Specify if the listener is a one-time listener.
+ * @returns {EventEmitter}
+ * @private
+ */
+function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== 'function') {
+ throw new TypeError('The listener must be a function');
+ }
+
+ var listener = new EE(fn, context || emitter, once)
+ , evt = prefix ? prefix + event : event;
+
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
+ else emitter._events[evt] = [emitter._events[evt], listener];
+
+ return emitter;
+}
+
+/**
+ * Clear event by name.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} evt The Event name.
+ * @private
+ */
+function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
+ else delete emitter._events[evt];
+}
+
+/**
+ * Minimal `EventEmitter` interface that is molded against the Node.js
+ * `EventEmitter` interface.
+ *
+ * @constructor
+ * @public
+ */
+function EventEmitter() {
+ this._events = new Events();
+ this._eventsCount = 0;
+}
+
+/**
+ * Return an array listing the events for which the emitter has registered
+ * listeners.
+ *
+ * @returns {Array}
+ * @public
+ */
+EventEmitter.prototype.eventNames = function eventNames() {
+ var names = []
+ , events
+ , name;
+
+ if (this._eventsCount === 0) return names;
+
+ for (name in (events = this._events)) {
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ }
+
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+
+ return names;
+};
+
+/**
+ * Return the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Array} The registered listeners.
+ * @public
+ */
+EventEmitter.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event
+ , handlers = this._events[evt];
+
+ if (!handlers) return [];
+ if (handlers.fn) return [handlers.fn];
+
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Return the number of listeners listening to a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Number} The number of listeners.
+ * @public
+ */
+EventEmitter.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event
+ , listeners = this._events[evt];
+
+ if (!listeners) return 0;
+ if (listeners.fn) return 1;
+ return listeners.length;
+};
+
+/**
+ * Calls each of the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
+ * @public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if (listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+};
+
+/**
+ * Add a one-time listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+};
+
+/**
+ * Remove the listeners of a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn Only remove the listeners that match this function.
+ * @param {*} context Only remove the listeners that have this context.
+ * @param {Boolean} once Only remove one-time listeners.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+
+ var listeners = this._events[evt];
+
+ if (listeners.fn) {
+ if (
+ listeners.fn === fn &&
+ (!once || listeners.once) &&
+ (!context || listeners.context === context)
+ ) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn ||
+ (once && !listeners[i].once) ||
+ (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
+ else clearEvent(this, evt);
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners, or those of the specified event.
+ *
+ * @param {(String|Symbol)} [event] The event name.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt]) clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Allow `EventEmitter` to be imported as module namespace.
+//
+EventEmitter.EventEmitter = EventEmitter;
+
+//
+// Expose the module.
+//
+if (true) {
+ module.exports = EventEmitter;
+}
+
+
+/***/ }),
+
+/***/ 2103:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+const retry = __nccwpck_require__(5546);
+
+const networkErrorMsgs = [
+ 'Failed to fetch', // Chrome
+ 'NetworkError when attempting to fetch resource.', // Firefox
+ 'The Internet connection appears to be offline.', // Safari
+ 'Network request failed' // `cross-fetch`
+];
+
+class AbortError extends Error {
+ constructor(message) {
+ super();
+
+ if (message instanceof Error) {
+ this.originalError = message;
+ ({message} = message);
+ } else {
+ this.originalError = new Error(message);
+ this.originalError.stack = this.stack;
+ }
+
+ this.name = 'AbortError';
+ this.message = message;
+ }
+}
+
+const decorateErrorWithCounts = (error, attemptNumber, options) => {
+ // Minus 1 from attemptNumber because the first attempt does not count as a retry
+ const retriesLeft = options.retries - (attemptNumber - 1);
+
+ error.attemptNumber = attemptNumber;
+ error.retriesLeft = retriesLeft;
+ return error;
+};
+
+const isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);
+
+const pRetry = (input, options) => new Promise((resolve, reject) => {
+ options = {
+ onFailedAttempt: () => {},
+ retries: 10,
+ ...options
+ };
+
+ const operation = retry.operation(options);
+
+ operation.attempt(async attemptNumber => {
+ try {
+ resolve(await input(attemptNumber));
+ } catch (error) {
+ if (!(error instanceof Error)) {
+ reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
+ return;
+ }
+
+ if (error instanceof AbortError) {
+ operation.stop();
+ reject(error.originalError);
+ } else if (error instanceof TypeError && !isNetworkError(error.message)) {
+ operation.stop();
+ reject(error);
+ } else {
+ decorateErrorWithCounts(error, attemptNumber, options);
+
+ try {
+ await options.onFailedAttempt(error);
+ } catch (error) {
+ reject(error);
+ return;
+ }
+
+ if (!operation.retry(error)) {
+ reject(operation.mainError());
+ }
+ }
+ }
+ });
+});
+
+module.exports = pRetry;
+// TODO: remove this in the next major version
+module.exports["default"] = pRetry;
+
+module.exports.AbortError = AbortError;
+
+
+/***/ }),
+
+/***/ 4802:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const pFinally = __nccwpck_require__(2766);
+
+class TimeoutError extends Error {
+ constructor(message) {
+ super(message);
+ this.name = 'TimeoutError';
+ }
+}
+
+const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => {
+ if (typeof milliseconds !== 'number' || milliseconds < 0) {
+ throw new TypeError('Expected `milliseconds` to be a positive number');
+ }
+
+ if (milliseconds === Infinity) {
+ resolve(promise);
+ return;
+ }
+
+ const timer = setTimeout(() => {
+ if (typeof fallback === 'function') {
+ try {
+ resolve(fallback());
+ } catch (error) {
+ reject(error);
+ }
+
+ return;
+ }
+
+ const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
+ const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
+
+ if (typeof promise.cancel === 'function') {
+ promise.cancel();
+ }
+
+ reject(timeoutError);
+ }, milliseconds);
+
+ // TODO: Use native `finally` keyword when targeting Node.js 10
+ pFinally(
+ // eslint-disable-next-line promise/prefer-await-to-then
+ promise.then(resolve, reject),
+ () => {
+ clearTimeout(timer);
+ }
+ );
+});
+
+module.exports = pTimeout;
+// TODO: Remove this for the next major release
+module.exports["default"] = pTimeout;
+
+module.exports.TimeoutError = TimeoutError;
+
+
+/***/ }),
+
+/***/ 5546:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+module.exports = __nccwpck_require__(7084);
+
+/***/ }),
+
+/***/ 7084:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+var RetryOperation = __nccwpck_require__(9538);
+
+exports.operation = function(options) {
+ var timeouts = exports.timeouts(options);
+ return new RetryOperation(timeouts, {
+ forever: options && (options.forever || options.retries === Infinity),
+ unref: options && options.unref,
+ maxRetryTime: options && options.maxRetryTime
+ });
+};
+
+exports.timeouts = function(options) {
+ if (options instanceof Array) {
+ return [].concat(options);
+ }
+
+ var opts = {
+ retries: 10,
+ factor: 2,
+ minTimeout: 1 * 1000,
+ maxTimeout: Infinity,
+ randomize: false
+ };
+ for (var key in options) {
+ opts[key] = options[key];
+ }
+
+ if (opts.minTimeout > opts.maxTimeout) {
+ throw new Error('minTimeout is greater than maxTimeout');
+ }
+
+ var timeouts = [];
+ for (var i = 0; i < opts.retries; i++) {
+ timeouts.push(this.createTimeout(i, opts));
+ }
+
+ if (options && options.forever && !timeouts.length) {
+ timeouts.push(this.createTimeout(i, opts));
+ }
+
+ // sort the array numerically ascending
+ timeouts.sort(function(a,b) {
+ return a - b;
+ });
+
+ return timeouts;
+};
+
+exports.createTimeout = function(attempt, opts) {
+ var random = (opts.randomize)
+ ? (Math.random() + 1)
+ : 1;
+
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
+ timeout = Math.min(timeout, opts.maxTimeout);
+
+ return timeout;
+};
+
+exports.wrap = function(obj, options, methods) {
+ if (options instanceof Array) {
+ methods = options;
+ options = null;
+ }
+
+ if (!methods) {
+ methods = [];
+ for (var key in obj) {
+ if (typeof obj[key] === 'function') {
+ methods.push(key);
+ }
+ }
+ }
+
+ for (var i = 0; i < methods.length; i++) {
+ var method = methods[i];
+ var original = obj[method];
+
+ obj[method] = function retryWrapper(original) {
+ var op = exports.operation(options);
+ var args = Array.prototype.slice.call(arguments, 1);
+ var callback = args.pop();
+
+ args.push(function(err) {
+ if (op.retry(err)) {
+ return;
+ }
+ if (err) {
+ arguments[0] = op.mainError();
}
+ callback.apply(this, arguments);
+ });
+
+ op.attempt(function() {
+ original.apply(obj, args);
+ });
+ }.bind(obj, original);
+ obj[method].options = options;
+ }
+};
+
+
+/***/ }),
+
+/***/ 9538:
+/***/ ((module) => {
+
+function RetryOperation(timeouts, options) {
+ // Compatibility for the old (timeouts, retryForever) signature
+ if (typeof options === 'boolean') {
+ options = { forever: options };
+ }
+
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
+ this._timeouts = timeouts;
+ this._options = options || {};
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
+ this._fn = null;
+ this._errors = [];
+ this._attempts = 1;
+ this._operationTimeout = null;
+ this._operationTimeoutCb = null;
+ this._timeout = null;
+ this._operationStart = null;
+ this._timer = null;
+
+ if (this._options.forever) {
+ this._cachedTimeouts = this._timeouts.slice(0);
+ }
+}
+module.exports = RetryOperation;
+
+RetryOperation.prototype.reset = function() {
+ this._attempts = 1;
+ this._timeouts = this._originalTimeouts.slice(0);
+}
+
+RetryOperation.prototype.stop = function() {
+ if (this._timeout) {
+ clearTimeout(this._timeout);
+ }
+ if (this._timer) {
+ clearTimeout(this._timer);
+ }
+
+ this._timeouts = [];
+ this._cachedTimeouts = null;
+};
+
+RetryOperation.prototype.retry = function(err) {
+ if (this._timeout) {
+ clearTimeout(this._timeout);
+ }
+
+ if (!err) {
+ return false;
+ }
+ var currentTime = new Date().getTime();
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
+ this._errors.push(err);
+ this._errors.unshift(new Error('RetryOperation timeout occurred'));
+ return false;
+ }
+
+ this._errors.push(err);
+
+ var timeout = this._timeouts.shift();
+ if (timeout === undefined) {
+ if (this._cachedTimeouts) {
+ // retry forever, only keep last error
+ this._errors.splice(0, this._errors.length - 1);
+ timeout = this._cachedTimeouts.slice(-1);
+ } else {
+ return false;
+ }
+ }
+
+ var self = this;
+ this._timer = setTimeout(function() {
+ self._attempts++;
+
+ if (self._operationTimeoutCb) {
+ self._timeout = setTimeout(function() {
+ self._operationTimeoutCb(self._attempts);
+ }, self._operationTimeout);
+
+ if (self._options.unref) {
+ self._timeout.unref();
+ }
+ }
+
+ self._fn(self._attempts);
+ }, timeout);
+
+ if (this._options.unref) {
+ this._timer.unref();
+ }
+
+ return true;
+};
+
+RetryOperation.prototype.attempt = function(fn, timeoutOps) {
+ this._fn = fn;
+
+ if (timeoutOps) {
+ if (timeoutOps.timeout) {
+ this._operationTimeout = timeoutOps.timeout;
+ }
+ if (timeoutOps.cb) {
+ this._operationTimeoutCb = timeoutOps.cb;
+ }
+ }
+
+ var self = this;
+ if (this._operationTimeoutCb) {
+ this._timeout = setTimeout(function() {
+ self._operationTimeoutCb();
+ }, self._operationTimeout);
+ }
+
+ this._operationStart = new Date().getTime();
+
+ this._fn(this._attempts);
+};
+
+RetryOperation.prototype.try = function(fn) {
+ console.log('Using RetryOperation.try() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = function(fn) {
+ console.log('Using RetryOperation.start() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = RetryOperation.prototype.try;
+
+RetryOperation.prototype.errors = function() {
+ return this._errors;
+};
+
+RetryOperation.prototype.attempts = function() {
+ return this._attempts;
+};
+
+RetryOperation.prototype.mainError = function() {
+ if (this._errors.length === 0) {
+ return null;
+ }
+
+ var counts = {};
+ var mainError = null;
+ var mainErrorCount = 0;
+
+ for (var i = 0; i < this._errors.length; i++) {
+ var error = this._errors[i];
+ var message = error.message;
+ var count = (counts[message] || 0) + 1;
+
+ counts[message] = count;
+
+ if (count >= mainErrorCount) {
+ mainError = error;
+ mainErrorCount = count;
}
+ }
+
+ return mainError;
+};
+
+
+/***/ }),
+
+/***/ 1450:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+const os = __nccwpck_require__(857);
+const tty = __nccwpck_require__(2018);
+const hasFlag = __nccwpck_require__(3813);
+
+const {env} = process;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false') ||
+ hasFlag('color=never')) {
+ forceColor = 0;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = 1;
}
-exports.Methods = Methods;
-__exportStar(__nccwpck_require__(4380), exports);
-//# sourceMappingURL=methods.js.map
-/***/ }),
+if ('FORCE_COLOR' in env) {
+ if (env.FORCE_COLOR === 'true') {
+ forceColor = 1;
+ } else if (env.FORCE_COLOR === 'false') {
+ forceColor = 0;
+ } else {
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
+ }
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(haveStream, streamIsTTY) {
+ if (forceColor === 0) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
+ return 0;
+ }
+
+ const min = forceColor || 0;
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ if (process.platform === 'win32') {
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
+ const osRelease = os.release().split('.');
+ if (
+ Number(osRelease[0]) >= 10 &&
+ Number(osRelease[2]) >= 10586
+ ) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+
+ if (env.COLORTERM === 'truecolor') {
+ return 3;
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
-/***/ 2156:
-/***/ ((__unused_webpack_module, exports) => {
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
-"use strict";
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.rapidRetryPolicy = exports.fiveRetriesInFiveMinutes = exports.tenRetriesInAboutThirtyMinutes = void 0;
-/**
- * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because
- * randomization has been added to prevent a stampeding herd problem (if all instances in your application are retrying
- * a request at the exact same intervals, they are more likely to cause failures for each other).
- */
-exports.tenRetriesInAboutThirtyMinutes = {
- retries: 10,
- factor: 1.96821,
- randomize: true,
-};
-/**
- * Short & sweet, five retries in five minutes and then bail.
- */
-exports.fiveRetriesInFiveMinutes = {
- retries: 5,
- factor: 3.86,
-};
-/**
- * This policy is just to keep the tests running fast.
- */
-exports.rapidRetryPolicy = {
- minTimeout: 0,
- maxTimeout: 1,
-};
-const policies = {
- tenRetriesInAboutThirtyMinutes: exports.tenRetriesInAboutThirtyMinutes,
- fiveRetriesInFiveMinutes: exports.fiveRetriesInFiveMinutes,
- rapidRetryPolicy: exports.rapidRetryPolicy,
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ const level = supportsColor(stream, stream && stream.isTTY);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
};
-exports["default"] = policies;
-//# sourceMappingURL=retry-policies.js.map
+
/***/ }),
-/***/ 1099:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 770:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+module.exports = __nccwpck_require__(218);
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 2888:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 218:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-"use strict";
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=index.js.map
-/***/ }),
+var net = __nccwpck_require__(9278);
+var tls = __nccwpck_require__(4756);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var events = __nccwpck_require__(4434);
+var assert = __nccwpck_require__(2613);
+var util = __nccwpck_require__(9023);
-/***/ 4812:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports =
-{
- parallel : __nccwpck_require__(8210),
- serial : __nccwpck_require__(445),
- serialOrdered : __nccwpck_require__(3578)
-};
+exports.httpOverHttp = httpOverHttp;
+exports.httpsOverHttp = httpsOverHttp;
+exports.httpOverHttps = httpOverHttps;
+exports.httpsOverHttps = httpsOverHttps;
-/***/ }),
+function httpOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ return agent;
+}
-/***/ 1700:
-/***/ ((module) => {
+function httpsOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
-// API
-module.exports = abort;
+function httpOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ return agent;
+}
-/**
- * Aborts leftover active jobs
- *
- * @param {object} state - current state object
- */
-function abort(state)
-{
- Object.keys(state.jobs).forEach(clean.bind(state));
+function httpsOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
- // reset leftover jobs
- state.jobs = {};
+
+function TunnelingAgent(options) {
+ var self = this;
+ self.options = options || {};
+ self.proxyOptions = self.options.proxy || {};
+ self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
+ self.requests = [];
+ self.sockets = [];
+
+ self.on('free', function onFree(socket, host, port, localAddress) {
+ var options = toOptions(host, port, localAddress);
+ for (var i = 0, len = self.requests.length; i < len; ++i) {
+ var pending = self.requests[i];
+ if (pending.host === options.host && pending.port === options.port) {
+ // Detect the request to connect same origin server,
+ // reuse the connection.
+ self.requests.splice(i, 1);
+ pending.request.onSocket(socket);
+ return;
+ }
+ }
+ socket.destroy();
+ self.removeSocket(socket);
+ });
}
+util.inherits(TunnelingAgent, events.EventEmitter);
-/**
- * Cleans up leftover job by invoking abort function for the provided job id
- *
- * @this state
- * @param {string|number} key - job id to abort
- */
-function clean(key)
-{
- if (typeof this.jobs[key] == 'function')
- {
- this.jobs[key]();
+TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
+ var self = this;
+ var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
+
+ if (self.sockets.length >= this.maxSockets) {
+ // We are over limit so we'll add it to the queue.
+ self.requests.push(options);
+ return;
}
-}
+ // If we are under maxSockets create a new one.
+ self.createSocket(options, function(socket) {
+ socket.on('free', onFree);
+ socket.on('close', onCloseOrRemove);
+ socket.on('agentRemove', onCloseOrRemove);
+ req.onSocket(socket);
-/***/ }),
+ function onFree() {
+ self.emit('free', socket, options);
+ }
-/***/ 2794:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ function onCloseOrRemove(err) {
+ self.removeSocket(socket);
+ socket.removeListener('free', onFree);
+ socket.removeListener('close', onCloseOrRemove);
+ socket.removeListener('agentRemove', onCloseOrRemove);
+ }
+ });
+};
-var defer = __nccwpck_require__(5295);
+TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
+ var self = this;
+ var placeholder = {};
+ self.sockets.push(placeholder);
-// API
-module.exports = async;
+ var connectOptions = mergeOptions({}, self.proxyOptions, {
+ method: 'CONNECT',
+ path: options.host + ':' + options.port,
+ agent: false,
+ headers: {
+ host: options.host + ':' + options.port
+ }
+ });
+ if (options.localAddress) {
+ connectOptions.localAddress = options.localAddress;
+ }
+ if (connectOptions.proxyAuth) {
+ connectOptions.headers = connectOptions.headers || {};
+ connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
+ new Buffer(connectOptions.proxyAuth).toString('base64');
+ }
-/**
- * Runs provided callback asynchronously
- * even if callback itself is not
- *
- * @param {function} callback - callback to invoke
- * @returns {function} - augmented callback
- */
-function async(callback)
-{
- var isAsync = false;
+ debug('making CONNECT request');
+ var connectReq = self.request(connectOptions);
+ connectReq.useChunkedEncodingByDefault = false; // for v0.6
+ connectReq.once('response', onResponse); // for v0.6
+ connectReq.once('upgrade', onUpgrade); // for v0.6
+ connectReq.once('connect', onConnect); // for v0.7 or later
+ connectReq.once('error', onError);
+ connectReq.end();
- // check if async happened
- defer(function() { isAsync = true; });
+ function onResponse(res) {
+ // Very hacky. This is necessary to avoid http-parser leaks.
+ res.upgrade = true;
+ }
- return function async_callback(err, result)
- {
- if (isAsync)
- {
- callback(err, result);
+ function onUpgrade(res, socket, head) {
+ // Hacky.
+ process.nextTick(function() {
+ onConnect(res, socket, head);
+ });
+ }
+
+ function onConnect(res, socket, head) {
+ connectReq.removeAllListeners();
+ socket.removeAllListeners();
+
+ if (res.statusCode !== 200) {
+ debug('tunneling socket could not be established, statusCode=%d',
+ res.statusCode);
+ socket.destroy();
+ var error = new Error('tunneling socket could not be established, ' +
+ 'statusCode=' + res.statusCode);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
}
- else
- {
- defer(function nextTick_callback()
- {
- callback(err, result);
- });
+ if (head.length > 0) {
+ debug('got illegal response body from proxy');
+ socket.destroy();
+ var error = new Error('got illegal response body from proxy');
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
}
- };
-}
+ debug('tunneling connection has established');
+ self.sockets[self.sockets.indexOf(placeholder)] = socket;
+ return cb(socket);
+ }
+ function onError(cause) {
+ connectReq.removeAllListeners();
-/***/ }),
+ debug('tunneling socket could not be established, cause=%s\n',
+ cause.message, cause.stack);
+ var error = new Error('tunneling socket could not be established, ' +
+ 'cause=' + cause.message);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ }
+};
-/***/ 5295:
-/***/ ((module) => {
+TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
+ var pos = this.sockets.indexOf(socket)
+ if (pos === -1) {
+ return;
+ }
+ this.sockets.splice(pos, 1);
-module.exports = defer;
+ var pending = this.requests.shift();
+ if (pending) {
+ // If we have pending requests and a socket gets closed a new one
+ // needs to be created to take over in the pool for the one that closed.
+ this.createSocket(pending, function(socket) {
+ pending.request.onSocket(socket);
+ });
+ }
+};
-/**
- * Runs provided function on next iteration of the event loop
- *
- * @param {function} fn - function to run
- */
-function defer(fn)
-{
- var nextTick = typeof setImmediate == 'function'
- ? setImmediate
- : (
- typeof process == 'object' && typeof process.nextTick == 'function'
- ? process.nextTick
- : null
- );
+function createSecureSocket(options, cb) {
+ var self = this;
+ TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
+ var hostHeader = options.request.getHeader('host');
+ var tlsOptions = mergeOptions({}, self.options, {
+ socket: socket,
+ servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
+ });
- if (nextTick)
- {
- nextTick(fn);
+ // 0 is dummy port for v0.6
+ var secureSocket = tls.connect(0, tlsOptions);
+ self.sockets[self.sockets.indexOf(socket)] = secureSocket;
+ cb(secureSocket);
+ });
+}
+
+
+function toOptions(host, port, localAddress) {
+ if (typeof host === 'string') { // since v0.10
+ return {
+ host: host,
+ port: port,
+ localAddress: localAddress
+ };
}
- else
- {
- setTimeout(fn, 0);
+ return host; // for v0.11 or later
+}
+
+function mergeOptions(target) {
+ for (var i = 1, len = arguments.length; i < len; ++i) {
+ var overrides = arguments[i];
+ if (typeof overrides === 'object') {
+ var keys = Object.keys(overrides);
+ for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
+ var k = keys[j];
+ if (overrides[k] !== undefined) {
+ target[k] = overrides[k];
+ }
+ }
+ }
+ }
+ return target;
+}
+
+
+var debug;
+if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
+ debug = function() {
+ var args = Array.prototype.slice.call(arguments);
+ if (typeof args[0] === 'string') {
+ args[0] = 'TUNNEL: ' + args[0];
+ } else {
+ args.unshift('TUNNEL:');
+ }
+ console.error.apply(console, args);
}
+} else {
+ debug = function() {};
}
+exports.debug = debug; // for test
/***/ }),
-/***/ 9023:
+/***/ 6752:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var async = __nccwpck_require__(2794)
- , abort = __nccwpck_require__(1700)
- ;
-// API
-module.exports = iterate;
-/**
- * Iterates over each job object
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {object} state - current job status
- * @param {function} callback - invoked when all elements processed
- */
-function iterate(list, iterator, state, callback)
-{
- // store current index
- var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+const Client = __nccwpck_require__(3701)
+const Dispatcher = __nccwpck_require__(883)
+const Pool = __nccwpck_require__(628)
+const BalancedPool = __nccwpck_require__(837)
+const Agent = __nccwpck_require__(7405)
+const ProxyAgent = __nccwpck_require__(6672)
+const EnvHttpProxyAgent = __nccwpck_require__(3137)
+const RetryAgent = __nccwpck_require__(50)
+const errors = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError } = errors
+const api = __nccwpck_require__(6615)
+const buildConnector = __nccwpck_require__(9136)
+const MockClient = __nccwpck_require__(7365)
+const MockAgent = __nccwpck_require__(7501)
+const MockPool = __nccwpck_require__(4004)
+const mockErrors = __nccwpck_require__(2429)
+const RetryHandler = __nccwpck_require__(7816)
+const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(2581)
+const DecoratorHandler = __nccwpck_require__(8155)
+const RedirectHandler = __nccwpck_require__(8754)
+const createRedirectInterceptor = __nccwpck_require__(5092)
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
- {
- // don't repeat yourself
- // skip secondary callbacks
- if (!(key in state.jobs))
- {
- return;
- }
+Object.assign(Dispatcher.prototype, api)
- // clean up jobs
- delete state.jobs[key];
+module.exports.Dispatcher = Dispatcher
+module.exports.Client = Client
+module.exports.Pool = Pool
+module.exports.BalancedPool = BalancedPool
+module.exports.Agent = Agent
+module.exports.ProxyAgent = ProxyAgent
+module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent
+module.exports.RetryAgent = RetryAgent
+module.exports.RetryHandler = RetryHandler
- if (error)
- {
- // don't process rest of the results
- // stop still active jobs
- // and reset the list
- abort(state);
- }
- else
- {
- state.results[key] = output;
- }
+module.exports.DecoratorHandler = DecoratorHandler
+module.exports.RedirectHandler = RedirectHandler
+module.exports.createRedirectInterceptor = createRedirectInterceptor
+module.exports.interceptors = {
+ redirect: __nccwpck_require__(1514),
+ retry: __nccwpck_require__(2026),
+ dump: __nccwpck_require__(8060),
+ dns: __nccwpck_require__(379)
+}
- // return salvaged results
- callback(error, state.results);
- });
+module.exports.buildConnector = buildConnector
+module.exports.errors = errors
+module.exports.util = {
+ parseHeaders: util.parseHeaders,
+ headerNameToString: util.headerNameToString
}
-/**
- * Runs iterator over provided job element
- *
- * @param {function} iterator - iterator to invoke
- * @param {string|number} key - key/index of the element in the list of jobs
- * @param {mixed} item - job description
- * @param {function} callback - invoked after iterator is done with the job
- * @returns {function|mixed} - job abort function or something else
- */
-function runJob(iterator, key, item, callback)
-{
- var aborter;
+function makeDispatcher (fn) {
+ return (url, opts, handler) => {
+ if (typeof opts === 'function') {
+ handler = opts
+ opts = null
+ }
- // allow shortcut if iterator expects only two arguments
- if (iterator.length == 2)
- {
- aborter = iterator(item, async(callback));
- }
- // otherwise go with full three arguments
- else
- {
- aborter = iterator(item, key, async(callback));
- }
+ if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
+ throw new InvalidArgumentError('invalid url')
+ }
- return aborter;
-}
+ if (opts != null && typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
+ if (opts && opts.path != null) {
+ if (typeof opts.path !== 'string') {
+ throw new InvalidArgumentError('invalid opts.path')
+ }
-/***/ }),
+ let path = opts.path
+ if (!opts.path.startsWith('/')) {
+ path = `/${path}`
+ }
-/***/ 2474:
-/***/ ((module) => {
+ url = new URL(util.parseOrigin(url).origin + path)
+ } else {
+ if (!opts) {
+ opts = typeof url === 'object' ? url : {}
+ }
-// API
-module.exports = state;
+ url = util.parseURL(url)
+ }
-/**
- * Creates initial state object
- * for iteration over list
- *
- * @param {array|object} list - list to iterate over
- * @param {function|null} sortMethod - function to use for keys sort,
- * or `null` to keep them as is
- * @returns {object} - initial state object
- */
-function state(list, sortMethod)
-{
- var isNamedList = !Array.isArray(list)
- , initState =
- {
- index : 0,
- keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
- jobs : {},
- results : isNamedList ? {} : [],
- size : isNamedList ? Object.keys(list).length : list.length
+ const { agent, dispatcher = getGlobalDispatcher() } = opts
+
+ if (agent) {
+ throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
}
- ;
- if (sortMethod)
- {
- // sort array keys based on it's values
- // sort object's keys just on own merit
- initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
- {
- return sortMethod(list[a], list[b]);
- });
+ return fn.call(dispatcher, {
+ ...opts,
+ origin: url.origin,
+ path: url.search ? `${url.pathname}${url.search}` : url.pathname,
+ method: opts.method || (opts.body ? 'PUT' : 'GET')
+ }, handler)
}
+}
- return initState;
+module.exports.setGlobalDispatcher = setGlobalDispatcher
+module.exports.getGlobalDispatcher = getGlobalDispatcher
+
+const fetchImpl = (__nccwpck_require__(4398).fetch)
+module.exports.fetch = async function fetch (init, options = undefined) {
+ try {
+ return await fetchImpl(init, options)
+ } catch (err) {
+ if (err && typeof err === 'object') {
+ Error.captureStackTrace(err)
+ }
+
+ throw err
+ }
}
+module.exports.Headers = __nccwpck_require__(660).Headers
+module.exports.Response = __nccwpck_require__(9051).Response
+module.exports.Request = __nccwpck_require__(9967).Request
+module.exports.FormData = __nccwpck_require__(5910).FormData
+module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File)
+module.exports.FileReader = __nccwpck_require__(8355).FileReader
+const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1059)
-/***/ }),
+module.exports.setGlobalOrigin = setGlobalOrigin
+module.exports.getGlobalOrigin = getGlobalOrigin
-/***/ 7942:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+const { CacheStorage } = __nccwpck_require__(3245)
+const { kConstruct } = __nccwpck_require__(109)
-var abort = __nccwpck_require__(1700)
- , async = __nccwpck_require__(2794)
- ;
+// Cache & CacheStorage are tightly coupled with fetch. Even if it may run
+// in an older version of Node, it doesn't have any use without fetch.
+module.exports.caches = new CacheStorage(kConstruct)
-// API
-module.exports = terminator;
+const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(9061)
-/**
- * Terminates jobs in the attached state context
- *
- * @this AsyncKitState#
- * @param {function} callback - final callback to invoke after termination
- */
-function terminator(callback)
-{
- if (!Object.keys(this.jobs).length)
- {
- return;
- }
+module.exports.deleteCookie = deleteCookie
+module.exports.getCookies = getCookies
+module.exports.getSetCookies = getSetCookies
+module.exports.setCookie = setCookie
- // fast forward iteration index
- this.index = this.size;
+const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(1900)
- // abort jobs
- abort(this);
+module.exports.parseMIMEType = parseMIMEType
+module.exports.serializeAMimeType = serializeAMimeType
- // send back results we have so far
- async(callback)(null, this.results);
-}
+const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(5188)
+module.exports.WebSocket = __nccwpck_require__(3726).WebSocket
+module.exports.CloseEvent = CloseEvent
+module.exports.ErrorEvent = ErrorEvent
+module.exports.MessageEvent = MessageEvent
+
+module.exports.request = makeDispatcher(api.request)
+module.exports.stream = makeDispatcher(api.stream)
+module.exports.pipeline = makeDispatcher(api.pipeline)
+module.exports.connect = makeDispatcher(api.connect)
+module.exports.upgrade = makeDispatcher(api.upgrade)
+
+module.exports.MockClient = MockClient
+module.exports.MockPool = MockPool
+module.exports.MockAgent = MockAgent
+module.exports.mockErrors = mockErrors
+
+const { EventSource } = __nccwpck_require__(1238)
+
+module.exports.EventSource = EventSource
/***/ }),
-/***/ 8210:
+/***/ 158:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var iterate = __nccwpck_require__(9023)
- , initState = __nccwpck_require__(2474)
- , terminator = __nccwpck_require__(7942)
- ;
+const { addAbortListener } = __nccwpck_require__(3440)
+const { RequestAbortedError } = __nccwpck_require__(8707)
-// Public API
-module.exports = parallel;
+const kListener = Symbol('kListener')
+const kSignal = Symbol('kSignal')
-/**
- * Runs iterator over provided array elements in parallel
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function parallel(list, iterator, callback)
-{
- var state = initState(list);
+function abort (self) {
+ if (self.abort) {
+ self.abort(self[kSignal]?.reason)
+ } else {
+ self.reason = self[kSignal]?.reason ?? new RequestAbortedError()
+ }
+ removeSignal(self)
+}
- while (state.index < (state['keyedList'] || list).length)
- {
- iterate(list, iterator, state, function(error, result)
- {
- if (error)
- {
- callback(error, result);
- return;
- }
+function addSignal (self, signal) {
+ self.reason = null
- // looks like it's the last one
- if (Object.keys(state.jobs).length === 0)
- {
- callback(null, state.results);
- return;
- }
- });
+ self[kSignal] = null
+ self[kListener] = null
- state.index++;
+ if (!signal) {
+ return
}
- return terminator.bind(state, callback);
-}
+ if (signal.aborted) {
+ abort(self)
+ return
+ }
+ self[kSignal] = signal
+ self[kListener] = () => {
+ abort(self)
+ }
-/***/ }),
+ addAbortListener(self[kSignal], self[kListener])
+}
-/***/ 445:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function removeSignal (self) {
+ if (!self[kSignal]) {
+ return
+ }
-var serialOrdered = __nccwpck_require__(3578);
+ if ('removeEventListener' in self[kSignal]) {
+ self[kSignal].removeEventListener('abort', self[kListener])
+ } else {
+ self[kSignal].removeListener('abort', self[kListener])
+ }
-// Public API
-module.exports = serial;
+ self[kSignal] = null
+ self[kListener] = null
+}
-/**
- * Runs iterator over provided array elements in series
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function serial(list, iterator, callback)
-{
- return serialOrdered(list, iterator, null, callback);
+module.exports = {
+ addSignal,
+ removeSignal
}
/***/ }),
-/***/ 3578:
+/***/ 2279:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var iterate = __nccwpck_require__(9023)
- , initState = __nccwpck_require__(2474)
- , terminator = __nccwpck_require__(7942)
- ;
-// Public API
-module.exports = serialOrdered;
-// sorting helpers
-module.exports.ascending = ascending;
-module.exports.descending = descending;
-/**
- * Runs iterator over provided sorted array elements in series
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} sortMethod - custom sort function
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function serialOrdered(list, iterator, sortMethod, callback)
-{
- var state = initState(list, sortMethod);
+const assert = __nccwpck_require__(4589)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
- iterate(list, iterator, state, function iteratorHandler(error, result)
- {
- if (error)
- {
- callback(error, result);
- return;
+class ConnectHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
}
- state.index++;
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- // are we there yet?
- if (state.index < (state['keyedList'] || list).length)
- {
- iterate(list, iterator, state, iteratorHandler);
- return;
+ const { signal, opaque, responseHeaders } = opts
+
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
- // done here
- callback(null, state.results);
- });
+ super('UNDICI_CONNECT')
- return terminator.bind(state, callback);
-}
+ this.opaque = opaque || null
+ this.responseHeaders = responseHeaders || null
+ this.callback = callback
+ this.abort = null
-/*
- * -- Sort methods
- */
+ addSignal(this, signal)
+ }
-/**
- * sort helper to sort array elements in ascending order
- *
- * @param {mixed} a - an item to compare
- * @param {mixed} b - an item to compare
- * @returns {number} - comparison result
- */
-function ascending(a, b)
-{
- return a < b ? -1 : a > b ? 1 : 0;
-}
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
-/**
- * sort helper to sort array elements in descending order
- *
- * @param {mixed} a - an item to compare
- * @param {mixed} b - an item to compare
- * @returns {number} - comparison result
- */
-function descending(a, b)
-{
- return -1 * ascending(a, b);
-}
+ assert(this.callback)
+ this.abort = abort
+ this.context = context
+ }
-/***/ }),
+ onHeaders () {
+ throw new SocketError('bad connect', null)
+ }
-/***/ 3682:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ onUpgrade (statusCode, rawHeaders, socket) {
+ const { callback, opaque, context } = this
-var register = __nccwpck_require__(4670);
-var addHook = __nccwpck_require__(5549);
-var removeHook = __nccwpck_require__(6819);
+ removeSignal(this)
-// bind with array of arguments: https://stackoverflow.com/a/21792913
-var bind = Function.bind;
-var bindable = bind.bind(bind);
+ this.callback = null
-function bindApi(hook, state, name) {
- var removeHookRef = bindable(removeHook, null).apply(
- null,
- name ? [state, name] : [state]
- );
- hook.api = { remove: removeHookRef };
- hook.remove = removeHookRef;
- ["before", "error", "after", "wrap"].forEach(function (kind) {
- var args = name ? [state, kind, name] : [state, kind];
- hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
- });
-}
+ let headers = rawHeaders
+ // Indicates is an HTTP2Session
+ if (headers != null) {
+ headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ }
-function HookSingular() {
- var singularHookName = "h";
- var singularHookState = {
- registry: {},
- };
- var singularHook = register.bind(null, singularHookState, singularHookName);
- bindApi(singularHook, singularHookState, singularHookName);
- return singularHook;
-}
+ this.runInAsyncScope(callback, null, null, {
+ statusCode,
+ headers,
+ socket,
+ opaque,
+ context
+ })
+ }
-function HookCollection() {
- var state = {
- registry: {},
- };
+ onError (err) {
+ const { callback, opaque } = this
- var hook = register.bind(null, state);
- bindApi(hook, state);
+ removeSignal(this)
- return hook;
+ if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
+ }
}
-var collectionHookDeprecationMessageDisplayed = false;
-function Hook() {
- if (!collectionHookDeprecationMessageDisplayed) {
- console.warn(
- '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
- );
- collectionHookDeprecationMessageDisplayed = true;
+function connect (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ connect.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
}
- return HookCollection();
-}
-Hook.Singular = HookSingular.bind();
-Hook.Collection = HookCollection.bind();
+ try {
+ const connectHandler = new ConnectHandler(opts, callback)
+ this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
+}
-module.exports = Hook;
-// expose constructors as a named property for TypeScript
-module.exports.Hook = Hook;
-module.exports.Singular = Hook.Singular;
-module.exports.Collection = Hook.Collection;
+module.exports = connect
/***/ }),
-/***/ 5549:
-/***/ ((module) => {
+/***/ 6862:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = addHook;
-function addHook(state, kind, name, hook) {
- var orig = hook;
- if (!state.registry[name]) {
- state.registry[name] = [];
+
+const {
+ Readable,
+ Duplex,
+ PassThrough
+} = __nccwpck_require__(7075)
+const {
+ InvalidArgumentError,
+ InvalidReturnValueError,
+ RequestAbortedError
+} = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
+const assert = __nccwpck_require__(4589)
+
+const kResume = Symbol('resume')
+
+class PipelineRequest extends Readable {
+ constructor () {
+ super({ autoDestroy: true })
+
+ this[kResume] = null
}
- if (kind === "before") {
- hook = function (method, options) {
- return Promise.resolve()
- .then(orig.bind(null, options))
- .then(method.bind(null, options));
- };
+ _read () {
+ const { [kResume]: resume } = this
+
+ if (resume) {
+ this[kResume] = null
+ resume()
+ }
}
- if (kind === "after") {
- hook = function (method, options) {
- var result;
- return Promise.resolve()
- .then(method.bind(null, options))
- .then(function (result_) {
- result = result_;
- return orig(result, options);
- })
- .then(function () {
- return result;
- });
- };
+ _destroy (err, callback) {
+ this._read()
+
+ callback(err)
}
+}
- if (kind === "error") {
- hook = function (method, options) {
- return Promise.resolve()
- .then(method.bind(null, options))
- .catch(function (error) {
- return orig(error, options);
- });
- };
+class PipelineResponse extends Readable {
+ constructor (resume) {
+ super({ autoDestroy: true })
+ this[kResume] = resume
}
- state.registry[name].push({
- hook: hook,
- orig: orig,
- });
+ _read () {
+ this[kResume]()
+ }
+
+ _destroy (err, callback) {
+ if (!err && !this._readableState.endEmitted) {
+ err = new RequestAbortedError()
+ }
+
+ callback(err)
+ }
}
+class PipelineHandler extends AsyncResource {
+ constructor (opts, handler) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
+
+ if (typeof handler !== 'function') {
+ throw new InvalidArgumentError('invalid handler')
+ }
-/***/ }),
+ const { signal, method, opaque, onInfo, responseHeaders } = opts
-/***/ 4670:
-/***/ ((module) => {
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
-module.exports = register;
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
-function register(state, name, method, options) {
- if (typeof method !== "function") {
- throw new Error("method for before hook must be a function");
- }
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
- if (!options) {
- options = {};
+ super('UNDICI_PIPELINE')
+
+ this.opaque = opaque || null
+ this.responseHeaders = responseHeaders || null
+ this.handler = handler
+ this.abort = null
+ this.context = null
+ this.onInfo = onInfo || null
+
+ this.req = new PipelineRequest().on('error', util.nop)
+
+ this.ret = new Duplex({
+ readableObjectMode: opts.objectMode,
+ autoDestroy: true,
+ read: () => {
+ const { body } = this
+
+ if (body?.resume) {
+ body.resume()
+ }
+ },
+ write: (chunk, encoding, callback) => {
+ const { req } = this
+
+ if (req.push(chunk, encoding) || req._readableState.destroyed) {
+ callback()
+ } else {
+ req[kResume] = callback
+ }
+ },
+ destroy: (err, callback) => {
+ const { body, req, res, ret, abort } = this
+
+ if (!err && !ret._readableState.endEmitted) {
+ err = new RequestAbortedError()
+ }
+
+ if (abort && err) {
+ abort()
+ }
+
+ util.destroy(body, err)
+ util.destroy(req, err)
+ util.destroy(res, err)
+
+ removeSignal(this)
+
+ callback(err)
+ }
+ }).on('prefinish', () => {
+ const { req } = this
+
+ // Node < 15 does not call _final in same tick.
+ req.push(null)
+ })
+
+ this.res = null
+
+ addSignal(this, signal)
}
- if (Array.isArray(name)) {
- return name.reverse().reduce(function (callback, name) {
- return register.bind(null, state, name, callback, options);
- }, method)();
+ onConnect (abort, context) {
+ const { ret, res } = this
+
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
+
+ assert(!res, 'pipeline cannot be retried')
+ assert(!ret.destroyed)
+
+ this.abort = abort
+ this.context = context
}
- return Promise.resolve().then(function () {
- if (!state.registry[name]) {
- return method(options);
+ onHeaders (statusCode, rawHeaders, resume) {
+ const { opaque, handler, context } = this
+
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ this.onInfo({ statusCode, headers })
+ }
+ return
+ }
+
+ this.res = new PipelineResponse(resume)
+
+ let body
+ try {
+ this.handler = null
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ body = this.runInAsyncScope(handler, null, {
+ statusCode,
+ headers,
+ opaque,
+ body: this.res,
+ context
+ })
+ } catch (err) {
+ this.res.on('error', util.nop)
+ throw err
+ }
+
+ if (!body || typeof body.on !== 'function') {
+ throw new InvalidReturnValueError('expected Readable')
}
- return state.registry[name].reduce(function (method, registered) {
- return registered.hook.bind(null, method, options);
- }, method)();
- });
-}
+ body
+ .on('data', (chunk) => {
+ const { ret, body } = this
+ if (!ret.push(chunk) && body.pause) {
+ body.pause()
+ }
+ })
+ .on('error', (err) => {
+ const { ret } = this
-/***/ }),
+ util.destroy(ret, err)
+ })
+ .on('end', () => {
+ const { ret } = this
-/***/ 6819:
-/***/ ((module) => {
+ ret.push(null)
+ })
+ .on('close', () => {
+ const { ret } = this
-module.exports = removeHook;
+ if (!ret._readableState.ended) {
+ util.destroy(ret, new RequestAbortedError())
+ }
+ })
-function removeHook(state, name, method) {
- if (!state.registry[name]) {
- return;
+ this.body = body
}
- var index = state.registry[name]
- .map(function (registered) {
- return registered.orig;
- })
- .indexOf(method);
+ onData (chunk) {
+ const { res } = this
+ return res.push(chunk)
+ }
- if (index === -1) {
- return;
+ onComplete (trailers) {
+ const { res } = this
+ res.push(null)
}
- state.registry[name].splice(index, 1);
+ onError (err) {
+ const { ret } = this
+ this.handler = null
+ util.destroy(ret, err)
+ }
+}
+
+function pipeline (opts, handler) {
+ try {
+ const pipelineHandler = new PipelineHandler(opts, handler)
+ this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
+ return pipelineHandler.ret
+ } catch (err) {
+ return new PassThrough().destroy(err)
+ }
}
+module.exports = pipeline
+
/***/ }),
-/***/ 5443:
+/***/ 4043:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var util = __nccwpck_require__(3837);
-var Stream = (__nccwpck_require__(2781).Stream);
-var DelayedStream = __nccwpck_require__(8611);
-module.exports = CombinedStream;
-function CombinedStream() {
- this.writable = false;
- this.readable = true;
- this.dataSize = 0;
- this.maxDataSize = 2 * 1024 * 1024;
- this.pauseStreams = true;
- this._released = false;
- this._streams = [];
- this._currentStream = null;
- this._insideLoop = false;
- this._pendingNext = false;
-}
-util.inherits(CombinedStream, Stream);
+const assert = __nccwpck_require__(4589)
+const { Readable } = __nccwpck_require__(9927)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(7655)
+const { AsyncResource } = __nccwpck_require__(6698)
-CombinedStream.create = function(options) {
- var combinedStream = new this();
+class RequestHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
- options = options || {};
- for (var option in options) {
- combinedStream[option] = options[option];
- }
+ const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
- return combinedStream;
-};
+ try {
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
-CombinedStream.isStreamLike = function(stream) {
- return (typeof stream !== 'function')
- && (typeof stream !== 'string')
- && (typeof stream !== 'boolean')
- && (typeof stream !== 'number')
- && (!Buffer.isBuffer(stream));
-};
+ if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
+ throw new InvalidArgumentError('invalid highWaterMark')
+ }
-CombinedStream.prototype.append = function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
- if (isStreamLike) {
- if (!(stream instanceof DelayedStream)) {
- var newStream = DelayedStream.create(stream, {
- maxDataSize: Infinity,
- pauseStream: this.pauseStreams,
- });
- stream.on('data', this._checkDataSize.bind(this));
- stream = newStream;
- }
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
- this._handleErrors(stream);
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
- if (this.pauseStreams) {
- stream.pause();
+ super('UNDICI_REQUEST')
+ } catch (err) {
+ if (util.isStream(body)) {
+ util.destroy(body.on('error', util.nop), err)
+ }
+ throw err
}
- }
-
- this._streams.push(stream);
- return this;
-};
-CombinedStream.prototype.pipe = function(dest, options) {
- Stream.prototype.pipe.call(this, dest, options);
- this.resume();
- return dest;
-};
+ this.method = method
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.callback = callback
+ this.res = null
+ this.abort = null
+ this.body = body
+ this.trailers = {}
+ this.context = null
+ this.onInfo = onInfo || null
+ this.throwOnError = throwOnError
+ this.highWaterMark = highWaterMark
+ this.signal = signal
+ this.reason = null
+ this.removeAbortListener = null
-CombinedStream.prototype._getNext = function() {
- this._currentStream = null;
+ if (util.isStream(body)) {
+ body.on('error', (err) => {
+ this.onError(err)
+ })
+ }
- if (this._insideLoop) {
- this._pendingNext = true;
- return; // defer call
- }
+ if (this.signal) {
+ if (this.signal.aborted) {
+ this.reason = this.signal.reason ?? new RequestAbortedError()
+ } else {
+ this.removeAbortListener = util.addAbortListener(this.signal, () => {
+ this.reason = this.signal.reason ?? new RequestAbortedError()
+ if (this.res) {
+ util.destroy(this.res.on('error', util.nop), this.reason)
+ } else if (this.abort) {
+ this.abort(this.reason)
+ }
- this._insideLoop = true;
- try {
- do {
- this._pendingNext = false;
- this._realGetNext();
- } while (this._pendingNext);
- } finally {
- this._insideLoop = false;
+ if (this.removeAbortListener) {
+ this.res?.off('close', this.removeAbortListener)
+ this.removeAbortListener()
+ this.removeAbortListener = null
+ }
+ })
+ }
+ }
}
-};
-CombinedStream.prototype._realGetNext = function() {
- var stream = this._streams.shift();
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
+ assert(this.callback)
- if (typeof stream == 'undefined') {
- this.end();
- return;
+ this.abort = abort
+ this.context = context
}
- if (typeof stream !== 'function') {
- this._pipeNext(stream);
- return;
- }
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
- var getStream = stream;
- getStream(function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('data', this._checkDataSize.bind(this));
- this._handleErrors(stream);
+ const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ this.onInfo({ statusCode, headers })
+ }
+ return
}
- this._pipeNext(stream);
- }.bind(this));
-};
+ const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
+ const contentType = parsedHeaders['content-type']
+ const contentLength = parsedHeaders['content-length']
+ const res = new Readable({
+ resume,
+ abort,
+ contentType,
+ contentLength: this.method !== 'HEAD' && contentLength
+ ? Number(contentLength)
+ : null,
+ highWaterMark
+ })
-CombinedStream.prototype._pipeNext = function(stream) {
- this._currentStream = stream;
+ if (this.removeAbortListener) {
+ res.on('close', this.removeAbortListener)
+ }
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('end', this._getNext.bind(this));
- stream.pipe(this, {end: false});
- return;
+ this.callback = null
+ this.res = res
+ if (callback !== null) {
+ if (this.throwOnError && statusCode >= 400) {
+ this.runInAsyncScope(getResolveErrorBodyCallback, null,
+ { callback, body: res, contentType, statusCode, statusMessage, headers }
+ )
+ } else {
+ this.runInAsyncScope(callback, null, null, {
+ statusCode,
+ headers,
+ trailers: this.trailers,
+ opaque,
+ body: res,
+ context
+ })
+ }
+ }
}
- var value = stream;
- this.write(value);
- this._getNext();
-};
-
-CombinedStream.prototype._handleErrors = function(stream) {
- var self = this;
- stream.on('error', function(err) {
- self._emitError(err);
- });
-};
-
-CombinedStream.prototype.write = function(data) {
- this.emit('data', data);
-};
+ onData (chunk) {
+ return this.res.push(chunk)
+ }
-CombinedStream.prototype.pause = function() {
- if (!this.pauseStreams) {
- return;
+ onComplete (trailers) {
+ util.parseHeaders(trailers, this.trailers)
+ this.res.push(null)
}
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
- this.emit('pause');
-};
+ onError (err) {
+ const { res, callback, body, opaque } = this
-CombinedStream.prototype.resume = function() {
- if (!this._released) {
- this._released = true;
- this.writable = true;
- this._getNext();
- }
+ if (callback) {
+ // TODO: Does this need queueMicrotask?
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
- this.emit('resume');
-};
+ if (res) {
+ this.res = null
+ // Ensure all queued handlers are invoked before destroying res.
+ queueMicrotask(() => {
+ util.destroy(res, err)
+ })
+ }
-CombinedStream.prototype.end = function() {
- this._reset();
- this.emit('end');
-};
+ if (body) {
+ this.body = null
+ util.destroy(body, err)
+ }
-CombinedStream.prototype.destroy = function() {
- this._reset();
- this.emit('close');
-};
+ if (this.removeAbortListener) {
+ res?.off('close', this.removeAbortListener)
+ this.removeAbortListener()
+ this.removeAbortListener = null
+ }
+ }
+}
-CombinedStream.prototype._reset = function() {
- this.writable = false;
- this._streams = [];
- this._currentStream = null;
-};
+function request (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ request.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
-CombinedStream.prototype._checkDataSize = function() {
- this._updateDataSize();
- if (this.dataSize <= this.maxDataSize) {
- return;
+ try {
+ this.dispatch(opts, new RequestHandler(opts, callback))
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
}
+}
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
- this._emitError(new Error(message));
-};
+module.exports = request
+module.exports.RequestHandler = RequestHandler
-CombinedStream.prototype._updateDataSize = function() {
- this.dataSize = 0;
- var self = this;
- this._streams.forEach(function(stream) {
- if (!stream.dataSize) {
- return;
- }
+/***/ }),
- self.dataSize += stream.dataSize;
- });
+/***/ 3560:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (this._currentStream && this._currentStream.dataSize) {
- this.dataSize += this._currentStream.dataSize;
- }
-};
-CombinedStream.prototype._emitError = function(err) {
- this._reset();
- this.emit('error', err);
-};
+const assert = __nccwpck_require__(4589)
+const { finished, PassThrough } = __nccwpck_require__(7075)
+const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(7655)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
-/***/ }),
+class StreamHandler extends AsyncResource {
+ constructor (opts, factory, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
-/***/ 8222:
-/***/ ((module, exports, __nccwpck_require__) => {
+ const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
-/* eslint-env browser */
+ try {
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
-/**
- * This is the web browser implementation of `debug()`.
- */
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('invalid factory')
+ }
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.storage = localstorage();
-exports.destroy = (() => {
- let warned = false;
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
- return () => {
- if (!warned) {
- warned = true;
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
- };
-})();
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
-/**
- * Colors.
- */
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
-exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
-];
+ super('UNDICI_STREAM')
+ } catch (err) {
+ if (util.isStream(body)) {
+ util.destroy(body.on('error', util.nop), err)
+ }
+ throw err
+ }
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.factory = factory
+ this.callback = callback
+ this.res = null
+ this.abort = null
+ this.context = null
+ this.trailers = null
+ this.body = body
+ this.onInfo = onInfo || null
+ this.throwOnError = throwOnError || false
+
+ if (util.isStream(body)) {
+ body.on('error', (err) => {
+ this.onError(err)
+ })
+ }
-// eslint-disable-next-line complexity
-function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
+ addSignal(this, signal)
+ }
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
-}
+ assert(this.callback)
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
+ this.abort = abort
+ this.context = context
+ }
-function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const { factory, opaque, context, callback, responseHeaders } = this
- if (!this.useColors) {
- return;
- }
+ const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ this.onInfo({ statusCode, headers })
+ }
+ return
+ }
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
+ this.factory = null
- args.splice(lastC, 0, c);
-}
+ let res
-/**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
-exports.log = console.debug || console.log || (() => {});
+ if (this.throwOnError && statusCode >= 400) {
+ const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
+ const contentType = parsedHeaders['content-type']
+ res = new PassThrough()
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-}
+ this.callback = null
+ this.runInAsyncScope(getResolveErrorBodyCallback, null,
+ { callback, body: res, contentType, statusCode, statusMessage, headers }
+ )
+ } else {
+ if (factory === null) {
+ return
+ }
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
+ res = this.runInAsyncScope(factory, null, {
+ statusCode,
+ headers,
+ opaque,
+ context
+ })
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
+ if (
+ !res ||
+ typeof res.write !== 'function' ||
+ typeof res.end !== 'function' ||
+ typeof res.on !== 'function'
+ ) {
+ throw new InvalidReturnValueError('expected Writable')
+ }
- return r;
-}
+ // TODO: Avoid finished. It registers an unnecessary amount of listeners.
+ finished(res, { readable: false }, (err) => {
+ const { callback, res, opaque, trailers, abort } = this
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
+ this.res = null
+ if (err || !res.readable) {
+ util.destroy(res, err)
+ }
-function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-}
+ this.callback = null
+ this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
-module.exports = __nccwpck_require__(6243)(exports);
+ if (err) {
+ abort()
+ }
+ })
+ }
-const {formatters} = module.exports;
+ res.on('drain', resume)
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
+ this.res = res
-formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
-};
+ const needDrain = res.writableNeedDrain !== undefined
+ ? res.writableNeedDrain
+ : res._writableState?.needDrain
+ return needDrain !== true
+ }
-/***/ }),
+ onData (chunk) {
+ const { res } = this
-/***/ 6243:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ return res ? res.write(chunk) : true
+ }
+ onComplete (trailers) {
+ const { res } = this
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- */
+ removeSignal(this)
-function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = __nccwpck_require__(900);
- createDebug.destroy = destroy;
+ if (!res) {
+ return
+ }
- Object.keys(env).forEach(key => {
- createDebug[key] = env[key];
- });
+ this.trailers = util.parseHeaders(trailers)
- /**
- * The currently active debug mode names, and names to skip.
- */
+ res.end()
+ }
- createDebug.names = [];
- createDebug.skips = [];
+ onError (err) {
+ const { res, callback, opaque, body } = this
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
- createDebug.formatters = {};
+ removeSignal(this)
- /**
- * Selects a color for a debug namespace
- * @param {String} namespace The namespace string for the debug instance to be colored
- * @return {Number|String} An ANSI color code for the given namespace
- * @api private
- */
- function selectColor(namespace) {
- let hash = 0;
+ this.factory = null
- for (let i = 0; i < namespace.length; i++) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
+ if (res) {
+ this.res = null
+ util.destroy(res, err)
+ } else if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
+ if (body) {
+ this.body = null
+ util.destroy(body, err)
+ }
+ }
+}
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
- function createDebug(namespace) {
- let prevTime;
- let enableOverride = null;
- let namespacesCache;
- let enabledCache;
+function stream (opts, factory, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ stream.call(this, opts, factory, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
- function debug(...args) {
- // Disabled?
- if (!debug.enabled) {
- return;
- }
+ try {
+ this.dispatch(opts, new StreamHandler(opts, factory, callback))
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
+}
- const self = debug;
+module.exports = stream
- // Set `diff` timestamp
- const curr = Number(new Date());
- const ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
+/***/ }),
- if (typeof args[0] !== 'string') {
- // Anything else let's inspect with %O
- args.unshift('%O');
- }
+/***/ 1882:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // Apply any `formatters` transformations
- let index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
- // If we encounter an escaped % then don't increase the array index
- if (match === '%%') {
- return '%';
- }
- index++;
- const formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- const val = args[index];
- match = formatter.call(self, val);
- // Now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- // Apply env-specific formatting (colors, etc.)
- createDebug.formatArgs.call(self, args);
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(8707)
+const { AsyncResource } = __nccwpck_require__(6698)
+const util = __nccwpck_require__(3440)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
+const assert = __nccwpck_require__(4589)
- const logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
+class UpgradeHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
- debug.namespace = namespace;
- debug.useColors = createDebug.useColors();
- debug.color = createDebug.selectColor(namespace);
- debug.extend = extend;
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- Object.defineProperty(debug, 'enabled', {
- enumerable: true,
- configurable: false,
- get: () => {
- if (enableOverride !== null) {
- return enableOverride;
- }
- if (namespacesCache !== createDebug.namespaces) {
- namespacesCache = createDebug.namespaces;
- enabledCache = createDebug.enabled(namespace);
- }
+ const { signal, opaque, responseHeaders } = opts
- return enabledCache;
- },
- set: v => {
- enableOverride = v;
- }
- });
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
- // Env-specific initialization logic for debug instances
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
+ super('UNDICI_UPGRADE')
- return debug;
- }
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.callback = callback
+ this.abort = null
+ this.context = null
- function extend(namespace, delimiter) {
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
+ addSignal(this, signal)
+ }
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.namespaces = namespaces;
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
- createDebug.names = [];
- createDebug.skips = [];
+ assert(this.callback)
- let i;
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- const len = split.length;
+ this.abort = abort
+ this.context = null
+ }
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- // ignore empty strings
- continue;
- }
+ onHeaders () {
+ throw new SocketError('bad upgrade', null)
+ }
- namespaces = split[i].replace(/\*/g, '.*?');
+ onUpgrade (statusCode, rawHeaders, socket) {
+ assert(statusCode === 101)
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
+ const { callback, opaque, context } = this
- /**
- * Disable debug output.
- *
- * @return {String} namespaces
- * @api public
- */
- function disable() {
- const namespaces = [
- ...createDebug.names.map(toNamespace),
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
- ].join(',');
- createDebug.enable('');
- return namespaces;
- }
+ removeSignal(this)
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
+ this.callback = null
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ this.runInAsyncScope(callback, null, null, {
+ headers,
+ socket,
+ opaque,
+ context
+ })
+ }
- let i;
- let len;
+ onError (err) {
+ const { callback, opaque } = this
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
+ removeSignal(this)
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
+ if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
+ }
+}
- return false;
- }
+function upgrade (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ upgrade.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
+
+ try {
+ const upgradeHandler = new UpgradeHandler(opts, callback)
+ this.dispatch({
+ ...opts,
+ method: opts.method || 'GET',
+ upgrade: opts.protocol || 'Websocket'
+ }, upgradeHandler)
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
+}
+
+module.exports = upgrade
- /**
- * Convert regexp to namespace
- *
- * @param {RegExp} regxep
- * @return {String} namespace
- * @api private
- */
- function toNamespace(regexp) {
- return regexp.toString()
- .substring(2, regexp.toString().length - 2)
- .replace(/\.\*\?$/, '*');
- }
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
+/***/ }),
- /**
- * XXX DO NOT USE. This is a temporary stub function.
- * XXX It WILL be removed in the next major release.
- */
- function destroy() {
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
+/***/ 6615:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- createDebug.enable(createDebug.load());
- return createDebug;
-}
-module.exports = setup;
+module.exports.request = __nccwpck_require__(4043)
+module.exports.stream = __nccwpck_require__(3560)
+module.exports.pipeline = __nccwpck_require__(6862)
+module.exports.upgrade = __nccwpck_require__(1882)
+module.exports.connect = __nccwpck_require__(2279)
/***/ }),
-/***/ 8237:
+/***/ 9927:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * Detect Electron renderer / nwjs process, which is node, but we should
- * treat as a browser.
- */
+// Ported from https://github.com/nodejs/undici/pull/907
-if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
- module.exports = __nccwpck_require__(8222);
-} else {
- module.exports = __nccwpck_require__(5332);
-}
-/***/ }),
+const assert = __nccwpck_require__(4589)
+const { Readable } = __nccwpck_require__(7075)
+const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { ReadableStreamFrom } = __nccwpck_require__(3440)
-/***/ 5332:
-/***/ ((module, exports, __nccwpck_require__) => {
+const kConsume = Symbol('kConsume')
+const kReading = Symbol('kReading')
+const kBody = Symbol('kBody')
+const kAbort = Symbol('kAbort')
+const kContentType = Symbol('kContentType')
+const kContentLength = Symbol('kContentLength')
-/**
- * Module dependencies.
- */
+const noop = () => {}
-const tty = __nccwpck_require__(6224);
-const util = __nccwpck_require__(3837);
+class BodyReadable extends Readable {
+ constructor ({
+ resume,
+ abort,
+ contentType = '',
+ contentLength,
+ highWaterMark = 64 * 1024 // Same as nodejs fs streams.
+ }) {
+ super({
+ autoDestroy: true,
+ read: resume,
+ highWaterMark
+ })
-/**
- * This is the Node.js implementation of `debug()`.
- */
+ this._readableState.dataEmitted = false
-exports.init = init;
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.destroy = util.deprecate(
- () => {},
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
-);
+ this[kAbort] = abort
+ this[kConsume] = null
+ this[kBody] = null
+ this[kContentType] = contentType
+ this[kContentLength] = contentLength
-/**
- * Colors.
- */
+ // Is stream being consumed through Readable API?
+ // This is an optimization so that we avoid checking
+ // for 'data' and 'readable' listeners in the hot path
+ // inside push().
+ this[kReading] = false
+ }
-exports.colors = [6, 2, 3, 4, 5, 1];
+ destroy (err) {
+ if (!err && !this._readableState.endEmitted) {
+ err = new RequestAbortedError()
+ }
-try {
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
- // eslint-disable-next-line import/no-extraneous-dependencies
- const supportsColor = __nccwpck_require__(9318);
+ if (err) {
+ this[kAbort]()
+ }
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
-} catch (error) {
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
-}
+ return super.destroy(err)
+ }
-/**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
+ _destroy (err, callback) {
+ // Workaround for Node "bug". If the stream is destroyed in same
+ // tick as it is created, then a user who is waiting for a
+ // promise (i.e micro tick) for installing a 'error' listener will
+ // never get a chance and will always encounter an unhandled exception.
+ if (!this[kReading]) {
+ setImmediate(() => {
+ callback(err)
+ })
+ } else {
+ callback(err)
+ }
+ }
-exports.inspectOpts = Object.keys(process.env).filter(key => {
- return /^debug_/i.test(key);
-}).reduce((obj, key) => {
- // Camel-case
- const prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
+ on (ev, ...args) {
+ if (ev === 'data' || ev === 'readable') {
+ this[kReading] = true
+ }
+ return super.on(ev, ...args)
+ }
- // Coerce string value into JS value
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === 'null') {
- val = null;
- } else {
- val = Number(val);
- }
+ addListener (ev, ...args) {
+ return this.on(ev, ...args)
+ }
- obj[prop] = val;
- return obj;
-}, {});
+ off (ev, ...args) {
+ const ret = super.off(ev, ...args)
+ if (ev === 'data' || ev === 'readable') {
+ this[kReading] = (
+ this.listenerCount('data') > 0 ||
+ this.listenerCount('readable') > 0
+ )
+ }
+ return ret
+ }
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+ removeListener (ev, ...args) {
+ return this.off(ev, ...args)
+ }
-function useColors() {
- return 'colors' in exports.inspectOpts ?
- Boolean(exports.inspectOpts.colors) :
- tty.isatty(process.stderr.fd);
-}
+ push (chunk) {
+ if (this[kConsume] && chunk !== null) {
+ consumePush(this[kConsume], chunk)
+ return this[kReading] ? super.push(chunk) : true
+ }
+ return super.push(chunk)
+ }
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
+ // https://fetch.spec.whatwg.org/#dom-body-text
+ async text () {
+ return consume(this, 'text')
+ }
-function formatArgs(args) {
- const {namespace: name, useColors} = this;
+ // https://fetch.spec.whatwg.org/#dom-body-json
+ async json () {
+ return consume(this, 'json')
+ }
- if (useColors) {
- const c = this.color;
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+ // https://fetch.spec.whatwg.org/#dom-body-blob
+ async blob () {
+ return consume(this, 'blob')
+ }
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
-}
+ // https://fetch.spec.whatwg.org/#dom-body-bytes
+ async bytes () {
+ return consume(this, 'bytes')
+ }
-function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- }
- return new Date().toISOString() + ' ';
-}
+ // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
+ async arrayBuffer () {
+ return consume(this, 'arrayBuffer')
+ }
-/**
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
- */
+ // https://fetch.spec.whatwg.org/#dom-body-formdata
+ async formData () {
+ // TODO: Implement.
+ throw new NotSupportedError()
+ }
-function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
-}
+ // https://fetch.spec.whatwg.org/#dom-body-bodyused
+ get bodyUsed () {
+ return util.isDisturbed(this)
+ }
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- }
-}
+ // https://fetch.spec.whatwg.org/#dom-body-body
+ get body () {
+ if (!this[kBody]) {
+ this[kBody] = ReadableStreamFrom(this)
+ if (this[kConsume]) {
+ // TODO: Is this the best way to force a lock?
+ this[kBody].getReader() // Ensure stream is locked.
+ assert(this[kBody].locked)
+ }
+ }
+ return this[kBody]
+ }
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ async dump (opts) {
+ let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024
+ const signal = opts?.signal
-function load() {
- return process.env.DEBUG;
-}
+ if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {
+ throw new InvalidArgumentError('signal must be an AbortSignal')
+ }
-/**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
+ signal?.throwIfAborted()
-function init(debug) {
- debug.inspectOpts = {};
+ if (this._readableState.closeEmitted) {
+ return null
+ }
- const keys = Object.keys(exports.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
+ return await new Promise((resolve, reject) => {
+ if (this[kContentLength] > limit) {
+ this.destroy(new AbortError())
+ }
+
+ const onAbort = () => {
+ this.destroy(signal.reason ?? new AbortError())
+ }
+ signal?.addEventListener('abort', onAbort)
+
+ this
+ .on('close', function () {
+ signal?.removeEventListener('abort', onAbort)
+ if (signal?.aborted) {
+ reject(signal.reason ?? new AbortError())
+ } else {
+ resolve(null)
+ }
+ })
+ .on('error', noop)
+ .on('data', function (chunk) {
+ limit -= chunk.length
+ if (limit <= 0) {
+ this.destroy()
+ }
+ })
+ .resume()
+ })
+ }
}
-module.exports = __nccwpck_require__(6243)(exports);
+// https://streams.spec.whatwg.org/#readablestream-locked
+function isLocked (self) {
+ // Consume is an implicit lock.
+ return (self[kBody] && self[kBody].locked === true) || self[kConsume]
+}
-const {formatters} = module.exports;
+// https://fetch.spec.whatwg.org/#body-unusable
+function isUnusable (self) {
+ return util.isDisturbed(self) || isLocked(self)
+}
-/**
- * Map %o to `util.inspect()`, all on a single line.
- */
+async function consume (stream, type) {
+ assert(!stream[kConsume])
-formatters.o = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n')
- .map(str => str.trim())
- .join(' ');
-};
+ return new Promise((resolve, reject) => {
+ if (isUnusable(stream)) {
+ const rState = stream._readableState
+ if (rState.destroyed && rState.closeEmitted === false) {
+ stream
+ .on('error', err => {
+ reject(err)
+ })
+ .on('close', () => {
+ reject(new TypeError('unusable'))
+ })
+ } else {
+ reject(rState.errored ?? new TypeError('unusable'))
+ }
+ } else {
+ queueMicrotask(() => {
+ stream[kConsume] = {
+ type,
+ stream,
+ resolve,
+ reject,
+ length: 0,
+ body: []
+ }
-/**
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
- */
+ stream
+ .on('error', function (err) {
+ consumeFinish(this[kConsume], err)
+ })
+ .on('close', function () {
+ if (this[kConsume].body !== null) {
+ consumeFinish(this[kConsume], new RequestAbortedError())
+ }
+ })
-formatters.O = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
-};
+ consumeStart(stream[kConsume])
+ })
+ }
+ })
+}
+function consumeStart (consume) {
+ if (consume.body === null) {
+ return
+ }
-/***/ }),
+ const { _readableState: state } = consume.stream
-/***/ 8611:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (state.bufferIndex) {
+ const start = state.bufferIndex
+ const end = state.buffer.length
+ for (let n = start; n < end; n++) {
+ consumePush(consume, state.buffer[n])
+ }
+ } else {
+ for (const chunk of state.buffer) {
+ consumePush(consume, chunk)
+ }
+ }
-var Stream = (__nccwpck_require__(2781).Stream);
-var util = __nccwpck_require__(3837);
+ if (state.endEmitted) {
+ consumeEnd(this[kConsume])
+ } else {
+ consume.stream.on('end', function () {
+ consumeEnd(this[kConsume])
+ })
+ }
-module.exports = DelayedStream;
-function DelayedStream() {
- this.source = null;
- this.dataSize = 0;
- this.maxDataSize = 1024 * 1024;
- this.pauseStream = true;
+ consume.stream.resume()
- this._maxDataSizeExceeded = false;
- this._released = false;
- this._bufferedEvents = [];
+ while (consume.stream.read() != null) {
+ // Loop
+ }
}
-util.inherits(DelayedStream, Stream);
-
-DelayedStream.create = function(source, options) {
- var delayedStream = new this();
- options = options || {};
- for (var option in options) {
- delayedStream[option] = options[option];
+/**
+ * @param {Buffer[]} chunks
+ * @param {number} length
+ */
+function chunksDecode (chunks, length) {
+ if (chunks.length === 0 || length === 0) {
+ return ''
}
+ const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)
+ const bufferLength = buffer.length
- delayedStream.source = source;
+ // Skip BOM.
+ const start =
+ bufferLength > 2 &&
+ buffer[0] === 0xef &&
+ buffer[1] === 0xbb &&
+ buffer[2] === 0xbf
+ ? 3
+ : 0
+ return buffer.utf8Slice(start, bufferLength)
+}
- var realEmit = source.emit;
- source.emit = function() {
- delayedStream._handleEmit(arguments);
- return realEmit.apply(source, arguments);
- };
+/**
+ * @param {Buffer[]} chunks
+ * @param {number} length
+ * @returns {Uint8Array}
+ */
+function chunksConcat (chunks, length) {
+ if (chunks.length === 0 || length === 0) {
+ return new Uint8Array(0)
+ }
+ if (chunks.length === 1) {
+ // fast-path
+ return new Uint8Array(chunks[0])
+ }
+ const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)
- source.on('error', function() {});
- if (delayedStream.pauseStream) {
- source.pause();
+ let offset = 0
+ for (let i = 0; i < chunks.length; ++i) {
+ const chunk = chunks[i]
+ buffer.set(chunk, offset)
+ offset += chunk.length
}
- return delayedStream;
-};
+ return buffer
+}
-Object.defineProperty(DelayedStream.prototype, 'readable', {
- configurable: true,
- enumerable: true,
- get: function() {
- return this.source.readable;
+function consumeEnd (consume) {
+ const { type, body, resolve, stream, length } = consume
+
+ try {
+ if (type === 'text') {
+ resolve(chunksDecode(body, length))
+ } else if (type === 'json') {
+ resolve(JSON.parse(chunksDecode(body, length)))
+ } else if (type === 'arrayBuffer') {
+ resolve(chunksConcat(body, length).buffer)
+ } else if (type === 'blob') {
+ resolve(new Blob(body, { type: stream[kContentType] }))
+ } else if (type === 'bytes') {
+ resolve(chunksConcat(body, length))
+ }
+
+ consumeFinish(consume)
+ } catch (err) {
+ stream.destroy(err)
}
-});
+}
-DelayedStream.prototype.setEncoding = function() {
- return this.source.setEncoding.apply(this.source, arguments);
-};
+function consumePush (consume, chunk) {
+ consume.length += chunk.length
+ consume.body.push(chunk)
+}
+
+function consumeFinish (consume, err) {
+ if (consume.body === null) {
+ return
+ }
-DelayedStream.prototype.resume = function() {
- if (!this._released) {
- this.release();
+ if (err) {
+ consume.reject(err)
+ } else {
+ consume.resolve()
}
- this.source.resume();
-};
+ consume.type = null
+ consume.stream = null
+ consume.resolve = null
+ consume.reject = null
+ consume.length = 0
+ consume.body = null
+}
-DelayedStream.prototype.pause = function() {
- this.source.pause();
-};
+module.exports = { Readable: BodyReadable, chunksDecode }
-DelayedStream.prototype.release = function() {
- this._released = true;
- this._bufferedEvents.forEach(function(args) {
- this.emit.apply(this, args);
- }.bind(this));
- this._bufferedEvents = [];
-};
+/***/ }),
-DelayedStream.prototype.pipe = function() {
- var r = Stream.prototype.pipe.apply(this, arguments);
- this.resume();
- return r;
-};
+/***/ 7655:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-DelayedStream.prototype._handleEmit = function(args) {
- if (this._released) {
- this.emit.apply(this, args);
- return;
- }
+const assert = __nccwpck_require__(4589)
+const {
+ ResponseStatusCodeError
+} = __nccwpck_require__(8707)
- if (args[0] === 'data') {
- this.dataSize += args[1].length;
- this._checkIfMaxDataSizeExceeded();
- }
+const { chunksDecode } = __nccwpck_require__(9927)
+const CHUNK_LIMIT = 128 * 1024
- this._bufferedEvents.push(args);
-};
+async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
+ assert(body)
-DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
- if (this._maxDataSizeExceeded) {
- return;
+ let chunks = []
+ let length = 0
+
+ try {
+ for await (const chunk of body) {
+ chunks.push(chunk)
+ length += chunk.length
+ if (length > CHUNK_LIMIT) {
+ chunks = []
+ length = 0
+ break
+ }
+ }
+ } catch {
+ chunks = []
+ length = 0
+ // Do nothing....
}
- if (this.dataSize <= this.maxDataSize) {
- return;
+ const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`
+
+ if (statusCode === 204 || !contentType || !length) {
+ queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))
+ return
}
- this._maxDataSizeExceeded = true;
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
- this.emit('error', new Error(message));
-};
+ const stackTraceLimit = Error.stackTraceLimit
+ Error.stackTraceLimit = 0
+ let payload
+ try {
+ if (isContentTypeApplicationJson(contentType)) {
+ payload = JSON.parse(chunksDecode(chunks, length))
+ } else if (isContentTypeText(contentType)) {
+ payload = chunksDecode(chunks, length)
+ }
+ } catch {
+ // process in a callback to avoid throwing in the microtask queue
+ } finally {
+ Error.stackTraceLimit = stackTraceLimit
+ }
+ queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))
+}
-/***/ }),
+const isContentTypeApplicationJson = (contentType) => {
+ return (
+ contentType.length > 15 &&
+ contentType[11] === '/' &&
+ contentType[0] === 'a' &&
+ contentType[1] === 'p' &&
+ contentType[2] === 'p' &&
+ contentType[3] === 'l' &&
+ contentType[4] === 'i' &&
+ contentType[5] === 'c' &&
+ contentType[6] === 'a' &&
+ contentType[7] === 't' &&
+ contentType[8] === 'i' &&
+ contentType[9] === 'o' &&
+ contentType[10] === 'n' &&
+ contentType[12] === 'j' &&
+ contentType[13] === 's' &&
+ contentType[14] === 'o' &&
+ contentType[15] === 'n'
+ )
+}
-/***/ 8932:
-/***/ ((__unused_webpack_module, exports) => {
+const isContentTypeText = (contentType) => {
+ return (
+ contentType.length > 4 &&
+ contentType[4] === '/' &&
+ contentType[0] === 't' &&
+ contentType[1] === 'e' &&
+ contentType[2] === 'x' &&
+ contentType[3] === 't'
+ )
+}
-"use strict";
+module.exports = {
+ getResolveErrorBodyCallback,
+ isContentTypeApplicationJson,
+ isContentTypeText
+}
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+/***/ }),
-class Deprecation extends Error {
- constructor(message) {
- super(message); // Maintains proper stack trace (only available on V8)
+/***/ 9136:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- /* istanbul ignore next */
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- }
- this.name = 'Deprecation';
- }
+const net = __nccwpck_require__(7030)
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8707)
+const timers = __nccwpck_require__(6603)
-}
+function noop () {}
-exports.Deprecation = Deprecation;
+let tls // include tls conditionally since it is not always available
+// TODO: session re-use does not wait for the first
+// connection to resolve the session and might therefore
+// resolve the same servername multiple times even when
+// re-use is enabled.
-/***/ }),
+let SessionCache
+// FIXME: remove workaround when the Node bug is fixed
+// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
+if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {
+ SessionCache = class WeakSessionCache {
+ constructor (maxCachedSessions) {
+ this._maxCachedSessions = maxCachedSessions
+ this._sessionCache = new Map()
+ this._sessionRegistry = new global.FinalizationRegistry((key) => {
+ if (this._sessionCache.size < this._maxCachedSessions) {
+ return
+ }
-/***/ 1848:
-/***/ ((module) => {
+ const ref = this._sessionCache.get(key)
+ if (ref !== undefined && ref.deref() === undefined) {
+ this._sessionCache.delete(key)
+ }
+ })
+ }
-"use strict";
+ get (sessionKey) {
+ const ref = this._sessionCache.get(sessionKey)
+ return ref ? ref.deref() : null
+ }
+ set (sessionKey, session) {
+ if (this._maxCachedSessions === 0) {
+ return
+ }
-var has = Object.prototype.hasOwnProperty
- , prefix = '~';
+ this._sessionCache.set(sessionKey, new WeakRef(session))
+ this._sessionRegistry.register(session, sessionKey)
+ }
+ }
+} else {
+ SessionCache = class SimpleSessionCache {
+ constructor (maxCachedSessions) {
+ this._maxCachedSessions = maxCachedSessions
+ this._sessionCache = new Map()
+ }
-/**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
-function Events() {}
+ get (sessionKey) {
+ return this._sessionCache.get(sessionKey)
+ }
-//
-// We try to not inherit from `Object.prototype`. In some engines creating an
-// instance in this way is faster than calling `Object.create(null)` directly.
-// If `Object.create(null)` is not supported we prefix the event names with a
-// character to make sure that the built-in object properties are not
-// overridden or used as an attack vector.
-//
-if (Object.create) {
- Events.prototype = Object.create(null);
+ set (sessionKey, session) {
+ if (this._maxCachedSessions === 0) {
+ return
+ }
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
-}
+ if (this._sessionCache.size >= this._maxCachedSessions) {
+ // remove the oldest session
+ const { value: oldestKey } = this._sessionCache.keys().next()
+ this._sessionCache.delete(oldestKey)
+ }
-/**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
-function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
+ this._sessionCache.set(sessionKey, session)
+ }
+ }
}
-/**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
-function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
+function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
+ if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
+ throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
}
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
+ const options = { path: socketPath, ...opts }
+ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
+ timeout = timeout == null ? 10e3 : timeout
+ allowH2 = allowH2 != null ? allowH2 : false
+ return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
+ let socket
+ if (protocol === 'https:') {
+ if (!tls) {
+ tls = __nccwpck_require__(1692)
+ }
+ servername = servername || options.servername || util.getServerName(host) || null
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
+ const sessionKey = servername || hostname
+ assert(sessionKey)
- return emitter;
-}
+ const session = customSession || sessionCache.get(sessionKey) || null
-/**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
-function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
-}
+ port = port || 443
-/**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
-function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
-}
+ socket = tls.connect({
+ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
+ ...options,
+ servername,
+ session,
+ localAddress,
+ // TODO(HTTP/2): Add support for h2c
+ ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
+ socket: httpSocket, // upgrade socket connection
+ port,
+ host: hostname
+ })
-/**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
-EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
+ socket
+ .on('session', function (session) {
+ // TODO (fix): Can a session become invalid once established? Don't think so?
+ sessionCache.set(sessionKey, session)
+ })
+ } else {
+ assert(!httpSocket, 'httpSocket can only be sent on TLS update')
- if (this._eventsCount === 0) return names;
+ port = port || 80
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
+ socket = net.connect({
+ highWaterMark: 64 * 1024, // Same as nodejs fs streams.
+ ...options,
+ localAddress,
+ port,
+ host: hostname
+ })
+ }
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
+ // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
+ if (options.keepAlive == null || options.keepAlive) {
+ const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
+ socket.setKeepAlive(true, keepAliveInitialDelay)
+ }
- return names;
-};
+ const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })
-/**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
-EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
+ socket
+ .setNoDelay(true)
+ .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
+ queueMicrotask(clearConnectTimeout)
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb(null, this)
+ }
+ })
+ .on('error', function (err) {
+ queueMicrotask(clearConnectTimeout)
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb(err)
+ }
+ })
- return ee;
-};
+ return socket
+ }
+}
/**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
+ * @param {WeakRef} socketWeakRef
+ * @param {object} opts
+ * @param {number} opts.timeout
+ * @param {string} opts.hostname
+ * @param {number} opts.port
+ * @returns {() => void}
*/
-EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
+const setupConnectTimeout = process.platform === 'win32'
+ ? (socketWeakRef, opts) => {
+ if (!opts.timeout) {
+ return noop
+ }
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
-};
+ let s1 = null
+ let s2 = null
+ const fastTimer = timers.setFastTimeout(() => {
+ // setImmediate is added to make sure that we prioritize socket error events over timeouts
+ s1 = setImmediate(() => {
+ // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
+ s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))
+ })
+ }, opts.timeout)
+ return () => {
+ timers.clearFastTimeout(fastTimer)
+ clearImmediate(s1)
+ clearImmediate(s2)
+ }
+ }
+ : (socketWeakRef, opts) => {
+ if (!opts.timeout) {
+ return noop
+ }
+
+ let s1 = null
+ const fastTimer = timers.setFastTimeout(() => {
+ // setImmediate is added to make sure that we prioritize socket error events over timeouts
+ s1 = setImmediate(() => {
+ onConnectTimeout(socketWeakRef.deref(), opts)
+ })
+ }, opts.timeout)
+ return () => {
+ timers.clearFastTimeout(fastTimer)
+ clearImmediate(s1)
+ }
+ }
/**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
+ * @param {net.Socket} socket
+ * @param {object} opts
+ * @param {number} opts.timeout
+ * @param {string} opts.hostname
+ * @param {number} opts.port
*/
-EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
+function onConnectTimeout (socket, opts) {
+ // The socket could be already garbage collected
+ if (socket == null) {
+ return
+ }
- if (!this._events[evt]) return false;
+ let message = 'Connect Timeout Error'
+ if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
+ message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`
+ } else {
+ message += ` (attempted address: ${opts.hostname}:${opts.port},`
+ }
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
+ message += ` timeout: ${opts.timeout}ms)`
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+ util.destroy(socket, new ConnectTimeoutError(message))
+}
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
+module.exports = buildConnector
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
+/***/ }),
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+/***/ 735:
+/***/ ((module) => {
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
- return true;
-};
+/** @type {Record} */
+const headerNameLowerCasedRecord = {}
-/**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
-};
+// https://developer.mozilla.org/docs/Web/HTTP/Headers
+const wellknownHeaderNames = [
+ 'Accept',
+ 'Accept-Encoding',
+ 'Accept-Language',
+ 'Accept-Ranges',
+ 'Access-Control-Allow-Credentials',
+ 'Access-Control-Allow-Headers',
+ 'Access-Control-Allow-Methods',
+ 'Access-Control-Allow-Origin',
+ 'Access-Control-Expose-Headers',
+ 'Access-Control-Max-Age',
+ 'Access-Control-Request-Headers',
+ 'Access-Control-Request-Method',
+ 'Age',
+ 'Allow',
+ 'Alt-Svc',
+ 'Alt-Used',
+ 'Authorization',
+ 'Cache-Control',
+ 'Clear-Site-Data',
+ 'Connection',
+ 'Content-Disposition',
+ 'Content-Encoding',
+ 'Content-Language',
+ 'Content-Length',
+ 'Content-Location',
+ 'Content-Range',
+ 'Content-Security-Policy',
+ 'Content-Security-Policy-Report-Only',
+ 'Content-Type',
+ 'Cookie',
+ 'Cross-Origin-Embedder-Policy',
+ 'Cross-Origin-Opener-Policy',
+ 'Cross-Origin-Resource-Policy',
+ 'Date',
+ 'Device-Memory',
+ 'Downlink',
+ 'ECT',
+ 'ETag',
+ 'Expect',
+ 'Expect-CT',
+ 'Expires',
+ 'Forwarded',
+ 'From',
+ 'Host',
+ 'If-Match',
+ 'If-Modified-Since',
+ 'If-None-Match',
+ 'If-Range',
+ 'If-Unmodified-Since',
+ 'Keep-Alive',
+ 'Last-Modified',
+ 'Link',
+ 'Location',
+ 'Max-Forwards',
+ 'Origin',
+ 'Permissions-Policy',
+ 'Pragma',
+ 'Proxy-Authenticate',
+ 'Proxy-Authorization',
+ 'RTT',
+ 'Range',
+ 'Referer',
+ 'Referrer-Policy',
+ 'Refresh',
+ 'Retry-After',
+ 'Sec-WebSocket-Accept',
+ 'Sec-WebSocket-Extensions',
+ 'Sec-WebSocket-Key',
+ 'Sec-WebSocket-Protocol',
+ 'Sec-WebSocket-Version',
+ 'Server',
+ 'Server-Timing',
+ 'Service-Worker-Allowed',
+ 'Service-Worker-Navigation-Preload',
+ 'Set-Cookie',
+ 'SourceMap',
+ 'Strict-Transport-Security',
+ 'Supports-Loading-Mode',
+ 'TE',
+ 'Timing-Allow-Origin',
+ 'Trailer',
+ 'Transfer-Encoding',
+ 'Upgrade',
+ 'Upgrade-Insecure-Requests',
+ 'User-Agent',
+ 'Vary',
+ 'Via',
+ 'WWW-Authenticate',
+ 'X-Content-Type-Options',
+ 'X-DNS-Prefetch-Control',
+ 'X-Frame-Options',
+ 'X-Permitted-Cross-Domain-Policies',
+ 'X-Powered-By',
+ 'X-Requested-With',
+ 'X-XSS-Protection'
+]
-/**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
-};
+for (let i = 0; i < wellknownHeaderNames.length; ++i) {
+ const key = wellknownHeaderNames[i]
+ const lowerCasedKey = key.toLowerCase()
+ headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
+ lowerCasedKey
+}
-/**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
+// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
+Object.setPrototypeOf(headerNameLowerCasedRecord, null)
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
+module.exports = {
+ wellknownHeaderNames,
+ headerNameLowerCasedRecord
+}
- var listeners = this._events[evt];
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
+/***/ }),
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
+/***/ 2414:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return this;
-};
-/**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
+const diagnosticsChannel = __nccwpck_require__(3053)
+const util = __nccwpck_require__(7975)
+
+const undiciDebugLog = util.debuglog('undici')
+const fetchDebuglog = util.debuglog('fetch')
+const websocketDebuglog = util.debuglog('websocket')
+let isClientSet = false
+const channels = {
+ // Client
+ beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),
+ connected: diagnosticsChannel.channel('undici:client:connected'),
+ connectError: diagnosticsChannel.channel('undici:client:connectError'),
+ sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),
+ // Request
+ create: diagnosticsChannel.channel('undici:request:create'),
+ bodySent: diagnosticsChannel.channel('undici:request:bodySent'),
+ headers: diagnosticsChannel.channel('undici:request:headers'),
+ trailers: diagnosticsChannel.channel('undici:request:trailers'),
+ error: diagnosticsChannel.channel('undici:request:error'),
+ // WebSocket
+ open: diagnosticsChannel.channel('undici:websocket:open'),
+ close: diagnosticsChannel.channel('undici:websocket:close'),
+ socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),
+ ping: diagnosticsChannel.channel('undici:websocket:ping'),
+ pong: diagnosticsChannel.channel('undici:websocket:pong')
+}
+
+if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
+ const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog
+
+ // Track all Client events
+ diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connecting to %s using %s%s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version
+ )
+ })
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
+ diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connected to %s using %s%s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version
+ )
+ })
- return this;
-};
+ diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host },
+ error
+ } = evt
+ debuglog(
+ 'connection to %s using %s%s errored - %s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version,
+ error.message
+ )
+ })
-//
-// Alias methods names because people roll like that.
-//
-EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+ diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('sending request to %s %s/%s', method, origin, path)
+ })
-//
-// Expose the prefix.
-//
-EventEmitter.prefixed = prefix;
+ // Track Request events
+ diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {
+ const {
+ request: { method, path, origin },
+ response: { statusCode }
+ } = evt
+ debuglog(
+ 'received response to %s %s/%s - HTTP %d',
+ method,
+ origin,
+ path,
+ statusCode
+ )
+ })
-//
-// Allow `EventEmitter` to be imported as module namespace.
-//
-EventEmitter.EventEmitter = EventEmitter;
+ diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('trailers received from %s %s/%s', method, origin, path)
+ })
-//
-// Expose the module.
-//
-if (true) {
- module.exports = EventEmitter;
-}
+ diagnosticsChannel.channel('undici:request:error').subscribe(evt => {
+ const {
+ request: { method, path, origin },
+ error
+ } = evt
+ debuglog(
+ 'request to %s %s/%s errored - %s',
+ method,
+ origin,
+ path,
+ error.message
+ )
+ })
+ isClientSet = true
+}
-/***/ }),
+if (websocketDebuglog.enabled) {
+ if (!isClientSet) {
+ const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog
+ diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connecting to %s%s using %s%s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version
+ )
+ })
-/***/ 1133:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connected to %s%s using %s%s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version
+ )
+ })
-var debug;
+ diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host },
+ error
+ } = evt
+ debuglog(
+ 'connection to %s%s using %s%s errored - %s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version,
+ error.message
+ )
+ })
-module.exports = function () {
- if (!debug) {
- try {
- /* eslint global-require: off */
- debug = __nccwpck_require__(8237)("follow-redirects");
- }
- catch (error) { /* */ }
- if (typeof debug !== "function") {
- debug = function () { /* */ };
- }
+ diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('sending request to %s %s/%s', method, origin, path)
+ })
}
- debug.apply(null, arguments);
-};
+ // Track all WebSocket events
+ diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {
+ const {
+ address: { address, port }
+ } = evt
+ websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')
+ })
-/***/ }),
+ diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {
+ const { websocket, code, reason } = evt
+ websocketDebuglog(
+ 'closed connection to %s - %s %s',
+ websocket.url,
+ code,
+ reason
+ )
+ })
-/***/ 7707:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {
+ websocketDebuglog('connection errored - %s', err.message)
+ })
-var url = __nccwpck_require__(7310);
-var URL = url.URL;
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var Writable = (__nccwpck_require__(2781).Writable);
-var assert = __nccwpck_require__(9491);
-var debug = __nccwpck_require__(1133);
+ diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {
+ websocketDebuglog('ping received')
+ })
-// Whether to use the native URL object or the legacy url module
-var useNativeURL = false;
-try {
- assert(new URL());
+ diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {
+ websocketDebuglog('pong received')
+ })
}
-catch (error) {
- useNativeURL = error.code === "ERR_INVALID_URL";
+
+module.exports = {
+ channels
}
-// URL fields to preserve in copy operations
-var preservedUrlFields = [
- "auth",
- "host",
- "hostname",
- "href",
- "path",
- "pathname",
- "port",
- "protocol",
- "query",
- "search",
- "hash",
-];
-// Create handlers that pass events from native requests
-var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
-var eventHandlers = Object.create(null);
-events.forEach(function (event) {
- eventHandlers[event] = function (arg1, arg2, arg3) {
- this._redirectable.emit(event, arg1, arg2, arg3);
- };
-});
+/***/ }),
-// Error types with codes
-var InvalidUrlError = createErrorType(
- "ERR_INVALID_URL",
- "Invalid URL",
- TypeError
-);
-var RedirectionError = createErrorType(
- "ERR_FR_REDIRECTION_FAILURE",
- "Redirected request failed"
-);
-var TooManyRedirectsError = createErrorType(
- "ERR_FR_TOO_MANY_REDIRECTS",
- "Maximum number of redirects exceeded",
- RedirectionError
-);
-var MaxBodyLengthExceededError = createErrorType(
- "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
- "Request body larger than maxBodyLength limit"
-);
-var WriteAfterEndError = createErrorType(
- "ERR_STREAM_WRITE_AFTER_END",
- "write after end"
-);
+/***/ 8707:
+/***/ ((module) => {
-// istanbul ignore next
-var destroy = Writable.prototype.destroy || noop;
-// An HTTP(S) request that can be redirected
-function RedirectableRequest(options, responseCallback) {
- // Initialize the request
- Writable.call(this);
- this._sanitizeOptions(options);
- this._options = options;
- this._ended = false;
- this._ending = false;
- this._redirectCount = 0;
- this._redirects = [];
- this._requestBodyLength = 0;
- this._requestBodyBuffers = [];
- // Attach a callback if passed
- if (responseCallback) {
- this.on("response", responseCallback);
+const kUndiciError = Symbol.for('undici.error.UND_ERR')
+class UndiciError extends Error {
+ constructor (message) {
+ super(message)
+ this.name = 'UndiciError'
+ this.code = 'UND_ERR'
}
- // React to responses of native requests
- var self = this;
- this._onNativeResponse = function (response) {
- try {
- self._processResponse(response);
- }
- catch (cause) {
- self.emit("error", cause instanceof RedirectionError ?
- cause : new RedirectionError({ cause: cause }));
- }
- };
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kUndiciError] === true
+ }
- // Perform the first request
- this._performRequest();
+ [kUndiciError] = true
}
-RedirectableRequest.prototype = Object.create(Writable.prototype);
-
-RedirectableRequest.prototype.abort = function () {
- destroyRequest(this._currentRequest);
- this._currentRequest.abort();
- this.emit("abort");
-};
-
-RedirectableRequest.prototype.destroy = function (error) {
- destroyRequest(this._currentRequest, error);
- destroy.call(this, error);
- return this;
-};
-// Writes buffered data to the current native request
-RedirectableRequest.prototype.write = function (data, encoding, callback) {
- // Writing is not allowed if end has been called
- if (this._ending) {
- throw new WriteAfterEndError();
+const kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')
+class ConnectTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ConnectTimeoutError'
+ this.message = message || 'Connect Timeout Error'
+ this.code = 'UND_ERR_CONNECT_TIMEOUT'
}
- // Validate input and shift parameters if necessary
- if (!isString(data) && !isBuffer(data)) {
- throw new TypeError("data should be a string, Buffer or Uint8Array");
- }
- if (isFunction(encoding)) {
- callback = encoding;
- encoding = null;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kConnectTimeoutError] === true
}
- // Ignore empty buffers, since writing them doesn't invoke the callback
- // https://github.com/nodejs/node/issues/22066
- if (data.length === 0) {
- if (callback) {
- callback();
- }
- return;
- }
- // Only write when we don't exceed the maximum body length
- if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
- this._requestBodyLength += data.length;
- this._requestBodyBuffers.push({ data: data, encoding: encoding });
- this._currentRequest.write(data, encoding, callback);
- }
- // Error when we exceed the maximum body length
- else {
- this.emit("error", new MaxBodyLengthExceededError());
- this.abort();
- }
-};
+ [kConnectTimeoutError] = true
+}
-// Ends the current native request
-RedirectableRequest.prototype.end = function (data, encoding, callback) {
- // Shift parameters if necessary
- if (isFunction(data)) {
- callback = data;
- data = encoding = null;
- }
- else if (isFunction(encoding)) {
- callback = encoding;
- encoding = null;
+const kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')
+class HeadersTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'HeadersTimeoutError'
+ this.message = message || 'Headers Timeout Error'
+ this.code = 'UND_ERR_HEADERS_TIMEOUT'
}
- // Write data if needed and end
- if (!data) {
- this._ended = this._ending = true;
- this._currentRequest.end(null, null, callback);
- }
- else {
- var self = this;
- var currentRequest = this._currentRequest;
- this.write(data, encoding, function () {
- self._ended = true;
- currentRequest.end(null, null, callback);
- });
- this._ending = true;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHeadersTimeoutError] === true
}
-};
-
-// Sets a header value on the current native request
-RedirectableRequest.prototype.setHeader = function (name, value) {
- this._options.headers[name] = value;
- this._currentRequest.setHeader(name, value);
-};
-// Clears a header value on the current native request
-RedirectableRequest.prototype.removeHeader = function (name) {
- delete this._options.headers[name];
- this._currentRequest.removeHeader(name);
-};
-
-// Global timeout for all underlying requests
-RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
- var self = this;
+ [kHeadersTimeoutError] = true
+}
- // Destroys the socket on timeout
- function destroyOnTimeout(socket) {
- socket.setTimeout(msecs);
- socket.removeListener("timeout", socket.destroy);
- socket.addListener("timeout", socket.destroy);
+const kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')
+class HeadersOverflowError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'HeadersOverflowError'
+ this.message = message || 'Headers Overflow Error'
+ this.code = 'UND_ERR_HEADERS_OVERFLOW'
}
- // Sets up a timer to trigger a timeout event
- function startTimer(socket) {
- if (self._timeout) {
- clearTimeout(self._timeout);
- }
- self._timeout = setTimeout(function () {
- self.emit("timeout");
- clearTimer();
- }, msecs);
- destroyOnTimeout(socket);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHeadersOverflowError] === true
}
- // Stops a timeout from triggering
- function clearTimer() {
- // Clear the timeout
- if (self._timeout) {
- clearTimeout(self._timeout);
- self._timeout = null;
- }
+ [kHeadersOverflowError] = true
+}
- // Clean up all attached listeners
- self.removeListener("abort", clearTimer);
- self.removeListener("error", clearTimer);
- self.removeListener("response", clearTimer);
- self.removeListener("close", clearTimer);
- if (callback) {
- self.removeListener("timeout", callback);
- }
- if (!self.socket) {
- self._currentRequest.removeListener("socket", startTimer);
- }
+const kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')
+class BodyTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'BodyTimeoutError'
+ this.message = message || 'Body Timeout Error'
+ this.code = 'UND_ERR_BODY_TIMEOUT'
}
- // Attach callback if passed
- if (callback) {
- this.on("timeout", callback);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kBodyTimeoutError] === true
}
- // Start the timer if or when the socket is opened
- if (this.socket) {
- startTimer(this.socket);
- }
- else {
- this._currentRequest.once("socket", startTimer);
- }
+ [kBodyTimeoutError] = true
+}
- // Clean up on events
- this.on("socket", destroyOnTimeout);
- this.on("abort", clearTimer);
- this.on("error", clearTimer);
- this.on("response", clearTimer);
- this.on("close", clearTimer);
+const kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')
+class ResponseStatusCodeError extends UndiciError {
+ constructor (message, statusCode, headers, body) {
+ super(message)
+ this.name = 'ResponseStatusCodeError'
+ this.message = message || 'Response Status Code Error'
+ this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
+ this.body = body
+ this.status = statusCode
+ this.statusCode = statusCode
+ this.headers = headers
+ }
- return this;
-};
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseStatusCodeError] === true
+ }
-// Proxy all other public ClientRequest methods
-[
- "flushHeaders", "getHeader",
- "setNoDelay", "setSocketKeepAlive",
-].forEach(function (method) {
- RedirectableRequest.prototype[method] = function (a, b) {
- return this._currentRequest[method](a, b);
- };
-});
+ [kResponseStatusCodeError] = true
+}
-// Proxy all public ClientRequest properties
-["aborted", "connection", "socket"].forEach(function (property) {
- Object.defineProperty(RedirectableRequest.prototype, property, {
- get: function () { return this._currentRequest[property]; },
- });
-});
+const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')
+class InvalidArgumentError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InvalidArgumentError'
+ this.message = message || 'Invalid Argument Error'
+ this.code = 'UND_ERR_INVALID_ARG'
+ }
-RedirectableRequest.prototype._sanitizeOptions = function (options) {
- // Ensure headers are always present
- if (!options.headers) {
- options.headers = {};
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInvalidArgumentError] === true
}
- // Since http.request treats host as an alias of hostname,
- // but the url module interprets host as hostname plus port,
- // eliminate the host property to avoid confusion.
- if (options.host) {
- // Use hostname if set, because it has precedence
- if (!options.hostname) {
- options.hostname = options.host;
- }
- delete options.host;
+ [kInvalidArgumentError] = true
+}
+
+const kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')
+class InvalidReturnValueError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InvalidReturnValueError'
+ this.message = message || 'Invalid Return Value Error'
+ this.code = 'UND_ERR_INVALID_RETURN_VALUE'
}
- // Complete the URL object when necessary
- if (!options.pathname && options.path) {
- var searchPos = options.path.indexOf("?");
- if (searchPos < 0) {
- options.pathname = options.path;
- }
- else {
- options.pathname = options.path.substring(0, searchPos);
- options.search = options.path.substring(searchPos);
- }
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInvalidReturnValueError] === true
}
-};
+ [kInvalidReturnValueError] = true
+}
-// Executes the next native request (initial or redirect)
-RedirectableRequest.prototype._performRequest = function () {
- // Load the native protocol
- var protocol = this._options.protocol;
- var nativeProtocol = this._options.nativeProtocols[protocol];
- if (!nativeProtocol) {
- throw new TypeError("Unsupported protocol " + protocol);
+const kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')
+class AbortError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'AbortError'
+ this.message = message || 'The operation was aborted'
+ this.code = 'UND_ERR_ABORT'
}
- // If specified, use the agent corresponding to the protocol
- // (HTTP and HTTPS use different types of agents)
- if (this._options.agents) {
- var scheme = protocol.slice(0, -1);
- this._options.agent = this._options.agents[scheme];
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kAbortError] === true
}
- // Create the native request and set up its event handlers
- var request = this._currentRequest =
- nativeProtocol.request(this._options, this._onNativeResponse);
- request._redirectable = this;
- for (var event of events) {
- request.on(event, eventHandlers[event]);
+ [kAbortError] = true
+}
+
+const kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')
+class RequestAbortedError extends AbortError {
+ constructor (message) {
+ super(message)
+ this.name = 'AbortError'
+ this.message = message || 'Request aborted'
+ this.code = 'UND_ERR_ABORTED'
}
- // RFC7230§5.3.1: When making a request directly to an origin server, […]
- // a client MUST send only the absolute path […] as the request-target.
- this._currentUrl = /^\//.test(this._options.path) ?
- url.format(this._options) :
- // When making a request to a proxy, […]
- // a client MUST send the target URI in absolute-form […].
- this._options.path;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestAbortedError] === true
+ }
- // End a redirected request
- // (The first request must be ended explicitly with RedirectableRequest#end)
- if (this._isRedirect) {
- // Write the request entity and end
- var i = 0;
- var self = this;
- var buffers = this._requestBodyBuffers;
- (function writeNext(error) {
- // Only write if this request has not been redirected yet
- /* istanbul ignore else */
- if (request === self._currentRequest) {
- // Report any write errors
- /* istanbul ignore if */
- if (error) {
- self.emit("error", error);
- }
- // Write the next buffer if there are still left
- else if (i < buffers.length) {
- var buffer = buffers[i++];
- /* istanbul ignore else */
- if (!request.finished) {
- request.write(buffer.data, buffer.encoding, writeNext);
- }
- }
- // End the request if `end` has been called on us
- else if (self._ended) {
- request.end();
- }
- }
- }());
+ [kRequestAbortedError] = true
+}
+
+const kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')
+class InformationalError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InformationalError'
+ this.message = message || 'Request information'
+ this.code = 'UND_ERR_INFO'
}
-};
-// Processes a response from the current native request
-RedirectableRequest.prototype._processResponse = function (response) {
- // Store the redirected response
- var statusCode = response.statusCode;
- if (this._options.trackRedirects) {
- this._redirects.push({
- url: this._currentUrl,
- headers: response.headers,
- statusCode: statusCode,
- });
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInformationalError] === true
}
- // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
- // that further action needs to be taken by the user agent in order to
- // fulfill the request. If a Location header field is provided,
- // the user agent MAY automatically redirect its request to the URI
- // referenced by the Location field value,
- // even if the specific status code is not understood.
+ [kInformationalError] = true
+}
- // If the response is not a redirect; return it as-is
- var location = response.headers.location;
- if (!location || this._options.followRedirects === false ||
- statusCode < 300 || statusCode >= 400) {
- response.responseUrl = this._currentUrl;
- response.redirects = this._redirects;
- this.emit("response", response);
+const kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')
+class RequestContentLengthMismatchError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'RequestContentLengthMismatchError'
+ this.message = message || 'Request body length does not match content-length header'
+ this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
+ }
- // Clean up
- this._requestBodyBuffers = [];
- return;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestContentLengthMismatchError] === true
}
- // The response is a redirect, so abort the current request
- destroyRequest(this._currentRequest);
- // Discard the remainder of the response to avoid waiting for data
- response.destroy();
+ [kRequestContentLengthMismatchError] = true
+}
- // RFC7231§6.4: A client SHOULD detect and intervene
- // in cyclical redirections (i.e., "infinite" redirection loops).
- if (++this._redirectCount > this._options.maxRedirects) {
- throw new TooManyRedirectsError();
+const kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')
+class ResponseContentLengthMismatchError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ResponseContentLengthMismatchError'
+ this.message = message || 'Response body length does not match content-length header'
+ this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
}
- // Store the request headers if applicable
- var requestHeaders;
- var beforeRedirect = this._options.beforeRedirect;
- if (beforeRedirect) {
- requestHeaders = Object.assign({
- // The Host header was set by nativeProtocol.request
- Host: response.req.getHeader("host"),
- }, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseContentLengthMismatchError] === true
}
- // RFC7231§6.4: Automatic redirection needs to done with
- // care for methods not known to be safe, […]
- // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
- // the request method from POST to GET for the subsequent request.
- var method = this._options.method;
- if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
- // RFC7231§6.4.4: The 303 (See Other) status code indicates that
- // the server is redirecting the user agent to a different resource […]
- // A user agent can perform a retrieval request targeting that URI
- // (a GET or HEAD request if using HTTP) […]
- (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
- this._options.method = "GET";
- // Drop a possible entity and headers related to it
- this._requestBodyBuffers = [];
- removeMatchingHeaders(/^content-/i, this._options.headers);
+ [kResponseContentLengthMismatchError] = true
+}
+
+const kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')
+class ClientDestroyedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ClientDestroyedError'
+ this.message = message || 'The client is destroyed'
+ this.code = 'UND_ERR_DESTROYED'
}
- // Drop the Host header, as the redirect might lead to a different host
- var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kClientDestroyedError] === true
+ }
- // If the redirect is relative, carry over the host of the last request
- var currentUrlParts = parseUrl(this._currentUrl);
- var currentHost = currentHostHeader || currentUrlParts.host;
- var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
- url.format(Object.assign(currentUrlParts, { host: currentHost }));
+ [kClientDestroyedError] = true
+}
- // Create the redirected request
- var redirectUrl = resolveUrl(location, currentUrl);
- debug("redirecting to", redirectUrl.href);
- this._isRedirect = true;
- spreadUrlObject(redirectUrl, this._options);
+const kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')
+class ClientClosedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ClientClosedError'
+ this.message = message || 'The client is closed'
+ this.code = 'UND_ERR_CLOSED'
+ }
- // Drop confidential headers when redirecting to a less secure protocol
- // or to a different domain that is not a superdomain
- if (redirectUrl.protocol !== currentUrlParts.protocol &&
- redirectUrl.protocol !== "https:" ||
- redirectUrl.host !== currentHost &&
- !isSubdomain(redirectUrl.host, currentHost)) {
- removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kClientClosedError] === true
}
- // Evaluate the beforeRedirect callback
- if (isFunction(beforeRedirect)) {
- var responseDetails = {
- headers: response.headers,
- statusCode: statusCode,
- };
- var requestDetails = {
- url: currentUrl,
- method: method,
- headers: requestHeaders,
- };
- beforeRedirect(this._options, responseDetails, requestDetails);
- this._sanitizeOptions(this._options);
+ [kClientClosedError] = true
+}
+
+const kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')
+class SocketError extends UndiciError {
+ constructor (message, socket) {
+ super(message)
+ this.name = 'SocketError'
+ this.message = message || 'Socket error'
+ this.code = 'UND_ERR_SOCKET'
+ this.socket = socket
}
- // Perform the redirected request
- this._performRequest();
-};
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kSocketError] === true
+ }
-// Wraps the key/value object of protocols with redirect functionality
-function wrap(protocols) {
- // Default settings
- var exports = {
- maxRedirects: 21,
- maxBodyLength: 10 * 1024 * 1024,
- };
+ [kSocketError] = true
+}
- // Wrap each protocol
- var nativeProtocols = {};
- Object.keys(protocols).forEach(function (scheme) {
- var protocol = scheme + ":";
- var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
- var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+const kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')
+class NotSupportedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'NotSupportedError'
+ this.message = message || 'Not supported error'
+ this.code = 'UND_ERR_NOT_SUPPORTED'
+ }
- // Executes a request, following redirects
- function request(input, options, callback) {
- // Parse parameters, ensuring that input is an object
- if (isURL(input)) {
- input = spreadUrlObject(input);
- }
- else if (isString(input)) {
- input = spreadUrlObject(parseUrl(input));
- }
- else {
- callback = options;
- options = validateUrl(input);
- input = { protocol: protocol };
- }
- if (isFunction(options)) {
- callback = options;
- options = null;
- }
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kNotSupportedError] === true
+ }
- // Set defaults
- options = Object.assign({
- maxRedirects: exports.maxRedirects,
- maxBodyLength: exports.maxBodyLength,
- }, input, options);
- options.nativeProtocols = nativeProtocols;
- if (!isString(options.host) && !isString(options.hostname)) {
- options.hostname = "::1";
- }
+ [kNotSupportedError] = true
+}
- assert.equal(options.protocol, protocol, "protocol mismatch");
- debug("options", options);
- return new RedirectableRequest(options, callback);
- }
+const kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')
+class BalancedPoolMissingUpstreamError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'MissingUpstreamError'
+ this.message = message || 'No upstream has been added to the BalancedPool'
+ this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
+ }
- // Executes a GET request, following redirects
- function get(input, options, callback) {
- var wrappedRequest = wrappedProtocol.request(input, options, callback);
- wrappedRequest.end();
- return wrappedRequest;
- }
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kBalancedPoolMissingUpstreamError] === true
+ }
- // Expose the properties on the wrapped protocol
- Object.defineProperties(wrappedProtocol, {
- request: { value: request, configurable: true, enumerable: true, writable: true },
- get: { value: get, configurable: true, enumerable: true, writable: true },
- });
- });
- return exports;
+ [kBalancedPoolMissingUpstreamError] = true
}
-function noop() { /* empty */ }
-
-function parseUrl(input) {
- var parsed;
- /* istanbul ignore else */
- if (useNativeURL) {
- parsed = new URL(input);
+const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')
+class HTTPParserError extends Error {
+ constructor (message, code, data) {
+ super(message)
+ this.name = 'HTTPParserError'
+ this.code = code ? `HPE_${code}` : undefined
+ this.data = data ? data.toString() : undefined
}
- else {
- // Ensure the URL is valid and absolute
- parsed = validateUrl(url.parse(input));
- if (!isString(parsed.protocol)) {
- throw new InvalidUrlError({ input });
- }
+
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHTTPParserError] === true
}
- return parsed;
-}
-function resolveUrl(relative, base) {
- /* istanbul ignore next */
- return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
+ [kHTTPParserError] = true
}
-function validateUrl(input) {
- if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
- throw new InvalidUrlError({ input: input.href || input });
+const kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')
+class ResponseExceededMaxSizeError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ResponseExceededMaxSizeError'
+ this.message = message || 'Response content exceeded max size'
+ this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
}
- if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
- throw new InvalidUrlError({ input: input.href || input });
+
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseExceededMaxSizeError] === true
}
- return input;
+
+ [kResponseExceededMaxSizeError] = true
}
-function spreadUrlObject(urlObject, target) {
- var spread = target || {};
- for (var key of preservedUrlFields) {
- spread[key] = urlObject[key];
+const kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')
+class RequestRetryError extends UndiciError {
+ constructor (message, code, { headers, data }) {
+ super(message)
+ this.name = 'RequestRetryError'
+ this.message = message || 'Request retry error'
+ this.code = 'UND_ERR_REQ_RETRY'
+ this.statusCode = code
+ this.data = data
+ this.headers = headers
}
- // Fix IPv6 hostname
- if (spread.hostname.startsWith("[")) {
- spread.hostname = spread.hostname.slice(1, -1);
- }
- // Ensure port is a number
- if (spread.port !== "") {
- spread.port = Number(spread.port);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestRetryError] === true
}
- // Concatenate path
- spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
- return spread;
+ [kRequestRetryError] = true
}
-function removeMatchingHeaders(regex, headers) {
- var lastValue;
- for (var header in headers) {
- if (regex.test(header)) {
- lastValue = headers[header];
- delete headers[header];
- }
+const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')
+class ResponseError extends UndiciError {
+ constructor (message, code, { headers, data }) {
+ super(message)
+ this.name = 'ResponseError'
+ this.message = message || 'Response error'
+ this.code = 'UND_ERR_RESPONSE'
+ this.statusCode = code
+ this.data = data
+ this.headers = headers
}
- return (lastValue === null || typeof lastValue === "undefined") ?
- undefined : String(lastValue).trim();
-}
-function createErrorType(code, message, baseClass) {
- // Create constructor
- function CustomError(properties) {
- Error.captureStackTrace(this, this.constructor);
- Object.assign(this, properties || {});
- this.code = code;
- this.message = this.cause ? message + ": " + this.cause.message : message;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseError] === true
}
- // Attach constructor and set default properties
- CustomError.prototype = new (baseClass || Error)();
- Object.defineProperties(CustomError.prototype, {
- constructor: {
- value: CustomError,
- enumerable: false,
- },
- name: {
- value: "Error [" + code + "]",
- enumerable: false,
- },
- });
- return CustomError;
+ [kResponseError] = true
}
-function destroyRequest(request, error) {
- for (var event of events) {
- request.removeListener(event, eventHandlers[event]);
+const kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')
+class SecureProxyConnectionError extends UndiciError {
+ constructor (cause, message, options) {
+ super(message, { cause, ...(options ?? {}) })
+ this.name = 'SecureProxyConnectionError'
+ this.message = message || 'Secure Proxy Connection failed'
+ this.code = 'UND_ERR_PRX_TLS'
+ this.cause = cause
}
- request.on("error", noop);
- request.destroy(error);
-}
-function isSubdomain(subdomain, domain) {
- assert(isString(subdomain) && isString(domain));
- var dot = subdomain.length - domain.length - 1;
- return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
-}
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kSecureProxyConnectionError] === true
+ }
-function isString(value) {
- return typeof value === "string" || value instanceof String;
+ [kSecureProxyConnectionError] = true
}
-function isFunction(value) {
- return typeof value === "function";
-}
+const kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')
+class MessageSizeExceededError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'MessageSizeExceededError'
+ this.message = message || 'Max decompressed message size exceeded'
+ this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'
+ }
-function isBuffer(value) {
- return typeof value === "object" && ("length" in value);
-}
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kMessageSizeExceededError] === true
+ }
-function isURL(value) {
- return URL && value instanceof URL;
+ get [kMessageSizeExceededError] () {
+ return true
+ }
}
-// Exports
-module.exports = wrap({ http: http, https: https });
-module.exports.wrap = wrap;
+module.exports = {
+ AbortError,
+ HTTPParserError,
+ UndiciError,
+ HeadersTimeoutError,
+ HeadersOverflowError,
+ BodyTimeoutError,
+ RequestContentLengthMismatchError,
+ ConnectTimeoutError,
+ ResponseStatusCodeError,
+ InvalidArgumentError,
+ InvalidReturnValueError,
+ RequestAbortedError,
+ ClientDestroyedError,
+ ClientClosedError,
+ InformationalError,
+ SocketError,
+ NotSupportedError,
+ ResponseContentLengthMismatchError,
+ BalancedPoolMissingUpstreamError,
+ ResponseExceededMaxSizeError,
+ RequestRetryError,
+ ResponseError,
+ SecureProxyConnectionError,
+ MessageSizeExceededError
+}
/***/ }),
-/***/ 4334:
+/***/ 4655:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var CombinedStream = __nccwpck_require__(5443);
-var util = __nccwpck_require__(3837);
-var path = __nccwpck_require__(1017);
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var parseUrl = (__nccwpck_require__(7310).parse);
-var fs = __nccwpck_require__(7147);
-var Stream = (__nccwpck_require__(2781).Stream);
-var mime = __nccwpck_require__(3583);
-var asynckit = __nccwpck_require__(4812);
-var populate = __nccwpck_require__(7142);
-// Public API
-module.exports = FormData;
-// make it a Stream
-util.inherits(FormData, CombinedStream);
+const {
+ InvalidArgumentError,
+ NotSupportedError
+} = __nccwpck_require__(8707)
+const assert = __nccwpck_require__(4589)
+const {
+ isValidHTTPToken,
+ isValidHeaderValue,
+ isStream,
+ destroy,
+ isBuffer,
+ isFormDataLike,
+ isIterable,
+ isBlobLike,
+ buildURL,
+ validateHandler,
+ getServerName,
+ normalizedMethodRecords
+} = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(735)
-/**
- * Create readable "multipart/form-data" streams.
- * Can be used to submit forms
- * and file uploads to other web applications.
- *
- * @constructor
- * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
- */
-function FormData(options) {
- if (!(this instanceof FormData)) {
- return new FormData(options);
- }
+// Verifies that a given path is valid does not contain control chars \x00 to \x20
+const invalidPathRegex = /[^\u0021-\u00ff]/
- this._overheadLength = 0;
- this._valueLength = 0;
- this._valuesToMeasure = [];
+const kHandler = Symbol('handler')
- CombinedStream.call(this);
+class Request {
+ constructor (origin, {
+ path,
+ method,
+ body,
+ headers,
+ query,
+ idempotent,
+ blocking,
+ upgrade,
+ headersTimeout,
+ bodyTimeout,
+ reset,
+ throwOnError,
+ expectContinue,
+ servername
+ }, handler) {
+ if (typeof path !== 'string') {
+ throw new InvalidArgumentError('path must be a string')
+ } else if (
+ path[0] !== '/' &&
+ !(path.startsWith('http://') || path.startsWith('https://')) &&
+ method !== 'CONNECT'
+ ) {
+ throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
+ } else if (invalidPathRegex.test(path)) {
+ throw new InvalidArgumentError('invalid request path')
+ }
- options = options || {};
- for (var option in options) {
- this[option] = options[option];
- }
-}
+ if (typeof method !== 'string') {
+ throw new InvalidArgumentError('method must be a string')
+ } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {
+ throw new InvalidArgumentError('invalid request method')
+ }
-FormData.LINE_BREAK = '\r\n';
-FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+ if (upgrade && typeof upgrade !== 'string') {
+ throw new InvalidArgumentError('upgrade must be a string')
+ }
+
+ if (upgrade && !isValidHeaderValue(upgrade)) {
+ throw new InvalidArgumentError('invalid upgrade header')
+ }
+
+ if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
+ throw new InvalidArgumentError('invalid headersTimeout')
+ }
+
+ if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
+ throw new InvalidArgumentError('invalid bodyTimeout')
+ }
+
+ if (reset != null && typeof reset !== 'boolean') {
+ throw new InvalidArgumentError('invalid reset')
+ }
+
+ if (expectContinue != null && typeof expectContinue !== 'boolean') {
+ throw new InvalidArgumentError('invalid expectContinue')
+ }
-FormData.prototype.append = function(field, value, options) {
+ this.headersTimeout = headersTimeout
- options = options || {};
+ this.bodyTimeout = bodyTimeout
- // allow filename as single option
- if (typeof options == 'string') {
- options = {filename: options};
- }
+ this.throwOnError = throwOnError === true
- var append = CombinedStream.prototype.append.bind(this);
+ this.method = method
- // all that streamy business can't handle numbers
- if (typeof value == 'number') {
- value = '' + value;
- }
+ this.abort = null
- // https://github.com/felixge/node-form-data/issues/38
- if (util.isArray(value)) {
- // Please convert your array into string
- // the way web server expects it
- this._error(new Error('Arrays are not supported.'));
- return;
- }
+ if (body == null) {
+ this.body = null
+ } else if (isStream(body)) {
+ this.body = body
- var header = this._multiPartHeader(field, value, options);
- var footer = this._multiPartFooter();
+ const rState = this.body._readableState
+ if (!rState || !rState.autoDestroy) {
+ this.endHandler = function autoDestroy () {
+ destroy(this)
+ }
+ this.body.on('end', this.endHandler)
+ }
- append(header);
- append(value);
- append(footer);
+ this.errorHandler = err => {
+ if (this.abort) {
+ this.abort(err)
+ } else {
+ this.error = err
+ }
+ }
+ this.body.on('error', this.errorHandler)
+ } else if (isBuffer(body)) {
+ this.body = body.byteLength ? body : null
+ } else if (ArrayBuffer.isView(body)) {
+ this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
+ } else if (body instanceof ArrayBuffer) {
+ this.body = body.byteLength ? Buffer.from(body) : null
+ } else if (typeof body === 'string') {
+ this.body = body.length ? Buffer.from(body) : null
+ } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {
+ this.body = body
+ } else {
+ throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
+ }
- // pass along options.knownLength
- this._trackLength(header, value, options);
-};
+ this.completed = false
-FormData.prototype._trackLength = function(header, value, options) {
- var valueLength = 0;
+ this.aborted = false
- // used w/ getLengthSync(), when length is known.
- // e.g. for streaming directly from a remote server,
- // w/ a known file a size, and not wanting to wait for
- // incoming file to finish to get its size.
- if (options.knownLength != null) {
- valueLength += +options.knownLength;
- } else if (Buffer.isBuffer(value)) {
- valueLength = value.length;
- } else if (typeof value === 'string') {
- valueLength = Buffer.byteLength(value);
- }
+ this.upgrade = upgrade || null
- this._valueLength += valueLength;
+ this.path = query ? buildURL(path, query) : path
- // @check why add CRLF? does this account for custom/multiple CRLFs?
- this._overheadLength +=
- Buffer.byteLength(header) +
- FormData.LINE_BREAK.length;
+ this.origin = origin
- // empty or either doesn't have path or not an http response or not a stream
- if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {
- return;
- }
+ this.idempotent = idempotent == null
+ ? method === 'HEAD' || method === 'GET'
+ : idempotent
- // no need to bother with the length
- if (!options.knownLength) {
- this._valuesToMeasure.push(value);
- }
-};
+ this.blocking = blocking == null ? false : blocking
-FormData.prototype._lengthRetriever = function(value, callback) {
+ this.reset = reset == null ? null : reset
- if (value.hasOwnProperty('fd')) {
+ this.host = null
- // take read range into a account
- // `end` = Infinity –> read file till the end
- //
- // TODO: Looks like there is bug in Node fs.createReadStream
- // it doesn't respect `end` options without `start` options
- // Fix it when node fixes it.
- // https://github.com/joyent/node/issues/7819
- if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+ this.contentLength = null
- // when end specified
- // no need to calculate range
- // inclusive, starts with 0
- callback(null, value.end + 1 - (value.start ? value.start : 0));
+ this.contentType = null
- // not that fast snoopy
- } else {
- // still need to fetch file size from fs
- fs.stat(value.path, function(err, stat) {
+ this.headers = []
- var fileSize;
+ // Only for H2
+ this.expectContinue = expectContinue != null ? expectContinue : false
- if (err) {
- callback(err);
- return;
+ if (Array.isArray(headers)) {
+ if (headers.length % 2 !== 0) {
+ throw new InvalidArgumentError('headers array must be even')
+ }
+ for (let i = 0; i < headers.length; i += 2) {
+ processHeader(this, headers[i], headers[i + 1])
+ }
+ } else if (headers && typeof headers === 'object') {
+ if (headers[Symbol.iterator]) {
+ for (const header of headers) {
+ if (!Array.isArray(header) || header.length !== 2) {
+ throw new InvalidArgumentError('headers must be in key-value pair format')
+ }
+ processHeader(this, header[0], header[1])
}
-
- // update final size based on the range options
- fileSize = stat.size - (value.start ? value.start : 0);
- callback(null, fileSize);
- });
+ } else {
+ const keys = Object.keys(headers)
+ for (let i = 0; i < keys.length; ++i) {
+ processHeader(this, keys[i], headers[keys[i]])
+ }
+ }
+ } else if (headers != null) {
+ throw new InvalidArgumentError('headers must be an object or an array')
}
- // or http response
- } else if (value.hasOwnProperty('httpVersion')) {
- callback(null, +value.headers['content-length']);
-
- // or request stream http://github.com/mikeal/request
- } else if (value.hasOwnProperty('httpModule')) {
- // wait till response come back
- value.on('response', function(response) {
- value.pause();
- callback(null, +response.headers['content-length']);
- });
- value.resume();
-
- // something else
- } else {
- callback('Unknown stream');
- }
-};
-
-FormData.prototype._multiPartHeader = function(field, value, options) {
- // custom header specified (as string)?
- // it becomes responsible for boundary
- // (e.g. to handle extra CRLFs on .NET servers)
- if (typeof options.header == 'string') {
- return options.header;
- }
+ validateHandler(handler, method, upgrade)
- var contentDisposition = this._getContentDisposition(value, options);
- var contentType = this._getContentType(value, options);
+ this.servername = servername || getServerName(this.host)
- var contents = '';
- var headers = {
- // add custom disposition as third element or keep it two elements if not
- 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
- // if no content type. allow it to be empty array
- 'Content-Type': [].concat(contentType || [])
- };
+ this[kHandler] = handler
- // allow custom headers.
- if (typeof options.header == 'object') {
- populate(headers, options.header);
+ if (channels.create.hasSubscribers) {
+ channels.create.publish({ request: this })
+ }
}
- var header;
- for (var prop in headers) {
- if (!headers.hasOwnProperty(prop)) continue;
- header = headers[prop];
-
- // skip nullish headers.
- if (header == null) {
- continue;
+ onBodySent (chunk) {
+ if (this[kHandler].onBodySent) {
+ try {
+ return this[kHandler].onBodySent(chunk)
+ } catch (err) {
+ this.abort(err)
+ }
}
+ }
- // convert all headers to arrays.
- if (!Array.isArray(header)) {
- header = [header];
+ onRequestSent () {
+ if (channels.bodySent.hasSubscribers) {
+ channels.bodySent.publish({ request: this })
}
- // add non-empty headers.
- if (header.length) {
- contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
+ if (this[kHandler].onRequestSent) {
+ try {
+ return this[kHandler].onRequestSent()
+ } catch (err) {
+ this.abort(err)
+ }
}
}
- return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
-};
-
-FormData.prototype._getContentDisposition = function(value, options) {
-
- var filename
- , contentDisposition
- ;
+ onConnect (abort) {
+ assert(!this.aborted)
+ assert(!this.completed)
- if (typeof options.filepath === 'string') {
- // custom filepath for relative paths
- filename = path.normalize(options.filepath).replace(/\\/g, '/');
- } else if (options.filename || value.name || value.path) {
- // custom filename take precedence
- // formidable and the browser add a name property
- // fs- and request- streams have path property
- filename = path.basename(options.filename || value.name || value.path);
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
- // or try http response
- filename = path.basename(value.client._httpMessage.path || '');
+ if (this.error) {
+ abort(this.error)
+ } else {
+ this.abort = abort
+ return this[kHandler].onConnect(abort)
+ }
}
- if (filename) {
- contentDisposition = 'filename="' + filename + '"';
+ onResponseStarted () {
+ return this[kHandler].onResponseStarted?.()
}
- return contentDisposition;
-};
-
-FormData.prototype._getContentType = function(value, options) {
+ onHeaders (statusCode, headers, resume, statusText) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // use custom content-type above all
- var contentType = options.contentType;
+ if (channels.headers.hasSubscribers) {
+ channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
+ }
- // or try `name` from formidable, browser
- if (!contentType && value.name) {
- contentType = mime.lookup(value.name);
+ try {
+ return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
+ } catch (err) {
+ this.abort(err)
+ }
}
- // or try `path` from fs-, request- streams
- if (!contentType && value.path) {
- contentType = mime.lookup(value.path);
- }
+ onData (chunk) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // or if it's http-reponse
- if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
- contentType = value.headers['content-type'];
+ try {
+ return this[kHandler].onData(chunk)
+ } catch (err) {
+ this.abort(err)
+ return false
+ }
}
- // or guess it from the filepath or filename
- if (!contentType && (options.filepath || options.filename)) {
- contentType = mime.lookup(options.filepath || options.filename);
- }
+ onUpgrade (statusCode, headers, socket) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // fallback to the default content type if `value` is not simple value
- if (!contentType && typeof value == 'object') {
- contentType = FormData.DEFAULT_CONTENT_TYPE;
+ return this[kHandler].onUpgrade(statusCode, headers, socket)
}
- return contentType;
-};
+ onComplete (trailers) {
+ this.onFinally()
-FormData.prototype._multiPartFooter = function() {
- return function(next) {
- var footer = FormData.LINE_BREAK;
+ assert(!this.aborted)
- var lastPart = (this._streams.length === 0);
- if (lastPart) {
- footer += this._lastBoundary();
+ this.completed = true
+ if (channels.trailers.hasSubscribers) {
+ channels.trailers.publish({ request: this, trailers })
}
- next(footer);
- }.bind(this);
-};
-
-FormData.prototype._lastBoundary = function() {
- return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
-};
-
-FormData.prototype.getHeaders = function(userHeaders) {
- var header;
- var formHeaders = {
- 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
- };
-
- for (header in userHeaders) {
- if (userHeaders.hasOwnProperty(header)) {
- formHeaders[header.toLowerCase()] = userHeaders[header];
+ try {
+ return this[kHandler].onComplete(trailers)
+ } catch (err) {
+ // TODO (fix): This might be a bad idea?
+ this.onError(err)
}
}
- return formHeaders;
-};
-
-FormData.prototype.setBoundary = function(boundary) {
- this._boundary = boundary;
-};
-
-FormData.prototype.getBoundary = function() {
- if (!this._boundary) {
- this._generateBoundary();
- }
+ onError (error) {
+ this.onFinally()
- return this._boundary;
-};
+ if (channels.error.hasSubscribers) {
+ channels.error.publish({ request: this, error })
+ }
-FormData.prototype.getBuffer = function() {
- var dataBuffer = new Buffer.alloc( 0 );
- var boundary = this.getBoundary();
+ if (this.aborted) {
+ return
+ }
+ this.aborted = true
- // Create the form content. Add Line breaks to the end of data.
- for (var i = 0, len = this._streams.length; i < len; i++) {
- if (typeof this._streams[i] !== 'function') {
+ return this[kHandler].onError(error)
+ }
- // Add content to the buffer.
- if(Buffer.isBuffer(this._streams[i])) {
- dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);
- }else {
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);
- }
+ onFinally () {
+ if (this.errorHandler) {
+ this.body.off('error', this.errorHandler)
+ this.errorHandler = null
+ }
- // Add break after content.
- if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );
- }
+ if (this.endHandler) {
+ this.body.off('end', this.endHandler)
+ this.endHandler = null
}
}
- // Add the footer and return the Buffer object.
- return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );
-};
-
-FormData.prototype._generateBoundary = function() {
- // This generates a 50 character boundary similar to those used by Firefox.
- // They are optimized for boyer-moore parsing.
- var boundary = '--------------------------';
- for (var i = 0; i < 24; i++) {
- boundary += Math.floor(Math.random() * 10).toString(16);
+ addHeader (key, value) {
+ processHeader(this, key, value)
+ return this
}
+}
- this._boundary = boundary;
-};
+function processHeader (request, key, val) {
+ if (val && (typeof val === 'object' && !Array.isArray(val))) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ } else if (val === undefined) {
+ return
+ }
-// Note: getLengthSync DOESN'T calculate streams length
-// As workaround one can calculate file size manually
-// and add it as knownLength option
-FormData.prototype.getLengthSync = function() {
- var knownLength = this._overheadLength + this._valueLength;
+ let headerName = headerNameLowerCasedRecord[key]
- // Don't get confused, there are 3 "internal" streams for each keyval pair
- // so it basically checks if there is any value added to the form
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
+ if (headerName === undefined) {
+ headerName = key.toLowerCase()
+ if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {
+ throw new InvalidArgumentError('invalid header key')
+ }
}
- // https://github.com/form-data/form-data/issues/40
- if (!this.hasKnownLength()) {
- // Some async length retrievers are present
- // therefore synchronous length calculation is false.
- // Please use getLength(callback) to get proper length
- this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ if (Array.isArray(val)) {
+ const arr = []
+ for (let i = 0; i < val.length; i++) {
+ if (typeof val[i] === 'string') {
+ if (!isValidHeaderValue(val[i])) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ }
+ arr.push(val[i])
+ } else if (val[i] === null) {
+ arr.push('')
+ } else if (typeof val[i] === 'object') {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ } else {
+ arr.push(`${val[i]}`)
+ }
+ }
+ val = arr
+ } else if (typeof val === 'string') {
+ if (!isValidHeaderValue(val)) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ }
+ } else if (val === null) {
+ val = ''
+ } else {
+ val = `${val}`
}
- return knownLength;
-};
-
-// Public API to check if length of added values is known
-// https://github.com/form-data/form-data/issues/196
-// https://github.com/form-data/form-data/issues/262
-FormData.prototype.hasKnownLength = function() {
- var hasKnownLength = true;
+ if (headerName === 'host') {
+ if (request.host !== null) {
+ throw new InvalidArgumentError('duplicate host header')
+ }
+ if (typeof val !== 'string') {
+ throw new InvalidArgumentError('invalid host header')
+ }
+ // Consumed by Client
+ request.host = val
+ } else if (headerName === 'content-length') {
+ if (request.contentLength !== null) {
+ throw new InvalidArgumentError('duplicate content-length header')
+ }
+ request.contentLength = parseInt(val, 10)
+ if (!Number.isFinite(request.contentLength)) {
+ throw new InvalidArgumentError('invalid content-length header')
+ }
+ } else if (request.contentType === null && headerName === 'content-type') {
+ request.contentType = val
+ request.headers.push(key, val)
+ } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {
+ throw new InvalidArgumentError(`invalid ${headerName} header`)
+ } else if (headerName === 'connection') {
+ const value = typeof val === 'string' ? val.toLowerCase() : null
+ if (value !== 'close' && value !== 'keep-alive') {
+ throw new InvalidArgumentError('invalid connection header')
+ }
- if (this._valuesToMeasure.length) {
- hasKnownLength = false;
+ if (value === 'close') {
+ request.reset = true
+ }
+ } else if (headerName === 'expect') {
+ throw new NotSupportedError('expect header not supported')
+ } else {
+ request.headers.push(key, val)
}
+}
- return hasKnownLength;
-};
-
-FormData.prototype.getLength = function(cb) {
- var knownLength = this._overheadLength + this._valueLength;
+module.exports = Request
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
- }
- if (!this._valuesToMeasure.length) {
- process.nextTick(cb.bind(this, null, knownLength));
- return;
- }
+/***/ }),
- asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
- if (err) {
- cb(err);
- return;
- }
+/***/ 6443:
+/***/ ((module) => {
- values.forEach(function(length) {
- knownLength += length;
- });
+module.exports = {
+ kClose: Symbol('close'),
+ kDestroy: Symbol('destroy'),
+ kDispatch: Symbol('dispatch'),
+ kUrl: Symbol('url'),
+ kWriting: Symbol('writing'),
+ kResuming: Symbol('resuming'),
+ kQueue: Symbol('queue'),
+ kConnect: Symbol('connect'),
+ kConnecting: Symbol('connecting'),
+ kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
+ kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
+ kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
+ kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
+ kKeepAlive: Symbol('keep alive'),
+ kHeadersTimeout: Symbol('headers timeout'),
+ kBodyTimeout: Symbol('body timeout'),
+ kServerName: Symbol('server name'),
+ kLocalAddress: Symbol('local address'),
+ kHost: Symbol('host'),
+ kNoRef: Symbol('no ref'),
+ kBodyUsed: Symbol('used'),
+ kBody: Symbol('abstracted request body'),
+ kRunning: Symbol('running'),
+ kBlocking: Symbol('blocking'),
+ kPending: Symbol('pending'),
+ kSize: Symbol('size'),
+ kBusy: Symbol('busy'),
+ kQueued: Symbol('queued'),
+ kFree: Symbol('free'),
+ kConnected: Symbol('connected'),
+ kClosed: Symbol('closed'),
+ kNeedDrain: Symbol('need drain'),
+ kReset: Symbol('reset'),
+ kDestroyed: Symbol.for('nodejs.stream.destroyed'),
+ kResume: Symbol('resume'),
+ kOnError: Symbol('on error'),
+ kMaxHeadersSize: Symbol('max headers size'),
+ kRunningIdx: Symbol('running index'),
+ kPendingIdx: Symbol('pending index'),
+ kError: Symbol('error'),
+ kClients: Symbol('clients'),
+ kClient: Symbol('client'),
+ kParser: Symbol('parser'),
+ kOnDestroyed: Symbol('destroy callbacks'),
+ kPipelining: Symbol('pipelining'),
+ kSocket: Symbol('socket'),
+ kHostHeader: Symbol('host header'),
+ kConnector: Symbol('connector'),
+ kStrictContentLength: Symbol('strict content length'),
+ kMaxRedirections: Symbol('maxRedirections'),
+ kMaxRequests: Symbol('maxRequestsPerClient'),
+ kProxy: Symbol('proxy agent options'),
+ kCounter: Symbol('socket request counter'),
+ kInterceptors: Symbol('dispatch interceptors'),
+ kMaxResponseSize: Symbol('max response size'),
+ kHTTP2Session: Symbol('http2Session'),
+ kHTTP2SessionState: Symbol('http2Session state'),
+ kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
+ kConstruct: Symbol('constructable'),
+ kListeners: Symbol('listeners'),
+ kHTTPContext: Symbol('http context'),
+ kMaxConcurrentStreams: Symbol('max concurrent streams'),
+ kNoProxyAgent: Symbol('no proxy agent'),
+ kHttpProxyAgent: Symbol('http proxy agent'),
+ kHttpsProxyAgent: Symbol('https proxy agent')
+}
- cb(null, knownLength);
- });
-};
-FormData.prototype.submit = function(params, cb) {
- var request
- , options
- , defaults = {method: 'post'}
- ;
+/***/ }),
- // parse provided url if it's string
- // or treat it as options object
- if (typeof params == 'string') {
+/***/ 7752:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- params = parseUrl(params);
- options = populate({
- port: params.port,
- path: params.pathname,
- host: params.hostname,
- protocol: params.protocol
- }, defaults);
- // use custom params
- } else {
- options = populate(params, defaults);
- // if no port provided use default one
- if (!options.port) {
- options.port = options.protocol == 'https:' ? 443 : 80;
+const {
+ wellknownHeaderNames,
+ headerNameLowerCasedRecord
+} = __nccwpck_require__(735)
+
+class TstNode {
+ /** @type {any} */
+ value = null
+ /** @type {null | TstNode} */
+ left = null
+ /** @type {null | TstNode} */
+ middle = null
+ /** @type {null | TstNode} */
+ right = null
+ /** @type {number} */
+ code
+ /**
+ * @param {string} key
+ * @param {any} value
+ * @param {number} index
+ */
+ constructor (key, value, index) {
+ if (index === undefined || index >= key.length) {
+ throw new TypeError('Unreachable')
}
- }
-
- // put that good code in getHeaders to some use
- options.headers = this.getHeaders(params.headers);
-
- // https if specified, fallback to http in any other case
- if (options.protocol == 'https:') {
- request = https.request(options);
- } else {
- request = http.request(options);
- }
-
- // get content length and fire away
- this.getLength(function(err, length) {
- if (err && err !== 'Unknown stream') {
- this._error(err);
- return;
+ const code = this.code = key.charCodeAt(index)
+ // check code is ascii string
+ if (code > 0x7F) {
+ throw new TypeError('key must be ascii string')
}
-
- // add content length
- if (length) {
- request.setHeader('Content-Length', length);
+ if (key.length !== ++index) {
+ this.middle = new TstNode(key, value, index)
+ } else {
+ this.value = value
}
+ }
- this.pipe(request);
- if (cb) {
- var onResponse;
-
- var callback = function (error, responce) {
- request.removeListener('error', callback);
- request.removeListener('response', onResponse);
-
- return cb.call(this, error, responce);
- };
-
- onResponse = callback.bind(this, null);
-
- request.on('error', callback);
- request.on('response', onResponse);
+ /**
+ * @param {string} key
+ * @param {any} value
+ */
+ add (key, value) {
+ const length = key.length
+ if (length === 0) {
+ throw new TypeError('Unreachable')
}
- }.bind(this));
-
- return request;
-};
+ let index = 0
+ let node = this
+ while (true) {
+ const code = key.charCodeAt(index)
+ // check code is ascii string
+ if (code > 0x7F) {
+ throw new TypeError('key must be ascii string')
+ }
+ if (node.code === code) {
+ if (length === ++index) {
+ node.value = value
+ break
+ } else if (node.middle !== null) {
+ node = node.middle
+ } else {
+ node.middle = new TstNode(key, value, index)
+ break
+ }
+ } else if (node.code < code) {
+ if (node.left !== null) {
+ node = node.left
+ } else {
+ node.left = new TstNode(key, value, index)
+ break
+ }
+ } else if (node.right !== null) {
+ node = node.right
+ } else {
+ node.right = new TstNode(key, value, index)
+ break
+ }
+ }
+ }
-FormData.prototype._error = function(err) {
- if (!this.error) {
- this.error = err;
- this.pause();
- this.emit('error', err);
+ /**
+ * @param {Uint8Array} key
+ * @return {TstNode | null}
+ */
+ search (key) {
+ const keylength = key.length
+ let index = 0
+ let node = this
+ while (node !== null && index < keylength) {
+ let code = key[index]
+ // A-Z
+ // First check if it is bigger than 0x5a.
+ // Lowercase letters have higher char codes than uppercase ones.
+ // Also we assume that headers will mostly contain lowercase characters.
+ if (code <= 0x5a && code >= 0x41) {
+ // Lowercase for uppercase.
+ code |= 32
+ }
+ while (node !== null) {
+ if (code === node.code) {
+ if (keylength === ++index) {
+ // Returns Node since it is the last key.
+ return node
+ }
+ node = node.middle
+ break
+ }
+ node = node.code < code ? node.left : node.right
+ }
+ }
+ return null
}
-};
-
-FormData.prototype.toString = function () {
- return '[object FormData]';
-};
+}
+class TernarySearchTree {
+ /** @type {TstNode | null} */
+ node = null
-/***/ }),
+ /**
+ * @param {string} key
+ * @param {any} value
+ * */
+ insert (key, value) {
+ if (this.node === null) {
+ this.node = new TstNode(key, value, 0)
+ } else {
+ this.node.add(key, value)
+ }
+ }
-/***/ 7142:
-/***/ ((module) => {
+ /**
+ * @param {Uint8Array} key
+ * @return {any}
+ */
+ lookup (key) {
+ return this.node?.search(key)?.value ?? null
+ }
+}
-// populates missing values
-module.exports = function(dst, src) {
+const tree = new TernarySearchTree()
- Object.keys(src).forEach(function(prop)
- {
- dst[prop] = dst[prop] || src[prop];
- });
+for (let i = 0; i < wellknownHeaderNames.length; ++i) {
+ const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]
+ tree.insert(key, key)
+}
- return dst;
-};
+module.exports = {
+ TernarySearchTree,
+ tree
+}
/***/ }),
-/***/ 1621:
-/***/ ((module) => {
+/***/ 3440:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-module.exports = (flag, argv) => {
- argv = argv || process.argv;
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
- const pos = argv.indexOf(prefix + flag);
- const terminatorPos = argv.indexOf('--');
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
-};
+const assert = __nccwpck_require__(4589)
+const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(6443)
+const { IncomingMessage } = __nccwpck_require__(7067)
+const stream = __nccwpck_require__(7075)
+const net = __nccwpck_require__(7030)
+const { Blob } = __nccwpck_require__(4573)
+const nodeUtil = __nccwpck_require__(7975)
+const { stringify } = __nccwpck_require__(1792)
+const { EventEmitter: EE } = __nccwpck_require__(8474)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(735)
+const { tree } = __nccwpck_require__(7752)
-/***/ }),
+const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
-/***/ 4293:
-/***/ ((module) => {
+class BodyAsyncIterable {
+ constructor (body) {
+ this[kBody] = body
+ this[kBodyUsed] = false
+ }
-// https://github.com/electron/electron/issues/2288
-function isElectron() {
- // Renderer process
- if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
- return true;
- }
+ async * [Symbol.asyncIterator] () {
+ assert(!this[kBodyUsed], 'disturbed')
+ this[kBodyUsed] = true
+ yield * this[kBody]
+ }
+}
- // Main process
- if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
- return true;
+function wrapRequestBody (body) {
+ if (isStream(body)) {
+ // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
+ // so that it can be dispatched again?
+ // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
+ if (bodyLength(body) === 0) {
+ body
+ .on('data', function () {
+ assert(false)
+ })
}
- // Detect the user agent when the `nodeIntegration` option is set to false
- if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
- return true;
+ if (typeof body.readableDidRead !== 'boolean') {
+ body[kBodyUsed] = false
+ EE.prototype.on.call(body, 'data', function () {
+ this[kBodyUsed] = true
+ })
}
- return false;
+ return body
+ } else if (body && typeof body.pipeTo === 'function') {
+ // TODO (fix): We can't access ReadableStream internal state
+ // to determine whether or not it has been disturbed. This is just
+ // a workaround.
+ return new BodyAsyncIterable(body)
+ } else if (
+ body &&
+ typeof body !== 'string' &&
+ !ArrayBuffer.isView(body) &&
+ isIterable(body)
+ ) {
+ // TODO: Should we allow re-using iterable if !this.opts.idempotent
+ // or through some other flag?
+ return new BodyAsyncIterable(body)
+ } else {
+ return body
+ }
}
-module.exports = isElectron;
+function nop () {}
+function isStream (obj) {
+ return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
+}
-/***/ }),
+// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
+function isBlobLike (object) {
+ if (object === null) {
+ return false
+ } else if (object instanceof Blob) {
+ return true
+ } else if (typeof object !== 'object') {
+ return false
+ } else {
+ const sTag = object[Symbol.toStringTag]
-/***/ 1554:
-/***/ ((module) => {
+ return (sTag === 'Blob' || sTag === 'File') && (
+ ('stream' in object && typeof object.stream === 'function') ||
+ ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')
+ )
+ }
+}
-"use strict";
+function buildURL (url, queryParams) {
+ if (url.includes('?') || url.includes('#')) {
+ throw new Error('Query params cannot be passed when url already contains "?" or "#".')
+ }
+ const stringified = stringify(queryParams)
-const isStream = stream =>
- stream !== null &&
- typeof stream === 'object' &&
- typeof stream.pipe === 'function';
+ if (stringified) {
+ url += '?' + stringified
+ }
-isStream.writable = stream =>
- isStream(stream) &&
- stream.writable !== false &&
- typeof stream._write === 'function' &&
- typeof stream._writableState === 'object';
+ return url
+}
-isStream.readable = stream =>
- isStream(stream) &&
- stream.readable !== false &&
- typeof stream._read === 'function' &&
- typeof stream._readableState === 'object';
+function isValidPort (port) {
+ const value = parseInt(port, 10)
+ return (
+ value === Number(port) &&
+ value >= 0 &&
+ value <= 65535
+ )
+}
-isStream.duplex = stream =>
- isStream.writable(stream) &&
- isStream.readable(stream);
+function isHttpOrHttpsPrefixed (value) {
+ return (
+ value != null &&
+ value[0] === 'h' &&
+ value[1] === 't' &&
+ value[2] === 't' &&
+ value[3] === 'p' &&
+ (
+ value[4] === ':' ||
+ (
+ value[4] === 's' &&
+ value[5] === ':'
+ )
+ )
+ )
+}
-isStream.transform = stream =>
- isStream.duplex(stream) &&
- typeof stream._transform === 'function';
+function parseURL (url) {
+ if (typeof url === 'string') {
+ url = new URL(url)
-module.exports = isStream;
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
+ return url
+ }
-/***/ }),
+ if (!url || typeof url !== 'object') {
+ throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
+ }
-/***/ 7426:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (!(url instanceof URL)) {
+ if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {
+ throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
+ }
-/*!
- * mime-db
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
- * MIT Licensed
- */
+ if (url.path != null && typeof url.path !== 'string') {
+ throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
+ }
-/**
- * Module exports.
- */
+ if (url.pathname != null && typeof url.pathname !== 'string') {
+ throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
+ }
-module.exports = __nccwpck_require__(3765)
+ if (url.hostname != null && typeof url.hostname !== 'string') {
+ throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
+ }
+ if (url.origin != null && typeof url.origin !== 'string') {
+ throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
+ }
-/***/ }),
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
-/***/ 3583:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ const port = url.port != null
+ ? url.port
+ : (url.protocol === 'https:' ? 443 : 80)
+ let origin = url.origin != null
+ ? url.origin
+ : `${url.protocol || ''}//${url.hostname || ''}:${port}`
+ let path = url.path != null
+ ? url.path
+ : `${url.pathname || ''}${url.search || ''}`
-"use strict";
-/*!
- * mime-types
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */
+ if (origin[origin.length - 1] === '/') {
+ origin = origin.slice(0, origin.length - 1)
+ }
+ if (path && path[0] !== '/') {
+ path = `/${path}`
+ }
+ // new URL(path, origin) is unsafe when `path` contains an absolute URL
+ // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
+ // If first parameter is a relative URL, second param is required, and will be used as the base URL.
+ // If first parameter is an absolute URL, a given second param will be ignored.
+ return new URL(`${origin}${path}`)
+ }
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
-/**
- * Module dependencies.
- * @private
- */
+ return url
+}
-var db = __nccwpck_require__(7426)
-var extname = (__nccwpck_require__(1017).extname)
+function parseOrigin (url) {
+ url = parseURL(url)
-/**
- * Module variables.
- * @private
- */
+ if (url.pathname !== '/' || url.search || url.hash) {
+ throw new InvalidArgumentError('invalid url')
+ }
-var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
-var TEXT_TYPE_REGEXP = /^text\//i
+ return url
+}
-/**
- * Module exports.
- * @public
- */
+function getHostname (host) {
+ if (host[0] === '[') {
+ const idx = host.indexOf(']')
-exports.charset = charset
-exports.charsets = { lookup: charset }
-exports.contentType = contentType
-exports.extension = extension
-exports.extensions = Object.create(null)
-exports.lookup = lookup
-exports.types = Object.create(null)
+ assert(idx !== -1)
+ return host.substring(1, idx)
+ }
-// Populate the extensions/types maps
-populateMaps(exports.extensions, exports.types)
+ const idx = host.indexOf(':')
+ if (idx === -1) return host
-/**
- * Get the default charset for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
- */
+ return host.substring(0, idx)
+}
-function charset (type) {
- if (!type || typeof type !== 'string') {
- return false
+// IP addresses are not valid server names per RFC6066
+// > Currently, the only server names supported are DNS hostnames
+function getServerName (host) {
+ if (!host) {
+ return null
}
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
- var mime = match && db[match[1].toLowerCase()]
+ assert(typeof host === 'string')
- if (mime && mime.charset) {
- return mime.charset
+ const servername = getHostname(host)
+ if (net.isIP(servername)) {
+ return ''
}
- // default text/* to utf-8
- if (match && TEXT_TYPE_REGEXP.test(match[1])) {
- return 'UTF-8'
+ return servername
+}
+
+function deepClone (obj) {
+ return JSON.parse(JSON.stringify(obj))
+}
+
+function isAsyncIterable (obj) {
+ return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
+}
+
+function isIterable (obj) {
+ return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
+}
+
+function bodyLength (body) {
+ if (body == null) {
+ return 0
+ } else if (isStream(body)) {
+ const state = body._readableState
+ return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
+ ? state.length
+ : null
+ } else if (isBlobLike(body)) {
+ return body.size != null ? body.size : null
+ } else if (isBuffer(body)) {
+ return body.byteLength
}
- return false
+ return null
}
-/**
- * Create a full Content-Type header given a MIME type or extension.
- *
- * @param {string} str
- * @return {boolean|string}
- */
+function isDestroyed (body) {
+ return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))
+}
-function contentType (str) {
- // TODO: should this even be in this module?
- if (!str || typeof str !== 'string') {
- return false
+function destroy (stream, err) {
+ if (stream == null || !isStream(stream) || isDestroyed(stream)) {
+ return
}
- var mime = str.indexOf('/') === -1
- ? exports.lookup(str)
- : str
+ if (typeof stream.destroy === 'function') {
+ if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
+ // See: https://github.com/nodejs/node/pull/38505/files
+ stream.socket = null
+ }
- if (!mime) {
- return false
+ stream.destroy(err)
+ } else if (err) {
+ queueMicrotask(() => {
+ stream.emit('error', err)
+ })
}
- // TODO: use content-type or other module
- if (mime.indexOf('charset') === -1) {
- var charset = exports.charset(mime)
- if (charset) mime += '; charset=' + charset.toLowerCase()
+ if (stream.destroyed !== true) {
+ stream[kDestroyed] = true
}
+}
- return mime
+const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
+function parseKeepAliveTimeout (val) {
+ const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
+ return m ? parseInt(m[1], 10) * 1000 : null
}
/**
- * Get the default extension for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
+ * Retrieves a header name and returns its lowercase value.
+ * @param {string | Buffer} value Header name
+ * @returns {string}
*/
+function headerNameToString (value) {
+ return typeof value === 'string'
+ ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()
+ : tree.lookup(value) ?? value.toString('latin1').toLowerCase()
+}
-function extension (type) {
- if (!type || typeof type !== 'string') {
- return false
- }
+/**
+ * Receive the buffer as a string and return its lowercase value.
+ * @param {Buffer} value Header name
+ * @returns {string}
+ */
+function bufferToLowerCasedHeaderName (value) {
+ return tree.lookup(value) ?? value.toString('latin1').toLowerCase()
+}
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
+/**
+ * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers
+ * @param {Record} [obj]
+ * @returns {Record}
+ */
+function parseHeaders (headers, obj) {
+ if (obj === undefined) obj = {}
+ for (let i = 0; i < headers.length; i += 2) {
+ const key = headerNameToString(headers[i])
+ let val = obj[key]
- // get extensions
- var exts = match && exports.extensions[match[1].toLowerCase()]
+ if (val) {
+ if (typeof val === 'string') {
+ val = [val]
+ obj[key] = val
+ }
+ val.push(headers[i + 1].toString('utf8'))
+ } else {
+ const headersValue = headers[i + 1]
+ if (typeof headersValue === 'string') {
+ obj[key] = headersValue
+ } else {
+ obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')
+ }
+ }
+ }
- if (!exts || !exts.length) {
- return false
+ // See https://github.com/nodejs/node/pull/46528
+ if ('content-length' in obj && 'content-disposition' in obj) {
+ obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
}
- return exts[0]
+ return obj
}
-/**
- * Lookup the MIME type for a file path/extension.
- *
- * @param {string} path
- * @return {boolean|string}
- */
+function parseRawHeaders (headers) {
+ const len = headers.length
+ const ret = new Array(len)
-function lookup (path) {
- if (!path || typeof path !== 'string') {
- return false
- }
+ let hasContentLength = false
+ let contentDispositionIdx = -1
+ let key
+ let val
+ let kLen = 0
- // get the extension ("ext" or ".ext" or full path)
- var extension = extname('x.' + path)
- .toLowerCase()
- .substr(1)
+ for (let n = 0; n < headers.length; n += 2) {
+ key = headers[n]
+ val = headers[n + 1]
- if (!extension) {
- return false
+ typeof key !== 'string' && (key = key.toString())
+ typeof val !== 'string' && (val = val.toString('utf8'))
+
+ kLen = key.length
+ if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
+ hasContentLength = true
+ } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
+ contentDispositionIdx = n + 1
+ }
+ ret[n] = key
+ ret[n + 1] = val
}
- return exports.types[extension] || false
+ // See https://github.com/nodejs/node/pull/46528
+ if (hasContentLength && contentDispositionIdx !== -1) {
+ ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
+ }
+
+ return ret
}
-/**
- * Populate the extensions and types maps.
- * @private
- */
+function isBuffer (buffer) {
+ // See, https://github.com/mcollina/undici/pull/319
+ return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
+}
-function populateMaps (extensions, types) {
- // source preference (least -> most)
- var preference = ['nginx', 'apache', undefined, 'iana']
+function validateHandler (handler, method, upgrade) {
+ if (!handler || typeof handler !== 'object') {
+ throw new InvalidArgumentError('handler must be an object')
+ }
- Object.keys(db).forEach(function forEachMimeType (type) {
- var mime = db[type]
- var exts = mime.extensions
+ if (typeof handler.onConnect !== 'function') {
+ throw new InvalidArgumentError('invalid onConnect method')
+ }
- if (!exts || !exts.length) {
- return
+ if (typeof handler.onError !== 'function') {
+ throw new InvalidArgumentError('invalid onError method')
+ }
+
+ if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
+ throw new InvalidArgumentError('invalid onBodySent method')
+ }
+
+ if (upgrade || method === 'CONNECT') {
+ if (typeof handler.onUpgrade !== 'function') {
+ throw new InvalidArgumentError('invalid onUpgrade method')
+ }
+ } else {
+ if (typeof handler.onHeaders !== 'function') {
+ throw new InvalidArgumentError('invalid onHeaders method')
}
- // mime -> extensions
- extensions[type] = exts
+ if (typeof handler.onData !== 'function') {
+ throw new InvalidArgumentError('invalid onData method')
+ }
- // extension -> mime
- for (var i = 0; i < exts.length; i++) {
- var extension = exts[i]
+ if (typeof handler.onComplete !== 'function') {
+ throw new InvalidArgumentError('invalid onComplete method')
+ }
+ }
+}
- if (types[extension]) {
- var from = preference.indexOf(db[types[extension]].source)
- var to = preference.indexOf(mime.source)
+// A body is disturbed if it has been read from and it cannot
+// be re-used without losing state or data.
+function isDisturbed (body) {
+ // TODO (fix): Why is body[kBodyUsed] needed?
+ return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))
+}
- if (types[extension] !== 'application/octet-stream' &&
- (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
- // skip the remapping
- continue
- }
- }
+function isErrored (body) {
+ return !!(body && stream.isErrored(body))
+}
- // set the extension -> mime
- types[extension] = type
+function isReadable (body) {
+ return !!(body && stream.isReadable(body))
+}
+
+function getSocketInfo (socket) {
+ return {
+ localAddress: socket.localAddress,
+ localPort: socket.localPort,
+ remoteAddress: socket.remoteAddress,
+ remotePort: socket.remotePort,
+ remoteFamily: socket.remoteFamily,
+ timeout: socket.timeout,
+ bytesWritten: socket.bytesWritten,
+ bytesRead: socket.bytesRead
+ }
+}
+
+/** @type {globalThis['ReadableStream']} */
+function ReadableStreamFrom (iterable) {
+ // We cannot use ReadableStream.from here because it does not return a byte stream.
+
+ let iterator
+ return new ReadableStream(
+ {
+ async start () {
+ iterator = iterable[Symbol.asyncIterator]()
+ },
+ async pull (controller) {
+ const { done, value } = await iterator.next()
+ if (done) {
+ queueMicrotask(() => {
+ controller.close()
+ controller.byobRequest?.respond(0)
+ })
+ } else {
+ const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
+ if (buf.byteLength) {
+ controller.enqueue(new Uint8Array(buf))
+ }
+ }
+ return controller.desiredSize > 0
+ },
+ async cancel (reason) {
+ await iterator.return()
+ },
+ type: 'bytes'
}
- })
+ )
+}
+
+// The chunk should be a FormData instance and contains
+// all the required methods.
+function isFormDataLike (object) {
+ return (
+ object &&
+ typeof object === 'object' &&
+ typeof object.append === 'function' &&
+ typeof object.delete === 'function' &&
+ typeof object.get === 'function' &&
+ typeof object.getAll === 'function' &&
+ typeof object.has === 'function' &&
+ typeof object.set === 'function' &&
+ object[Symbol.toStringTag] === 'FormData'
+ )
}
+function addAbortListener (signal, listener) {
+ if ('addEventListener' in signal) {
+ signal.addEventListener('abort', listener, { once: true })
+ return () => signal.removeEventListener('abort', listener)
+ }
+ signal.addListener('abort', listener)
+ return () => signal.removeListener('abort', listener)
+}
-/***/ }),
-
-/***/ 900:
-/***/ ((module) => {
+const hasToWellFormed = typeof String.prototype.toWellFormed === 'function'
+const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'
/**
- * Helpers.
+ * @param {string} val
*/
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var w = d * 7;
-var y = d * 365.25;
+function toUSVString (val) {
+ return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)
+}
/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
+ * @param {string} val
*/
-
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
+// TODO: move this to webidl
+function isUSVString (val) {
+ return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`
+}
/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
+ * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
+ * @param {number} c
*/
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
+function isTokenCharCode (c) {
+ switch (c) {
+ case 0x22:
+ case 0x28:
+ case 0x29:
+ case 0x2c:
+ case 0x2f:
+ case 0x3a:
+ case 0x3b:
+ case 0x3c:
+ case 0x3d:
+ case 0x3e:
+ case 0x3f:
+ case 0x40:
+ case 0x5b:
+ case 0x5c:
+ case 0x5d:
+ case 0x7b:
+ case 0x7d:
+ // DQUOTE and "(),/:;<=>?@[\]{}"
+ return false
default:
- return undefined;
+ // VCHAR %x21-7E
+ return c >= 0x21 && c <= 0x7e
}
}
/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
+ * @param {string} characters
*/
-
-function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
+function isValidHTTPToken (characters) {
+ if (characters.length === 0) {
+ return false
}
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
+ for (let i = 0; i < characters.length; ++i) {
+ if (!isTokenCharCode(characters.charCodeAt(i))) {
+ return false
+ }
}
- return ms + 'ms';
+ return true
}
+// headerCharRegex have been lifted from
+// https://github.com/nodejs/node/blob/main/lib/_http_common.js
+
/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
+ * Matches if val contains an invalid field-vchar
+ * field-value = *( field-content / obs-fold )
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+ * field-vchar = VCHAR / obs-text
*/
-
-function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
- }
- return ms + ' ms';
-}
+const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
/**
- * Pluralization helper.
+ * @param {string} characters
*/
-
-function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+function isValidHeaderValue (characters) {
+ return !headerCharRegex.test(characters)
}
+// Parsed accordingly to RFC 9110
+// https://www.rfc-editor.org/rfc/rfc9110#field.content-range
+function parseRangeHeader (range) {
+ if (range == null || range === '') return { start: 0, end: null, size: null }
-/***/ }),
+ const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
+ return m
+ ? {
+ start: parseInt(m[1]),
+ end: m[2] ? parseInt(m[2]) : null,
+ size: m[3] ? parseInt(m[3]) : null
+ }
+ : null
+}
-/***/ 1223:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function addListener (obj, name, listener) {
+ const listeners = (obj[kListeners] ??= [])
+ listeners.push([name, listener])
+ obj.on(name, listener)
+ return obj
+}
-var wrappy = __nccwpck_require__(2940)
-module.exports = wrappy(once)
-module.exports.strict = wrappy(onceStrict)
+function removeAllListeners (obj) {
+ for (const [name, listener] of obj[kListeners] ?? []) {
+ obj.removeListener(name, listener)
+ }
+ obj[kListeners] = null
+}
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
+function errorRequest (client, request, err) {
+ try {
+ request.onError(err)
+ assert(request.aborted)
+ } catch (err) {
+ client.emit('error', err)
+ }
+}
- Object.defineProperty(Function.prototype, 'onceStrict', {
- value: function () {
- return onceStrict(this)
- },
- configurable: true
- })
-})
+const kEnumerableProperty = Object.create(null)
+kEnumerableProperty.enumerable = true
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
+const normalizedMethodRecordsBase = {
+ delete: 'DELETE',
+ DELETE: 'DELETE',
+ get: 'GET',
+ GET: 'GET',
+ head: 'HEAD',
+ HEAD: 'HEAD',
+ options: 'OPTIONS',
+ OPTIONS: 'OPTIONS',
+ post: 'POST',
+ POST: 'POST',
+ put: 'PUT',
+ PUT: 'PUT'
}
-function onceStrict (fn) {
- var f = function () {
- if (f.called)
- throw new Error(f.onceError)
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- var name = fn.name || 'Function wrapped with `once`'
- f.onceError = name + " shouldn't be called more than once"
- f.called = false
- return f
+const normalizedMethodRecords = {
+ ...normalizedMethodRecordsBase,
+ patch: 'patch',
+ PATCH: 'PATCH'
}
+// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
+Object.setPrototypeOf(normalizedMethodRecordsBase, null)
+Object.setPrototypeOf(normalizedMethodRecords, null)
-/***/ }),
+module.exports = {
+ kEnumerableProperty,
+ nop,
+ isDisturbed,
+ isErrored,
+ isReadable,
+ toUSVString,
+ isUSVString,
+ isBlobLike,
+ parseOrigin,
+ parseURL,
+ getServerName,
+ isStream,
+ isIterable,
+ isAsyncIterable,
+ isDestroyed,
+ headerNameToString,
+ bufferToLowerCasedHeaderName,
+ addListener,
+ removeAllListeners,
+ errorRequest,
+ parseRawHeaders,
+ parseHeaders,
+ parseKeepAliveTimeout,
+ destroy,
+ bodyLength,
+ deepClone,
+ ReadableStreamFrom,
+ isBuffer,
+ validateHandler,
+ getSocketInfo,
+ isFormDataLike,
+ buildURL,
+ addAbortListener,
+ isValidHTTPToken,
+ isValidHeaderValue,
+ isTokenCharCode,
+ parseRangeHeader,
+ normalizedMethodRecordsBase,
+ normalizedMethodRecords,
+ isValidPort,
+ isHttpOrHttpsPrefixed,
+ nodeMajor,
+ nodeMinor,
+ safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],
+ wrapRequestBody
+}
-/***/ 1330:
-/***/ ((module) => {
-"use strict";
+/***/ }),
-module.exports = (promise, onFinally) => {
- onFinally = onFinally || (() => {});
+/***/ 7405:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return promise.then(
- val => new Promise(resolve => {
- resolve(onFinally());
- }).then(() => val),
- err => new Promise(resolve => {
- resolve(onFinally());
- }).then(() => {
- throw err;
- })
- );
-};
-/***/ }),
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443)
+const DispatcherBase = __nccwpck_require__(1841)
+const Pool = __nccwpck_require__(628)
+const Client = __nccwpck_require__(3701)
+const util = __nccwpck_require__(3440)
+const createRedirectInterceptor = __nccwpck_require__(5092)
-/***/ 8983:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+const kOnConnect = Symbol('onConnect')
+const kOnDisconnect = Symbol('onDisconnect')
+const kOnConnectionError = Symbol('onConnectionError')
+const kMaxRedirections = Symbol('maxRedirections')
+const kOnDrain = Symbol('onDrain')
+const kFactory = Symbol('factory')
+const kOptions = Symbol('options')
-"use strict";
+function defaultFactory (origin, opts) {
+ return opts && opts.connections === 1
+ ? new Client(origin, opts)
+ : new Pool(origin, opts)
+}
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const EventEmitter = __nccwpck_require__(4924);
-const p_timeout_1 = __nccwpck_require__(6424);
-const priority_queue_1 = __nccwpck_require__(8492);
-// eslint-disable-next-line @typescript-eslint/no-empty-function
-const empty = () => { };
-const timeoutError = new p_timeout_1.TimeoutError();
-/**
-Promise queue with concurrency control.
-*/
-class PQueue extends EventEmitter {
- constructor(options) {
- var _a, _b, _c, _d;
- super();
- this._intervalCount = 0;
- this._intervalEnd = 0;
- this._pendingCount = 0;
- this._resolveEmpty = empty;
- this._resolveIdle = empty;
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
- options = Object.assign({ carryoverConcurrencyCount: false, intervalCap: Infinity, interval: 0, concurrency: Infinity, autoStart: true, queueClass: priority_queue_1.default }, options);
- if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`);
- }
- if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`);
- }
- this._carryoverConcurrencyCount = options.carryoverConcurrencyCount;
- this._isIntervalIgnored = options.intervalCap === Infinity || options.interval === 0;
- this._intervalCap = options.intervalCap;
- this._interval = options.interval;
- this._queue = new options.queueClass();
- this._queueClass = options.queueClass;
- this.concurrency = options.concurrency;
- this._timeout = options.timeout;
- this._throwOnTimeout = options.throwOnTimeout === true;
- this._isPaused = options.autoStart === false;
- }
- get _doesIntervalAllowAnother() {
- return this._isIntervalIgnored || this._intervalCount < this._intervalCap;
- }
- get _doesConcurrentAllowAnother() {
- return this._pendingCount < this._concurrency;
- }
- _next() {
- this._pendingCount--;
- this._tryToStartAnother();
- this.emit('next');
- }
- _resolvePromises() {
- this._resolveEmpty();
- this._resolveEmpty = empty;
- if (this._pendingCount === 0) {
- this._resolveIdle();
- this._resolveIdle = empty;
- this.emit('idle');
- }
- }
- _onResumeInterval() {
- this._onInterval();
- this._initializeIntervalIfNeeded();
- this._timeoutId = undefined;
- }
- _isIntervalPaused() {
- const now = Date.now();
- if (this._intervalId === undefined) {
- const delay = this._intervalEnd - now;
- if (delay < 0) {
- // Act as the interval was done
- // We don't need to resume it here because it will be resumed on line 160
- this._intervalCount = (this._carryoverConcurrencyCount) ? this._pendingCount : 0;
- }
- else {
- // Act as the interval is pending
- if (this._timeoutId === undefined) {
- this._timeoutId = setTimeout(() => {
- this._onResumeInterval();
- }, delay);
- }
- return true;
- }
- }
- return false;
- }
- _tryToStartAnother() {
- if (this._queue.size === 0) {
- // We can clear the interval ("pause")
- // Because we can redo it later ("resume")
- if (this._intervalId) {
- clearInterval(this._intervalId);
- }
- this._intervalId = undefined;
- this._resolvePromises();
- return false;
- }
- if (!this._isPaused) {
- const canInitializeInterval = !this._isIntervalPaused();
- if (this._doesIntervalAllowAnother && this._doesConcurrentAllowAnother) {
- const job = this._queue.dequeue();
- if (!job) {
- return false;
- }
- this.emit('active');
- job();
- if (canInitializeInterval) {
- this._initializeIntervalIfNeeded();
- }
- return true;
- }
- }
- return false;
- }
- _initializeIntervalIfNeeded() {
- if (this._isIntervalIgnored || this._intervalId !== undefined) {
- return;
- }
- this._intervalId = setInterval(() => {
- this._onInterval();
- }, this._interval);
- this._intervalEnd = Date.now() + this._interval;
- }
- _onInterval() {
- if (this._intervalCount === 0 && this._pendingCount === 0 && this._intervalId) {
- clearInterval(this._intervalId);
- this._intervalId = undefined;
- }
- this._intervalCount = this._carryoverConcurrencyCount ? this._pendingCount : 0;
- this._processQueue();
- }
- /**
- Executes all queued functions until it reaches the limit.
- */
- _processQueue() {
- // eslint-disable-next-line no-empty
- while (this._tryToStartAnother()) { }
- }
- get concurrency() {
- return this._concurrency;
- }
- set concurrency(newConcurrency) {
- if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {
- throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
- }
- this._concurrency = newConcurrency;
- this._processQueue();
- }
- /**
- Adds a sync or async task to the queue. Always returns a promise.
- */
- async add(fn, options = {}) {
- return new Promise((resolve, reject) => {
- const run = async () => {
- this._pendingCount++;
- this._intervalCount++;
- try {
- const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {
- if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {
- reject(timeoutError);
- }
- return undefined;
- });
- resolve(await operation);
- }
- catch (error) {
- reject(error);
- }
- this._next();
- };
- this._queue.enqueue(run, options);
- this._tryToStartAnother();
- this.emit('add');
- });
+class Agent extends DispatcherBase {
+ constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
}
- /**
- Same as `.add()`, but accepts an array of sync or async functions.
- @returns A promise that resolves when all functions are resolved.
- */
- async addAll(functions, options) {
- return Promise.all(functions.map(async (function_) => this.add(function_, options)));
- }
- /**
- Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
- */
- start() {
- if (!this._isPaused) {
- return this;
- }
- this._isPaused = false;
- this._processQueue();
- return this;
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
}
- /**
- Put queue execution on hold.
- */
- pause() {
- this._isPaused = true;
+
+ if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
+ throw new InvalidArgumentError('maxRedirections must be a positive number')
}
- /**
- Clear the queue.
- */
- clear() {
- this._queue = new this._queueClass();
+
+ super(options)
+
+ if (connect && typeof connect !== 'function') {
+ connect = { ...connect }
}
- /**
- Can be called multiple times. Useful if you for example add additional items at a later time.
- @returns A promise that settles when the queue becomes empty.
- */
- async onEmpty() {
- // Instantly resolve if the queue is empty
- if (this._queue.size === 0) {
- return;
- }
- return new Promise(resolve => {
- const existingResolve = this._resolveEmpty;
- this._resolveEmpty = () => {
- existingResolve();
- resolve();
- };
- });
+ this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)
+ ? options.interceptors.Agent
+ : [createRedirectInterceptor({ maxRedirections })]
+
+ this[kOptions] = { ...util.deepClone(options), connect }
+ this[kOptions].interceptors = options.interceptors
+ ? { ...options.interceptors }
+ : undefined
+ this[kMaxRedirections] = maxRedirections
+ this[kFactory] = factory
+ this[kClients] = new Map()
+
+ this[kOnDrain] = (origin, targets) => {
+ this.emit('drain', origin, [this, ...targets])
}
- /**
- The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
- @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
- */
- async onIdle() {
- // Instantly resolve if none pending and if nothing else is queued
- if (this._pendingCount === 0 && this._queue.size === 0) {
- return;
- }
- return new Promise(resolve => {
- const existingResolve = this._resolveIdle;
- this._resolveIdle = () => {
- existingResolve();
- resolve();
- };
- });
+ this[kOnConnect] = (origin, targets) => {
+ this.emit('connect', origin, [this, ...targets])
}
- /**
- Size of the queue.
- */
- get size() {
- return this._queue.size;
+
+ this[kOnDisconnect] = (origin, targets, err) => {
+ this.emit('disconnect', origin, [this, ...targets], err)
}
- /**
- Size of the queue, filtered by the given options.
- For example, this can be used to find the number of items remaining in the queue with a specific priority level.
- */
- sizeBy(options) {
- // eslint-disable-next-line unicorn/no-fn-reference-in-iterator
- return this._queue.filter(options).length;
+ this[kOnConnectionError] = (origin, targets, err) => {
+ this.emit('connectionError', origin, [this, ...targets], err)
}
- /**
- Number of pending promises.
- */
- get pending() {
- return this._pendingCount;
+ }
+
+ get [kRunning] () {
+ let ret = 0
+ for (const client of this[kClients].values()) {
+ ret += client[kRunning]
}
- /**
- Whether the queue is currently paused.
- */
- get isPaused() {
- return this._isPaused;
+ return ret
+ }
+
+ [kDispatch] (opts, handler) {
+ let key
+ if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
+ key = String(opts.origin)
+ } else {
+ throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
}
- get timeout() {
- return this._timeout;
+
+ let dispatcher = this[kClients].get(key)
+
+ if (!dispatcher) {
+ dispatcher = this[kFactory](opts.origin, this[kOptions])
+ .on('drain', this[kOnDrain])
+ .on('connect', this[kOnConnect])
+ .on('disconnect', this[kOnDisconnect])
+ .on('connectionError', this[kOnConnectionError])
+
+ // This introduces a tiny memory leak, as dispatchers are never removed from the map.
+ // TODO(mcollina): remove te timer when the client/pool do not have any more
+ // active connections.
+ this[kClients].set(key, dispatcher)
}
- /**
- Set the timeout for future operations.
- */
- set timeout(milliseconds) {
- this._timeout = milliseconds;
+
+ return dispatcher.dispatch(opts, handler)
+ }
+
+ async [kClose] () {
+ const closePromises = []
+ for (const client of this[kClients].values()) {
+ closePromises.push(client.close())
+ }
+ this[kClients].clear()
+
+ await Promise.all(closePromises)
+ }
+
+ async [kDestroy] (err) {
+ const destroyPromises = []
+ for (const client of this[kClients].values()) {
+ destroyPromises.push(client.destroy(err))
}
+ this[kClients].clear()
+
+ await Promise.all(destroyPromises)
+ }
}
-exports["default"] = PQueue;
+
+module.exports = Agent
/***/ }),
-/***/ 2291:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 837:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
-// Used to compute insertion index to keep queue sorted after insertion
-function lowerBound(array, value, comparator) {
- let first = 0;
- let count = array.length;
- while (count > 0) {
- const step = (count / 2) | 0;
- let it = first + step;
- if (comparator(array[it], value) <= 0) {
- first = ++it;
- count -= step + 1;
- }
- else {
- count = step;
- }
- }
- return first;
+
+const {
+ BalancedPoolMissingUpstreamError,
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kRemoveClient,
+ kGetDispatcher
+} = __nccwpck_require__(2128)
+const Pool = __nccwpck_require__(628)
+const { kUrl, kInterceptors } = __nccwpck_require__(6443)
+const { parseOrigin } = __nccwpck_require__(3440)
+const kFactory = Symbol('factory')
+
+const kOptions = Symbol('options')
+const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
+const kCurrentWeight = Symbol('kCurrentWeight')
+const kIndex = Symbol('kIndex')
+const kWeight = Symbol('kWeight')
+const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
+const kErrorPenalty = Symbol('kErrorPenalty')
+
+/**
+ * Calculate the greatest common divisor of two numbers by
+ * using the Euclidean algorithm.
+ *
+ * @param {number} a
+ * @param {number} b
+ * @returns {number}
+ */
+function getGreatestCommonDivisor (a, b) {
+ if (a === 0) return b
+
+ while (b !== 0) {
+ const t = b
+ b = a % b
+ a = t
+ }
+ return a
}
-exports["default"] = lowerBound;
+function defaultFactory (origin, opts) {
+ return new Pool(origin, opts)
+}
-/***/ }),
+class BalancedPool extends PoolBase {
+ constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
+ super()
-/***/ 8492:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ this[kOptions] = opts
+ this[kIndex] = -1
+ this[kCurrentWeight] = 0
-"use strict";
+ this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
+ this[kErrorPenalty] = this[kOptions].errorPenalty || 15
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const lower_bound_1 = __nccwpck_require__(2291);
-class PriorityQueue {
- constructor() {
- this._queue = [];
- }
- enqueue(run, options) {
- options = Object.assign({ priority: 0 }, options);
- const element = {
- priority: options.priority,
- run
- };
- if (this.size && this._queue[this.size - 1].priority >= options.priority) {
- this._queue.push(element);
- return;
- }
- const index = lower_bound_1.default(this._queue, element, (a, b) => b.priority - a.priority);
- this._queue.splice(index, 0, element);
+ if (!Array.isArray(upstreams)) {
+ upstreams = [upstreams]
}
- dequeue() {
- const item = this._queue.shift();
- return item === null || item === void 0 ? void 0 : item.run;
+
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
}
- filter(options) {
- return this._queue.filter((element) => element.priority === options.priority).map((element) => element.run);
+
+ this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
+ ? opts.interceptors.BalancedPool
+ : []
+ this[kFactory] = factory
+
+ for (const upstream of upstreams) {
+ this.addUpstream(upstream)
}
- get size() {
- return this._queue.length;
+ this._updateBalancedPoolStats()
+ }
+
+ addUpstream (upstream) {
+ const upstreamOrigin = parseOrigin(upstream).origin
+
+ if (this[kClients].find((pool) => (
+ pool[kUrl].origin === upstreamOrigin &&
+ pool.closed !== true &&
+ pool.destroyed !== true
+ ))) {
+ return this
}
-}
-exports["default"] = PriorityQueue;
+ const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
+ this[kAddClient](pool)
+ pool.on('connect', () => {
+ pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
+ })
-/***/ }),
+ pool.on('connectionError', () => {
+ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
+ this._updateBalancedPoolStats()
+ })
-/***/ 4924:
-/***/ ((module) => {
+ pool.on('disconnect', (...args) => {
+ const err = args[2]
+ if (err && err.code === 'UND_ERR_SOCKET') {
+ // decrease the weight of the pool.
+ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
+ this._updateBalancedPoolStats()
+ }
+ })
-"use strict";
+ for (const client of this[kClients]) {
+ client[kWeight] = this[kMaxWeightPerServer]
+ }
+ this._updateBalancedPoolStats()
-var has = Object.prototype.hasOwnProperty
- , prefix = '~';
+ return this
+ }
-/**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
-function Events() {}
+ _updateBalancedPoolStats () {
+ let result = 0
+ for (let i = 0; i < this[kClients].length; i++) {
+ result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)
+ }
-//
-// We try to not inherit from `Object.prototype`. In some engines creating an
-// instance in this way is faster than calling `Object.create(null)` directly.
-// If `Object.create(null)` is not supported we prefix the event names with a
-// character to make sure that the built-in object properties are not
-// overridden or used as an attack vector.
-//
-if (Object.create) {
- Events.prototype = Object.create(null);
+ this[kGreatestCommonDivisor] = result
+ }
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
-}
+ removeUpstream (upstream) {
+ const upstreamOrigin = parseOrigin(upstream).origin
-/**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
-function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
-}
+ const pool = this[kClients].find((pool) => (
+ pool[kUrl].origin === upstreamOrigin &&
+ pool.closed !== true &&
+ pool.destroyed !== true
+ ))
-/**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
-function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
+ if (pool) {
+ this[kRemoveClient](pool)
+ }
+
+ return this
}
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
+ get upstreams () {
+ return this[kClients]
+ .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
+ .map((p) => p[kUrl].origin)
+ }
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
+ [kGetDispatcher] () {
+ // We validate that pools is greater than 0,
+ // otherwise we would have to wait until an upstream
+ // is added, which might never happen.
+ if (this[kClients].length === 0) {
+ throw new BalancedPoolMissingUpstreamError()
+ }
- return emitter;
-}
+ const dispatcher = this[kClients].find(dispatcher => (
+ !dispatcher[kNeedDrain] &&
+ dispatcher.closed !== true &&
+ dispatcher.destroyed !== true
+ ))
-/**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
-function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
-}
+ if (!dispatcher) {
+ return
+ }
-/**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
-function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
-}
+ const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
-/**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
-EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
+ if (allClientsBusy) {
+ return
+ }
- if (this._eventsCount === 0) return names;
+ let counter = 0
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
+ let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
+ while (counter++ < this[kClients].length) {
+ this[kIndex] = (this[kIndex] + 1) % this[kClients].length
+ const pool = this[kClients][this[kIndex]]
- return names;
-};
+ // find pool index with the largest weight
+ if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
+ maxWeightIndex = this[kIndex]
+ }
-/**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
-EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
+ // decrease the current weight every `this[kClients].length`.
+ if (this[kIndex] === 0) {
+ // Set the current weight to the next lower weight.
+ this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
+ if (this[kCurrentWeight] <= 0) {
+ this[kCurrentWeight] = this[kMaxWeightPerServer]
+ }
+ }
+ if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
+ return pool
+ }
+ }
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
+ this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
+ this[kIndex] = maxWeightIndex
+ return this[kClients][maxWeightIndex]
}
+}
- return ee;
-};
+module.exports = BalancedPool
-/**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
-EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
-};
+/***/ }),
+
+/***/ 637:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+/* global WebAssembly */
+
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const timers = __nccwpck_require__(6603)
+const {
+ RequestContentLengthMismatchError,
+ ResponseContentLengthMismatchError,
+ RequestAbortedError,
+ HeadersTimeoutError,
+ HeadersOverflowError,
+ SocketError,
+ InformationalError,
+ BodyTimeoutError,
+ HTTPParserError,
+ ResponseExceededMaxSizeError
+} = __nccwpck_require__(8707)
+const {
+ kUrl,
+ kReset,
+ kClient,
+ kParser,
+ kBlocking,
+ kRunning,
+ kPending,
+ kSize,
+ kWriting,
+ kQueue,
+ kNoRef,
+ kKeepAliveDefaultTimeout,
+ kHostHeader,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kPipelining,
+ kSocket,
+ kKeepAliveTimeoutValue,
+ kMaxHeadersSize,
+ kKeepAliveMaxTimeout,
+ kKeepAliveTimeoutThreshold,
+ kHeadersTimeout,
+ kBodyTimeout,
+ kStrictContentLength,
+ kMaxRequests,
+ kCounter,
+ kMaxResponseSize,
+ kOnError,
+ kResume,
+ kHTTPContext
+} = __nccwpck_require__(6443)
+
+const constants = __nccwpck_require__(2824)
+const EMPTY_BUF = Buffer.alloc(0)
+const FastBuffer = Buffer[Symbol.species]
+const addListener = util.addListener
+const removeAllListeners = util.removeAllListeners
+const kIdleSocketValidation = Symbol('kIdleSocketValidation')
+const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')
+const kSocketUsed = Symbol('kSocketUsed')
-/**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
-EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
+let extractBody
- if (!this._events[evt]) return false;
+async function lazyllhttp () {
+ const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(3870) : undefined
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
+ let mod
+ try {
+ mod = await WebAssembly.compile(__nccwpck_require__(3434))
+ } catch (e) {
+ /* istanbul ignore next */
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+ // We could check if the error was caused by the simd option not
+ // being enabled, but the occurring of this other error
+ // * https://github.com/emscripten-core/emscripten/issues/11495
+ // got me to remove that check to avoid breaking Node 12.
+ mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(3870))
+ }
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
+ return await WebAssembly.instantiate(mod, {
+ env: {
+ /* eslint-disable camelcase */
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
+ wasm_on_url: (p, at, len) => {
+ /* istanbul ignore next */
+ return 0
+ },
+ wasm_on_status: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_message_begin: (p) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onMessageBegin() || 0
+ },
+ wasm_on_header_field: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_header_value: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
+ },
+ wasm_on_body: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_message_complete: (p) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onMessageComplete() || 0
+ }
+
+ /* eslint-enable camelcase */
}
+ })
+}
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
+let llhttpInstance = null
+let llhttpPromise = lazyllhttp()
+llhttpPromise.catch()
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+let currentParser = null
+let currentBufferRef = null
+let currentBufferSize = 0
+let currentBufferPtr = null
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
+const USE_NATIVE_TIMER = 0
+const USE_FAST_TIMER = 1
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
+// Use fast timers for headers and body to take eventual event loop
+// latency into account.
+const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER
+const TIMEOUT_BODY = 4 | USE_FAST_TIMER
- return true;
-};
+// Use native timers to ignore event loop latency for keep-alive
+// handling.
+const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER
-/**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
-};
+class Parser {
+ constructor (client, socket, { exports }) {
+ assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
-/**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
-};
+ this.llhttp = exports
+ this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
+ this.client = client
+ this.socket = socket
+ this.timeout = null
+ this.timeoutValue = null
+ this.timeoutType = null
+ this.statusCode = null
+ this.statusText = ''
+ this.upgrade = false
+ this.headers = []
+ this.headersSize = 0
+ this.headersMaxSize = client[kMaxHeadersSize]
+ this.shouldKeepAlive = false
+ this.paused = false
+ this.resume = this.resume.bind(this)
-/**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
+ this.bytesRead = 0
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
+ this.keepAlive = ''
+ this.contentLength = ''
+ this.connection = ''
+ this.maxResponseSize = client[kMaxResponseSize]
}
- var listeners = this._events[evt];
-
- if (listeners.fn) {
+ setTimeout (delay, type) {
+ // If the existing timer and the new timer are of different timer type
+ // (fast or native) or have different delay, we need to clear the existing
+ // timer and set a new one.
if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
+ delay !== this.timeoutValue ||
+ (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)
) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
+ // If a timeout is already set, clear it with clearTimeout of the fast
+ // timer implementation, as it can clear fast and native timers.
+ if (this.timeout) {
+ timers.clearTimeout(this.timeout)
+ this.timeout = null
+ }
+
+ if (delay) {
+ if (type & USE_FAST_TIMER) {
+ this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))
+ } else {
+ this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))
+ this.timeout.unref()
+ }
+ }
+
+ this.timeoutValue = delay
+ } else if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
}
}
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
+ this.timeoutType = type
}
- return this;
-};
-
-/**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
+ resume () {
+ if (this.socket.destroyed || !this.paused) {
+ return
+ }
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
+ assert(this.ptr != null)
+ assert(currentParser == null)
- return this;
-};
+ this.llhttp.llhttp_resume(this.ptr)
-//
-// Alias methods names because people roll like that.
-//
-EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+ assert(this.timeoutType === TIMEOUT_BODY)
+ if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
-//
-// Expose the prefix.
-//
-EventEmitter.prefixed = prefix;
+ this.paused = false
+ this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
+ this.readMore()
+ }
-//
-// Allow `EventEmitter` to be imported as module namespace.
-//
-EventEmitter.EventEmitter = EventEmitter;
+ readMore () {
+ while (!this.paused && this.ptr) {
+ const chunk = this.socket.read()
+ if (chunk === null) {
+ break
+ }
+ this.execute(chunk)
+ }
+ }
-//
-// Expose the module.
-//
-if (true) {
- module.exports = EventEmitter;
-}
+ execute (data) {
+ assert(this.ptr != null)
+ assert(currentParser == null)
+ assert(!this.paused)
+ const { socket, llhttp } = this
-/***/ }),
+ if (data.length > currentBufferSize) {
+ if (currentBufferPtr) {
+ llhttp.free(currentBufferPtr)
+ }
+ currentBufferSize = Math.ceil(data.length / 4096) * 4096
+ currentBufferPtr = llhttp.malloc(currentBufferSize)
+ }
-/***/ 2548:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
-"use strict";
+ // Call `execute` on the wasm parser.
+ // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
+ // and finally the length of bytes to parse.
+ // The return value is an error code or `constants.ERROR.OK`.
+ try {
+ let ret
-const retry = __nccwpck_require__(1604);
+ try {
+ currentBufferRef = data
+ currentParser = this
+ ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
+ /* eslint-disable-next-line no-useless-catch */
+ } catch (err) {
+ /* istanbul ignore next: difficult to make a test case for */
+ throw err
+ } finally {
+ currentParser = null
+ currentBufferRef = null
+ }
-const networkErrorMsgs = [
- 'Failed to fetch', // Chrome
- 'NetworkError when attempting to fetch resource.', // Firefox
- 'The Internet connection appears to be offline.', // Safari
- 'Network request failed' // `cross-fetch`
-];
+ const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
-class AbortError extends Error {
- constructor(message) {
- super();
+ if (ret !== constants.ERROR.OK) {
+ const body = data.subarray(offset)
- if (message instanceof Error) {
- this.originalError = message;
- ({message} = message);
- } else {
- this.originalError = new Error(message);
- this.originalError.stack = this.stack;
- }
+ if (ret === constants.ERROR.PAUSED_UPGRADE) {
+ this.onUpgrade(body)
+ } else if (ret === constants.ERROR.PAUSED) {
+ this.paused = true
+ socket.unshift(body)
+ } else {
+ throw this.createError(ret, body)
+ }
+ }
+ } catch (err) {
+ util.destroy(socket, err)
+ }
+ }
- this.name = 'AbortError';
- this.message = message;
- }
-}
+ finish () {
+ assert(currentParser === null)
+ assert(this.ptr != null)
+ assert(!this.paused)
-const decorateErrorWithCounts = (error, attemptNumber, options) => {
- // Minus 1 from attemptNumber because the first attempt does not count as a retry
- const retriesLeft = options.retries - (attemptNumber - 1);
+ const { llhttp } = this
- error.attemptNumber = attemptNumber;
- error.retriesLeft = retriesLeft;
- return error;
-};
+ let ret
-const isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);
+ try {
+ currentParser = this
+ ret = llhttp.llhttp_finish(this.ptr)
+ } finally {
+ currentParser = null
+ }
-const pRetry = (input, options) => new Promise((resolve, reject) => {
- options = {
- onFailedAttempt: () => {},
- retries: 10,
- ...options
- };
+ if (ret === constants.ERROR.OK) {
+ return null
+ }
- const operation = retry.operation(options);
+ if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
+ this.paused = true
+ return null
+ }
- operation.attempt(async attemptNumber => {
- try {
- resolve(await input(attemptNumber));
- } catch (error) {
- if (!(error instanceof Error)) {
- reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
- return;
- }
+ return this.createError(ret, EMPTY_BUF)
+ }
- if (error instanceof AbortError) {
- operation.stop();
- reject(error.originalError);
- } else if (error instanceof TypeError && !isNetworkError(error.message)) {
- operation.stop();
- reject(error);
- } else {
- decorateErrorWithCounts(error, attemptNumber, options);
+ createError (ret, data) {
+ const { llhttp, contentLength, bytesRead } = this
- try {
- await options.onFailedAttempt(error);
- } catch (error) {
- reject(error);
- return;
- }
+ if (contentLength && bytesRead !== parseInt(contentLength, 10)) {
+ return new ResponseContentLengthMismatchError()
+ }
- if (!operation.retry(error)) {
- reject(operation.mainError());
- }
- }
- }
- });
-});
+ const ptr = llhttp.llhttp_get_error_reason(this.ptr)
+ let message = ''
+ if (ptr) {
+ const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
+ message =
+ 'Response does not match the HTTP/1.1 protocol (' +
+ Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
+ ')'
+ }
-module.exports = pRetry;
-// TODO: remove this in the next major version
-module.exports["default"] = pRetry;
+ return new HTTPParserError(message, constants.ERROR[ret], data)
+ }
-module.exports.AbortError = AbortError;
+ destroy () {
+ assert(this.ptr != null)
+ assert(currentParser == null)
+ this.llhttp.llhttp_free(this.ptr)
+ this.ptr = null
-/***/ }),
+ this.timeout && timers.clearTimeout(this.timeout)
+ this.timeout = null
+ this.timeoutValue = null
+ this.timeoutType = null
-/***/ 6424:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this.paused = false
+ }
-"use strict";
+ onStatus (buf) {
+ this.statusText = buf.toString()
+ }
+ onMessageBegin () {
+ const { socket, client } = this
-const pFinally = __nccwpck_require__(1330);
+ /* istanbul ignore next: difficult to make a test case for */
+ if (socket.destroyed) {
+ return -1
+ }
-class TimeoutError extends Error {
- constructor(message) {
- super(message);
- this.name = 'TimeoutError';
- }
-}
+ if (client[kRunning] === 0) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
+ }
-const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => {
- if (typeof milliseconds !== 'number' || milliseconds < 0) {
- throw new TypeError('Expected `milliseconds` to be a positive number');
- }
+ const request = client[kQueue][client[kRunningIdx]]
+ if (!request) {
+ return -1
+ }
+ request.onResponseStarted()
+ }
- if (milliseconds === Infinity) {
- resolve(promise);
- return;
- }
+ onHeaderField (buf) {
+ const len = this.headers.length
- const timer = setTimeout(() => {
- if (typeof fallback === 'function') {
- try {
- resolve(fallback());
- } catch (error) {
- reject(error);
- }
+ if ((len & 1) === 0) {
+ this.headers.push(buf)
+ } else {
+ this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ }
- return;
- }
+ this.trackHeader(buf.length)
+ }
- const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
- const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
+ onHeaderValue (buf) {
+ let len = this.headers.length
- if (typeof promise.cancel === 'function') {
- promise.cancel();
- }
+ if ((len & 1) === 1) {
+ this.headers.push(buf)
+ len += 1
+ } else {
+ this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ }
- reject(timeoutError);
- }, milliseconds);
+ const key = this.headers[len - 2]
+ if (key.length === 10) {
+ const headerName = util.bufferToLowerCasedHeaderName(key)
+ if (headerName === 'keep-alive') {
+ this.keepAlive += buf.toString()
+ } else if (headerName === 'connection') {
+ this.connection += buf.toString()
+ }
+ } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {
+ this.contentLength += buf.toString()
+ }
- // TODO: Use native `finally` keyword when targeting Node.js 10
- pFinally(
- // eslint-disable-next-line promise/prefer-await-to-then
- promise.then(resolve, reject),
- () => {
- clearTimeout(timer);
- }
- );
-});
+ this.trackHeader(buf.length)
+ }
-module.exports = pTimeout;
-// TODO: Remove this for the next major release
-module.exports["default"] = pTimeout;
+ trackHeader (len) {
+ this.headersSize += len
+ if (this.headersSize >= this.headersMaxSize) {
+ util.destroy(this.socket, new HeadersOverflowError())
+ }
+ }
-module.exports.TimeoutError = TimeoutError;
+ onUpgrade (head) {
+ const { upgrade, client, socket, headers, statusCode } = this
+ assert(upgrade)
+ assert(client[kSocket] === socket)
+ assert(!socket.destroyed)
+ assert(!this.paused)
+ assert((headers.length & 1) === 0)
-/***/ }),
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
+ assert(request.upgrade || request.method === 'CONNECT')
-/***/ 3329:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ this.statusCode = null
+ this.statusText = ''
+ this.shouldKeepAlive = null
-"use strict";
+ this.headers = []
+ this.headersSize = 0
+ socket.unshift(head)
-var parseUrl = (__nccwpck_require__(7310).parse);
+ socket[kParser].destroy()
+ socket[kParser] = null
-var DEFAULT_PORTS = {
- ftp: 21,
- gopher: 70,
- http: 80,
- https: 443,
- ws: 80,
- wss: 443,
-};
+ socket[kClient] = null
+ socket[kError] = null
-var stringEndsWith = String.prototype.endsWith || function(s) {
- return s.length <= this.length &&
- this.indexOf(s, this.length - s.length) !== -1;
-};
+ removeAllListeners(socket)
-/**
- * @param {string|object} url - The URL, or the result from url.parse.
- * @return {string} The URL of the proxy that should handle the request to the
- * given URL. If no proxy is set, this will be an empty string.
- */
-function getProxyForUrl(url) {
- var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};
- var proto = parsedUrl.protocol;
- var hostname = parsedUrl.host;
- var port = parsedUrl.port;
- if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
- return ''; // Don't proxy URLs without a valid scheme or host.
- }
+ client[kSocket] = null
+ client[kHTTPContext] = null // TODO (fix): This is hacky...
+ client[kQueue][client[kRunningIdx]++] = null
+ client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
- proto = proto.split(':', 1)[0];
- // Stripping ports in this way instead of using parsedUrl.hostname to make
- // sure that the brackets around IPv6 addresses are kept.
- hostname = hostname.replace(/:\d*$/, '');
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
- if (!shouldProxy(hostname, port)) {
- return ''; // Don't proxy URLs that match NO_PROXY.
- }
+ try {
+ request.onUpgrade(statusCode, headers, socket)
+ } catch (err) {
+ util.destroy(socket, err)
+ }
- var proxy =
- getEnv('npm_config_' + proto + '_proxy') ||
- getEnv(proto + '_proxy') ||
- getEnv('npm_config_proxy') ||
- getEnv('all_proxy');
- if (proxy && proxy.indexOf('://') === -1) {
- // Missing scheme in proxy, default to the requested URL's scheme.
- proxy = proto + '://' + proxy;
+ client[kResume]()
}
- return proxy;
-}
-/**
- * Determines whether a given URL should be proxied.
- *
- * @param {string} hostname - The host name of the URL.
- * @param {number} port - The effective port of the URL.
- * @returns {boolean} Whether the given URL should be proxied.
- * @private
- */
-function shouldProxy(hostname, port) {
- var NO_PROXY =
- (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
- if (!NO_PROXY) {
- return true; // Always proxy if NO_PROXY is not set.
- }
- if (NO_PROXY === '*') {
- return false; // Never proxy if wildcard is set.
- }
+ onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
+ const { client, socket, headers, statusText } = this
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
- if (!proxy) {
- return true; // Skip zero-length hosts.
- }
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
- if (parsedProxyPort && parsedProxyPort !== port) {
- return true; // Skip if ports don't match.
+ /* istanbul ignore next: difficult to make a test case for */
+ if (socket.destroyed) {
+ return -1
}
- if (!/^[.*]/.test(parsedProxyHostname)) {
- // No wildcards, so stop proxying if there is an exact match.
- return hostname !== parsedProxyHostname;
+ if (client[kRunning] === 0) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
}
- if (parsedProxyHostname.charAt(0) === '*') {
- // Remove leading wildcard.
- parsedProxyHostname = parsedProxyHostname.slice(1);
- }
- // Stop proxying if the hostname ends with the no_proxy host.
- return !stringEndsWith.call(hostname, parsedProxyHostname);
- });
-}
+ const request = client[kQueue][client[kRunningIdx]]
-/**
- * Get the value for an environment variable.
- *
- * @param {string} key - The name of the environment variable.
- * @return {string} The value of the environment variable.
- * @private
- */
-function getEnv(key) {
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
-}
+ /* istanbul ignore next: difficult to make a test case for */
+ if (!request) {
+ return -1
+ }
-exports.getProxyForUrl = getProxyForUrl;
+ assert(!this.upgrade)
+ assert(this.statusCode < 200)
+ if (statusCode === 100) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
+ }
-/***/ }),
+ /* this can only happen if server is misbehaving */
+ if (upgrade && !request.upgrade) {
+ util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
+ return -1
+ }
-/***/ 1604:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ assert(this.timeoutType === TIMEOUT_HEADERS)
-module.exports = __nccwpck_require__(6244);
+ this.statusCode = statusCode
+ this.shouldKeepAlive = (
+ shouldKeepAlive ||
+ // Override llhttp value which does not allow keepAlive for HEAD.
+ (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
+ )
-/***/ }),
+ if (this.statusCode >= 200) {
+ const bodyTimeout = request.bodyTimeout != null
+ ? request.bodyTimeout
+ : client[kBodyTimeout]
+ this.setTimeout(bodyTimeout, TIMEOUT_BODY)
+ } else if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
-/***/ 6244:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if (request.method === 'CONNECT') {
+ assert(client[kRunning] === 1)
+ this.upgrade = true
+ return 2
+ }
-var RetryOperation = __nccwpck_require__(5369);
+ if (upgrade) {
+ assert(client[kRunning] === 1)
+ this.upgrade = true
+ return 2
+ }
-exports.operation = function(options) {
- var timeouts = exports.timeouts(options);
- return new RetryOperation(timeouts, {
- forever: options && (options.forever || options.retries === Infinity),
- unref: options && options.unref,
- maxRetryTime: options && options.maxRetryTime
- });
-};
+ assert((this.headers.length & 1) === 0)
+ this.headers = []
+ this.headersSize = 0
-exports.timeouts = function(options) {
- if (options instanceof Array) {
- return [].concat(options);
- }
+ if (this.shouldKeepAlive && client[kPipelining]) {
+ const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
- var opts = {
- retries: 10,
- factor: 2,
- minTimeout: 1 * 1000,
- maxTimeout: Infinity,
- randomize: false
- };
- for (var key in options) {
- opts[key] = options[key];
- }
+ if (keepAliveTimeout != null) {
+ const timeout = Math.min(
+ keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
+ client[kKeepAliveMaxTimeout]
+ )
+ if (timeout <= 0) {
+ socket[kReset] = true
+ } else {
+ client[kKeepAliveTimeoutValue] = timeout
+ }
+ } else {
+ client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
+ }
+ } else {
+ // Stop more requests from being dispatched.
+ socket[kReset] = true
+ }
- if (opts.minTimeout > opts.maxTimeout) {
- throw new Error('minTimeout is greater than maxTimeout');
- }
+ const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
- var timeouts = [];
- for (var i = 0; i < opts.retries; i++) {
- timeouts.push(this.createTimeout(i, opts));
- }
+ if (request.aborted) {
+ return -1
+ }
- if (options && options.forever && !timeouts.length) {
- timeouts.push(this.createTimeout(i, opts));
- }
+ if (request.method === 'HEAD') {
+ return 1
+ }
- // sort the array numerically ascending
- timeouts.sort(function(a,b) {
- return a - b;
- });
+ if (statusCode < 200) {
+ return 1
+ }
- return timeouts;
-};
+ if (socket[kBlocking]) {
+ socket[kBlocking] = false
+ client[kResume]()
+ }
-exports.createTimeout = function(attempt, opts) {
- var random = (opts.randomize)
- ? (Math.random() + 1)
- : 1;
+ return pause ? constants.ERROR.PAUSED : 0
+ }
- var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
- timeout = Math.min(timeout, opts.maxTimeout);
+ onBody (buf) {
+ const { client, socket, statusCode, maxResponseSize } = this
- return timeout;
-};
+ if (socket.destroyed) {
+ return -1
+ }
-exports.wrap = function(obj, options, methods) {
- if (options instanceof Array) {
- methods = options;
- options = null;
- }
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
- if (!methods) {
- methods = [];
- for (var key in obj) {
- if (typeof obj[key] === 'function') {
- methods.push(key);
+ assert(this.timeoutType === TIMEOUT_BODY)
+ if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
}
}
- }
- for (var i = 0; i < methods.length; i++) {
- var method = methods[i];
- var original = obj[method];
+ assert(statusCode >= 200)
- obj[method] = function retryWrapper(original) {
- var op = exports.operation(options);
- var args = Array.prototype.slice.call(arguments, 1);
- var callback = args.pop();
+ if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
+ util.destroy(socket, new ResponseExceededMaxSizeError())
+ return -1
+ }
- args.push(function(err) {
- if (op.retry(err)) {
- return;
- }
- if (err) {
- arguments[0] = op.mainError();
- }
- callback.apply(this, arguments);
- });
+ this.bytesRead += buf.length
- op.attempt(function() {
- original.apply(obj, args);
- });
- }.bind(obj, original);
- obj[method].options = options;
+ if (request.onData(buf) === false) {
+ return constants.ERROR.PAUSED
+ }
}
-};
+ onMessageComplete () {
+ const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
-/***/ }),
-
-/***/ 5369:
-/***/ ((module) => {
+ if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
+ return -1
+ }
-function RetryOperation(timeouts, options) {
- // Compatibility for the old (timeouts, retryForever) signature
- if (typeof options === 'boolean') {
- options = { forever: options };
- }
+ if (upgrade) {
+ return
+ }
- this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
- this._timeouts = timeouts;
- this._options = options || {};
- this._maxRetryTime = options && options.maxRetryTime || Infinity;
- this._fn = null;
- this._errors = [];
- this._attempts = 1;
- this._operationTimeout = null;
- this._operationTimeoutCb = null;
- this._timeout = null;
- this._operationStart = null;
- this._timer = null;
+ assert(statusCode >= 100)
+ assert((this.headers.length & 1) === 0)
- if (this._options.forever) {
- this._cachedTimeouts = this._timeouts.slice(0);
- }
-}
-module.exports = RetryOperation;
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
-RetryOperation.prototype.reset = function() {
- this._attempts = 1;
- this._timeouts = this._originalTimeouts.slice(0);
-}
+ this.statusCode = null
+ this.statusText = ''
+ this.bytesRead = 0
+ this.contentLength = ''
+ this.keepAlive = ''
+ this.connection = ''
-RetryOperation.prototype.stop = function() {
- if (this._timeout) {
- clearTimeout(this._timeout);
- }
- if (this._timer) {
- clearTimeout(this._timer);
- }
+ this.headers = []
+ this.headersSize = 0
- this._timeouts = [];
- this._cachedTimeouts = null;
-};
+ if (statusCode < 200) {
+ return
+ }
-RetryOperation.prototype.retry = function(err) {
- if (this._timeout) {
- clearTimeout(this._timeout);
- }
+ /* istanbul ignore next: should be handled by llhttp? */
+ if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
+ util.destroy(socket, new ResponseContentLengthMismatchError())
+ return -1
+ }
- if (!err) {
- return false;
- }
- var currentTime = new Date().getTime();
- if (err && currentTime - this._operationStart >= this._maxRetryTime) {
- this._errors.push(err);
- this._errors.unshift(new Error('RetryOperation timeout occurred'));
- return false;
- }
+ request.onComplete(headers)
- this._errors.push(err);
+ client[kQueue][client[kRunningIdx]++] = null
+ socket[kSocketUsed] = true
- var timeout = this._timeouts.shift();
- if (timeout === undefined) {
- if (this._cachedTimeouts) {
- // retry forever, only keep last error
- this._errors.splice(0, this._errors.length - 1);
- timeout = this._cachedTimeouts.slice(-1);
+ if (socket[kWriting]) {
+ assert(client[kRunning] === 0)
+ // Response completed before request.
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (!shouldKeepAlive) {
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (socket[kReset] && client[kRunning] === 0) {
+ // Destroy socket once all requests have completed.
+ // The request at the tail of the pipeline is the one
+ // that requested reset and no further requests should
+ // have been queued since then.
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (client[kPipelining] == null || client[kPipelining] === 1) {
+ // We must wait a full event loop cycle to reuse this socket to make sure
+ // that non-spec compliant servers are not closing the connection even if they
+ // said they won't.
+ setImmediate(() => client[kResume]())
} else {
- return false;
+ client[kResume]()
}
}
+}
- var self = this;
- this._timer = setTimeout(function() {
- self._attempts++;
-
- if (self._operationTimeoutCb) {
- self._timeout = setTimeout(function() {
- self._operationTimeoutCb(self._attempts);
- }, self._operationTimeout);
+function onParserTimeout (parser) {
+ const { socket, timeoutType, client, paused } = parser.deref()
- if (self._options.unref) {
- self._timeout.unref();
- }
+ /* istanbul ignore else */
+ if (timeoutType === TIMEOUT_HEADERS) {
+ if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
+ assert(!paused, 'cannot be paused while waiting for headers')
+ util.destroy(socket, new HeadersTimeoutError())
}
+ } else if (timeoutType === TIMEOUT_BODY) {
+ if (!paused) {
+ util.destroy(socket, new BodyTimeoutError())
+ }
+ } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
+ assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
+ util.destroy(socket, new InformationalError('socket idle timeout'))
+ }
+}
- self._fn(self._attempts);
- }, timeout);
+async function connectH1 (client, socket) {
+ client[kSocket] = socket
- if (this._options.unref) {
- this._timer.unref();
+ if (!llhttpInstance) {
+ llhttpInstance = await llhttpPromise
+ llhttpPromise = null
}
- return true;
-};
+ socket[kNoRef] = false
+ socket[kWriting] = false
+ socket[kReset] = false
+ socket[kBlocking] = false
+ socket[kIdleSocketValidation] = 0
+ socket[kIdleSocketValidationTimeout] = null
+ socket[kSocketUsed] = false
+ socket[kParser] = new Parser(client, socket, llhttpInstance)
-RetryOperation.prototype.attempt = function(fn, timeoutOps) {
- this._fn = fn;
+ addListener(socket, 'error', function (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- if (timeoutOps) {
- if (timeoutOps.timeout) {
- this._operationTimeout = timeoutOps.timeout;
- }
- if (timeoutOps.cb) {
- this._operationTimeoutCb = timeoutOps.cb;
+ const parser = this[kParser]
+
+ // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
+ // to the user.
+ if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
+ const parserErr = parser.finish()
+ if (parserErr) {
+ this[kError] = parserErr
+ this[kClient][kOnError](parserErr)
+ }
+ return
}
- }
- var self = this;
- if (this._operationTimeoutCb) {
- this._timeout = setTimeout(function() {
- self._operationTimeoutCb();
- }, self._operationTimeout);
- }
+ this[kError] = err
- this._operationStart = new Date().getTime();
+ this[kClient][kOnError](err)
+ })
+ addListener(socket, 'readable', function () {
+ const parser = this[kParser]
- this._fn(this._attempts);
-};
+ if (parser) {
+ parser.readMore()
+ }
+ })
+ addListener(socket, 'end', function () {
+ const parser = this[kParser]
-RetryOperation.prototype.try = function(fn) {
- console.log('Using RetryOperation.try() is deprecated');
- this.attempt(fn);
-};
+ if (parser.statusCode && !parser.shouldKeepAlive) {
+ const parserErr = parser.finish()
+ if (parserErr) {
+ util.destroy(this, parserErr)
+ }
+ return
+ }
-RetryOperation.prototype.start = function(fn) {
- console.log('Using RetryOperation.start() is deprecated');
- this.attempt(fn);
-};
+ util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
+ })
+ addListener(socket, 'close', function () {
+ const client = this[kClient]
+ const parser = this[kParser]
-RetryOperation.prototype.start = RetryOperation.prototype.try;
+ clearIdleSocketValidation(this)
-RetryOperation.prototype.errors = function() {
- return this._errors;
-};
+ if (parser) {
+ if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
+ this[kError] = parser.finish() || this[kError]
+ }
-RetryOperation.prototype.attempts = function() {
- return this._attempts;
-};
+ this[kParser].destroy()
+ this[kParser] = null
+ }
-RetryOperation.prototype.mainError = function() {
- if (this._errors.length === 0) {
- return null;
- }
+ const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
- var counts = {};
- var mainError = null;
- var mainErrorCount = 0;
+ client[kSocket] = null
+ client[kHTTPContext] = null // TODO (fix): This is hacky...
- for (var i = 0; i < this._errors.length; i++) {
- var error = this._errors[i];
- var message = error.message;
- var count = (counts[message] || 0) + 1;
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
- counts[message] = count;
+ // Fail entire queue.
+ const requests = client[kQueue].splice(client[kRunningIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
+ }
+ } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
+ // Fail head of pipeline.
+ const request = client[kQueue][client[kRunningIdx]]
+ client[kQueue][client[kRunningIdx]++] = null
- if (count >= mainErrorCount) {
- mainError = error;
- mainErrorCount = count;
+ util.errorRequest(client, request, err)
}
- }
- return mainError;
-};
+ client[kPendingIdx] = client[kRunningIdx]
+ assert(client[kRunning] === 0)
-/***/ }),
+ client.emit('disconnect', client[kUrl], [client], err)
-/***/ 9318:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ client[kResume]()
+ })
+
+ let closed = false
+ socket.on('close', () => {
+ closed = true
+ })
+
+ return {
+ version: 'h1',
+ defaultPipelining: 1,
+ write (...args) {
+ return writeH1(client, ...args)
+ },
+ resume () {
+ resumeH1(client)
+ },
+ destroy (err, callback) {
+ if (closed) {
+ queueMicrotask(callback)
+ } else {
+ socket.destroy(err).on('close', callback)
+ }
+ },
+ get destroyed () {
+ return socket.destroyed
+ },
+ busy (request) {
+ if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {
+ return true
+ }
-"use strict";
+ if (request) {
+ if (client[kRunning] > 0 && !request.idempotent) {
+ // Non-idempotent request cannot be retried.
+ // Ensure that no other requests are inflight and
+ // could cause failure.
+ return true
+ }
-const os = __nccwpck_require__(2037);
-const hasFlag = __nccwpck_require__(1621);
+ if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
+ // Don't dispatch an upgrade until all preceding requests have completed.
+ // A misbehaving server might upgrade the connection before all pipelined
+ // request has completed.
+ return true
+ }
-const env = process.env;
+ if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
+ (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {
+ // Request with stream or iterator body can error while other requests
+ // are inflight and indirectly error those as well.
+ // Ensure this doesn't happen by waiting for inflight
+ // to complete before dispatching.
-let forceColor;
-if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false')) {
- forceColor = false;
-} else if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
- forceColor = true;
+ // Request with stream or iterator body cannot be retried.
+ // Ensure that no other requests are inflight and
+ // could cause failure.
+ return true
+ }
+ }
+
+ return false
+ }
+ }
}
-if ('FORCE_COLOR' in env) {
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+
+function clearIdleSocketValidation (socket) {
+ if (socket[kIdleSocketValidationTimeout]) {
+ clearTimeout(socket[kIdleSocketValidationTimeout])
+ socket[kIdleSocketValidationTimeout] = null
+ }
+
+ socket[kIdleSocketValidation] = 0
}
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
+function scheduleIdleSocketValidation (client, socket) {
+ socket[kIdleSocketValidation] = 1
+ socket[kIdleSocketValidationTimeout] = setTimeout(() => {
+ socket[kIdleSocketValidationTimeout] = null
+ socket[kIdleSocketValidation] = 2
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
+ if (client[kSocket] === socket && !socket.destroyed) {
+ client[kResume]()
+ }
+ }, 0)
+ socket[kIdleSocketValidationTimeout].unref?.()
}
-function supportsColor(stream) {
- if (forceColor === false) {
- return 0;
- }
+/**
+ * @param {import('./client.js')} client
+ */
+function resumeH1 (client) {
+ const socket = client[kSocket]
- if (hasFlag('color=16m') ||
- hasFlag('color=full') ||
- hasFlag('color=truecolor')) {
- return 3;
- }
+ if (socket && !socket.destroyed) {
+ if (client[kSize] === 0) {
+ if (!socket[kNoRef] && socket.unref) {
+ socket.unref()
+ socket[kNoRef] = true
+ }
+ } else if (socket[kNoRef] && socket.ref) {
+ socket.ref()
+ socket[kNoRef] = false
+ }
- if (hasFlag('color=256')) {
- return 2;
- }
+ if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {
+ if (socket[kIdleSocketValidation] === 0) {
+ scheduleIdleSocketValidation(client, socket)
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ return
+ }
- if (stream && !stream.isTTY && forceColor !== true) {
- return 0;
- }
+ if (socket[kIdleSocketValidation] === 1) {
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ return
+ }
+ }
- const min = forceColor ? 1 : 0;
+ if (client[kRunning] === 0) {
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ }
- if (process.platform === 'win32') {
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
- // libuv that enables 256 color output on Windows. Anything earlier and it
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
- // release that supports 256 colors. Windows 10 build 14931 is the first release
- // that supports 16m/TrueColor.
- const osRelease = os.release().split('.');
- if (
- Number(process.versions.node.split('.')[0]) >= 8 &&
- Number(osRelease[0]) >= 10 &&
- Number(osRelease[2]) >= 10586
- ) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
+ if (client[kSize] === 0) {
+ if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
+ socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)
+ }
+ } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
+ if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
+ const request = client[kQueue][client[kRunningIdx]]
+ const headersTimeout = request.headersTimeout != null
+ ? request.headersTimeout
+ : client[kHeadersTimeout]
+ socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
+ }
+ }
+ }
+}
- return 1;
- }
+// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
+function shouldSendContentLength (method) {
+ return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
+}
- if ('CI' in env) {
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
- return 1;
- }
+function writeH1 (client, request) {
+ const { method, path, host, upgrade, blocking, reset } = request
- return min;
- }
+ let { body, headers, contentLength } = request
- if ('TEAMCITY_VERSION' in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
+ // https://tools.ietf.org/html/rfc7231#section-4.3.1
+ // https://tools.ietf.org/html/rfc7231#section-4.3.2
+ // https://tools.ietf.org/html/rfc7231#section-4.3.5
- if (env.COLORTERM === 'truecolor') {
- return 3;
- }
+ // Sending a payload body on a request that does not
+ // expect it can cause undefined behavior on some
+ // servers and corrupt connection state. Do not
+ // re-use the connection for further requests.
- if ('TERM_PROGRAM' in env) {
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+ const expectsPayload = (
+ method === 'PUT' ||
+ method === 'POST' ||
+ method === 'PATCH' ||
+ method === 'QUERY' ||
+ method === 'PROPFIND' ||
+ method === 'PROPPATCH'
+ )
- switch (env.TERM_PROGRAM) {
- case 'iTerm.app':
- return version >= 3 ? 3 : 2;
- case 'Apple_Terminal':
- return 2;
- // No default
- }
- }
+ if (util.isFormDataLike(body)) {
+ if (!extractBody) {
+ extractBody = (__nccwpck_require__(4492).extractBody)
+ }
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
+ const [bodyStream, contentType] = extractBody(body)
+ if (request.contentType == null) {
+ headers.push('content-type', contentType)
+ }
+ body = bodyStream.stream
+ contentLength = bodyStream.length
+ } else if (util.isBlobLike(body) && request.contentType == null && body.type) {
+ headers.push('content-type', body.type)
+ }
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
+ if (body && typeof body.read === 'function') {
+ // Try to read EOF in order to get length.
+ body.read(0)
+ }
- if ('COLORTERM' in env) {
- return 1;
- }
+ const bodyLength = util.bodyLength(body)
- if (env.TERM === 'dumb') {
- return min;
- }
+ contentLength = bodyLength ?? contentLength
- return min;
-}
+ if (contentLength === null) {
+ contentLength = request.contentLength
+ }
-function getSupportLevel(stream) {
- const level = supportsColor(stream);
- return translateLevel(level);
-}
+ if (contentLength === 0 && !expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD NOT send a Content-Length header field when
+ // the request message does not contain a payload body and the method
+ // semantics do not anticipate such a body.
-module.exports = {
- supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr)
-};
+ contentLength = null
+ }
+ // https://github.com/nodejs/undici/issues/2046
+ // A user agent may send a Content-Length header with 0 value, this should be allowed.
+ if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
+ if (client[kStrictContentLength]) {
+ util.errorRequest(client, request, new RequestContentLengthMismatchError())
+ return false
+ }
-/***/ }),
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
-/***/ 4294:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const socket = client[kSocket]
+ clearIdleSocketValidation(socket)
-module.exports = __nccwpck_require__(4219);
+ const abort = (err) => {
+ if (request.aborted || request.completed) {
+ return
+ }
+ util.errorRequest(client, request, err || new RequestAbortedError())
-/***/ }),
+ util.destroy(body)
+ util.destroy(socket, new InformationalError('aborted'))
+ }
-/***/ 4219:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ try {
+ request.onConnect(abort)
+ } catch (err) {
+ util.errorRequest(client, request, err)
+ }
-"use strict";
+ if (request.aborted) {
+ return false
+ }
+ if (method === 'HEAD') {
+ // https://github.com/mcollina/undici/issues/258
+ // Close after a HEAD request to interop with misbehaving servers
+ // that may send a body in the response.
-var net = __nccwpck_require__(1808);
-var tls = __nccwpck_require__(4404);
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var events = __nccwpck_require__(2361);
-var assert = __nccwpck_require__(9491);
-var util = __nccwpck_require__(3837);
+ socket[kReset] = true
+ }
+ if (upgrade || method === 'CONNECT') {
+ // On CONNECT or upgrade, block pipeline from dispatching further
+ // requests on this connection.
-exports.httpOverHttp = httpOverHttp;
-exports.httpsOverHttp = httpsOverHttp;
-exports.httpOverHttps = httpOverHttps;
-exports.httpsOverHttps = httpsOverHttps;
+ socket[kReset] = true
+ }
+ if (reset != null) {
+ socket[kReset] = reset
+ }
-function httpOverHttp(options) {
- var agent = new TunnelingAgent(options);
- agent.request = http.request;
- return agent;
-}
+ if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
+ socket[kReset] = true
+ }
-function httpsOverHttp(options) {
- var agent = new TunnelingAgent(options);
- agent.request = http.request;
- agent.createSocket = createSecureSocket;
- agent.defaultPort = 443;
- return agent;
-}
+ if (blocking) {
+ socket[kBlocking] = true
+ }
-function httpOverHttps(options) {
- var agent = new TunnelingAgent(options);
- agent.request = https.request;
- return agent;
-}
+ let header = `${method} ${path} HTTP/1.1\r\n`
-function httpsOverHttps(options) {
- var agent = new TunnelingAgent(options);
- agent.request = https.request;
- agent.createSocket = createSecureSocket;
- agent.defaultPort = 443;
- return agent;
-}
+ if (typeof host === 'string') {
+ header += `host: ${host}\r\n`
+ } else {
+ header += client[kHostHeader]
+ }
+ if (upgrade) {
+ header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
+ } else if (client[kPipelining] && !socket[kReset]) {
+ header += 'connection: keep-alive\r\n'
+ } else {
+ header += 'connection: close\r\n'
+ }
-function TunnelingAgent(options) {
- var self = this;
- self.options = options || {};
- self.proxyOptions = self.options.proxy || {};
- self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
- self.requests = [];
- self.sockets = [];
+ if (Array.isArray(headers)) {
+ for (let n = 0; n < headers.length; n += 2) {
+ const key = headers[n + 0]
+ const val = headers[n + 1]
- self.on('free', function onFree(socket, host, port, localAddress) {
- var options = toOptions(host, port, localAddress);
- for (var i = 0, len = self.requests.length; i < len; ++i) {
- var pending = self.requests[i];
- if (pending.host === options.host && pending.port === options.port) {
- // Detect the request to connect same origin server,
- // reuse the connection.
- self.requests.splice(i, 1);
- pending.request.onSocket(socket);
- return;
+ if (Array.isArray(val)) {
+ for (let i = 0; i < val.length; i++) {
+ header += `${key}: ${val[i]}\r\n`
+ }
+ } else {
+ header += `${key}: ${val}\r\n`
}
}
- socket.destroy();
- self.removeSocket(socket);
- });
-}
-util.inherits(TunnelingAgent, events.EventEmitter);
+ }
-TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
- var self = this;
- var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
+ if (channels.sendHeaders.hasSubscribers) {
+ channels.sendHeaders.publish({ request, headers: header, socket })
+ }
- if (self.sockets.length >= this.maxSockets) {
- // We are over limit so we'll add it to the queue.
- self.requests.push(options);
- return;
+ /* istanbul ignore else: assertion */
+ if (!body || bodyLength === 0) {
+ writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isBuffer(body)) {
+ writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isBlobLike(body)) {
+ if (typeof body.stream === 'function') {
+ writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)
+ } else {
+ writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ }
+ } else if (util.isStream(body)) {
+ writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isIterable(body)) {
+ writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else {
+ assert(false)
}
- // If we are under maxSockets create a new one.
- self.createSocket(options, function(socket) {
- socket.on('free', onFree);
- socket.on('close', onCloseOrRemove);
- socket.on('agentRemove', onCloseOrRemove);
- req.onSocket(socket);
+ return true
+}
- function onFree() {
- self.emit('free', socket, options);
- }
+function writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
- function onCloseOrRemove(err) {
- self.removeSocket(socket);
- socket.removeListener('free', onFree);
- socket.removeListener('close', onCloseOrRemove);
- socket.removeListener('agentRemove', onCloseOrRemove);
+ let finished = false
+
+ const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
+
+ const onData = function (chunk) {
+ if (finished) {
+ return
}
- });
-};
-TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
- var self = this;
- var placeholder = {};
- self.sockets.push(placeholder);
+ try {
+ if (!writer.write(chunk) && this.pause) {
+ this.pause()
+ }
+ } catch (err) {
+ util.destroy(this, err)
+ }
+ }
+ const onDrain = function () {
+ if (finished) {
+ return
+ }
- var connectOptions = mergeOptions({}, self.proxyOptions, {
- method: 'CONNECT',
- path: options.host + ':' + options.port,
- agent: false,
- headers: {
- host: options.host + ':' + options.port
+ if (body.resume) {
+ body.resume()
}
- });
- if (options.localAddress) {
- connectOptions.localAddress = options.localAddress;
}
- if (connectOptions.proxyAuth) {
- connectOptions.headers = connectOptions.headers || {};
- connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
- new Buffer(connectOptions.proxyAuth).toString('base64');
+ const onClose = function () {
+ // 'close' might be emitted *before* 'error' for
+ // broken streams. Wait a tick to avoid this case.
+ queueMicrotask(() => {
+ // It's only safe to remove 'error' listener after
+ // 'close'.
+ body.removeListener('error', onFinished)
+ })
+
+ if (!finished) {
+ const err = new RequestAbortedError()
+ queueMicrotask(() => onFinished(err))
+ }
}
+ const onFinished = function (err) {
+ if (finished) {
+ return
+ }
- debug('making CONNECT request');
- var connectReq = self.request(connectOptions);
- connectReq.useChunkedEncodingByDefault = false; // for v0.6
- connectReq.once('response', onResponse); // for v0.6
- connectReq.once('upgrade', onUpgrade); // for v0.6
- connectReq.once('connect', onConnect); // for v0.7 or later
- connectReq.once('error', onError);
- connectReq.end();
+ finished = true
- function onResponse(res) {
- // Very hacky. This is necessary to avoid http-parser leaks.
- res.upgrade = true;
- }
+ assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
- function onUpgrade(res, socket, head) {
- // Hacky.
- process.nextTick(function() {
- onConnect(res, socket, head);
- });
- }
+ socket
+ .off('drain', onDrain)
+ .off('error', onFinished)
- function onConnect(res, socket, head) {
- connectReq.removeAllListeners();
- socket.removeAllListeners();
+ body
+ .removeListener('data', onData)
+ .removeListener('end', onFinished)
+ .removeListener('close', onClose)
- if (res.statusCode !== 200) {
- debug('tunneling socket could not be established, statusCode=%d',
- res.statusCode);
- socket.destroy();
- var error = new Error('tunneling socket could not be established, ' +
- 'statusCode=' + res.statusCode);
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
- return;
+ if (!err) {
+ try {
+ writer.end()
+ } catch (er) {
+ err = er
+ }
}
- if (head.length > 0) {
- debug('got illegal response body from proxy');
- socket.destroy();
- var error = new Error('got illegal response body from proxy');
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
- return;
+
+ writer.destroy(err)
+
+ if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
+ util.destroy(body, err)
+ } else {
+ util.destroy(body)
}
- debug('tunneling connection has established');
- self.sockets[self.sockets.indexOf(placeholder)] = socket;
- return cb(socket);
}
- function onError(cause) {
- connectReq.removeAllListeners();
+ body
+ .on('data', onData)
+ .on('end', onFinished)
+ .on('error', onFinished)
+ .on('close', onClose)
- debug('tunneling socket could not be established, cause=%s\n',
- cause.message, cause.stack);
- var error = new Error('tunneling socket could not be established, ' +
- 'cause=' + cause.message);
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
+ if (body.resume) {
+ body.resume()
}
-};
-TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
- var pos = this.sockets.indexOf(socket)
- if (pos === -1) {
- return;
+ socket
+ .on('drain', onDrain)
+ .on('error', onFinished)
+
+ if (body.errorEmitted ?? body.errored) {
+ setImmediate(() => onFinished(body.errored))
+ } else if (body.endEmitted ?? body.readableEnded) {
+ setImmediate(() => onFinished(null))
}
- this.sockets.splice(pos, 1);
- var pending = this.requests.shift();
- if (pending) {
- // If we have pending requests and a socket gets closed a new one
- // needs to be created to take over in the pool for the one that closed.
- this.createSocket(pending, function(socket) {
- pending.request.onSocket(socket);
- });
+ if (body.closeEmitted ?? body.closed) {
+ setImmediate(onClose)
}
-};
+}
-function createSecureSocket(options, cb) {
- var self = this;
- TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
- var hostHeader = options.request.getHeader('host');
- var tlsOptions = mergeOptions({}, self.options, {
- socket: socket,
- servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
- });
+function writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ try {
+ if (!body) {
+ if (contentLength === 0) {
+ socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
+ } else {
+ assert(contentLength === null, 'no body must not have content length')
+ socket.write(`${header}\r\n`, 'latin1')
+ }
+ } else if (util.isBuffer(body)) {
+ assert(contentLength === body.byteLength, 'buffer body must have content length')
- // 0 is dummy port for v0.6
- var secureSocket = tls.connect(0, tlsOptions);
- self.sockets[self.sockets.indexOf(socket)] = secureSocket;
- cb(secureSocket);
- });
-}
+ socket.cork()
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ socket.write(body)
+ socket.uncork()
+ request.onBodySent(body)
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
+ }
+ }
+ request.onRequestSent()
-function toOptions(host, port, localAddress) {
- if (typeof host === 'string') { // since v0.10
- return {
- host: host,
- port: port,
- localAddress: localAddress
- };
+ client[kResume]()
+ } catch (err) {
+ abort(err)
}
- return host; // for v0.11 or later
}
-function mergeOptions(target) {
- for (var i = 1, len = arguments.length; i < len; ++i) {
- var overrides = arguments[i];
- if (typeof overrides === 'object') {
- var keys = Object.keys(overrides);
- for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
- var k = keys[j];
- if (overrides[k] !== undefined) {
- target[k] = overrides[k];
- }
- }
+async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength === body.size, 'blob body must have content length')
+
+ try {
+ if (contentLength != null && contentLength !== body.size) {
+ throw new RequestContentLengthMismatchError()
+ }
+
+ const buffer = Buffer.from(await body.arrayBuffer())
+
+ socket.cork()
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ socket.write(buffer)
+ socket.uncork()
+
+ request.onBodySent(buffer)
+ request.onRequestSent()
+
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
}
+
+ client[kResume]()
+ } catch (err) {
+ abort(err)
}
- return target;
}
+async function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
-var debug;
-if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
- debug = function() {
- var args = Array.prototype.slice.call(arguments);
- if (typeof args[0] === 'string') {
- args[0] = 'TUNNEL: ' + args[0];
- } else {
- args.unshift('TUNNEL:');
+ let callback = null
+ function onDrain () {
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb()
}
- console.error.apply(console, args);
}
-} else {
- debug = function() {};
-}
-exports.debug = debug; // for test
+ const waitForDrain = () => new Promise((resolve, reject) => {
+ assert(callback === null)
-/***/ }),
+ if (socket[kError]) {
+ reject(socket[kError])
+ } else {
+ callback = resolve
+ }
+ })
-/***/ 1773:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ socket
+ .on('close', onDrain)
+ .on('drain', onDrain)
-"use strict";
+ const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
+ try {
+ // It's up to the user to somehow abort the async iterable.
+ for await (const chunk of body) {
+ if (socket[kError]) {
+ throw socket[kError]
+ }
+ if (!writer.write(chunk)) {
+ await waitForDrain()
+ }
+ }
-const Client = __nccwpck_require__(3598)
-const Dispatcher = __nccwpck_require__(412)
-const errors = __nccwpck_require__(8045)
-const Pool = __nccwpck_require__(4634)
-const BalancedPool = __nccwpck_require__(7931)
-const Agent = __nccwpck_require__(7890)
-const util = __nccwpck_require__(3983)
-const { InvalidArgumentError } = errors
-const api = __nccwpck_require__(4059)
-const buildConnector = __nccwpck_require__(2067)
-const MockClient = __nccwpck_require__(8687)
-const MockAgent = __nccwpck_require__(6771)
-const MockPool = __nccwpck_require__(6193)
-const mockErrors = __nccwpck_require__(888)
-const ProxyAgent = __nccwpck_require__(7858)
-const RetryHandler = __nccwpck_require__(2286)
-const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
-const DecoratorHandler = __nccwpck_require__(6930)
-const RedirectHandler = __nccwpck_require__(2860)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-
-let hasCrypto
-try {
- __nccwpck_require__(6113)
- hasCrypto = true
-} catch {
- hasCrypto = false
+ writer.end()
+ } catch (err) {
+ writer.destroy(err)
+ } finally {
+ socket
+ .off('close', onDrain)
+ .off('drain', onDrain)
+ }
}
-Object.assign(Dispatcher.prototype, api)
-
-module.exports.Dispatcher = Dispatcher
-module.exports.Client = Client
-module.exports.Pool = Pool
-module.exports.BalancedPool = BalancedPool
-module.exports.Agent = Agent
-module.exports.ProxyAgent = ProxyAgent
-module.exports.RetryHandler = RetryHandler
+class AsyncWriter {
+ constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {
+ this.socket = socket
+ this.request = request
+ this.contentLength = contentLength
+ this.client = client
+ this.bytesWritten = 0
+ this.expectsPayload = expectsPayload
+ this.header = header
+ this.abort = abort
-module.exports.DecoratorHandler = DecoratorHandler
-module.exports.RedirectHandler = RedirectHandler
-module.exports.createRedirectInterceptor = createRedirectInterceptor
+ socket[kWriting] = true
+ }
-module.exports.buildConnector = buildConnector
-module.exports.errors = errors
+ write (chunk) {
+ const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
-function makeDispatcher (fn) {
- return (url, opts, handler) => {
- if (typeof opts === 'function') {
- handler = opts
- opts = null
+ if (socket[kError]) {
+ throw socket[kError]
}
- if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
- throw new InvalidArgumentError('invalid url')
+ if (socket.destroyed) {
+ return false
}
- if (opts != null && typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+ const len = Buffer.byteLength(chunk)
+ if (!len) {
+ return true
}
- if (opts && opts.path != null) {
- if (typeof opts.path !== 'string') {
- throw new InvalidArgumentError('invalid opts.path')
+ // We should defer writing chunks.
+ if (contentLength !== null && bytesWritten + len > contentLength) {
+ if (client[kStrictContentLength]) {
+ throw new RequestContentLengthMismatchError()
}
- let path = opts.path
- if (!opts.path.startsWith('/')) {
- path = `/${path}`
- }
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
- url = new URL(util.parseOrigin(url).origin + path)
- } else {
- if (!opts) {
- opts = typeof url === 'object' ? url : {}
+ socket.cork()
+
+ if (bytesWritten === 0) {
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
}
- url = util.parseURL(url)
+ if (contentLength === null) {
+ socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
+ } else {
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ }
}
- const { agent, dispatcher = getGlobalDispatcher() } = opts
-
- if (agent) {
- throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
+ if (contentLength === null) {
+ socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
}
- return fn.call(dispatcher, {
- ...opts,
- origin: url.origin,
- path: url.search ? `${url.pathname}${url.search}` : url.pathname,
- method: opts.method || (opts.body ? 'PUT' : 'GET')
- }, handler)
- }
-}
+ this.bytesWritten += len
-module.exports.setGlobalDispatcher = setGlobalDispatcher
-module.exports.getGlobalDispatcher = getGlobalDispatcher
+ const ret = socket.write(chunk)
-if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
- let fetchImpl = null
- module.exports.fetch = async function fetch (resource) {
- if (!fetchImpl) {
- fetchImpl = (__nccwpck_require__(4881).fetch)
- }
+ socket.uncork()
- try {
- return await fetchImpl(...arguments)
- } catch (err) {
- if (typeof err === 'object') {
- Error.captureStackTrace(err, this)
- }
+ request.onBodySent(chunk)
- throw err
+ if (!ret) {
+ if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
+ // istanbul ignore else: only for jest
+ if (socket[kParser].timeout.refresh) {
+ socket[kParser].timeout.refresh()
+ }
+ }
}
+
+ return ret
}
- module.exports.Headers = __nccwpck_require__(554).Headers
- module.exports.Response = __nccwpck_require__(7823).Response
- module.exports.Request = __nccwpck_require__(8359).Request
- module.exports.FormData = __nccwpck_require__(2015).FormData
- module.exports.File = __nccwpck_require__(8511).File
- module.exports.FileReader = __nccwpck_require__(1446).FileReader
- const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
+ end () {
+ const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
+ request.onRequestSent()
- module.exports.setGlobalOrigin = setGlobalOrigin
- module.exports.getGlobalOrigin = getGlobalOrigin
+ socket[kWriting] = false
- const { CacheStorage } = __nccwpck_require__(7907)
- const { kConstruct } = __nccwpck_require__(9174)
+ if (socket[kError]) {
+ throw socket[kError]
+ }
- // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
- // in an older version of Node, it doesn't have any use without fetch.
- module.exports.caches = new CacheStorage(kConstruct)
-}
+ if (socket.destroyed) {
+ return
+ }
-if (util.nodeMajor >= 16) {
- const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
+ if (bytesWritten === 0) {
+ if (expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD send a Content-Length in a request message when
+ // no Transfer-Encoding is sent and the request method defines a meaning
+ // for an enclosed payload body.
- module.exports.deleteCookie = deleteCookie
- module.exports.getCookies = getCookies
- module.exports.getSetCookies = getSetCookies
- module.exports.setCookie = setCookie
+ socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
+ } else {
+ socket.write(`${header}\r\n`, 'latin1')
+ }
+ } else if (contentLength === null) {
+ socket.write('\r\n0\r\n\r\n', 'latin1')
+ }
- const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
+ if (contentLength !== null && bytesWritten !== contentLength) {
+ if (client[kStrictContentLength]) {
+ throw new RequestContentLengthMismatchError()
+ } else {
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
+ }
- module.exports.parseMIMEType = parseMIMEType
- module.exports.serializeAMimeType = serializeAMimeType
-}
+ if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
+ // istanbul ignore else: only for jest
+ if (socket[kParser].timeout.refresh) {
+ socket[kParser].timeout.refresh()
+ }
+ }
-if (util.nodeMajor >= 18 && hasCrypto) {
- const { WebSocket } = __nccwpck_require__(4284)
+ client[kResume]()
+ }
- module.exports.WebSocket = WebSocket
-}
+ destroy (err) {
+ const { socket, client, abort } = this
-module.exports.request = makeDispatcher(api.request)
-module.exports.stream = makeDispatcher(api.stream)
-module.exports.pipeline = makeDispatcher(api.pipeline)
-module.exports.connect = makeDispatcher(api.connect)
-module.exports.upgrade = makeDispatcher(api.upgrade)
+ socket[kWriting] = false
-module.exports.MockClient = MockClient
-module.exports.MockPool = MockPool
-module.exports.MockAgent = MockAgent
-module.exports.mockErrors = mockErrors
+ if (err) {
+ assert(client[kRunning] <= 1, 'pipeline should only contain this request')
+ abort(err)
+ }
+ }
+}
+
+module.exports = connectH1
/***/ }),
-/***/ 7890:
+/***/ 8788:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
-const DispatcherBase = __nccwpck_require__(4839)
-const Pool = __nccwpck_require__(4634)
-const Client = __nccwpck_require__(3598)
-const util = __nccwpck_require__(3983)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
+const assert = __nccwpck_require__(4589)
+const { pipeline } = __nccwpck_require__(7075)
+const util = __nccwpck_require__(3440)
+const {
+ RequestContentLengthMismatchError,
+ RequestAbortedError,
+ SocketError,
+ InformationalError
+} = __nccwpck_require__(8707)
+const {
+ kUrl,
+ kReset,
+ kClient,
+ kRunning,
+ kPending,
+ kQueue,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kSocket,
+ kStrictContentLength,
+ kOnError,
+ kMaxConcurrentStreams,
+ kHTTP2Session,
+ kResume,
+ kSize,
+ kHTTPContext
+} = __nccwpck_require__(6443)
-const kOnConnect = Symbol('onConnect')
-const kOnDisconnect = Symbol('onDisconnect')
-const kOnConnectionError = Symbol('onConnectionError')
-const kMaxRedirections = Symbol('maxRedirections')
-const kOnDrain = Symbol('onDrain')
-const kFactory = Symbol('factory')
-const kFinalizer = Symbol('finalizer')
-const kOptions = Symbol('options')
+const kOpenStreams = Symbol('open streams')
-function defaultFactory (origin, opts) {
- return opts && opts.connections === 1
- ? new Client(origin, opts)
- : new Pool(origin, opts)
-}
+let extractBody
-class Agent extends DispatcherBase {
- constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
- super()
+// Experimental
+let h2ExperimentalWarned = false
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
- }
+/** @type {import('http2')} */
+let http2
+try {
+ http2 = __nccwpck_require__(2467)
+} catch {
+ // @ts-ignore
+ http2 = { constants: {} }
+}
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
- }
+const {
+ constants: {
+ HTTP2_HEADER_AUTHORITY,
+ HTTP2_HEADER_METHOD,
+ HTTP2_HEADER_PATH,
+ HTTP2_HEADER_SCHEME,
+ HTTP2_HEADER_CONTENT_LENGTH,
+ HTTP2_HEADER_EXPECT,
+ HTTP2_HEADER_STATUS
+ }
+} = http2
- if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
- }
+function parseH2Headers (headers) {
+ const result = []
- if (connect && typeof connect !== 'function') {
- connect = { ...connect }
+ for (const [name, value] of Object.entries(headers)) {
+ // h2 may concat the header value by array
+ // e.g. Set-Cookie
+ if (Array.isArray(value)) {
+ for (const subvalue of value) {
+ // we need to provide each header value of header name
+ // because the headers handler expect name-value pair
+ result.push(Buffer.from(name), Buffer.from(subvalue))
+ }
+ } else {
+ result.push(Buffer.from(name), Buffer.from(value))
}
+ }
- this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
- ? options.interceptors.Agent
- : [createRedirectInterceptor({ maxRedirections })]
+ return result
+}
- this[kOptions] = { ...util.deepClone(options), connect }
- this[kOptions].interceptors = options.interceptors
- ? { ...options.interceptors }
- : undefined
- this[kMaxRedirections] = maxRedirections
- this[kFactory] = factory
- this[kClients] = new Map()
- this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
- const ref = this[kClients].get(key)
- if (ref !== undefined && ref.deref() === undefined) {
- this[kClients].delete(key)
- }
+async function connectH2 (client, socket) {
+ client[kSocket] = socket
+
+ if (!h2ExperimentalWarned) {
+ h2ExperimentalWarned = true
+ process.emitWarning('H2 support is experimental, expect them to change at any time.', {
+ code: 'UNDICI-H2'
})
+ }
- const agent = this
+ const session = http2.connect(client[kUrl], {
+ createConnection: () => socket,
+ peerMaxConcurrentStreams: client[kMaxConcurrentStreams]
+ })
- this[kOnDrain] = (origin, targets) => {
- agent.emit('drain', origin, [agent, ...targets])
- }
+ session[kOpenStreams] = 0
+ session[kClient] = client
+ session[kSocket] = socket
- this[kOnConnect] = (origin, targets) => {
- agent.emit('connect', origin, [agent, ...targets])
- }
+ util.addListener(session, 'error', onHttp2SessionError)
+ util.addListener(session, 'frameError', onHttp2FrameError)
+ util.addListener(session, 'end', onHttp2SessionEnd)
+ util.addListener(session, 'goaway', onHTTP2GoAway)
+ util.addListener(session, 'close', function () {
+ const { [kClient]: client } = this
+ const { [kSocket]: socket } = client
- this[kOnDisconnect] = (origin, targets, err) => {
- agent.emit('disconnect', origin, [agent, ...targets], err)
- }
+ const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))
- this[kOnConnectionError] = (origin, targets, err) => {
- agent.emit('connectionError', origin, [agent, ...targets], err)
- }
- }
+ client[kHTTP2Session] = null
- get [kRunning] () {
- let ret = 0
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore next: gc is undeterministic */
- if (client) {
- ret += client[kRunning]
- }
- }
- return ret
- }
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
- [kDispatch] (opts, handler) {
- let key
- if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
- key = String(opts.origin)
- } else {
- throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
+ // Fail entire queue.
+ const requests = client[kQueue].splice(client[kRunningIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
+ }
}
+ })
- const ref = this[kClients].get(key)
+ session.unref()
- let dispatcher = ref ? ref.deref() : null
- if (!dispatcher) {
- dispatcher = this[kFactory](opts.origin, this[kOptions])
- .on('drain', this[kOnDrain])
- .on('connect', this[kOnConnect])
- .on('disconnect', this[kOnDisconnect])
- .on('connectionError', this[kOnConnectionError])
+ client[kHTTP2Session] = session
+ socket[kHTTP2Session] = session
- this[kClients].set(key, new WeakRef(dispatcher))
- this[kFinalizer].register(dispatcher, key)
- }
+ util.addListener(socket, 'error', function (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- return dispatcher.dispatch(opts, handler)
- }
+ this[kError] = err
- async [kClose] () {
- const closePromises = []
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore else: gc is undeterministic */
- if (client) {
- closePromises.push(client.close())
- }
- }
+ this[kClient][kOnError](err)
+ })
- await Promise.all(closePromises)
- }
+ util.addListener(socket, 'end', function () {
+ util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
+ })
- async [kDestroy] (err) {
- const destroyPromises = []
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore else: gc is undeterministic */
- if (client) {
- destroyPromises.push(client.destroy(err))
- }
- }
+ util.addListener(socket, 'close', function () {
+ const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
- await Promise.all(destroyPromises)
- }
-}
+ client[kSocket] = null
-module.exports = Agent
+ if (this[kHTTP2Session] != null) {
+ this[kHTTP2Session].destroy(err)
+ }
+ client[kPendingIdx] = client[kRunningIdx]
-/***/ }),
+ assert(client[kRunning] === 0)
-/***/ 7032:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ client.emit('disconnect', client[kUrl], [client], err)
-const { addAbortListener } = __nccwpck_require__(3983)
-const { RequestAbortedError } = __nccwpck_require__(8045)
+ client[kResume]()
+ })
-const kListener = Symbol('kListener')
-const kSignal = Symbol('kSignal')
+ let closed = false
+ socket.on('close', () => {
+ closed = true
+ })
-function abort (self) {
- if (self.abort) {
- self.abort()
- } else {
- self.onError(new RequestAbortedError())
+ return {
+ version: 'h2',
+ defaultPipelining: Infinity,
+ write (...args) {
+ return writeH2(client, ...args)
+ },
+ resume () {
+ resumeH2(client)
+ },
+ destroy (err, callback) {
+ if (closed) {
+ queueMicrotask(callback)
+ } else {
+ // Destroying the socket will trigger the session close
+ socket.destroy(err).on('close', callback)
+ }
+ },
+ get destroyed () {
+ return socket.destroyed
+ },
+ busy () {
+ return false
+ }
}
}
-function addSignal (self, signal) {
- self[kSignal] = null
- self[kListener] = null
-
- if (!signal) {
- return
- }
+function resumeH2 (client) {
+ const socket = client[kSocket]
- if (signal.aborted) {
- abort(self)
- return
+ if (socket?.destroyed === false) {
+ if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {
+ socket.unref()
+ client[kHTTP2Session].unref()
+ } else {
+ socket.ref()
+ client[kHTTP2Session].ref()
+ }
}
+}
- self[kSignal] = signal
- self[kListener] = () => {
- abort(self)
- }
+function onHttp2SessionError (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- addAbortListener(self[kSignal], self[kListener])
+ this[kSocket][kError] = err
+ this[kClient][kOnError](err)
}
-function removeSignal (self) {
- if (!self[kSignal]) {
- return
- }
-
- if ('removeEventListener' in self[kSignal]) {
- self[kSignal].removeEventListener('abort', self[kListener])
- } else {
- self[kSignal].removeListener('abort', self[kListener])
+function onHttp2FrameError (type, code, id) {
+ if (id === 0) {
+ const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
+ this[kSocket][kError] = err
+ this[kClient][kOnError](err)
}
-
- self[kSignal] = null
- self[kListener] = null
}
-module.exports = {
- addSignal,
- removeSignal
+function onHttp2SessionEnd () {
+ const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))
+ this.destroy(err)
+ util.destroy(this[kSocket], err)
}
+/**
+ * This is the root cause of #3011
+ * We need to handle GOAWAY frames properly, and trigger the session close
+ * along with the socket right away
+ */
+function onHTTP2GoAway (code) {
+ // We cannot recover, so best to close the session and the socket
+ const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this))
+ const client = this[kClient]
-/***/ }),
+ client[kSocket] = null
+ client[kHTTPContext] = null
-/***/ 9744:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (this[kHTTP2Session] != null) {
+ this[kHTTP2Session].destroy(err)
+ this[kHTTP2Session] = null
+ }
-"use strict";
+ util.destroy(this[kSocket], err)
+ // Fail head of pipeline.
+ if (client[kRunningIdx] < client[kQueue].length) {
+ const request = client[kQueue][client[kRunningIdx]]
+ client[kQueue][client[kRunningIdx]++] = null
+ util.errorRequest(client, request, err)
+ client[kPendingIdx] = client[kRunningIdx]
+ }
-const { AsyncResource } = __nccwpck_require__(852)
-const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
+ assert(client[kRunning] === 0)
-class ConnectHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
+ client.emit('disconnect', client[kUrl], [client], err)
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
+ client[kResume]()
+}
- const { signal, opaque, responseHeaders } = opts
+// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
+function shouldSendContentLength (method) {
+ return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
+}
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+function writeH2 (client, request) {
+ const session = client[kHTTP2Session]
+ const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
+ let { body } = request
- super('UNDICI_CONNECT')
+ if (upgrade) {
+ util.errorRequest(client, request, new Error('Upgrade not supported for H2'))
+ return false
+ }
- this.opaque = opaque || null
- this.responseHeaders = responseHeaders || null
- this.callback = callback
- this.abort = null
+ const headers = {}
+ for (let n = 0; n < reqHeaders.length; n += 2) {
+ const key = reqHeaders[n + 0]
+ const val = reqHeaders[n + 1]
- addSignal(this, signal)
+ if (Array.isArray(val)) {
+ for (let i = 0; i < val.length; i++) {
+ if (headers[key]) {
+ headers[key] += `,${val[i]}`
+ } else {
+ headers[key] = val[i]
+ }
+ }
+ } else {
+ headers[key] = val
+ }
}
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
- }
+ /** @type {import('node:http2').ClientHttp2Stream} */
+ let stream
- this.abort = abort
- this.context = context
- }
+ const { hostname, port } = client[kUrl]
- onHeaders () {
- throw new SocketError('bad connect', null)
- }
+ headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
+ headers[HTTP2_HEADER_METHOD] = method
- onUpgrade (statusCode, rawHeaders, socket) {
- const { callback, opaque, context } = this
+ const abort = (err) => {
+ if (request.aborted || request.completed) {
+ return
+ }
- removeSignal(this)
+ err = err || new RequestAbortedError()
- this.callback = null
+ util.errorRequest(client, request, err)
- let headers = rawHeaders
- // Indicates is an HTTP2Session
- if (headers != null) {
- headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ if (stream != null) {
+ util.destroy(stream, err)
}
- this.runInAsyncScope(callback, null, null, {
- statusCode,
- headers,
- socket,
- opaque,
- context
- })
+ // We do not destroy the socket as we can continue using the session
+ // the stream get's destroyed and the session remains to create new streams
+ util.destroy(body, err)
+ client[kQueue][client[kRunningIdx]++] = null
+ client[kResume]()
}
- onError (err) {
- const { callback, opaque } = this
+ try {
+ // We are already connected, streams are pending.
+ // We can call on connect, and wait for abort
+ request.onConnect(abort)
+ } catch (err) {
+ util.errorRequest(client, request, err)
+ }
- removeSignal(this)
+ if (request.aborted) {
+ return false
+ }
- if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
+ if (method === 'CONNECT') {
+ session.ref()
+ // We are already connected, streams are pending, first request
+ // will create a new stream. We trigger a request to create the stream and wait until
+ // `ready` event is triggered
+ // We disabled endStream to allow the user to write to the stream
+ stream = session.request(headers, { endStream: false, signal })
+
+ if (stream.id && !stream.pending) {
+ request.onUpgrade(null, null, stream)
+ ++session[kOpenStreams]
+ client[kQueue][client[kRunningIdx]++] = null
+ } else {
+ stream.once('ready', () => {
+ request.onUpgrade(null, null, stream)
+ ++session[kOpenStreams]
+ client[kQueue][client[kRunningIdx]++] = null
})
}
- }
-}
-function connect (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- connect.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
+ stream.once('close', () => {
+ session[kOpenStreams] -= 1
+ if (session[kOpenStreams] === 0) session.unref()
})
- }
- try {
- const connectHandler = new ConnectHandler(opts, callback)
- this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
- }
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
+ return true
}
-}
-module.exports = connect
+ // https://tools.ietf.org/html/rfc7540#section-8.3
+ // :path and :scheme headers must be omitted when sending CONNECT
+ headers[HTTP2_HEADER_PATH] = path
+ headers[HTTP2_HEADER_SCHEME] = 'https'
-/***/ }),
+ // https://tools.ietf.org/html/rfc7231#section-4.3.1
+ // https://tools.ietf.org/html/rfc7231#section-4.3.2
+ // https://tools.ietf.org/html/rfc7231#section-4.3.5
-/***/ 8752:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // Sending a payload body on a request that does not
+ // expect it can cause undefined behavior on some
+ // servers and corrupt connection state. Do not
+ // re-use the connection for further requests.
-"use strict";
+ const expectsPayload = (
+ method === 'PUT' ||
+ method === 'POST' ||
+ method === 'PATCH'
+ )
+ if (body && typeof body.read === 'function') {
+ // Try to read EOF in order to get length.
+ body.read(0)
+ }
-const {
- Readable,
- Duplex,
- PassThrough
-} = __nccwpck_require__(2781)
-const {
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
-const assert = __nccwpck_require__(9491)
+ let contentLength = util.bodyLength(body)
-const kResume = Symbol('resume')
+ if (util.isFormDataLike(body)) {
+ extractBody ??= (__nccwpck_require__(4492).extractBody)
-class PipelineRequest extends Readable {
- constructor () {
- super({ autoDestroy: true })
+ const [bodyStream, contentType] = extractBody(body)
+ headers['content-type'] = contentType
- this[kResume] = null
+ body = bodyStream.stream
+ contentLength = bodyStream.length
}
- _read () {
- const { [kResume]: resume } = this
-
- if (resume) {
- this[kResume] = null
- resume()
- }
+ if (contentLength == null) {
+ contentLength = request.contentLength
}
- _destroy (err, callback) {
- this._read()
+ if (contentLength === 0 || !expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD NOT send a Content-Length header field when
+ // the request message does not contain a payload body and the method
+ // semantics do not anticipate such a body.
- callback(err)
+ contentLength = null
}
-}
-class PipelineResponse extends Readable {
- constructor (resume) {
- super({ autoDestroy: true })
- this[kResume] = resume
+ // https://github.com/nodejs/undici/issues/2046
+ // A user agent may send a Content-Length header with 0 value, this should be allowed.
+ if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
+ if (client[kStrictContentLength]) {
+ util.errorRequest(client, request, new RequestContentLengthMismatchError())
+ return false
+ }
+
+ process.emitWarning(new RequestContentLengthMismatchError())
}
- _read () {
- this[kResume]()
+ if (contentLength != null) {
+ assert(body, 'no body must not have content length')
+ headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
}
- _destroy (err, callback) {
- if (!err && !this._readableState.endEmitted) {
- err = new RequestAbortedError()
- }
+ session.ref()
- callback(err)
+ const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null
+ if (expectContinue) {
+ headers[HTTP2_HEADER_EXPECT] = '100-continue'
+ stream = session.request(headers, { endStream: shouldEndStream, signal })
+
+ stream.once('continue', writeBodyH2)
+ } else {
+ stream = session.request(headers, {
+ endStream: shouldEndStream,
+ signal
+ })
+ writeBodyH2()
}
-}
-class PipelineHandler extends AsyncResource {
- constructor (opts, handler) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+ // Increment counter as we have new streams open
+ ++session[kOpenStreams]
+
+ stream.once('response', headers => {
+ const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
+ request.onResponseStarted()
+
+ // Due to the stream nature, it is possible we face a race condition
+ // where the stream has been assigned, but the request has been aborted
+ // the request remains in-flight and headers hasn't been received yet
+ // for those scenarios, best effort is to destroy the stream immediately
+ // as there's no value to keep it open.
+ if (request.aborted) {
+ const err = new RequestAbortedError()
+ util.errorRequest(client, request, err)
+ util.destroy(stream, err)
+ return
}
- if (typeof handler !== 'function') {
- throw new InvalidArgumentError('invalid handler')
+ if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {
+ stream.pause()
}
- const { signal, method, opaque, onInfo, responseHeaders } = opts
+ stream.on('data', (chunk) => {
+ if (request.onData(chunk) === false) {
+ stream.pause()
+ }
+ })
+ })
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ stream.once('end', () => {
+ // When state is null, it means we haven't consumed body and the stream still do not have
+ // a state.
+ // Present specially when using pipeline or stream
+ if (stream.state?.state == null || stream.state.state < 6) {
+ request.onComplete([])
}
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+ if (session[kOpenStreams] === 0) {
+ // Stream is closed or half-closed-remote (6), decrement counter and cleanup
+ // It does not have sense to continue working with the stream as we do not
+ // have yet RST_STREAM support on client-side
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
+ session.unref()
}
- super('UNDICI_PIPELINE')
-
- this.opaque = opaque || null
- this.responseHeaders = responseHeaders || null
- this.handler = handler
- this.abort = null
- this.context = null
- this.onInfo = onInfo || null
+ abort(new InformationalError('HTTP/2: stream half-closed (remote)'))
+ client[kQueue][client[kRunningIdx]++] = null
+ client[kPendingIdx] = client[kRunningIdx]
+ client[kResume]()
+ })
- this.req = new PipelineRequest().on('error', util.nop)
+ stream.once('close', () => {
+ session[kOpenStreams] -= 1
+ if (session[kOpenStreams] === 0) {
+ session.unref()
+ }
+ })
- this.ret = new Duplex({
- readableObjectMode: opts.objectMode,
- autoDestroy: true,
- read: () => {
- const { body } = this
+ stream.once('error', function (err) {
+ abort(err)
+ })
- if (body && body.resume) {
- body.resume()
- }
- },
- write: (chunk, encoding, callback) => {
- const { req } = this
+ stream.once('frameError', (type, code) => {
+ abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`))
+ })
- if (req.push(chunk, encoding) || req._readableState.destroyed) {
- callback()
- } else {
- req[kResume] = callback
- }
- },
- destroy: (err, callback) => {
- const { body, req, res, ret, abort } = this
+ // stream.on('aborted', () => {
+ // // TODO(HTTP/2): Support aborted
+ // })
- if (!err && !ret._readableState.endEmitted) {
- err = new RequestAbortedError()
- }
+ // stream.on('timeout', () => {
+ // // TODO(HTTP/2): Support timeout
+ // })
- if (abort && err) {
- abort()
- }
+ // stream.on('push', headers => {
+ // // TODO(HTTP/2): Support push
+ // })
- util.destroy(body, err)
- util.destroy(req, err)
- util.destroy(res, err)
+ // stream.on('trailers', headers => {
+ // // TODO(HTTP/2): Support trailers
+ // })
- removeSignal(this)
+ return true
- callback(err)
+ function writeBodyH2 () {
+ /* istanbul ignore else: assertion */
+ if (!body || contentLength === 0) {
+ writeBuffer(
+ abort,
+ stream,
+ null,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else if (util.isBuffer(body)) {
+ writeBuffer(
+ abort,
+ stream,
+ body,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else if (util.isBlobLike(body)) {
+ if (typeof body.stream === 'function') {
+ writeIterable(
+ abort,
+ stream,
+ body.stream(),
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else {
+ writeBlob(
+ abort,
+ stream,
+ body,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
}
- }).on('prefinish', () => {
- const { req } = this
-
- // Node < 15 does not call _final in same tick.
- req.push(null)
- })
-
- this.res = null
-
- addSignal(this, signal)
+ } else if (util.isStream(body)) {
+ writeStream(
+ abort,
+ client[kSocket],
+ expectsPayload,
+ stream,
+ body,
+ client,
+ request,
+ contentLength
+ )
+ } else if (util.isIterable(body)) {
+ writeIterable(
+ abort,
+ stream,
+ body,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else {
+ assert(false)
+ }
}
+}
- onConnect (abort, context) {
- const { ret, res } = this
+function writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ try {
+ if (body != null && util.isBuffer(body)) {
+ assert(contentLength === body.byteLength, 'buffer body must have content length')
+ h2stream.cork()
+ h2stream.write(body)
+ h2stream.uncork()
+ h2stream.end()
- assert(!res, 'pipeline cannot be retried')
+ request.onBodySent(body)
+ }
- if (ret.destroyed) {
- throw new RequestAbortedError()
+ if (!expectsPayload) {
+ socket[kReset] = true
}
- this.abort = abort
- this.context = context
+ request.onRequestSent()
+ client[kResume]()
+ } catch (error) {
+ abort(error)
}
+}
- onHeaders (statusCode, rawHeaders, resume) {
- const { opaque, handler, context } = this
+function writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
- if (statusCode < 200) {
- if (this.onInfo) {
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- this.onInfo({ statusCode, headers })
+ // For HTTP/2, is enough to pipe the stream
+ const pipe = pipeline(
+ body,
+ h2stream,
+ (err) => {
+ if (err) {
+ util.destroy(pipe, err)
+ abort(err)
+ } else {
+ util.removeAllListeners(pipe)
+ request.onRequestSent()
+
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
+
+ client[kResume]()
}
- return
}
+ )
- this.res = new PipelineResponse(resume)
+ util.addListener(pipe, 'data', onPipeData)
- let body
- try {
- this.handler = null
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- body = this.runInAsyncScope(handler, null, {
- statusCode,
- headers,
- opaque,
- body: this.res,
- context
- })
- } catch (err) {
- this.res.on('error', util.nop)
- throw err
- }
+ function onPipeData (chunk) {
+ request.onBodySent(chunk)
+ }
+}
- if (!body || typeof body.on !== 'function') {
- throw new InvalidReturnValueError('expected Readable')
- }
+async function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ assert(contentLength === body.size, 'blob body must have content length')
- body
- .on('data', (chunk) => {
- const { ret, body } = this
+ try {
+ if (contentLength != null && contentLength !== body.size) {
+ throw new RequestContentLengthMismatchError()
+ }
- if (!ret.push(chunk) && body.pause) {
- body.pause()
- }
- })
- .on('error', (err) => {
- const { ret } = this
+ const buffer = Buffer.from(await body.arrayBuffer())
- util.destroy(ret, err)
- })
- .on('end', () => {
- const { ret } = this
+ h2stream.cork()
+ h2stream.write(buffer)
+ h2stream.uncork()
+ h2stream.end()
- ret.push(null)
- })
- .on('close', () => {
- const { ret } = this
+ request.onBodySent(buffer)
+ request.onRequestSent()
- if (!ret._readableState.ended) {
- util.destroy(ret, new RequestAbortedError())
- }
- })
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
- this.body = body
+ client[kResume]()
+ } catch (err) {
+ abort(err)
}
+}
- onData (chunk) {
- const { res } = this
- return res.push(chunk)
- }
+async function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
- onComplete (trailers) {
- const { res } = this
- res.push(null)
+ let callback = null
+ function onDrain () {
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb()
+ }
}
- onError (err) {
- const { ret } = this
- this.handler = null
- util.destroy(ret, err)
- }
-}
+ const waitForDrain = () => new Promise((resolve, reject) => {
+ assert(callback === null)
+
+ if (socket[kError]) {
+ reject(socket[kError])
+ } else {
+ callback = resolve
+ }
+ })
+
+ h2stream
+ .on('close', onDrain)
+ .on('drain', onDrain)
-function pipeline (opts, handler) {
try {
- const pipelineHandler = new PipelineHandler(opts, handler)
- this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
- return pipelineHandler.ret
+ // It's up to the user to somehow abort the async iterable.
+ for await (const chunk of body) {
+ if (socket[kError]) {
+ throw socket[kError]
+ }
+
+ const res = h2stream.write(chunk)
+ request.onBodySent(chunk)
+ if (!res) {
+ await waitForDrain()
+ }
+ }
+
+ h2stream.end()
+
+ request.onRequestSent()
+
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
+
+ client[kResume]()
} catch (err) {
- return new PassThrough().destroy(err)
+ abort(err)
+ } finally {
+ h2stream
+ .off('close', onDrain)
+ .off('drain', onDrain)
}
}
-module.exports = pipeline
+module.exports = connectH2
/***/ }),
-/***/ 5448:
+/***/ 3701:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+// @ts-check
+
-const Readable = __nccwpck_require__(3858)
+const assert = __nccwpck_require__(4589)
+const net = __nccwpck_require__(7030)
+const http = __nccwpck_require__(7067)
+const util = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const Request = __nccwpck_require__(4655)
+const DispatcherBase = __nccwpck_require__(1841)
const {
InvalidArgumentError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
-
-class RequestHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
-
- const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
-
- try {
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
-
- if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
- throw new InvalidArgumentError('invalid highWaterMark')
- }
-
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ InformationalError,
+ ClientDestroyedError
+} = __nccwpck_require__(8707)
+const buildConnector = __nccwpck_require__(9136)
+const {
+ kUrl,
+ kServerName,
+ kClient,
+ kBusy,
+ kConnect,
+ kResuming,
+ kRunning,
+ kPending,
+ kSize,
+ kQueue,
+ kConnected,
+ kConnecting,
+ kNeedDrain,
+ kKeepAliveDefaultTimeout,
+ kHostHeader,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kPipelining,
+ kKeepAliveTimeoutValue,
+ kMaxHeadersSize,
+ kKeepAliveMaxTimeout,
+ kKeepAliveTimeoutThreshold,
+ kHeadersTimeout,
+ kBodyTimeout,
+ kStrictContentLength,
+ kConnector,
+ kMaxRedirections,
+ kMaxRequests,
+ kCounter,
+ kClose,
+ kDestroy,
+ kDispatch,
+ kInterceptors,
+ kLocalAddress,
+ kMaxResponseSize,
+ kOnError,
+ kHTTPContext,
+ kMaxConcurrentStreams,
+ kResume
+} = __nccwpck_require__(6443)
+const connectH1 = __nccwpck_require__(637)
+const connectH2 = __nccwpck_require__(8788)
+let deprecatedInterceptorWarned = false
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+const kClosedResolve = Symbol('kClosedResolve')
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
- }
+const noop = () => {}
- super('UNDICI_REQUEST')
- } catch (err) {
- if (util.isStream(body)) {
- util.destroy(body.on('error', util.nop), err)
- }
- throw err
- }
+function getPipelining (client) {
+ return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1
+}
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.callback = callback
- this.res = null
- this.abort = null
- this.body = body
- this.trailers = {}
- this.context = null
- this.onInfo = onInfo || null
- this.throwOnError = throwOnError
- this.highWaterMark = highWaterMark
+/**
+ * @type {import('../../types/client.js').default}
+ */
+class Client extends DispatcherBase {
+ /**
+ *
+ * @param {string|URL} url
+ * @param {import('../../types/client.js').Client.Options} options
+ */
+ constructor (url, {
+ interceptors,
+ maxHeaderSize,
+ headersTimeout,
+ socketTimeout,
+ requestTimeout,
+ connectTimeout,
+ bodyTimeout,
+ idleTimeout,
+ keepAlive,
+ keepAliveTimeout,
+ maxKeepAliveTimeout,
+ keepAliveMaxTimeout,
+ keepAliveTimeoutThreshold,
+ socketPath,
+ pipelining,
+ tls,
+ strictContentLength,
+ maxCachedSessions,
+ maxRedirections,
+ connect,
+ maxRequestsPerClient,
+ localAddress,
+ maxResponseSize,
+ autoSelectFamily,
+ autoSelectFamilyAttemptTimeout,
+ // h2
+ maxConcurrentStreams,
+ allowH2,
+ webSocket
+ } = {}) {
+ super({ webSocket })
- if (util.isStream(body)) {
- body.on('error', (err) => {
- this.onError(err)
- })
+ if (keepAlive !== undefined) {
+ throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
}
- addSignal(this, signal)
- }
-
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
+ if (socketTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
}
- this.abort = abort
- this.context = context
- }
+ if (requestTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
+ }
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
+ if (idleTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
+ }
- const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ if (maxKeepAliveTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
+ }
- if (statusCode < 200) {
- if (this.onInfo) {
- this.onInfo({ statusCode, headers })
- }
- return
+ if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
+ throw new InvalidArgumentError('invalid maxHeaderSize')
}
- const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
- const contentType = parsedHeaders['content-type']
- const body = new Readable({ resume, abort, contentType, highWaterMark })
+ if (socketPath != null && typeof socketPath !== 'string') {
+ throw new InvalidArgumentError('invalid socketPath')
+ }
- this.callback = null
- this.res = body
- if (callback !== null) {
- if (this.throwOnError && statusCode >= 400) {
- this.runInAsyncScope(getResolveErrorBodyCallback, null,
- { callback, body, contentType, statusCode, statusMessage, headers }
- )
- } else {
- this.runInAsyncScope(callback, null, null, {
- statusCode,
- headers,
- trailers: this.trailers,
- opaque,
- body,
- context
- })
- }
+ if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
+ throw new InvalidArgumentError('invalid connectTimeout')
}
- }
- onData (chunk) {
- const { res } = this
- return res.push(chunk)
- }
+ if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
+ throw new InvalidArgumentError('invalid keepAliveTimeout')
+ }
- onComplete (trailers) {
- const { res } = this
+ if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
+ throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
+ }
- removeSignal(this)
+ if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
+ throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
+ }
- util.parseHeaders(trailers, this.trailers)
+ if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
+ throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
+ }
- res.push(null)
- }
+ if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
+ throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
+ }
- onError (err) {
- const { res, callback, body, opaque } = this
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
+ }
- removeSignal(this)
+ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
+ throw new InvalidArgumentError('maxRedirections must be a positive number')
+ }
- if (callback) {
- // TODO: Does this need queueMicrotask?
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
+ if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
+ throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
}
- if (res) {
- this.res = null
- // Ensure all queued handlers are invoked before destroying res.
- queueMicrotask(() => {
- util.destroy(res, err)
- })
+ if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
+ throw new InvalidArgumentError('localAddress must be valid string IP address')
}
- if (body) {
- this.body = null
- util.destroy(body, err)
+ if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
+ throw new InvalidArgumentError('maxResponseSize must be a positive number')
}
- }
-}
-function request (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- request.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+ if (
+ autoSelectFamilyAttemptTimeout != null &&
+ (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
+ ) {
+ throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
+ }
- try {
- this.dispatch(opts, new RequestHandler(opts, callback))
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ // h2
+ if (allowH2 != null && typeof allowH2 !== 'boolean') {
+ throw new InvalidArgumentError('allowH2 must be a valid boolean value')
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
- }
-}
-module.exports = request
-module.exports.RequestHandler = RequestHandler
+ if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
+ throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')
+ }
+ if (typeof connect !== 'function') {
+ connect = buildConnector({
+ ...tls,
+ maxCachedSessions,
+ allowH2,
+ socketPath,
+ timeout: connectTimeout,
+ ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
+ ...connect
+ })
+ }
-/***/ }),
+ if (interceptors?.Client && Array.isArray(interceptors.Client)) {
+ this[kInterceptors] = interceptors.Client
+ if (!deprecatedInterceptorWarned) {
+ deprecatedInterceptorWarned = true
+ process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {
+ code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'
+ })
+ }
+ } else {
+ this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]
+ }
-/***/ 5395:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this[kUrl] = util.parseOrigin(url)
+ this[kConnector] = connect
+ this[kPipelining] = pipelining != null ? pipelining : 1
+ this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
+ this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
+ this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
+ this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold
+ this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
+ this[kServerName] = null
+ this[kLocalAddress] = localAddress != null ? localAddress : null
+ this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
+ this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
+ this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
+ this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
+ this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
+ this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
+ this[kMaxRedirections] = maxRedirections
+ this[kMaxRequests] = maxRequestsPerClient
+ this[kClosedResolve] = null
+ this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
+ this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
+ this[kHTTPContext] = null
-"use strict";
+ // kQueue is built up of 3 sections separated by
+ // the kRunningIdx and kPendingIdx indices.
+ // | complete | running | pending |
+ // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
+ // kRunningIdx points to the first running element.
+ // kPendingIdx points to the first pending element.
+ // This implements a fast queue with an amortized
+ // time of O(1).
+ this[kQueue] = []
+ this[kRunningIdx] = 0
+ this[kPendingIdx] = 0
-const { finished, PassThrough } = __nccwpck_require__(2781)
-const {
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
+ this[kResume] = (sync) => resume(this, sync)
+ this[kOnError] = (err) => onError(this, err)
+ }
-class StreamHandler extends AsyncResource {
- constructor (opts, factory, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
+ get pipelining () {
+ return this[kPipelining]
+ }
- const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
+ set pipelining (value) {
+ this[kPipelining] = value
+ this[kResume](true)
+ }
- try {
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
+ get [kPending] () {
+ return this[kQueue].length - this[kPendingIdx]
+ }
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('invalid factory')
- }
+ get [kRunning] () {
+ return this[kPendingIdx] - this[kRunningIdx]
+ }
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ get [kSize] () {
+ return this[kQueue].length - this[kRunningIdx]
+ }
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+ get [kConnected] () {
+ return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed
+ }
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
- }
+ get [kBusy] () {
+ return Boolean(
+ this[kHTTPContext]?.busy(null) ||
+ (this[kSize] >= (getPipelining(this) || 1)) ||
+ this[kPending] > 0
+ )
+ }
- super('UNDICI_STREAM')
- } catch (err) {
- if (util.isStream(body)) {
- util.destroy(body.on('error', util.nop), err)
- }
- throw err
- }
+ /* istanbul ignore: only used for test */
+ [kConnect] (cb) {
+ connect(this)
+ this.once('connect', cb)
+ }
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.factory = factory
- this.callback = callback
- this.res = null
- this.abort = null
- this.context = null
- this.trailers = null
- this.body = body
- this.onInfo = onInfo || null
- this.throwOnError = throwOnError || false
+ [kDispatch] (opts, handler) {
+ const origin = opts.origin || this[kUrl].origin
+ const request = new Request(origin, opts, handler)
- if (util.isStream(body)) {
- body.on('error', (err) => {
- this.onError(err)
- })
+ this[kQueue].push(request)
+ if (this[kResuming]) {
+ // Do nothing.
+ } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
+ // Wait a tick in case stream/iterator is ended in the same tick.
+ this[kResuming] = 1
+ queueMicrotask(() => resume(this))
+ } else {
+ this[kResume](true)
}
- addSignal(this, signal)
- }
-
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
+ if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
+ this[kNeedDrain] = 2
}
- this.abort = abort
- this.context = context
+ return this[kNeedDrain] < 2
}
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const { factory, opaque, context, callback, responseHeaders } = this
-
- const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
-
- if (statusCode < 200) {
- if (this.onInfo) {
- this.onInfo({ statusCode, headers })
+ async [kClose] () {
+ // TODO: for H2 we need to gracefully flush the remaining enqueued
+ // request and close each stream.
+ return new Promise((resolve) => {
+ if (this[kSize]) {
+ this[kClosedResolve] = resolve
+ } else {
+ resolve(null)
}
- return
- }
-
- this.factory = null
+ })
+ }
- let res
+ async [kDestroy] (err) {
+ return new Promise((resolve) => {
+ const requests = this[kQueue].splice(this[kPendingIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(this, request, err)
+ }
- if (this.throwOnError && statusCode >= 400) {
- const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
- const contentType = parsedHeaders['content-type']
- res = new PassThrough()
+ const callback = () => {
+ if (this[kClosedResolve]) {
+ // TODO (fix): Should we error here with ClientDestroyedError?
+ this[kClosedResolve]()
+ this[kClosedResolve] = null
+ }
+ resolve(null)
+ }
- this.callback = null
- this.runInAsyncScope(getResolveErrorBodyCallback, null,
- { callback, body: res, contentType, statusCode, statusMessage, headers }
- )
- } else {
- if (factory === null) {
- return
+ if (this[kHTTPContext]) {
+ this[kHTTPContext].destroy(err, callback)
+ this[kHTTPContext] = null
+ } else {
+ queueMicrotask(callback)
}
- res = this.runInAsyncScope(factory, null, {
- statusCode,
- headers,
- opaque,
- context
- })
+ this[kResume]()
+ })
+ }
+}
- if (
- !res ||
- typeof res.write !== 'function' ||
- typeof res.end !== 'function' ||
- typeof res.on !== 'function'
- ) {
- throw new InvalidReturnValueError('expected Writable')
- }
+const createRedirectInterceptor = __nccwpck_require__(5092)
- // TODO: Avoid finished. It registers an unnecessary amount of listeners.
- finished(res, { readable: false }, (err) => {
- const { callback, res, opaque, trailers, abort } = this
+function onError (client, err) {
+ if (
+ client[kRunning] === 0 &&
+ err.code !== 'UND_ERR_INFO' &&
+ err.code !== 'UND_ERR_SOCKET'
+ ) {
+ // Error is not caused by running request and not a recoverable
+ // socket error.
- this.res = null
- if (err || !res.readable) {
- util.destroy(res, err)
- }
+ assert(client[kPendingIdx] === client[kRunningIdx])
- this.callback = null
- this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
+ const requests = client[kQueue].splice(client[kRunningIdx])
- if (err) {
- abort()
- }
- })
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
}
+ assert(client[kSize] === 0)
+ }
+}
- res.on('drain', resume)
+/**
+ * @param {Client} client
+ * @returns
+ */
+async function connect (client) {
+ assert(!client[kConnecting])
+ assert(!client[kHTTPContext])
- this.res = res
+ let { host, hostname, protocol, port } = client[kUrl]
- const needDrain = res.writableNeedDrain !== undefined
- ? res.writableNeedDrain
- : res._writableState && res._writableState.needDrain
+ // Resolve ipv6
+ if (hostname[0] === '[') {
+ const idx = hostname.indexOf(']')
- return needDrain !== true
+ assert(idx !== -1)
+ const ip = hostname.substring(1, idx)
+
+ assert(net.isIP(ip))
+ hostname = ip
}
- onData (chunk) {
- const { res } = this
+ client[kConnecting] = true
- return res ? res.write(chunk) : true
+ if (channels.beforeConnect.hasSubscribers) {
+ channels.beforeConnect.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector]
+ })
}
- onComplete (trailers) {
- const { res } = this
-
- removeSignal(this)
+ try {
+ const socket = await new Promise((resolve, reject) => {
+ client[kConnector]({
+ host,
+ hostname,
+ protocol,
+ port,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ }, (err, socket) => {
+ if (err) {
+ reject(err)
+ } else {
+ resolve(socket)
+ }
+ })
+ })
- if (!res) {
+ if (client.destroyed) {
+ util.destroy(socket.on('error', noop), new ClientDestroyedError())
return
}
- this.trailers = util.parseHeaders(trailers)
-
- res.end()
- }
+ assert(socket)
- onError (err) {
- const { res, callback, opaque, body } = this
+ try {
+ client[kHTTPContext] = socket.alpnProtocol === 'h2'
+ ? await connectH2(client, socket)
+ : await connectH1(client, socket)
+ } catch (err) {
+ socket.destroy().on('error', noop)
+ throw err
+ }
- removeSignal(this)
+ client[kConnecting] = false
- this.factory = null
+ socket[kCounter] = 0
+ socket[kMaxRequests] = client[kMaxRequests]
+ socket[kClient] = client
+ socket[kError] = null
- if (res) {
- this.res = null
- util.destroy(res, err)
- } else if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
+ if (channels.connected.hasSubscribers) {
+ channels.connected.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector],
+ socket
})
}
-
- if (body) {
- this.body = null
- util.destroy(body, err)
+ client.emit('connect', client[kUrl], [client])
+ } catch (err) {
+ if (client.destroyed) {
+ return
}
- }
-}
-function stream (opts, factory, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- stream.call(this, opts, factory, (err, data) => {
- return err ? reject(err) : resolve(data)
+ client[kConnecting] = false
+
+ if (channels.connectError.hasSubscribers) {
+ channels.connectError.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector],
+ error: err
})
- })
- }
+ }
- try {
- this.dispatch(opts, new StreamHandler(opts, factory, callback))
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
+ assert(client[kRunning] === 0)
+ while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
+ const request = client[kQueue][client[kPendingIdx]++]
+ util.errorRequest(client, request, err)
+ }
+ } else {
+ onError(client, err)
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
- }
-}
-module.exports = stream
+ client.emit('connectionError', client[kUrl], [client], err)
+ }
+ client[kResume]()
+}
-/***/ }),
+function emitDrain (client) {
+ client[kNeedDrain] = 0
+ client.emit('drain', client[kUrl], [client])
+}
-/***/ 6923:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function resume (client, sync) {
+ if (client[kResuming] === 2) {
+ return
+ }
-"use strict";
+ client[kResuming] = 2
+ _resume(client, sync)
+ client[kResuming] = 0
-const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
-const { AsyncResource } = __nccwpck_require__(852)
-const util = __nccwpck_require__(3983)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
-const assert = __nccwpck_require__(9491)
+ if (client[kRunningIdx] > 256) {
+ client[kQueue].splice(0, client[kRunningIdx])
+ client[kPendingIdx] -= client[kRunningIdx]
+ client[kRunningIdx] = 0
+ }
+}
-class UpgradeHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+function _resume (client, sync) {
+ while (true) {
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
+ return
}
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
+ if (client[kClosedResolve] && !client[kSize]) {
+ client[kClosedResolve]()
+ client[kClosedResolve] = null
+ return
}
- const { signal, opaque, responseHeaders } = opts
-
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ if (client[kHTTPContext]) {
+ client[kHTTPContext].resume()
}
- super('UNDICI_UPGRADE')
-
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.callback = callback
- this.abort = null
- this.context = null
-
- addSignal(this, signal)
- }
-
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
+ if (client[kBusy]) {
+ client[kNeedDrain] = 2
+ } else if (client[kNeedDrain] === 2) {
+ if (sync) {
+ client[kNeedDrain] = 1
+ queueMicrotask(() => emitDrain(client))
+ } else {
+ emitDrain(client)
+ }
+ continue
}
- this.abort = abort
- this.context = null
- }
-
- onHeaders () {
- throw new SocketError('bad upgrade', null)
- }
+ if (client[kPending] === 0) {
+ return
+ }
- onUpgrade (statusCode, rawHeaders, socket) {
- const { callback, opaque, context } = this
+ if (client[kRunning] >= (getPipelining(client) || 1)) {
+ return
+ }
- assert.strictEqual(statusCode, 101)
+ const request = client[kQueue][client[kPendingIdx]]
- removeSignal(this)
+ if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
+ if (client[kRunning] > 0) {
+ return
+ }
- this.callback = null
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- this.runInAsyncScope(callback, null, null, {
- headers,
- socket,
- opaque,
- context
- })
- }
+ client[kServerName] = request.servername
+ client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {
+ client[kHTTPContext] = null
+ resume(client)
+ })
+ }
- onError (err) {
- const { callback, opaque } = this
+ if (client[kConnecting]) {
+ return
+ }
- removeSignal(this)
+ if (!client[kHTTPContext]) {
+ connect(client)
+ return
+ }
- if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
+ if (client[kHTTPContext].destroyed) {
+ return
}
- }
-}
-function upgrade (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- upgrade.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+ if (client[kHTTPContext].busy(request)) {
+ return
+ }
- try {
- const upgradeHandler = new UpgradeHandler(opts, callback)
- this.dispatch({
- ...opts,
- method: opts.method || 'GET',
- upgrade: opts.protocol || 'Websocket'
- }, upgradeHandler)
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ if (!request.aborted && client[kHTTPContext].write(request)) {
+ client[kPendingIdx]++
+ } else {
+ client[kQueue].splice(client[kPendingIdx], 1)
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
}
}
-module.exports = upgrade
-
-
-/***/ }),
-
-/***/ 4059:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-module.exports.request = __nccwpck_require__(5448)
-module.exports.stream = __nccwpck_require__(5395)
-module.exports.pipeline = __nccwpck_require__(8752)
-module.exports.upgrade = __nccwpck_require__(6923)
-module.exports.connect = __nccwpck_require__(9744)
+module.exports = Client
/***/ }),
-/***/ 3858:
+/***/ 1841:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-// Ported from https://github.com/nodejs/undici/pull/907
-
-
-
-const assert = __nccwpck_require__(9491)
-const { Readable } = __nccwpck_require__(2781)
-const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
-let Blob
-const kConsume = Symbol('kConsume')
-const kReading = Symbol('kReading')
-const kBody = Symbol('kBody')
-const kAbort = Symbol('abort')
-const kContentType = Symbol('kContentType')
-
-const noop = () => {}
-
-module.exports = class BodyReadable extends Readable {
- constructor ({
- resume,
- abort,
- contentType = '',
- highWaterMark = 64 * 1024 // Same as nodejs fs streams.
- }) {
- super({
- autoDestroy: true,
- read: resume,
- highWaterMark
- })
+const Dispatcher = __nccwpck_require__(883)
+const {
+ ClientDestroyedError,
+ ClientClosedError,
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(6443)
- this._readableState.dataEmitted = false
+const kOnDestroyed = Symbol('onDestroyed')
+const kOnClosed = Symbol('onClosed')
+const kInterceptedDispatch = Symbol('Intercepted Dispatch')
+const kWebSocketOptions = Symbol('webSocketOptions')
- this[kAbort] = abort
- this[kConsume] = null
- this[kBody] = null
- this[kContentType] = contentType
+class DispatcherBase extends Dispatcher {
+ constructor (opts) {
+ super()
- // Is stream being consumed through Readable API?
- // This is an optimization so that we avoid checking
- // for 'data' and 'readable' listeners in the hot path
- // inside push().
- this[kReading] = false
+ this[kDestroyed] = false
+ this[kOnDestroyed] = null
+ this[kClosed] = false
+ this[kOnClosed] = []
+ this[kWebSocketOptions] = opts?.webSocket ?? {}
}
- destroy (err) {
- if (this.destroyed) {
- // Node < 16
- return this
- }
-
- if (!err && !this._readableState.endEmitted) {
- err = new RequestAbortedError()
- }
-
- if (err) {
- this[kAbort]()
+ get webSocketOptions () {
+ return {
+ maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,
+ maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024
}
-
- return super.destroy(err)
}
- emit (ev, ...args) {
- if (ev === 'data') {
- // Node < 16.7
- this._readableState.dataEmitted = true
- } else if (ev === 'error') {
- // Node < 16
- this._readableState.errorEmitted = true
- }
- return super.emit(ev, ...args)
+ get destroyed () {
+ return this[kDestroyed]
}
- on (ev, ...args) {
- if (ev === 'data' || ev === 'readable') {
- this[kReading] = true
- }
- return super.on(ev, ...args)
+ get closed () {
+ return this[kClosed]
}
- addListener (ev, ...args) {
- return this.on(ev, ...args)
+ get interceptors () {
+ return this[kInterceptors]
}
- off (ev, ...args) {
- const ret = super.off(ev, ...args)
- if (ev === 'data' || ev === 'readable') {
- this[kReading] = (
- this.listenerCount('data') > 0 ||
- this.listenerCount('readable') > 0
- )
+ set interceptors (newInterceptors) {
+ if (newInterceptors) {
+ for (let i = newInterceptors.length - 1; i >= 0; i--) {
+ const interceptor = this[kInterceptors][i]
+ if (typeof interceptor !== 'function') {
+ throw new InvalidArgumentError('interceptor must be an function')
+ }
+ }
}
- return ret
- }
- removeListener (ev, ...args) {
- return this.off(ev, ...args)
+ this[kInterceptors] = newInterceptors
}
- push (chunk) {
- if (this[kConsume] && chunk !== null && this.readableLength === 0) {
- consumePush(this[kConsume], chunk)
- return this[kReading] ? super.push(chunk) : true
+ close (callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ this.close((err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
}
- return super.push(chunk)
- }
- // https://fetch.spec.whatwg.org/#dom-body-text
- async text () {
- return consume(this, 'text')
- }
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- // https://fetch.spec.whatwg.org/#dom-body-json
- async json () {
- return consume(this, 'json')
- }
+ if (this[kDestroyed]) {
+ queueMicrotask(() => callback(new ClientDestroyedError(), null))
+ return
+ }
- // https://fetch.spec.whatwg.org/#dom-body-blob
- async blob () {
- return consume(this, 'blob')
- }
+ if (this[kClosed]) {
+ if (this[kOnClosed]) {
+ this[kOnClosed].push(callback)
+ } else {
+ queueMicrotask(() => callback(null, null))
+ }
+ return
+ }
- // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
- async arrayBuffer () {
- return consume(this, 'arrayBuffer')
- }
+ this[kClosed] = true
+ this[kOnClosed].push(callback)
- // https://fetch.spec.whatwg.org/#dom-body-formdata
- async formData () {
- // TODO: Implement.
- throw new NotSupportedError()
- }
+ const onClosed = () => {
+ const callbacks = this[kOnClosed]
+ this[kOnClosed] = null
+ for (let i = 0; i < callbacks.length; i++) {
+ callbacks[i](null, null)
+ }
+ }
- // https://fetch.spec.whatwg.org/#dom-body-bodyused
- get bodyUsed () {
- return util.isDisturbed(this)
+ // Should not error.
+ this[kClose]()
+ .then(() => this.destroy())
+ .then(() => {
+ queueMicrotask(onClosed)
+ })
}
- // https://fetch.spec.whatwg.org/#dom-body-body
- get body () {
- if (!this[kBody]) {
- this[kBody] = ReadableStreamFrom(this)
- if (this[kConsume]) {
- // TODO: Is this the best way to force a lock?
- this[kBody].getReader() // Ensure stream is locked.
- assert(this[kBody].locked)
- }
+ destroy (err, callback) {
+ if (typeof err === 'function') {
+ callback = err
+ err = null
+ }
+
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ this.destroy(err, (err, data) => {
+ return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
+ })
+ })
}
- return this[kBody]
- }
- dump (opts) {
- let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
- const signal = opts && opts.signal
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- if (signal) {
- try {
- if (typeof signal !== 'object' || !('aborted' in signal)) {
- throw new InvalidArgumentError('signal must be an AbortSignal')
- }
- util.throwIfAborted(signal)
- } catch (err) {
- return Promise.reject(err)
+ if (this[kDestroyed]) {
+ if (this[kOnDestroyed]) {
+ this[kOnDestroyed].push(callback)
+ } else {
+ queueMicrotask(() => callback(null, null))
}
+ return
}
- if (this.closed) {
- return Promise.resolve(null)
+ if (!err) {
+ err = new ClientDestroyedError()
}
- return new Promise((resolve, reject) => {
- const signalListenerCleanup = signal
- ? util.addAbortListener(signal, () => {
- this.destroy()
- })
- : noop
+ this[kDestroyed] = true
+ this[kOnDestroyed] = this[kOnDestroyed] || []
+ this[kOnDestroyed].push(callback)
- this
- .on('close', function () {
- signalListenerCleanup()
- if (signal && signal.aborted) {
- reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
- } else {
- resolve(null)
- }
- })
- .on('error', noop)
- .on('data', function (chunk) {
- limit -= chunk.length
- if (limit <= 0) {
- this.destroy()
- }
- })
- .resume()
+ const onDestroyed = () => {
+ const callbacks = this[kOnDestroyed]
+ this[kOnDestroyed] = null
+ for (let i = 0; i < callbacks.length; i++) {
+ callbacks[i](null, null)
+ }
+ }
+
+ // Should not error.
+ this[kDestroy](err).then(() => {
+ queueMicrotask(onDestroyed)
})
}
-}
-
-// https://streams.spec.whatwg.org/#readablestream-locked
-function isLocked (self) {
- // Consume is an implicit lock.
- return (self[kBody] && self[kBody].locked === true) || self[kConsume]
-}
-// https://fetch.spec.whatwg.org/#body-unusable
-function isUnusable (self) {
- return util.isDisturbed(self) || isLocked(self)
-}
+ [kInterceptedDispatch] (opts, handler) {
+ if (!this[kInterceptors] || this[kInterceptors].length === 0) {
+ this[kInterceptedDispatch] = this[kDispatch]
+ return this[kDispatch](opts, handler)
+ }
-async function consume (stream, type) {
- if (isUnusable(stream)) {
- throw new TypeError('unusable')
+ let dispatch = this[kDispatch].bind(this)
+ for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
+ dispatch = this[kInterceptors][i](dispatch)
+ }
+ this[kInterceptedDispatch] = dispatch
+ return dispatch(opts, handler)
}
- assert(!stream[kConsume])
-
- return new Promise((resolve, reject) => {
- stream[kConsume] = {
- type,
- stream,
- resolve,
- reject,
- length: 0,
- body: []
+ dispatch (opts, handler) {
+ if (!handler || typeof handler !== 'object') {
+ throw new InvalidArgumentError('handler must be an object')
}
- stream
- .on('error', function (err) {
- consumeFinish(this[kConsume], err)
- })
- .on('close', function () {
- if (this[kConsume].body !== null) {
- consumeFinish(this[kConsume], new RequestAbortedError())
- }
- })
-
- process.nextTick(consumeStart, stream[kConsume])
- })
-}
-
-function consumeStart (consume) {
- if (consume.body === null) {
- return
- }
+ try {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('opts must be an object.')
+ }
- const { _readableState: state } = consume.stream
+ if (this[kDestroyed] || this[kOnDestroyed]) {
+ throw new ClientDestroyedError()
+ }
- for (const chunk of state.buffer) {
- consumePush(consume, chunk)
- }
+ if (this[kClosed]) {
+ throw new ClientClosedError()
+ }
- if (state.endEmitted) {
- consumeEnd(this[kConsume])
- } else {
- consume.stream.on('end', function () {
- consumeEnd(this[kConsume])
- })
- }
+ return this[kInterceptedDispatch](opts, handler)
+ } catch (err) {
+ if (typeof handler.onError !== 'function') {
+ throw new InvalidArgumentError('invalid onError method')
+ }
- consume.stream.resume()
+ handler.onError(err)
- while (consume.stream.read() != null) {
- // Loop
+ return false
+ }
}
}
-function consumeEnd (consume) {
- const { type, body, resolve, stream, length } = consume
+module.exports = DispatcherBase
- try {
- if (type === 'text') {
- resolve(toUSVString(Buffer.concat(body)))
- } else if (type === 'json') {
- resolve(JSON.parse(Buffer.concat(body)))
- } else if (type === 'arrayBuffer') {
- const dst = new Uint8Array(length)
- let pos = 0
- for (const buf of body) {
- dst.set(buf, pos)
- pos += buf.byteLength
- }
+/***/ }),
- resolve(dst.buffer)
- } else if (type === 'blob') {
- if (!Blob) {
- Blob = (__nccwpck_require__(4300).Blob)
- }
- resolve(new Blob(body, { type: stream[kContentType] }))
- }
+/***/ 883:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- consumeFinish(consume)
- } catch (err) {
- stream.destroy(err)
- }
-}
-function consumePush (consume, chunk) {
- consume.length += chunk.length
- consume.body.push(chunk)
-}
+const EventEmitter = __nccwpck_require__(8474)
-function consumeFinish (consume, err) {
- if (consume.body === null) {
- return
+class Dispatcher extends EventEmitter {
+ dispatch () {
+ throw new Error('not implemented')
}
- if (err) {
- consume.reject(err)
- } else {
- consume.resolve()
+ close () {
+ throw new Error('not implemented')
}
- consume.type = null
- consume.stream = null
- consume.resolve = null
- consume.reject = null
- consume.length = 0
- consume.body = null
-}
-
-
-/***/ }),
+ destroy () {
+ throw new Error('not implemented')
+ }
-/***/ 7474:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ compose (...args) {
+ // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...
+ const interceptors = Array.isArray(args[0]) ? args[0] : args
+ let dispatch = this.dispatch.bind(this)
-const assert = __nccwpck_require__(9491)
-const {
- ResponseStatusCodeError
-} = __nccwpck_require__(8045)
-const { toUSVString } = __nccwpck_require__(3983)
+ for (const interceptor of interceptors) {
+ if (interceptor == null) {
+ continue
+ }
-async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
- assert(body)
+ if (typeof interceptor !== 'function') {
+ throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)
+ }
- let chunks = []
- let limit = 0
+ dispatch = interceptor(dispatch)
- for await (const chunk of body) {
- chunks.push(chunk)
- limit += chunk.length
- if (limit > 128 * 1024) {
- chunks = null
- break
+ if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {
+ throw new TypeError('invalid interceptor')
+ }
}
+
+ return new ComposedDispatcher(this, dispatch)
}
+}
- if (statusCode === 204 || !contentType || !chunks) {
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
- return
+class ComposedDispatcher extends Dispatcher {
+ #dispatcher = null
+ #dispatch = null
+
+ constructor (dispatcher, dispatch) {
+ super()
+ this.#dispatcher = dispatcher
+ this.#dispatch = dispatch
}
- try {
- if (contentType.startsWith('application/json')) {
- const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
- return
- }
+ dispatch (...args) {
+ this.#dispatch(...args)
+ }
- if (contentType.startsWith('text/')) {
- const payload = toUSVString(Buffer.concat(chunks))
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
- return
- }
- } catch (err) {
- // Process in a fallback if error
+ close (...args) {
+ return this.#dispatcher.close(...args)
}
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
+ destroy (...args) {
+ return this.#dispatcher.destroy(...args)
+ }
}
-module.exports = { getResolveErrorBodyCallback }
+module.exports = Dispatcher
/***/ }),
-/***/ 7931:
+/***/ 3137:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const {
- BalancedPoolMissingUpstreamError,
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kRemoveClient,
- kGetDispatcher
-} = __nccwpck_require__(3198)
-const Pool = __nccwpck_require__(4634)
-const { kUrl, kInterceptors } = __nccwpck_require__(2785)
-const { parseOrigin } = __nccwpck_require__(3983)
-const kFactory = Symbol('factory')
-const kOptions = Symbol('options')
-const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
-const kCurrentWeight = Symbol('kCurrentWeight')
-const kIndex = Symbol('kIndex')
-const kWeight = Symbol('kWeight')
-const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
-const kErrorPenalty = Symbol('kErrorPenalty')
-function getGreatestCommonDivisor (a, b) {
- if (b === 0) return a
- return getGreatestCommonDivisor(b, a % b)
-}
+const DispatcherBase = __nccwpck_require__(1841)
+const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(6443)
+const ProxyAgent = __nccwpck_require__(6672)
+const Agent = __nccwpck_require__(7405)
-function defaultFactory (origin, opts) {
- return new Pool(origin, opts)
+const DEFAULT_PORTS = {
+ 'http:': 80,
+ 'https:': 443
}
-class BalancedPool extends PoolBase {
- constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
- super()
+let experimentalWarned = false
- this[kOptions] = opts
- this[kIndex] = -1
- this[kCurrentWeight] = 0
+class EnvHttpProxyAgent extends DispatcherBase {
+ #noProxyValue = null
+ #noProxyEntries = null
+ #opts = null
- this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
- this[kErrorPenalty] = this[kOptions].errorPenalty || 15
+ constructor (opts = {}) {
+ super()
+ this.#opts = opts
- if (!Array.isArray(upstreams)) {
- upstreams = [upstreams]
+ if (!experimentalWarned) {
+ experimentalWarned = true
+ process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {
+ code: 'UNDICI-EHPA'
+ })
}
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
- }
+ const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts
- this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
- ? opts.interceptors.BalancedPool
- : []
- this[kFactory] = factory
+ this[kNoProxyAgent] = new Agent(agentOpts)
- for (const upstream of upstreams) {
- this.addUpstream(upstream)
+ const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY
+ if (HTTP_PROXY) {
+ this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })
+ } else {
+ this[kHttpProxyAgent] = this[kNoProxyAgent]
}
- this._updateBalancedPoolStats()
- }
- addUpstream (upstream) {
- const upstreamOrigin = parseOrigin(upstream).origin
-
- if (this[kClients].find((pool) => (
- pool[kUrl].origin === upstreamOrigin &&
- pool.closed !== true &&
- pool.destroyed !== true
- ))) {
- return this
+ const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY
+ if (HTTPS_PROXY) {
+ this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })
+ } else {
+ this[kHttpsProxyAgent] = this[kHttpProxyAgent]
}
- const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
-
- this[kAddClient](pool)
- pool.on('connect', () => {
- pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
- })
- pool.on('connectionError', () => {
- pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
- this._updateBalancedPoolStats()
- })
+ this.#parseNoProxy()
+ }
- pool.on('disconnect', (...args) => {
- const err = args[2]
- if (err && err.code === 'UND_ERR_SOCKET') {
- // decrease the weight of the pool.
- pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
- this._updateBalancedPoolStats()
- }
- })
+ [kDispatch] (opts, handler) {
+ const url = new URL(opts.origin)
+ const agent = this.#getProxyAgentForUrl(url)
+ return agent.dispatch(opts, handler)
+ }
- for (const client of this[kClients]) {
- client[kWeight] = this[kMaxWeightPerServer]
+ async [kClose] () {
+ await this[kNoProxyAgent].close()
+ if (!this[kHttpProxyAgent][kClosed]) {
+ await this[kHttpProxyAgent].close()
+ }
+ if (!this[kHttpsProxyAgent][kClosed]) {
+ await this[kHttpsProxyAgent].close()
}
-
- this._updateBalancedPoolStats()
-
- return this
}
- _updateBalancedPoolStats () {
- this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
+ async [kDestroy] (err) {
+ await this[kNoProxyAgent].destroy(err)
+ if (!this[kHttpProxyAgent][kDestroyed]) {
+ await this[kHttpProxyAgent].destroy(err)
+ }
+ if (!this[kHttpsProxyAgent][kDestroyed]) {
+ await this[kHttpsProxyAgent].destroy(err)
+ }
}
- removeUpstream (upstream) {
- const upstreamOrigin = parseOrigin(upstream).origin
-
- const pool = this[kClients].find((pool) => (
- pool[kUrl].origin === upstreamOrigin &&
- pool.closed !== true &&
- pool.destroyed !== true
- ))
+ #getProxyAgentForUrl (url) {
+ let { protocol, host: hostname, port } = url
- if (pool) {
- this[kRemoveClient](pool)
+ // Stripping ports in this way instead of using parsedUrl.hostname to make
+ // sure that the brackets around IPv6 addresses are kept.
+ hostname = hostname.replace(/:\d*$/, '').toLowerCase()
+ port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0
+ if (!this.#shouldProxy(hostname, port)) {
+ return this[kNoProxyAgent]
}
-
- return this
- }
-
- get upstreams () {
- return this[kClients]
- .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
- .map((p) => p[kUrl].origin)
+ if (protocol === 'https:') {
+ return this[kHttpsProxyAgent]
+ }
+ return this[kHttpProxyAgent]
}
- [kGetDispatcher] () {
- // We validate that pools is greater than 0,
- // otherwise we would have to wait until an upstream
- // is added, which might never happen.
- if (this[kClients].length === 0) {
- throw new BalancedPoolMissingUpstreamError()
+ #shouldProxy (hostname, port) {
+ if (this.#noProxyChanged) {
+ this.#parseNoProxy()
}
- const dispatcher = this[kClients].find(dispatcher => (
- !dispatcher[kNeedDrain] &&
- dispatcher.closed !== true &&
- dispatcher.destroyed !== true
- ))
-
- if (!dispatcher) {
- return
+ if (this.#noProxyEntries.length === 0) {
+ return true // Always proxy if NO_PROXY is not set or empty.
}
-
- const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
-
- if (allClientsBusy) {
- return
+ if (this.#noProxyValue === '*') {
+ return false // Never proxy if wildcard is set.
}
- let counter = 0
+ for (let i = 0; i < this.#noProxyEntries.length; i++) {
+ const entry = this.#noProxyEntries[i]
+ if (entry.port && entry.port !== port) {
+ continue // Skip if ports don't match.
+ }
+ if (!/^[.*]/.test(entry.hostname)) {
+ // No wildcards, so don't proxy only if there is not an exact match.
+ if (hostname === entry.hostname) {
+ return false
+ }
+ } else {
+ // Don't proxy if the hostname ends with the no_proxy host.
+ if (hostname.endsWith(entry.hostname.replace(/^\*/, ''))) {
+ return false
+ }
+ }
+ }
- let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
+ return true
+ }
- while (counter++ < this[kClients].length) {
- this[kIndex] = (this[kIndex] + 1) % this[kClients].length
- const pool = this[kClients][this[kIndex]]
+ #parseNoProxy () {
+ const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv
+ const noProxySplit = noProxyValue.split(/[,\s]/)
+ const noProxyEntries = []
- // find pool index with the largest weight
- if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
- maxWeightIndex = this[kIndex]
+ for (let i = 0; i < noProxySplit.length; i++) {
+ const entry = noProxySplit[i]
+ if (!entry) {
+ continue
}
+ const parsed = entry.match(/^(.+):(\d+)$/)
+ noProxyEntries.push({
+ hostname: (parsed ? parsed[1] : entry).toLowerCase(),
+ port: parsed ? Number.parseInt(parsed[2], 10) : 0
+ })
+ }
- // decrease the current weight every `this[kClients].length`.
- if (this[kIndex] === 0) {
- // Set the current weight to the next lower weight.
- this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
+ this.#noProxyValue = noProxyValue
+ this.#noProxyEntries = noProxyEntries
+ }
- if (this[kCurrentWeight] <= 0) {
- this[kCurrentWeight] = this[kMaxWeightPerServer]
- }
- }
- if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
- return pool
- }
+ get #noProxyChanged () {
+ if (this.#opts.noProxy !== undefined) {
+ return false
}
+ return this.#noProxyValue !== this.#noProxyEnv
+ }
- this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
- this[kIndex] = maxWeightIndex
- return this[kClients][maxWeightIndex]
+ get #noProxyEnv () {
+ return process.env.no_proxy ?? process.env.NO_PROXY ?? ''
}
}
-module.exports = BalancedPool
+module.exports = EnvHttpProxyAgent
/***/ }),
-/***/ 6101:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+/***/ 4660:
+/***/ ((module) => {
+/* eslint-disable */
-const { kConstruct } = __nccwpck_require__(9174)
-const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
-const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
-const { kHeadersList } = __nccwpck_require__(2785)
-const { webidl } = __nccwpck_require__(1744)
-const { Response, cloneResponse } = __nccwpck_require__(7823)
-const { Request } = __nccwpck_require__(8359)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const { fetching } = __nccwpck_require__(4881)
-const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
-const assert = __nccwpck_require__(9491)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-/**
- * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
- * @typedef {Object} CacheBatchOperation
- * @property {'delete' | 'put'} type
- * @property {any} request
- * @property {any} response
- * @property {import('../../types/cache').CacheQueryOptions} options
- */
-/**
- * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
- * @typedef {[any, any][]} requestResponseList
- */
+// Extracted from node/lib/internal/fixed_queue.js
-class Cache {
- /**
- * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
- * @type {requestResponseList}
- */
- #relevantRequestResponseList
+// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
+const kSize = 2048;
+const kMask = kSize - 1;
- constructor () {
- if (arguments[0] !== kConstruct) {
- webidl.illegalConstructor()
- }
+// The FixedQueue is implemented as a singly-linked list of fixed-size
+// circular buffers. It looks something like this:
+//
+// head tail
+// | |
+// v v
+// +-----------+ <-----\ +-----------+ <------\ +-----------+
+// | [null] | \----- | next | \------- | next |
+// +-----------+ +-----------+ +-----------+
+// | item | <-- bottom | item | <-- bottom | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | bottom --> | item |
+// | item | | item | | item |
+// | ... | | ... | | ... |
+// | item | | item | | item |
+// | item | | item | | item |
+// | [empty] | <-- top | item | | item |
+// | [empty] | | item | | item |
+// | [empty] | | [empty] | <-- top top --> | [empty] |
+// +-----------+ +-----------+ +-----------+
+//
+// Or, if there is only one circular buffer, it looks something
+// like either of these:
+//
+// head tail head tail
+// | | | |
+// v v v v
+// +-----------+ +-----------+
+// | [null] | | [null] |
+// +-----------+ +-----------+
+// | [empty] | | item |
+// | [empty] | | item |
+// | item | <-- bottom top --> | [empty] |
+// | item | | [empty] |
+// | [empty] | <-- top bottom --> | item |
+// | [empty] | | item |
+// +-----------+ +-----------+
+//
+// Adding a value means moving `top` forward by one, removing means
+// moving `bottom` forward by one. After reaching the end, the queue
+// wraps around.
+//
+// When `top === bottom` the current queue is empty and when
+// `top + 1 === bottom` it's full. This wastes a single space of storage
+// but allows much quicker checks.
- this.#relevantRequestResponseList = arguments[1]
+class FixedCircularBuffer {
+ constructor() {
+ this.bottom = 0;
+ this.top = 0;
+ this.list = new Array(kSize);
+ this.next = null;
}
- async match (request, options = {}) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
-
- request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
-
- const p = await this.matchAll(request, options)
-
- if (p.length === 0) {
- return
- }
+ isEmpty() {
+ return this.top === this.bottom;
+ }
- return p[0]
+ isFull() {
+ return ((this.top + 1) & kMask) === this.bottom;
}
- async matchAll (request = undefined, options = {}) {
- webidl.brandCheck(this, Cache)
+ push(data) {
+ this.list[this.top] = data;
+ this.top = (this.top + 1) & kMask;
+ }
- if (request !== undefined) request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
+ shift() {
+ const nextItem = this.list[this.bottom];
+ if (nextItem === undefined)
+ return null;
+ this.list[this.bottom] = undefined;
+ this.bottom = (this.bottom + 1) & kMask;
+ return nextItem;
+ }
+}
- // 1.
- let r = null
+module.exports = class FixedQueue {
+ constructor() {
+ this.head = this.tail = new FixedCircularBuffer();
+ }
- // 2.
- if (request !== undefined) {
- if (request instanceof Request) {
- // 2.1.1
- r = request[kState]
+ isEmpty() {
+ return this.head.isEmpty();
+ }
- // 2.1.2
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return []
- }
- } else if (typeof request === 'string') {
- // 2.2.1
- r = new Request(request)[kState]
- }
+ push(data) {
+ if (this.head.isFull()) {
+ // Head is full: Creates a new queue, sets the old queue's `.next` to it,
+ // and sets it as the new main queue.
+ this.head = this.head.next = new FixedCircularBuffer();
}
+ this.head.push(data);
+ }
- // 5.
- // 5.1
- const responses = []
-
- // 5.2
- if (request === undefined) {
- // 5.2.1
- for (const requestResponse of this.#relevantRequestResponseList) {
- responses.push(requestResponse[1])
- }
- } else { // 5.3
- // 5.3.1
- const requestResponses = this.#queryCache(r, options)
-
- // 5.3.2
- for (const requestResponse of requestResponses) {
- responses.push(requestResponse[1])
- }
+ shift() {
+ const tail = this.tail;
+ const next = tail.shift();
+ if (tail.isEmpty() && tail.next !== null) {
+ // If there is another queue, it forms the new tail.
+ this.tail = tail.next;
}
+ return next;
+ }
+};
- // 5.4
- // We don't implement CORs so we don't need to loop over the responses, yay!
-
- // 5.5.1
- const responseList = []
-
- // 5.5.2
- for (const response of responses) {
- // 5.5.2.1
- const responseObject = new Response(response.body?.source ?? null)
- const body = responseObject[kState].body
- responseObject[kState] = response
- responseObject[kState].body = body
- responseObject[kHeaders][kHeadersList] = response.headersList
- responseObject[kHeaders][kGuard] = 'immutable'
- responseList.push(responseObject)
- }
+/***/ }),
- // 6.
- return Object.freeze(responseList)
- }
+/***/ 2128:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- async add (request) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
- request = webidl.converters.RequestInfo(request)
- // 1.
- const requests = [request]
+const DispatcherBase = __nccwpck_require__(1841)
+const FixedQueue = __nccwpck_require__(4660)
+const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(6443)
+const PoolStats = __nccwpck_require__(3246)
- // 2.
- const responseArrayPromise = this.addAll(requests)
+const kClients = Symbol('clients')
+const kNeedDrain = Symbol('needDrain')
+const kQueue = Symbol('queue')
+const kClosedResolve = Symbol('closed resolve')
+const kOnDrain = Symbol('onDrain')
+const kOnConnect = Symbol('onConnect')
+const kOnDisconnect = Symbol('onDisconnect')
+const kOnConnectionError = Symbol('onConnectionError')
+const kGetDispatcher = Symbol('get dispatcher')
+const kAddClient = Symbol('add client')
+const kRemoveClient = Symbol('remove client')
+const kStats = Symbol('stats')
- // 3.
- return await responseArrayPromise
- }
+class PoolBase extends DispatcherBase {
+ constructor (opts) {
+ super(opts)
- async addAll (requests) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
+ this[kQueue] = new FixedQueue()
+ this[kClients] = []
+ this[kQueued] = 0
- requests = webidl.converters['sequence'](requests)
+ const pool = this
- // 1.
- const responsePromises = []
+ this[kOnDrain] = function onDrain (origin, targets) {
+ const queue = pool[kQueue]
- // 2.
- const requestList = []
+ let needDrain = false
- // 3.
- for (const request of requests) {
- if (typeof request === 'string') {
- continue
+ while (!needDrain) {
+ const item = queue.shift()
+ if (!item) {
+ break
+ }
+ pool[kQueued]--
+ needDrain = !this.dispatch(item.opts, item.handler)
}
- // 3.1
- const r = request[kState]
+ this[kNeedDrain] = needDrain
- // 3.2
- if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Expected http/s scheme when method is not GET.'
- })
+ if (!this[kNeedDrain] && pool[kNeedDrain]) {
+ pool[kNeedDrain] = false
+ pool.emit('drain', origin, [pool, ...targets])
}
- }
-
- // 4.
- /** @type {ReturnType[]} */
- const fetchControllers = []
-
- // 5.
- for (const request of requests) {
- // 5.1
- const r = new Request(request)[kState]
- // 5.2
- if (!urlIsHttpHttpsScheme(r.url)) {
- throw webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Expected http/s scheme.'
- })
+ if (pool[kClosedResolve] && queue.isEmpty()) {
+ Promise
+ .all(pool[kClients].map(c => c.close()))
+ .then(pool[kClosedResolve])
}
+ }
- // 5.4
- r.initiator = 'fetch'
- r.destination = 'subresource'
-
- // 5.5
- requestList.push(r)
+ this[kOnConnect] = (origin, targets) => {
+ pool.emit('connect', origin, [pool, ...targets])
+ }
- // 5.6
- const responsePromise = createDeferredPromise()
+ this[kOnDisconnect] = (origin, targets, err) => {
+ pool.emit('disconnect', origin, [pool, ...targets], err)
+ }
- // 5.7
- fetchControllers.push(fetching({
- request: r,
- dispatcher: getGlobalDispatcher(),
- processResponse (response) {
- // 1.
- if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
- responsePromise.reject(webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Received an invalid status code or the request failed.'
- }))
- } else if (response.headersList.contains('vary')) { // 2.
- // 2.1
- const fieldValues = getFieldValues(response.headersList.get('vary'))
+ this[kOnConnectionError] = (origin, targets, err) => {
+ pool.emit('connectionError', origin, [pool, ...targets], err)
+ }
- // 2.2
- for (const fieldValue of fieldValues) {
- // 2.2.1
- if (fieldValue === '*') {
- responsePromise.reject(webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'invalid vary field value'
- }))
+ this[kStats] = new PoolStats(this)
+ }
- for (const controller of fetchControllers) {
- controller.abort()
- }
+ get [kBusy] () {
+ return this[kNeedDrain]
+ }
- return
- }
- }
- }
- },
- processResponseEndOfBody (response) {
- // 1.
- if (response.aborted) {
- responsePromise.reject(new DOMException('aborted', 'AbortError'))
- return
- }
+ get [kConnected] () {
+ return this[kClients].filter(client => client[kConnected]).length
+ }
- // 2.
- responsePromise.resolve(response)
- }
- }))
+ get [kFree] () {
+ return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
+ }
- // 5.8
- responsePromises.push(responsePromise.promise)
+ get [kPending] () {
+ let ret = this[kQueued]
+ for (const { [kPending]: pending } of this[kClients]) {
+ ret += pending
}
+ return ret
+ }
- // 6.
- const p = Promise.all(responsePromises)
+ get [kRunning] () {
+ let ret = 0
+ for (const { [kRunning]: running } of this[kClients]) {
+ ret += running
+ }
+ return ret
+ }
- // 7.
- const responses = await p
+ get [kSize] () {
+ let ret = this[kQueued]
+ for (const { [kSize]: size } of this[kClients]) {
+ ret += size
+ }
+ return ret
+ }
- // 7.1
- const operations = []
+ get stats () {
+ return this[kStats]
+ }
- // 7.2
- let index = 0
+ async [kClose] () {
+ if (this[kQueue].isEmpty()) {
+ await Promise.all(this[kClients].map(c => c.close()))
+ } else {
+ await new Promise((resolve) => {
+ this[kClosedResolve] = resolve
+ })
+ }
+ }
- // 7.3
- for (const response of responses) {
- // 7.3.1
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'put', // 7.3.2
- request: requestList[index], // 7.3.3
- response // 7.3.4
+ async [kDestroy] (err) {
+ while (true) {
+ const item = this[kQueue].shift()
+ if (!item) {
+ break
}
+ item.handler.onError(err)
+ }
- operations.push(operation) // 7.3.5
+ await Promise.all(this[kClients].map(c => c.destroy(err)))
+ }
- index++ // 7.3.6
+ [kDispatch] (opts, handler) {
+ const dispatcher = this[kGetDispatcher]()
+
+ if (!dispatcher) {
+ this[kNeedDrain] = true
+ this[kQueue].push({ opts, handler })
+ this[kQueued]++
+ } else if (!dispatcher.dispatch(opts, handler)) {
+ dispatcher[kNeedDrain] = true
+ this[kNeedDrain] = !this[kGetDispatcher]()
}
- // 7.5
- const cacheJobPromise = createDeferredPromise()
+ return !this[kNeedDrain]
+ }
- // 7.6.1
- let errorData = null
+ [kAddClient] (client) {
+ client
+ .on('drain', this[kOnDrain])
+ .on('connect', this[kOnConnect])
+ .on('disconnect', this[kOnDisconnect])
+ .on('connectionError', this[kOnConnectionError])
- // 7.6.2
- try {
- this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
+ this[kClients].push(client)
+
+ if (this[kNeedDrain]) {
+ queueMicrotask(() => {
+ if (this[kNeedDrain]) {
+ this[kOnDrain](client[kUrl], [this, client])
+ }
+ })
}
- // 7.6.3
- queueMicrotask(() => {
- // 7.6.3.1
- if (errorData === null) {
- cacheJobPromise.resolve(undefined)
- } else {
- // 7.6.3.2
- cacheJobPromise.reject(errorData)
+ return this
+ }
+
+ [kRemoveClient] (client) {
+ client.close(() => {
+ const idx = this[kClients].indexOf(client)
+ if (idx !== -1) {
+ this[kClients].splice(idx, 1)
}
})
- // 7.7
- return cacheJobPromise.promise
+ this[kNeedDrain] = this[kClients].some(dispatcher => (
+ !dispatcher[kNeedDrain] &&
+ dispatcher.closed !== true &&
+ dispatcher.destroyed !== true
+ ))
}
+}
- async put (request, response) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
+module.exports = {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kRemoveClient,
+ kGetDispatcher
+}
- request = webidl.converters.RequestInfo(request)
- response = webidl.converters.Response(response)
- // 1.
- let innerRequest = null
+/***/ }),
- // 2.
- if (request instanceof Request) {
- innerRequest = request[kState]
- } else { // 3.
- innerRequest = new Request(request)[kState]
- }
+/***/ 3246:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 4.
- if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Expected an http/s scheme when method is not GET'
- })
- }
+const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(6443)
+const kPool = Symbol('pool')
- // 5.
- const innerResponse = response[kState]
+class PoolStats {
+ constructor (pool) {
+ this[kPool] = pool
+ }
- // 6.
- if (innerResponse.status === 206) {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Got 206 status'
- })
- }
+ get connected () {
+ return this[kPool][kConnected]
+ }
- // 7.
- if (innerResponse.headersList.contains('vary')) {
- // 7.1.
- const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
+ get free () {
+ return this[kPool][kFree]
+ }
- // 7.2.
- for (const fieldValue of fieldValues) {
- // 7.2.1
- if (fieldValue === '*') {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Got * vary field value'
- })
- }
- }
- }
+ get pending () {
+ return this[kPool][kPending]
+ }
- // 8.
- if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Response body is locked or disturbed'
- })
- }
+ get queued () {
+ return this[kPool][kQueued]
+ }
- // 9.
- const clonedResponse = cloneResponse(innerResponse)
+ get running () {
+ return this[kPool][kRunning]
+ }
- // 10.
- const bodyReadPromise = createDeferredPromise()
+ get size () {
+ return this[kPool][kSize]
+ }
+}
- // 11.
- if (innerResponse.body != null) {
- // 11.1
- const stream = innerResponse.body.stream
+module.exports = PoolStats
- // 11.2
- const reader = stream.getReader()
- // 11.3
- readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
- } else {
- bodyReadPromise.resolve(undefined)
- }
+/***/ }),
- // 12.
- /** @type {CacheBatchOperation[]} */
- const operations = []
+/***/ 628:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 13.
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'put', // 14.
- request: innerRequest, // 15.
- response: clonedResponse // 16.
- }
- // 17.
- operations.push(operation)
- // 19.
- const bytes = await bodyReadPromise.promise
+const {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kGetDispatcher
+} = __nccwpck_require__(2128)
+const Client = __nccwpck_require__(3701)
+const {
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { kUrl, kInterceptors } = __nccwpck_require__(6443)
+const buildConnector = __nccwpck_require__(9136)
- if (clonedResponse.body != null) {
- clonedResponse.body.source = bytes
+const kOptions = Symbol('options')
+const kConnections = Symbol('connections')
+const kFactory = Symbol('factory')
+
+function defaultFactory (origin, opts) {
+ return new Client(origin, opts)
+}
+
+class Pool extends PoolBase {
+ constructor (origin, {
+ connections,
+ factory = defaultFactory,
+ connect,
+ connectTimeout,
+ tls,
+ maxCachedSessions,
+ socketPath,
+ autoSelectFamily,
+ autoSelectFamilyAttemptTimeout,
+ allowH2,
+ ...options
+ } = {}) {
+ if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
+ throw new InvalidArgumentError('invalid connections')
}
- // 19.1
- const cacheJobPromise = createDeferredPromise()
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
+ }
- // 19.2.1
- let errorData = null
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
+ }
- // 19.2.2
- try {
- this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
+ if (typeof connect !== 'function') {
+ connect = buildConnector({
+ ...tls,
+ maxCachedSessions,
+ allowH2,
+ socketPath,
+ timeout: connectTimeout,
+ ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
+ ...connect
+ })
}
- // 19.2.3
- queueMicrotask(() => {
- // 19.2.3.1
- if (errorData === null) {
- cacheJobPromise.resolve()
- } else { // 19.2.3.2
- cacheJobPromise.reject(errorData)
+ super(options)
+
+ this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)
+ ? options.interceptors.Pool
+ : []
+ this[kConnections] = connections || null
+ this[kUrl] = util.parseOrigin(origin)
+ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
+ this[kOptions].interceptors = options.interceptors
+ ? { ...options.interceptors }
+ : undefined
+ this[kFactory] = factory
+
+ this.on('connectionError', (origin, targets, error) => {
+ // If a connection error occurs, we remove the client from the pool,
+ // and emit a connectionError event. They will not be re-used.
+ // Fixes https://github.com/nodejs/undici/issues/3895
+ for (const target of targets) {
+ // Do not use kRemoveClient here, as it will close the client,
+ // but the client cannot be closed in this state.
+ const idx = this[kClients].indexOf(target)
+ if (idx !== -1) {
+ this[kClients].splice(idx, 1)
+ }
}
})
+ }
- return cacheJobPromise.promise
+ [kGetDispatcher] () {
+ for (const client of this[kClients]) {
+ if (!client[kNeedDrain]) {
+ return client
+ }
+ }
+
+ if (!this[kConnections] || this[kClients].length < this[kConnections]) {
+ const dispatcher = this[kFactory](this[kUrl], this[kOptions])
+ this[kAddClient](dispatcher)
+ return dispatcher
+ }
}
+}
- async delete (request, options = {}) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
+module.exports = Pool
- request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
- /**
- * @type {Request}
- */
- let r = null
+/***/ }),
- if (request instanceof Request) {
- r = request[kState]
+/***/ 6672:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return false
- }
- } else {
- assert(typeof request === 'string')
- r = new Request(request)[kState]
- }
- /** @type {CacheBatchOperation[]} */
- const operations = []
+const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443)
+const { URL } = __nccwpck_require__(3136)
+const Agent = __nccwpck_require__(7405)
+const Pool = __nccwpck_require__(628)
+const DispatcherBase = __nccwpck_require__(1841)
+const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(8707)
+const buildConnector = __nccwpck_require__(9136)
+const Client = __nccwpck_require__(3701)
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'delete',
- request: r,
- options
- }
+const kAgent = Symbol('proxy agent')
+const kClient = Symbol('proxy client')
+const kProxyHeaders = Symbol('proxy headers')
+const kRequestTls = Symbol('request tls settings')
+const kProxyTls = Symbol('proxy tls settings')
+const kConnectEndpoint = Symbol('connect endpoint function')
+const kTunnelProxy = Symbol('tunnel proxy')
- operations.push(operation)
+function defaultProtocolPort (protocol) {
+ return protocol === 'https:' ? 443 : 80
+}
- const cacheJobPromise = createDeferredPromise()
+function defaultFactory (origin, opts) {
+ return new Pool(origin, opts)
+}
- let errorData = null
- let requestResponses
+const noop = () => {}
- try {
- requestResponses = this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
+function defaultAgentFactory (origin, opts) {
+ if (opts.connections === 1) {
+ return new Client(origin, opts)
+ }
+ return new Pool(origin, opts)
+}
+
+class Http1ProxyWrapper extends DispatcherBase {
+ #client
+
+ constructor (proxyUrl, { headers = {}, connect, factory }) {
+ super()
+ if (!proxyUrl) {
+ throw new InvalidArgumentError('Proxy URL is mandatory')
}
- queueMicrotask(() => {
- if (errorData === null) {
- cacheJobPromise.resolve(!!requestResponses?.length)
- } else {
- cacheJobPromise.reject(errorData)
+ this[kProxyHeaders] = headers
+ if (factory) {
+ this.#client = factory(proxyUrl, { connect })
+ } else {
+ this.#client = new Client(proxyUrl, { connect })
+ }
+ }
+
+ [kDispatch] (opts, handler) {
+ const onHeaders = handler.onHeaders
+ handler.onHeaders = function (statusCode, data, resume) {
+ if (statusCode === 407) {
+ if (typeof handler.onError === 'function') {
+ handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))
+ }
+ return
}
- })
+ if (onHeaders) onHeaders.call(this, statusCode, data, resume)
+ }
- return cacheJobPromise.promise
+ // Rewrite request as an HTTP1 Proxy request, without tunneling.
+ const {
+ origin,
+ path = '/',
+ headers = {}
+ } = opts
+
+ opts.path = origin + path
+
+ if (!('host' in headers) && !('Host' in headers)) {
+ const { host } = new URL(origin)
+ headers.host = host
+ }
+ opts.headers = { ...this[kProxyHeaders], ...headers }
+
+ return this.#client[kDispatch](opts, handler)
}
- /**
- * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
- * @param {any} request
- * @param {import('../../types/cache').CacheQueryOptions} options
- * @returns {readonly Request[]}
- */
- async keys (request = undefined, options = {}) {
- webidl.brandCheck(this, Cache)
+ async [kClose] () {
+ return this.#client.close()
+ }
- if (request !== undefined) request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
+ async [kDestroy] (err) {
+ return this.#client.destroy(err)
+ }
+}
- // 1.
- let r = null
+class ProxyAgent extends DispatcherBase {
+ constructor (opts) {
+ super()
- // 2.
- if (request !== undefined) {
- // 2.1
- if (request instanceof Request) {
- // 2.1.1
- r = request[kState]
+ if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {
+ throw new InvalidArgumentError('Proxy uri is mandatory')
+ }
- // 2.1.2
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return []
- }
- } else if (typeof request === 'string') { // 2.2
- r = new Request(request)[kState]
- }
+ const { clientFactory = defaultFactory } = opts
+ if (typeof clientFactory !== 'function') {
+ throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
}
- // 4.
- const promise = createDeferredPromise()
+ const { proxyTunnel = true } = opts
- // 5.
- // 5.1
- const requests = []
+ const url = this.#getUrl(opts)
+ const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url
- // 5.2
- if (request === undefined) {
- // 5.2.1
- for (const requestResponse of this.#relevantRequestResponseList) {
- // 5.2.1.1
- requests.push(requestResponse[0])
- }
- } else { // 5.3
- // 5.3.1
- const requestResponses = this.#queryCache(r, options)
+ this[kProxy] = { uri: href, protocol }
+ this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
+ ? opts.interceptors.ProxyAgent
+ : []
+ this[kRequestTls] = opts.requestTls
+ this[kProxyTls] = opts.proxyTls
+ this[kProxyHeaders] = opts.headers || {}
+ this[kTunnelProxy] = proxyTunnel
- // 5.3.2
- for (const requestResponse of requestResponses) {
- // 5.3.2.1
- requests.push(requestResponse[0])
- }
+ if (opts.auth && opts.token) {
+ throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
+ } else if (opts.auth) {
+ /* @deprecated in favour of opts.token */
+ this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
+ } else if (opts.token) {
+ this[kProxyHeaders]['proxy-authorization'] = opts.token
+ } else if (username && password) {
+ this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
}
- // 5.4
- queueMicrotask(() => {
- // 5.4.1
- const requestList = []
-
- // 5.4.2
- for (const request of requests) {
- const requestObject = new Request('https://a')
- requestObject[kState] = request
- requestObject[kHeaders][kHeadersList] = request.headersList
- requestObject[kHeaders][kGuard] = 'immutable'
- requestObject[kRealm] = request.client
+ const connect = buildConnector({ ...opts.proxyTls })
+ this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
- // 5.4.2.1
- requestList.push(requestObject)
+ const agentFactory = opts.factory || defaultAgentFactory
+ const factory = (origin, options) => {
+ const { protocol } = new URL(origin)
+ if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {
+ return new Http1ProxyWrapper(this[kProxy].uri, {
+ headers: this[kProxyHeaders],
+ connect,
+ factory: agentFactory
+ })
+ }
+ return agentFactory(origin, options)
+ }
+ this[kClient] = clientFactory(url, { connect })
+ this[kAgent] = new Agent({
+ ...opts,
+ factory,
+ connect: async (opts, callback) => {
+ let requestedPath = opts.host
+ if (!opts.port) {
+ requestedPath += `:${defaultProtocolPort(opts.protocol)}`
+ }
+ try {
+ const { socket, statusCode } = await this[kClient].connect({
+ origin,
+ port,
+ path: requestedPath,
+ signal: opts.signal,
+ headers: {
+ ...this[kProxyHeaders],
+ host: opts.host
+ },
+ servername: this[kProxyTls]?.servername || proxyHostname
+ })
+ if (statusCode !== 200) {
+ socket.on('error', noop).destroy()
+ callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
+ }
+ if (opts.protocol !== 'https:') {
+ callback(null, socket)
+ return
+ }
+ let servername
+ if (this[kRequestTls]) {
+ servername = this[kRequestTls].servername
+ } else {
+ servername = opts.servername
+ }
+ this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
+ } catch (err) {
+ if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
+ // Throw a custom error to avoid loop in client.js#connect
+ callback(new SecureProxyConnectionError(err))
+ } else {
+ callback(err)
+ }
+ }
}
+ })
+ }
+
+ dispatch (opts, handler) {
+ const headers = buildHeaders(opts.headers)
+ throwIfProxyAuthIsSent(headers)
- // 5.4.3
- promise.resolve(Object.freeze(requestList))
- })
+ if (headers && !('host' in headers) && !('Host' in headers)) {
+ const { host } = new URL(opts.origin)
+ headers.host = host
+ }
- return promise.promise
+ return this[kAgent].dispatch(
+ {
+ ...opts,
+ headers
+ },
+ handler
+ )
}
/**
- * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
- * @param {CacheBatchOperation[]} operations
- * @returns {requestResponseList}
+ * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
+ * @returns {URL}
*/
- #batchCacheOperations (operations) {
- // 1.
- const cache = this.#relevantRequestResponseList
-
- // 2.
- const backupCache = [...cache]
+ #getUrl (opts) {
+ if (typeof opts === 'string') {
+ return new URL(opts)
+ } else if (opts instanceof URL) {
+ return opts
+ } else {
+ return new URL(opts.uri)
+ }
+ }
- // 3.
- const addedItems = []
+ async [kClose] () {
+ await this[kAgent].close()
+ await this[kClient].close()
+ }
- // 4.1
- const resultList = []
+ async [kDestroy] () {
+ await this[kAgent].destroy()
+ await this[kClient].destroy()
+ }
+}
- try {
- // 4.2
- for (const operation of operations) {
- // 4.2.1
- if (operation.type !== 'delete' && operation.type !== 'put') {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'operation type does not match "delete" or "put"'
- })
- }
+/**
+ * @param {string[] | Record} headers
+ * @returns {Record}
+ */
+function buildHeaders (headers) {
+ // When using undici.fetch, the headers list is stored
+ // as an array.
+ if (Array.isArray(headers)) {
+ /** @type {Record} */
+ const headersPair = {}
- // 4.2.2
- if (operation.type === 'delete' && operation.response != null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'delete operation should not have an associated response'
- })
- }
+ for (let i = 0; i < headers.length; i += 2) {
+ headersPair[headers[i]] = headers[i + 1]
+ }
- // 4.2.3
- if (this.#queryCache(operation.request, operation.options, addedItems).length) {
- throw new DOMException('???', 'InvalidStateError')
- }
+ return headersPair
+ }
- // 4.2.4
- let requestResponses
+ return headers
+}
- // 4.2.5
- if (operation.type === 'delete') {
- // 4.2.5.1
- requestResponses = this.#queryCache(operation.request, operation.options)
+/**
+ * @param {Record} headers
+ *
+ * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
+ * Nevertheless, it was changed and to avoid a security vulnerability by end users
+ * this check was created.
+ * It should be removed in the next major version for performance reasons
+ */
+function throwIfProxyAuthIsSent (headers) {
+ const existProxyAuth = headers && Object.keys(headers)
+ .find((key) => key.toLowerCase() === 'proxy-authorization')
+ if (existProxyAuth) {
+ throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
+ }
+}
- // TODO: the spec is wrong, this is needed to pass WPTs
- if (requestResponses.length === 0) {
- return []
- }
+module.exports = ProxyAgent
- // 4.2.5.2
- for (const requestResponse of requestResponses) {
- const idx = cache.indexOf(requestResponse)
- assert(idx !== -1)
- // 4.2.5.2.1
- cache.splice(idx, 1)
- }
- } else if (operation.type === 'put') { // 4.2.6
- // 4.2.6.1
- if (operation.response == null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'put operation should have an associated response'
- })
- }
+/***/ }),
- // 4.2.6.2
- const r = operation.request
+/***/ 50:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 4.2.6.3
- if (!urlIsHttpHttpsScheme(r.url)) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'expected http or https scheme'
- })
- }
- // 4.2.6.4
- if (r.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'not get method'
- })
- }
- // 4.2.6.5
- if (operation.options != null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'options must not be defined'
- })
- }
+const Dispatcher = __nccwpck_require__(883)
+const RetryHandler = __nccwpck_require__(7816)
- // 4.2.6.6
- requestResponses = this.#queryCache(operation.request)
+class RetryAgent extends Dispatcher {
+ #agent = null
+ #options = null
+ constructor (agent, options = {}) {
+ super(options)
+ this.#agent = agent
+ this.#options = options
+ }
- // 4.2.6.7
- for (const requestResponse of requestResponses) {
- const idx = cache.indexOf(requestResponse)
- assert(idx !== -1)
+ dispatch (opts, handler) {
+ const retry = new RetryHandler({
+ ...opts,
+ retryOptions: this.#options
+ }, {
+ dispatch: this.#agent.dispatch.bind(this.#agent),
+ handler
+ })
+ return this.#agent.dispatch(opts, retry)
+ }
- // 4.2.6.7.1
- cache.splice(idx, 1)
- }
+ close () {
+ return this.#agent.close()
+ }
- // 4.2.6.8
- cache.push([operation.request, operation.response])
+ destroy () {
+ return this.#agent.destroy()
+ }
+}
- // 4.2.6.10
- addedItems.push([operation.request, operation.response])
- }
+module.exports = RetryAgent
- // 4.2.7
- resultList.push([operation.request, operation.response])
- }
- // 4.3
- return resultList
- } catch (e) { // 5.
- // 5.1
- this.#relevantRequestResponseList.length = 0
+/***/ }),
- // 5.2
- this.#relevantRequestResponseList = backupCache
+/***/ 2581:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 5.3
- throw e
- }
- }
- /**
- * @see https://w3c.github.io/ServiceWorker/#query-cache
- * @param {any} requestQuery
- * @param {import('../../types/cache').CacheQueryOptions} options
- * @param {requestResponseList} targetStorage
- * @returns {requestResponseList}
- */
- #queryCache (requestQuery, options, targetStorage) {
- /** @type {requestResponseList} */
- const resultList = []
- const storage = targetStorage ?? this.#relevantRequestResponseList
+// We include a version number for the Dispatcher API. In case of breaking changes,
+// this version number must be increased to avoid conflicts.
+const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const Agent = __nccwpck_require__(7405)
- for (const requestResponse of storage) {
- const [cachedRequest, cachedResponse] = requestResponse
- if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
- resultList.push(requestResponse)
- }
- }
+if (getGlobalDispatcher() === undefined) {
+ setGlobalDispatcher(new Agent())
+}
- return resultList
+function setGlobalDispatcher (agent) {
+ if (!agent || typeof agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument agent must implement Agent')
}
+ Object.defineProperty(globalThis, globalDispatcher, {
+ value: agent,
+ writable: true,
+ enumerable: false,
+ configurable: false
+ })
+}
- /**
- * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
- * @param {any} requestQuery
- * @param {any} request
- * @param {any | null} response
- * @param {import('../../types/cache').CacheQueryOptions | undefined} options
- * @returns {boolean}
- */
- #requestMatchesCachedItem (requestQuery, request, response = null, options) {
- // if (options?.ignoreMethod === false && request.method === 'GET') {
- // return false
- // }
-
- const queryURL = new URL(requestQuery.url)
-
- const cachedURL = new URL(request.url)
+function getGlobalDispatcher () {
+ return globalThis[globalDispatcher]
+}
- if (options?.ignoreSearch) {
- cachedURL.search = ''
+module.exports = {
+ setGlobalDispatcher,
+ getGlobalDispatcher
+}
- queryURL.search = ''
- }
- if (!urlEquals(queryURL, cachedURL, true)) {
- return false
- }
+/***/ }),
- if (
- response == null ||
- options?.ignoreVary ||
- !response.headersList.contains('vary')
- ) {
- return true
- }
+/***/ 8155:
+/***/ ((module) => {
- const fieldValues = getFieldValues(response.headersList.get('vary'))
- for (const fieldValue of fieldValues) {
- if (fieldValue === '*') {
- return false
- }
- const requestValue = request.headersList.get(fieldValue)
- const queryValue = requestQuery.headersList.get(fieldValue)
+module.exports = class DecoratorHandler {
+ #handler
- // If one has the header and the other doesn't, or one has
- // a different value than the other, return false
- if (requestValue !== queryValue) {
- return false
- }
+ constructor (handler) {
+ if (typeof handler !== 'object' || handler === null) {
+ throw new TypeError('handler must be an object')
}
+ this.#handler = handler
+ }
- return true
+ onConnect (...args) {
+ return this.#handler.onConnect?.(...args)
}
-}
-Object.defineProperties(Cache.prototype, {
- [Symbol.toStringTag]: {
- value: 'Cache',
- configurable: true
- },
- match: kEnumerableProperty,
- matchAll: kEnumerableProperty,
- add: kEnumerableProperty,
- addAll: kEnumerableProperty,
- put: kEnumerableProperty,
- delete: kEnumerableProperty,
- keys: kEnumerableProperty
-})
+ onError (...args) {
+ return this.#handler.onError?.(...args)
+ }
-const cacheQueryOptionConverters = [
- {
- key: 'ignoreSearch',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'ignoreMethod',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'ignoreVary',
- converter: webidl.converters.boolean,
- defaultValue: false
+ onUpgrade (...args) {
+ return this.#handler.onUpgrade?.(...args)
}
-]
-webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
+ onResponseStarted (...args) {
+ return this.#handler.onResponseStarted?.(...args)
+ }
-webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
- ...cacheQueryOptionConverters,
- {
- key: 'cacheName',
- converter: webidl.converters.DOMString
+ onHeaders (...args) {
+ return this.#handler.onHeaders?.(...args)
}
-])
-webidl.converters.Response = webidl.interfaceConverter(Response)
+ onData (...args) {
+ return this.#handler.onData?.(...args)
+ }
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.RequestInfo
-)
+ onComplete (...args) {
+ return this.#handler.onComplete?.(...args)
+ }
-module.exports = {
- Cache
+ onBodySent (...args) {
+ return this.#handler.onBodySent?.(...args)
+ }
}
/***/ }),
-/***/ 7907:
+/***/ 8754:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { kConstruct } = __nccwpck_require__(9174)
-const { Cache } = __nccwpck_require__(6101)
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+const util = __nccwpck_require__(3440)
+const { kBodyUsed } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const EE = __nccwpck_require__(8474)
-class CacheStorage {
- /**
- * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
- * @type {Map}
- */
- async has (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
+ onConnect (abort) {
+ this.abort = abort
+ this.handler.onConnect(abort, { history: this.history })
+ }
- cacheName = webidl.converters.DOMString(cacheName)
+ onUpgrade (statusCode, headers, socket) {
+ this.handler.onUpgrade(statusCode, headers, socket)
+ }
- // 2.1.1
- // 2.2
- return this.#caches.has(cacheName)
+ onError (error) {
+ this.handler.onError(error)
}
- /**
- * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
- * @param {string} cacheName
- * @returns {Promise}
- */
- async open (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
+ onHeaders (statusCode, headers, resume, statusText) {
+ this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
+ ? null
+ : parseLocation(statusCode, headers)
- cacheName = webidl.converters.DOMString(cacheName)
+ if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
+ if (this.request) {
+ this.request.abort(new Error('max redirects'))
+ }
- // 2.1
- if (this.#caches.has(cacheName)) {
- // await caches.open('v1') !== await caches.open('v1')
+ this.redirectionLimitReached = true
+ this.abort(new Error('max redirects'))
+ return
+ }
- // 2.1.1
- const cache = this.#caches.get(cacheName)
+ if (this.opts.origin) {
+ this.history.push(new URL(this.opts.path, this.opts.origin))
+ }
- // 2.1.1.1
- return new Cache(kConstruct, cache)
+ if (!this.location) {
+ return this.handler.onHeaders(statusCode, headers, resume, statusText)
}
- // 2.2
- const cache = []
+ const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
+ const path = search ? `${pathname}${search}` : pathname
- // 2.3
- this.#caches.set(cacheName, cache)
+ // Remove headers referring to the original URL.
+ // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
+ // https://tools.ietf.org/html/rfc7231#section-6.4
+ this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
+ this.opts.path = path
+ this.opts.origin = origin
+ this.opts.maxRedirections = 0
+ this.opts.query = null
- // 2.4
- return new Cache(kConstruct, cache)
+ // https://tools.ietf.org/html/rfc7231#section-6.4.4
+ // In case of HTTP 303, always replace method to be either HEAD or GET
+ if (statusCode === 303 && this.opts.method !== 'HEAD') {
+ this.opts.method = 'GET'
+ this.opts.body = null
+ }
}
- /**
- * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
- * @param {string} cacheName
- * @returns {Promise}
- */
- async delete (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
+ onData (chunk) {
+ if (this.location) {
+ /*
+ https://tools.ietf.org/html/rfc7231#section-6.4
+
+ TLDR: undici always ignores 3xx response bodies.
+
+ Redirection is used to serve the requested resource from another URL, so it is assumes that
+ no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
+
+ For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
+ (which means it's optional and not mandated) contain just an hyperlink to the value of
+ the Location response header, so the body can be ignored safely.
+
+ For status 300, which is "Multiple Choices", the spec mentions both generating a Location
+ response header AND a response body with the other possible location to follow.
+ Since the spec explicitly chooses not to specify a format for such body and leave it to
+ servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
+ */
+ } else {
+ return this.handler.onData(chunk)
+ }
+ }
+
+ onComplete (trailers) {
+ if (this.location) {
+ /*
+ https://tools.ietf.org/html/rfc7231#section-6.4
- cacheName = webidl.converters.DOMString(cacheName)
+ TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
+ and neither are useful if present.
- return this.#caches.delete(cacheName)
- }
+ See comment on onData method above for more detailed information.
+ */
- /**
- * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
- * @returns {string[]}
- */
- async keys () {
- webidl.brandCheck(this, CacheStorage)
+ this.location = null
+ this.abort = null
- // 2.1
- const keys = this.#caches.keys()
+ this.dispatch(this.opts, this)
+ } else {
+ this.handler.onComplete(trailers)
+ }
+ }
- // 2.2
- return [...keys]
+ onBodySent (chunk) {
+ if (this.handler.onBodySent) {
+ this.handler.onBodySent(chunk)
+ }
}
}
-Object.defineProperties(CacheStorage.prototype, {
- [Symbol.toStringTag]: {
- value: 'CacheStorage',
- configurable: true
- },
- match: kEnumerableProperty,
- has: kEnumerableProperty,
- open: kEnumerableProperty,
- delete: kEnumerableProperty,
- keys: kEnumerableProperty
-})
+function parseLocation (statusCode, headers) {
+ if (redirectableStatusCodes.indexOf(statusCode) === -1) {
+ return null
+ }
-module.exports = {
- CacheStorage
+ for (let i = 0; i < headers.length; i += 2) {
+ if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {
+ return headers[i + 1]
+ }
+ }
}
+// https://tools.ietf.org/html/rfc7231#section-6.4.4
+function shouldRemoveHeader (header, removeContent, unknownOrigin) {
+ if (header.length === 4) {
+ return util.headerNameToString(header) === 'host'
+ }
+ if (removeContent && util.headerNameToString(header).startsWith('content-')) {
+ return true
+ }
+ if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
+ const name = util.headerNameToString(header)
+ return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
+ }
+ return false
+}
-/***/ }),
-
-/***/ 9174:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-module.exports = {
- kConstruct: (__nccwpck_require__(2785).kConstruct)
+// https://tools.ietf.org/html/rfc7231#section-6.4
+function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
+ const ret = []
+ if (Array.isArray(headers)) {
+ for (let i = 0; i < headers.length; i += 2) {
+ if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
+ ret.push(headers[i], headers[i + 1])
+ }
+ }
+ } else if (headers && typeof headers === 'object') {
+ for (const key of Object.keys(headers)) {
+ if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
+ ret.push(key, headers[key])
+ }
+ }
+ } else {
+ assert(headers == null, 'headers must be an object or an array')
+ }
+ return ret
}
+module.exports = RedirectHandler
+
/***/ }),
-/***/ 2396:
+/***/ 7816:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const assert = __nccwpck_require__(9491)
-const { URLSerializer } = __nccwpck_require__(685)
-const { isValidHeaderName } = __nccwpck_require__(2538)
-/**
- * @see https://url.spec.whatwg.org/#concept-url-equals
- * @param {URL} A
- * @param {URL} B
- * @param {boolean | undefined} excludeFragment
- * @returns {boolean}
- */
-function urlEquals (A, B, excludeFragment = false) {
- const serializedA = URLSerializer(A, excludeFragment)
+const assert = __nccwpck_require__(4589)
- const serializedB = URLSerializer(B, excludeFragment)
+const { kRetryHandlerDefaultRetry } = __nccwpck_require__(6443)
+const { RequestRetryError } = __nccwpck_require__(8707)
+const {
+ isDisturbed,
+ parseHeaders,
+ parseRangeHeader,
+ wrapRequestBody
+} = __nccwpck_require__(3440)
- return serializedA === serializedB
+function calculateRetryAfterHeader (retryAfter) {
+ const current = Date.now()
+ return new Date(retryAfter).getTime() - current
}
-/**
- * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
- * @param {string} header
- */
-function fieldValues (header) {
- assert(header !== null)
-
- const values = []
-
- for (let value of header.split(',')) {
- value = value.trim()
+class RetryHandler {
+ constructor (opts, handlers) {
+ const { retryOptions, ...dispatchOpts } = opts
+ const {
+ // Retry scoped
+ retry: retryFn,
+ maxRetries,
+ maxTimeout,
+ minTimeout,
+ timeoutFactor,
+ // Response scoped
+ methods,
+ errorCodes,
+ retryAfter,
+ statusCodes
+ } = retryOptions ?? {}
- if (!value.length) {
- continue
- } else if (!isValidHeaderName(value)) {
- continue
+ this.dispatch = handlers.dispatch
+ this.handler = handlers.handler
+ this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }
+ this.abort = null
+ this.aborted = false
+ this.retryOpts = {
+ retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
+ retryAfter: retryAfter ?? true,
+ maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
+ minTimeout: minTimeout ?? 500, // .5s
+ timeoutFactor: timeoutFactor ?? 2,
+ maxRetries: maxRetries ?? 5,
+ // What errors we should retry
+ methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
+ // Indicates which errors to retry
+ statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
+ // List of errors to retry
+ errorCodes: errorCodes ?? [
+ 'ECONNRESET',
+ 'ECONNREFUSED',
+ 'ENOTFOUND',
+ 'ENETDOWN',
+ 'ENETUNREACH',
+ 'EHOSTDOWN',
+ 'EHOSTUNREACH',
+ 'EPIPE',
+ 'UND_ERR_SOCKET'
+ ]
}
- values.push(value)
+ this.retryCount = 0
+ this.retryCountCheckpoint = 0
+ this.start = 0
+ this.end = null
+ this.etag = null
+ this.resume = null
+
+ // Handle possible onConnect duplication
+ this.handler.onConnect(reason => {
+ this.aborted = true
+ if (this.abort) {
+ this.abort(reason)
+ } else {
+ this.reason = reason
+ }
+ })
}
- return values
-}
+ onRequestSent () {
+ if (this.handler.onRequestSent) {
+ this.handler.onRequestSent()
+ }
+ }
-module.exports = {
- urlEquals,
- fieldValues
-}
+ onUpgrade (statusCode, headers, socket) {
+ if (this.handler.onUpgrade) {
+ this.handler.onUpgrade(statusCode, headers, socket)
+ }
+ }
+ onConnect (abort) {
+ if (this.aborted) {
+ abort(this.reason)
+ } else {
+ this.abort = abort
+ }
+ }
-/***/ }),
+ onBodySent (chunk) {
+ if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
+ }
-/***/ 3598:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
+ const { statusCode, code, headers } = err
+ const { method, retryOptions } = opts
+ const {
+ maxRetries,
+ minTimeout,
+ maxTimeout,
+ timeoutFactor,
+ statusCodes,
+ errorCodes,
+ methods
+ } = retryOptions
+ const { counter } = state
-"use strict";
-// @ts-check
+ // Any code that is not a Undici's originated and allowed to retry
+ if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {
+ cb(err)
+ return
+ }
+ // If a set of method are provided and the current method is not in the list
+ if (Array.isArray(methods) && !methods.includes(method)) {
+ cb(err)
+ return
+ }
+ // If a set of status code are provided and the current status code is not in the list
+ if (
+ statusCode != null &&
+ Array.isArray(statusCodes) &&
+ !statusCodes.includes(statusCode)
+ ) {
+ cb(err)
+ return
+ }
-/* global WebAssembly */
+ // If we reached the max number of retries
+ if (counter > maxRetries) {
+ cb(err)
+ return
+ }
-const assert = __nccwpck_require__(9491)
-const net = __nccwpck_require__(1808)
-const http = __nccwpck_require__(3685)
-const { pipeline } = __nccwpck_require__(2781)
-const util = __nccwpck_require__(3983)
-const timers = __nccwpck_require__(9459)
-const Request = __nccwpck_require__(2905)
-const DispatcherBase = __nccwpck_require__(4839)
-const {
- RequestContentLengthMismatchError,
- ResponseContentLengthMismatchError,
- InvalidArgumentError,
- RequestAbortedError,
- HeadersTimeoutError,
- HeadersOverflowError,
- SocketError,
- InformationalError,
- BodyTimeoutError,
- HTTPParserError,
- ResponseExceededMaxSizeError,
- ClientDestroyedError
-} = __nccwpck_require__(8045)
-const buildConnector = __nccwpck_require__(2067)
-const {
- kUrl,
- kReset,
- kServerName,
- kClient,
- kBusy,
- kParser,
- kConnect,
- kBlocking,
- kResuming,
- kRunning,
- kPending,
- kSize,
- kWriting,
- kQueue,
- kConnected,
- kConnecting,
- kNeedDrain,
- kNoRef,
- kKeepAliveDefaultTimeout,
- kHostHeader,
- kPendingIdx,
- kRunningIdx,
- kError,
- kPipelining,
- kSocket,
- kKeepAliveTimeoutValue,
- kMaxHeadersSize,
- kKeepAliveMaxTimeout,
- kKeepAliveTimeoutThreshold,
- kHeadersTimeout,
- kBodyTimeout,
- kStrictContentLength,
- kConnector,
- kMaxRedirections,
- kMaxRequests,
- kCounter,
- kClose,
- kDestroy,
- kDispatch,
- kInterceptors,
- kLocalAddress,
- kMaxResponseSize,
- kHTTPConnVersion,
- // HTTP2
- kHost,
- kHTTP2Session,
- kHTTP2SessionState,
- kHTTP2BuildRequest,
- kHTTP2CopyHeaders,
- kHTTP1BuildRequest
-} = __nccwpck_require__(2785)
+ let retryAfterHeader = headers?.['retry-after']
+ if (retryAfterHeader) {
+ retryAfterHeader = Number(retryAfterHeader)
+ retryAfterHeader = Number.isNaN(retryAfterHeader)
+ ? calculateRetryAfterHeader(retryAfterHeader)
+ : retryAfterHeader * 1e3 // Retry-After is in seconds
+ }
-/** @type {import('http2')} */
-let http2
-try {
- http2 = __nccwpck_require__(5158)
-} catch {
- // @ts-ignore
- http2 = { constants: {} }
-}
+ const retryTimeout =
+ retryAfterHeader > 0
+ ? Math.min(retryAfterHeader, maxTimeout)
+ : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)
-const {
- constants: {
- HTTP2_HEADER_AUTHORITY,
- HTTP2_HEADER_METHOD,
- HTTP2_HEADER_PATH,
- HTTP2_HEADER_SCHEME,
- HTTP2_HEADER_CONTENT_LENGTH,
- HTTP2_HEADER_EXPECT,
- HTTP2_HEADER_STATUS
+ setTimeout(() => cb(null), retryTimeout)
}
-} = http2
-// Experimental
-let h2ExperimentalWarned = false
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const headers = parseHeaders(rawHeaders)
-const FastBuffer = Buffer[Symbol.species]
+ this.retryCount += 1
-const kClosedResolve = Symbol('kClosedResolve')
+ if (statusCode >= 300) {
+ if (this.retryOpts.statusCodes.includes(statusCode) === false) {
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ } else {
+ this.abort(
+ new RequestRetryError('Request failed', statusCode, {
+ headers,
+ data: {
+ count: this.retryCount
+ }
+ })
+ )
+ return false
+ }
+ }
-const channels = {}
+ // Checkpoint for resume from where we left it
+ if (this.resume != null) {
+ this.resume = null
-try {
- const diagnosticsChannel = __nccwpck_require__(7643)
- channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
- channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
- channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
- channels.connected = diagnosticsChannel.channel('undici:client:connected')
-} catch {
- channels.sendHeaders = { hasSubscribers: false }
- channels.beforeConnect = { hasSubscribers: false }
- channels.connectError = { hasSubscribers: false }
- channels.connected = { hasSubscribers: false }
-}
+ // Only Partial Content 206 supposed to provide Content-Range,
+ // any other status code that partially consumed the payload
+ // should not be retry because it would result in downstream
+ // wrongly concatanete multiple responses.
+ if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {
+ this.abort(
+ new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
-/**
- * @type {import('../types/client').default}
- */
-class Client extends DispatcherBase {
- /**
- *
- * @param {string|URL} url
- * @param {import('../types/client').Client.Options} options
- */
- constructor (url, {
- interceptors,
- maxHeaderSize,
- headersTimeout,
- socketTimeout,
- requestTimeout,
- connectTimeout,
- bodyTimeout,
- idleTimeout,
- keepAlive,
- keepAliveTimeout,
- maxKeepAliveTimeout,
- keepAliveMaxTimeout,
- keepAliveTimeoutThreshold,
- socketPath,
- pipelining,
- tls,
- strictContentLength,
- maxCachedSessions,
- maxRedirections,
- connect,
- maxRequestsPerClient,
- localAddress,
- maxResponseSize,
- autoSelectFamily,
- autoSelectFamilyAttemptTimeout,
- // h2
- allowH2,
- maxConcurrentStreams
- } = {}) {
- super()
+ const contentRange = parseRangeHeader(headers['content-range'])
+ // If no content range
+ if (!contentRange) {
+ this.abort(
+ new RequestRetryError('Content-Range mismatch', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
- if (keepAlive !== undefined) {
- throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
- }
+ // Let's start with a weak etag check
+ if (this.etag != null && this.etag !== headers.etag) {
+ this.abort(
+ new RequestRetryError('ETag mismatch', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
- if (socketTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
- }
+ const { start, size, end = size - 1 } = contentRange
- if (requestTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
- }
+ assert(this.start === start, 'content-range mismatch')
+ assert(this.end == null || this.end === end, 'content-range mismatch')
- if (idleTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
+ this.resume = resume
+ return true
}
- if (maxKeepAliveTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
- }
+ if (this.end == null) {
+ if (statusCode === 206) {
+ // First time we receive 206
+ const range = parseRangeHeader(headers['content-range'])
- if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
- throw new InvalidArgumentError('invalid maxHeaderSize')
- }
+ if (range == null) {
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ }
- if (socketPath != null && typeof socketPath !== 'string') {
- throw new InvalidArgumentError('invalid socketPath')
- }
+ const { start, size, end = size - 1 } = range
+ assert(
+ start != null && Number.isFinite(start),
+ 'content-range mismatch'
+ )
+ assert(end != null && Number.isFinite(end), 'invalid content-length')
- if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
- throw new InvalidArgumentError('invalid connectTimeout')
- }
+ this.start = start
+ this.end = end
+ }
- if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
- throw new InvalidArgumentError('invalid keepAliveTimeout')
- }
+ // We make our best to checkpoint the body for further range headers
+ if (this.end == null) {
+ const contentLength = headers['content-length']
+ this.end = contentLength != null ? Number(contentLength) - 1 : null
+ }
- if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
- throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
- }
+ assert(Number.isFinite(this.start))
+ assert(
+ this.end == null || Number.isFinite(this.end),
+ 'invalid content-length'
+ )
- if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
- throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
- }
+ this.resume = resume
+ this.etag = headers.etag != null ? headers.etag : null
- if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
- throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
- }
+ // Weak etags are not useful for comparison nor cache
+ // for instance not safe to assume if the response is byte-per-byte
+ // equal
+ if (this.etag != null && this.etag.startsWith('W/')) {
+ this.etag = null
+ }
- if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
- throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
}
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
- }
+ const err = new RequestRetryError('Request failed', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
- if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
- }
+ this.abort(err)
- if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
- throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
- }
+ return false
+ }
- if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
- throw new InvalidArgumentError('localAddress must be valid string IP address')
- }
+ onData (chunk) {
+ this.start += chunk.length
- if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
- throw new InvalidArgumentError('maxResponseSize must be a positive number')
- }
+ return this.handler.onData(chunk)
+ }
- if (
- autoSelectFamilyAttemptTimeout != null &&
- (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
- ) {
- throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
- }
+ onComplete (rawTrailers) {
+ this.retryCount = 0
+ return this.handler.onComplete(rawTrailers)
+ }
- // h2
- if (allowH2 != null && typeof allowH2 !== 'boolean') {
- throw new InvalidArgumentError('allowH2 must be a valid boolean value')
+ onError (err) {
+ if (this.aborted || isDisturbed(this.opts.body)) {
+ return this.handler.onError(err)
}
- if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
- throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
+ // We reconcile in case of a mix between network errors
+ // and server error response
+ if (this.retryCount - this.retryCountCheckpoint > 0) {
+ // We count the difference between the last checkpoint and the current retry count
+ this.retryCount =
+ this.retryCountCheckpoint +
+ (this.retryCount - this.retryCountCheckpoint)
+ } else {
+ this.retryCount += 1
}
- if (typeof connect !== 'function') {
- connect = buildConnector({
- ...tls,
- maxCachedSessions,
- allowH2,
- socketPath,
- timeout: connectTimeout,
- ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
- ...connect
- })
- }
+ this.retryOpts.retry(
+ err,
+ {
+ state: { counter: this.retryCount },
+ opts: { retryOptions: this.retryOpts, ...this.opts }
+ },
+ onRetry.bind(this)
+ )
- this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
- ? interceptors.Client
- : [createRedirectInterceptor({ maxRedirections })]
- this[kUrl] = util.parseOrigin(url)
- this[kConnector] = connect
- this[kSocket] = null
- this[kPipelining] = pipelining != null ? pipelining : 1
- this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
- this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
- this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
- this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
- this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
- this[kServerName] = null
- this[kLocalAddress] = localAddress != null ? localAddress : null
- this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
- this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
- this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
- this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
- this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
- this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
- this[kMaxRedirections] = maxRedirections
- this[kMaxRequests] = maxRequestsPerClient
- this[kClosedResolve] = null
- this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
- this[kHTTPConnVersion] = 'h1'
+ function onRetry (err) {
+ if (err != null || this.aborted || isDisturbed(this.opts.body)) {
+ return this.handler.onError(err)
+ }
- // HTTP/2
- this[kHTTP2Session] = null
- this[kHTTP2SessionState] = !allowH2
- ? null
- : {
- // streams: null, // Fixed queue of streams - For future support of `push`
- openStreams: 0, // Keep track of them to decide wether or not unref the session
- maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
+ if (this.start !== 0) {
+ const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }
+
+ // Weak etag check - weak etags will make comparison algorithms never match
+ if (this.etag != null) {
+ headers['if-match'] = this.etag
}
- this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
- // kQueue is built up of 3 sections separated by
- // the kRunningIdx and kPendingIdx indices.
- // | complete | running | pending |
- // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
- // kRunningIdx points to the first running element.
- // kPendingIdx points to the first pending element.
- // This implements a fast queue with an amortized
- // time of O(1).
+ this.opts = {
+ ...this.opts,
+ headers: {
+ ...this.opts.headers,
+ ...headers
+ }
+ }
+ }
- this[kQueue] = []
- this[kRunningIdx] = 0
- this[kPendingIdx] = 0
+ try {
+ this.retryCountCheckpoint = this.retryCount
+ this.dispatch(this.opts, this)
+ } catch (err) {
+ this.handler.onError(err)
+ }
+ }
}
+}
- get pipelining () {
- return this[kPipelining]
- }
+module.exports = RetryHandler
- set pipelining (value) {
- this[kPipelining] = value
- resume(this, true)
- }
- get [kPending] () {
- return this[kQueue].length - this[kPendingIdx]
- }
+/***/ }),
- get [kRunning] () {
- return this[kPendingIdx] - this[kRunningIdx]
- }
+/***/ 379:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- get [kSize] () {
- return this[kQueue].length - this[kRunningIdx]
- }
- get [kConnected] () {
- return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
- }
+const { isIP } = __nccwpck_require__(7030)
+const { lookup } = __nccwpck_require__(610)
+const DecoratorHandler = __nccwpck_require__(8155)
+const { InvalidArgumentError, InformationalError } = __nccwpck_require__(8707)
+const maxInt = Math.pow(2, 31) - 1
- get [kBusy] () {
- const socket = this[kSocket]
- return (
- (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
- (this[kSize] >= (this[kPipelining] || 1)) ||
- this[kPending] > 0
- )
- }
+class DNSInstance {
+ #maxTTL = 0
+ #maxItems = 0
+ #records = new Map()
+ dualStack = true
+ affinity = null
+ lookup = null
+ pick = null
- /* istanbul ignore: only used for test */
- [kConnect] (cb) {
- connect(this)
- this.once('connect', cb)
+ constructor (opts) {
+ this.#maxTTL = opts.maxTTL
+ this.#maxItems = opts.maxItems
+ this.dualStack = opts.dualStack
+ this.affinity = opts.affinity
+ this.lookup = opts.lookup ?? this.#defaultLookup
+ this.pick = opts.pick ?? this.#defaultPick
}
- [kDispatch] (opts, handler) {
- const origin = opts.origin || this[kUrl].origin
+ get full () {
+ return this.#records.size === this.#maxItems
+ }
- const request = this[kHTTPConnVersion] === 'h2'
- ? Request[kHTTP2BuildRequest](origin, opts, handler)
- : Request[kHTTP1BuildRequest](origin, opts, handler)
+ runLookup (origin, opts, cb) {
+ const ips = this.#records.get(origin.hostname)
- this[kQueue].push(request)
- if (this[kResuming]) {
- // Do nothing.
- } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
- // Wait a tick in case stream/iterator is ended in the same tick.
- this[kResuming] = 1
- process.nextTick(resume, this)
- } else {
- resume(this, true)
+ // If full, we just return the origin
+ if (ips == null && this.full) {
+ cb(null, origin.origin)
+ return
}
- if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
- this[kNeedDrain] = 2
+ const newOpts = {
+ affinity: this.affinity,
+ dualStack: this.dualStack,
+ lookup: this.lookup,
+ pick: this.pick,
+ ...opts.dns,
+ maxTTL: this.#maxTTL,
+ maxItems: this.#maxItems
}
- return this[kNeedDrain] < 2
- }
+ // If no IPs we lookup
+ if (ips == null) {
+ this.lookup(origin, newOpts, (err, addresses) => {
+ if (err || addresses == null || addresses.length === 0) {
+ cb(err ?? new InformationalError('No DNS entries found'))
+ return
+ }
- async [kClose] () {
- // TODO: for H2 we need to gracefully flush the remaining enqueued
- // request and close each stream.
- return new Promise((resolve) => {
- if (!this[kSize]) {
- resolve(null)
- } else {
- this[kClosedResolve] = resolve
- }
- })
- }
+ this.setRecords(origin, addresses)
+ const records = this.#records.get(origin.hostname)
- async [kDestroy] (err) {
- return new Promise((resolve) => {
- const requests = this[kQueue].splice(this[kPendingIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(this, request, err)
- }
+ const ip = this.pick(
+ origin,
+ records,
+ newOpts.affinity
+ )
- const callback = () => {
- if (this[kClosedResolve]) {
- // TODO (fix): Should we error here with ClientDestroyedError?
- this[kClosedResolve]()
- this[kClosedResolve] = null
+ let port
+ if (typeof ip.port === 'number') {
+ port = `:${ip.port}`
+ } else if (origin.port !== '') {
+ port = `:${origin.port}`
+ } else {
+ port = ''
}
- resolve()
- }
- if (this[kHTTP2Session] != null) {
- util.destroy(this[kHTTP2Session], err)
- this[kHTTP2Session] = null
- this[kHTTP2SessionState] = null
+ cb(
+ null,
+ `${origin.protocol}//${
+ ip.family === 6 ? `[${ip.address}]` : ip.address
+ }${port}`
+ )
+ })
+ } else {
+ // If there's IPs we pick
+ const ip = this.pick(
+ origin,
+ ips,
+ newOpts.affinity
+ )
+
+ // If no IPs we lookup - deleting old records
+ if (ip == null) {
+ this.#records.delete(origin.hostname)
+ this.runLookup(origin, opts, cb)
+ return
}
- if (!this[kSocket]) {
- queueMicrotask(callback)
+ let port
+ if (typeof ip.port === 'number') {
+ port = `:${ip.port}`
+ } else if (origin.port !== '') {
+ port = `:${origin.port}`
} else {
- util.destroy(this[kSocket].on('close', callback), err)
+ port = ''
}
- resume(this)
- })
+ cb(
+ null,
+ `${origin.protocol}//${
+ ip.family === 6 ? `[${ip.address}]` : ip.address
+ }${port}`
+ )
+ }
}
-}
-
-function onHttp2SessionError (err) {
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- this[kSocket][kError] = err
+ #defaultLookup (origin, opts, cb) {
+ lookup(
+ origin.hostname,
+ {
+ all: true,
+ family: this.dualStack === false ? this.affinity : 0,
+ order: 'ipv4first'
+ },
+ (err, addresses) => {
+ if (err) {
+ return cb(err)
+ }
- onError(this[kClient], err)
-}
+ const results = new Map()
-function onHttp2FrameError (type, code, id) {
- const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
+ for (const addr of addresses) {
+ // On linux we found duplicates, we attempt to remove them with
+ // the latest record
+ results.set(`${addr.address}:${addr.family}`, addr)
+ }
- if (id === 0) {
- this[kSocket][kError] = err
- onError(this[kClient], err)
+ cb(null, results.values())
+ }
+ )
}
-}
-function onHttp2SessionEnd () {
- util.destroy(this, new SocketError('other side closed'))
- util.destroy(this[kSocket], new SocketError('other side closed'))
-}
+ #defaultPick (origin, hostnameRecords, affinity) {
+ let ip = null
+ const { records, offset } = hostnameRecords
-function onHTTP2GoAway (code) {
- const client = this[kClient]
- const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
- client[kSocket] = null
- client[kHTTP2Session] = null
+ let family
+ if (this.dualStack) {
+ if (affinity == null) {
+ // Balance between ip families
+ if (offset == null || offset === maxInt) {
+ hostnameRecords.offset = 0
+ affinity = 4
+ } else {
+ hostnameRecords.offset++
+ affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4
+ }
+ }
- if (client.destroyed) {
- assert(this[kPending] === 0)
+ if (records[affinity] != null && records[affinity].ips.length > 0) {
+ family = records[affinity]
+ } else {
+ family = records[affinity === 4 ? 6 : 4]
+ }
+ } else {
+ family = records[affinity]
+ }
- // Fail entire queue.
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(this, request, err)
+ // If no IPs we return null
+ if (family == null || family.ips.length === 0) {
+ return ip
+ }
+
+ if (family.offset == null || family.offset === maxInt) {
+ family.offset = 0
+ } else {
+ family.offset++
+ }
+
+ const position = family.offset % family.ips.length
+ ip = family.ips[position] ?? null
+
+ if (ip == null) {
+ return ip
+ }
+
+ if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms
+ // We delete expired records
+ // It is possible that they have different TTL, so we manage them individually
+ family.ips.splice(position, 1)
+ return this.pick(origin, hostnameRecords, affinity)
}
- } else if (client[kRunning] > 0) {
- // Fail head of pipeline.
- const request = client[kQueue][client[kRunningIdx]]
- client[kQueue][client[kRunningIdx]++] = null
- errorRequest(client, request, err)
+ return ip
}
- client[kPendingIdx] = client[kRunningIdx]
+ setRecords (origin, addresses) {
+ const timestamp = Date.now()
+ const records = { records: { 4: null, 6: null } }
+ for (const record of addresses) {
+ record.timestamp = timestamp
+ if (typeof record.ttl === 'number') {
+ // The record TTL is expected to be in ms
+ record.ttl = Math.min(record.ttl, this.#maxTTL)
+ } else {
+ record.ttl = this.#maxTTL
+ }
- assert(client[kRunning] === 0)
+ const familyRecords = records.records[record.family] ?? { ips: [] }
- client.emit('disconnect',
- client[kUrl],
- [client],
- err
- )
+ familyRecords.ips.push(record)
+ records.records[record.family] = familyRecords
+ }
- resume(client)
+ this.#records.set(origin.hostname, records)
+ }
+
+ getHandler (meta, opts) {
+ return new DNSDispatchHandler(this, meta, opts)
+ }
}
-const constants = __nccwpck_require__(953)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-const EMPTY_BUF = Buffer.alloc(0)
+class DNSDispatchHandler extends DecoratorHandler {
+ #state = null
+ #opts = null
+ #dispatch = null
+ #handler = null
+ #origin = null
-async function lazyllhttp () {
- const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
+ constructor (state, { origin, handler, dispatch }, opts) {
+ super(handler)
+ this.#origin = origin
+ this.#handler = handler
+ this.#opts = { ...opts }
+ this.#state = state
+ this.#dispatch = dispatch
+ }
- let mod
- try {
- mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
- } catch (e) {
- /* istanbul ignore next */
+ onError (err) {
+ switch (err.code) {
+ case 'ETIMEDOUT':
+ case 'ECONNREFUSED': {
+ if (this.#state.dualStack) {
+ // We delete the record and retry
+ this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {
+ if (err) {
+ return this.#handler.onError(err)
+ }
- // We could check if the error was caused by the simd option not
- // being enabled, but the occurring of this other error
- // * https://github.com/emscripten-core/emscripten/issues/11495
- // got me to remove that check to avoid breaking Node 12.
- mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
- }
+ const dispatchOpts = {
+ ...this.#opts,
+ origin: newOrigin
+ }
- return await WebAssembly.instantiate(mod, {
- env: {
- /* eslint-disable camelcase */
+ this.#dispatch(dispatchOpts, this)
+ })
- wasm_on_url: (p, at, len) => {
- /* istanbul ignore next */
- return 0
- },
- wasm_on_status: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_message_begin: (p) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onMessageBegin() || 0
- },
- wasm_on_header_field: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_header_value: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
- },
- wasm_on_body: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_message_complete: (p) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onMessageComplete() || 0
- }
+ // if dual-stack disabled, we error out
+ return
+ }
- /* eslint-enable camelcase */
+ this.#handler.onError(err)
+ return
+ }
+ case 'ENOTFOUND':
+ this.#state.deleteRecord(this.#origin)
+ // eslint-disable-next-line no-fallthrough
+ default:
+ this.#handler.onError(err)
+ break
}
- })
+ }
}
-let llhttpInstance = null
-let llhttpPromise = lazyllhttp()
-llhttpPromise.catch()
-
-let currentParser = null
-let currentBufferRef = null
-let currentBufferSize = 0
-let currentBufferPtr = null
+module.exports = interceptorOpts => {
+ if (
+ interceptorOpts?.maxTTL != null &&
+ (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)
+ ) {
+ throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')
+ }
-const TIMEOUT_HEADERS = 1
-const TIMEOUT_BODY = 2
-const TIMEOUT_IDLE = 3
+ if (
+ interceptorOpts?.maxItems != null &&
+ (typeof interceptorOpts?.maxItems !== 'number' ||
+ interceptorOpts?.maxItems < 1)
+ ) {
+ throw new InvalidArgumentError(
+ 'Invalid maxItems. Must be a positive number and greater than zero'
+ )
+ }
-class Parser {
- constructor (client, socket, { exports }) {
- assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
+ if (
+ interceptorOpts?.affinity != null &&
+ interceptorOpts?.affinity !== 4 &&
+ interceptorOpts?.affinity !== 6
+ ) {
+ throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')
+ }
- this.llhttp = exports
- this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
- this.client = client
- this.socket = socket
- this.timeout = null
- this.timeoutValue = null
- this.timeoutType = null
- this.statusCode = null
- this.statusText = ''
- this.upgrade = false
- this.headers = []
- this.headersSize = 0
- this.headersMaxSize = client[kMaxHeadersSize]
- this.shouldKeepAlive = false
- this.paused = false
- this.resume = this.resume.bind(this)
+ if (
+ interceptorOpts?.dualStack != null &&
+ typeof interceptorOpts?.dualStack !== 'boolean'
+ ) {
+ throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')
+ }
- this.bytesRead = 0
+ if (
+ interceptorOpts?.lookup != null &&
+ typeof interceptorOpts?.lookup !== 'function'
+ ) {
+ throw new InvalidArgumentError('Invalid lookup. Must be a function')
+ }
- this.keepAlive = ''
- this.contentLength = ''
- this.connection = ''
- this.maxResponseSize = client[kMaxResponseSize]
+ if (
+ interceptorOpts?.pick != null &&
+ typeof interceptorOpts?.pick !== 'function'
+ ) {
+ throw new InvalidArgumentError('Invalid pick. Must be a function')
}
- setTimeout (value, type) {
- this.timeoutType = type
- if (value !== this.timeoutValue) {
- timers.clearTimeout(this.timeout)
- if (value) {
- this.timeout = timers.setTimeout(onParserTimeout, value, this)
- // istanbul ignore else: only for jest
- if (this.timeout.unref) {
- this.timeout.unref()
- }
- } else {
- this.timeout = null
- }
- this.timeoutValue = value
- } else if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
+ const dualStack = interceptorOpts?.dualStack ?? true
+ let affinity
+ if (dualStack) {
+ affinity = interceptorOpts?.affinity ?? null
+ } else {
+ affinity = interceptorOpts?.affinity ?? 4
}
- resume () {
- if (this.socket.destroyed || !this.paused) {
- return
- }
+ const opts = {
+ maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms
+ lookup: interceptorOpts?.lookup ?? null,
+ pick: interceptorOpts?.pick ?? null,
+ dualStack,
+ affinity,
+ maxItems: interceptorOpts?.maxItems ?? Infinity
+ }
- assert(this.ptr != null)
- assert(currentParser == null)
+ const instance = new DNSInstance(opts)
- this.llhttp.llhttp_resume(this.ptr)
+ return dispatch => {
+ return function dnsInterceptor (origDispatchOpts, handler) {
+ const origin =
+ origDispatchOpts.origin.constructor === URL
+ ? origDispatchOpts.origin
+ : new URL(origDispatchOpts.origin)
- assert(this.timeoutType === TIMEOUT_BODY)
- if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
+ if (isIP(origin.hostname) !== 0) {
+ return dispatch(origDispatchOpts, handler)
}
- }
- this.paused = false
- this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
- this.readMore()
- }
+ instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {
+ if (err) {
+ return handler.onError(err)
+ }
- readMore () {
- while (!this.paused && this.ptr) {
- const chunk = this.socket.read()
- if (chunk === null) {
- break
- }
- this.execute(chunk)
+ let dispatchOpts = null
+ dispatchOpts = {
+ ...origDispatchOpts,
+ servername: origin.hostname, // For SNI on TLS
+ origin: newOrigin,
+ headers: {
+ host: origin.hostname,
+ ...origDispatchOpts.headers
+ }
+ }
+
+ dispatch(
+ dispatchOpts,
+ instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)
+ )
+ })
+
+ return true
}
}
+}
- execute (data) {
- assert(this.ptr != null)
- assert(currentParser == null)
- assert(!this.paused)
- const { socket, llhttp } = this
+/***/ }),
- if (data.length > currentBufferSize) {
- if (currentBufferPtr) {
- llhttp.free(currentBufferPtr)
- }
- currentBufferSize = Math.ceil(data.length / 4096) * 4096
- currentBufferPtr = llhttp.malloc(currentBufferSize)
- }
+/***/ 8060:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
- // Call `execute` on the wasm parser.
- // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
- // and finally the length of bytes to parse.
- // The return value is an error code or `constants.ERROR.OK`.
- try {
- let ret
- try {
- currentBufferRef = data
- currentParser = this
- ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
- /* eslint-disable-next-line no-useless-catch */
- } catch (err) {
- /* istanbul ignore next: difficult to make a test case for */
- throw err
- } finally {
- currentParser = null
- currentBufferRef = null
- }
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707)
+const DecoratorHandler = __nccwpck_require__(8155)
- const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
+class DumpHandler extends DecoratorHandler {
+ #maxSize = 1024 * 1024
+ #abort = null
+ #dumped = false
+ #aborted = false
+ #size = 0
+ #reason = null
+ #handler = null
- if (ret === constants.ERROR.PAUSED_UPGRADE) {
- this.onUpgrade(data.slice(offset))
- } else if (ret === constants.ERROR.PAUSED) {
- this.paused = true
- socket.unshift(data.slice(offset))
- } else if (ret !== constants.ERROR.OK) {
- const ptr = llhttp.llhttp_get_error_reason(this.ptr)
- let message = ''
- /* istanbul ignore else: difficult to make a test case for */
- if (ptr) {
- const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
- message =
- 'Response does not match the HTTP/1.1 protocol (' +
- Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
- ')'
- }
- throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
- }
- } catch (err) {
- util.destroy(socket, err)
- }
- }
+ constructor ({ maxSize }, handler) {
+ super(handler)
- destroy () {
- assert(this.ptr != null)
- assert(currentParser == null)
+ if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {
+ throw new InvalidArgumentError('maxSize must be a number greater than 0')
+ }
- this.llhttp.llhttp_free(this.ptr)
- this.ptr = null
+ this.#maxSize = maxSize ?? this.#maxSize
+ this.#handler = handler
+ }
- timers.clearTimeout(this.timeout)
- this.timeout = null
- this.timeoutValue = null
- this.timeoutType = null
+ onConnect (abort) {
+ this.#abort = abort
- this.paused = false
+ this.#handler.onConnect(this.#customAbort.bind(this))
}
- onStatus (buf) {
- this.statusText = buf.toString()
+ #customAbort (reason) {
+ this.#aborted = true
+ this.#reason = reason
}
- onMessageBegin () {
- const { socket, client } = this
+ // TODO: will require adjustment after new hooks are out
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const headers = util.parseHeaders(rawHeaders)
+ const contentLength = headers['content-length']
+
+ if (contentLength != null && contentLength > this.#maxSize) {
+ throw new RequestAbortedError(
+ `Response size (${contentLength}) larger than maxSize (${
+ this.#maxSize
+ })`
+ )
+ }
- /* istanbul ignore next: difficult to make a test case for */
- if (socket.destroyed) {
- return -1
+ if (this.#aborted) {
+ return true
}
- const request = client[kQueue][client[kRunningIdx]]
- if (!request) {
- return -1
+ return this.#handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ }
+
+ onError (err) {
+ if (this.#dumped) {
+ return
}
+
+ err = this.#reason ?? err
+
+ this.#handler.onError(err)
}
- onHeaderField (buf) {
- const len = this.headers.length
+ onData (chunk) {
+ this.#size = this.#size + chunk.length
- if ((len & 1) === 0) {
- this.headers.push(buf)
- } else {
- this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ if (this.#size >= this.#maxSize) {
+ this.#dumped = true
+
+ if (this.#aborted) {
+ this.#handler.onError(this.#reason)
+ } else {
+ this.#handler.onComplete([])
+ }
}
- this.trackHeader(buf.length)
+ return true
}
- onHeaderValue (buf) {
- let len = this.headers.length
-
- if ((len & 1) === 1) {
- this.headers.push(buf)
- len += 1
- } else {
- this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ onComplete (trailers) {
+ if (this.#dumped) {
+ return
}
- const key = this.headers[len - 2]
- if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
- this.keepAlive += buf.toString()
- } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
- this.connection += buf.toString()
- } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
- this.contentLength += buf.toString()
+ if (this.#aborted) {
+ this.#handler.onError(this.reason)
+ return
}
- this.trackHeader(buf.length)
+ this.#handler.onComplete(trailers)
}
+}
- trackHeader (len) {
- this.headersSize += len
- if (this.headersSize >= this.headersMaxSize) {
- util.destroy(this.socket, new HeadersOverflowError())
- }
+function createDumpInterceptor (
+ { maxSize: defaultMaxSize } = {
+ maxSize: 1024 * 1024
}
+) {
+ return dispatch => {
+ return function Intercept (opts, handler) {
+ const { dumpMaxSize = defaultMaxSize } =
+ opts
- onUpgrade (head) {
- const { upgrade, client, socket, headers, statusCode } = this
+ const dumpHandler = new DumpHandler(
+ { maxSize: dumpMaxSize },
+ handler
+ )
- assert(upgrade)
+ return dispatch(opts, dumpHandler)
+ }
+ }
+}
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
+module.exports = createDumpInterceptor
- assert(!socket.destroyed)
- assert(socket === client[kSocket])
- assert(!this.paused)
- assert(request.upgrade || request.method === 'CONNECT')
- this.statusCode = null
- this.statusText = ''
- this.shouldKeepAlive = null
+/***/ }),
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
+/***/ 5092:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- socket.unshift(head)
- socket[kParser].destroy()
- socket[kParser] = null
- socket[kClient] = null
- socket[kError] = null
- socket
- .removeListener('error', onSocketError)
- .removeListener('readable', onSocketReadable)
- .removeListener('end', onSocketEnd)
- .removeListener('close', onSocketClose)
+const RedirectHandler = __nccwpck_require__(8754)
+
+function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
+ return (dispatch) => {
+ return function Intercept (opts, handler) {
+ const { maxRedirections = defaultMaxRedirections } = opts
- client[kSocket] = null
- client[kQueue][client[kRunningIdx]++] = null
- client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
+ if (!maxRedirections) {
+ return dispatch(opts, handler)
+ }
- try {
- request.onUpgrade(statusCode, headers, socket)
- } catch (err) {
- util.destroy(socket, err)
+ const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
+ opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
+ return dispatch(opts, redirectHandler)
}
-
- resume(client)
}
+}
- onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
- const { client, socket, headers, statusText } = this
+module.exports = createRedirectInterceptor
- /* istanbul ignore next: difficult to make a test case for */
- if (socket.destroyed) {
- return -1
- }
- const request = client[kQueue][client[kRunningIdx]]
+/***/ }),
- /* istanbul ignore next: difficult to make a test case for */
- if (!request) {
- return -1
- }
+/***/ 1514:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- assert(!this.upgrade)
- assert(this.statusCode < 200)
- if (statusCode === 100) {
- util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
- return -1
- }
+const RedirectHandler = __nccwpck_require__(8754)
- /* this can only happen if server is misbehaving */
- if (upgrade && !request.upgrade) {
- util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
- return -1
- }
+module.exports = opts => {
+ const globalMaxRedirections = opts?.maxRedirections
+ return dispatch => {
+ return function redirectInterceptor (opts, handler) {
+ const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts
- assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
+ if (!maxRedirections) {
+ return dispatch(opts, handler)
+ }
- this.statusCode = statusCode
- this.shouldKeepAlive = (
- shouldKeepAlive ||
- // Override llhttp value which does not allow keepAlive for HEAD.
- (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
- )
+ const redirectHandler = new RedirectHandler(
+ dispatch,
+ maxRedirections,
+ opts,
+ handler
+ )
- if (this.statusCode >= 200) {
- const bodyTimeout = request.bodyTimeout != null
- ? request.bodyTimeout
- : client[kBodyTimeout]
- this.setTimeout(bodyTimeout, TIMEOUT_BODY)
- } else if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
+ return dispatch(baseOpts, redirectHandler)
}
+ }
+}
- if (request.method === 'CONNECT') {
- assert(client[kRunning] === 1)
- this.upgrade = true
- return 2
- }
- if (upgrade) {
- assert(client[kRunning] === 1)
- this.upgrade = true
- return 2
- }
+/***/ }),
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
+/***/ 2026:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (this.shouldKeepAlive && client[kPipelining]) {
- const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
- if (keepAliveTimeout != null) {
- const timeout = Math.min(
- keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
- client[kKeepAliveMaxTimeout]
+const RetryHandler = __nccwpck_require__(7816)
+
+module.exports = globalOpts => {
+ return dispatch => {
+ return function retryInterceptor (opts, handler) {
+ return dispatch(
+ opts,
+ new RetryHandler(
+ { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },
+ {
+ handler,
+ dispatch
+ }
)
- if (timeout <= 0) {
- socket[kReset] = true
- } else {
- client[kKeepAliveTimeoutValue] = timeout
- }
- } else {
- client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
- }
- } else {
- // Stop more requests from being dispatched.
- socket[kReset] = true
+ )
}
+ }
+}
- const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
- if (request.aborted) {
- return -1
- }
+/***/ }),
- if (request.method === 'HEAD') {
- return 1
- }
+/***/ 2824:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
- if (statusCode < 200) {
- return 1
- }
- if (socket[kBlocking]) {
- socket[kBlocking] = false
- resume(client)
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
+const utils_1 = __nccwpck_require__(172);
+// C headers
+var ERROR;
+(function (ERROR) {
+ ERROR[ERROR["OK"] = 0] = "OK";
+ ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
+ ERROR[ERROR["STRICT"] = 2] = "STRICT";
+ ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
+ ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
+ ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
+ ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
+ ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
+ ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
+ ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
+ ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
+ ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
+ ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
+ ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
+ ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
+ ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
+ ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
+ ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
+ ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
+ ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
+ ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
+ ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
+ ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
+ ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
+ ERROR[ERROR["USER"] = 24] = "USER";
+})(ERROR = exports.ERROR || (exports.ERROR = {}));
+var TYPE;
+(function (TYPE) {
+ TYPE[TYPE["BOTH"] = 0] = "BOTH";
+ TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
+ TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
+})(TYPE = exports.TYPE || (exports.TYPE = {}));
+var FLAGS;
+(function (FLAGS) {
+ FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
+ FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
+ FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
+ FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
+ FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
+ FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
+ FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
+ FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
+ // 1 << 8 is unused
+ FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
+})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
+var LENIENT_FLAGS;
+(function (LENIENT_FLAGS) {
+ LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
+ LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
+ LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
+})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
+var METHODS;
+(function (METHODS) {
+ METHODS[METHODS["DELETE"] = 0] = "DELETE";
+ METHODS[METHODS["GET"] = 1] = "GET";
+ METHODS[METHODS["HEAD"] = 2] = "HEAD";
+ METHODS[METHODS["POST"] = 3] = "POST";
+ METHODS[METHODS["PUT"] = 4] = "PUT";
+ /* pathological */
+ METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
+ METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
+ METHODS[METHODS["TRACE"] = 7] = "TRACE";
+ /* WebDAV */
+ METHODS[METHODS["COPY"] = 8] = "COPY";
+ METHODS[METHODS["LOCK"] = 9] = "LOCK";
+ METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
+ METHODS[METHODS["MOVE"] = 11] = "MOVE";
+ METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
+ METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
+ METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
+ METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
+ METHODS[METHODS["BIND"] = 16] = "BIND";
+ METHODS[METHODS["REBIND"] = 17] = "REBIND";
+ METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
+ METHODS[METHODS["ACL"] = 19] = "ACL";
+ /* subversion */
+ METHODS[METHODS["REPORT"] = 20] = "REPORT";
+ METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
+ METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
+ METHODS[METHODS["MERGE"] = 23] = "MERGE";
+ /* upnp */
+ METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
+ METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
+ METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
+ METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
+ /* RFC-5789 */
+ METHODS[METHODS["PATCH"] = 28] = "PATCH";
+ METHODS[METHODS["PURGE"] = 29] = "PURGE";
+ /* CalDAV */
+ METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
+ /* RFC-2068, section 19.6.1.2 */
+ METHODS[METHODS["LINK"] = 31] = "LINK";
+ METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
+ /* icecast */
+ METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
+ /* RFC-7540, section 11.6 */
+ METHODS[METHODS["PRI"] = 34] = "PRI";
+ /* RFC-2326 RTSP */
+ METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
+ METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
+ METHODS[METHODS["SETUP"] = 37] = "SETUP";
+ METHODS[METHODS["PLAY"] = 38] = "PLAY";
+ METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
+ METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
+ METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
+ METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
+ METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
+ METHODS[METHODS["RECORD"] = 44] = "RECORD";
+ /* RAOP */
+ METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
+})(METHODS = exports.METHODS || (exports.METHODS = {}));
+exports.METHODS_HTTP = [
+ METHODS.DELETE,
+ METHODS.GET,
+ METHODS.HEAD,
+ METHODS.POST,
+ METHODS.PUT,
+ METHODS.CONNECT,
+ METHODS.OPTIONS,
+ METHODS.TRACE,
+ METHODS.COPY,
+ METHODS.LOCK,
+ METHODS.MKCOL,
+ METHODS.MOVE,
+ METHODS.PROPFIND,
+ METHODS.PROPPATCH,
+ METHODS.SEARCH,
+ METHODS.UNLOCK,
+ METHODS.BIND,
+ METHODS.REBIND,
+ METHODS.UNBIND,
+ METHODS.ACL,
+ METHODS.REPORT,
+ METHODS.MKACTIVITY,
+ METHODS.CHECKOUT,
+ METHODS.MERGE,
+ METHODS['M-SEARCH'],
+ METHODS.NOTIFY,
+ METHODS.SUBSCRIBE,
+ METHODS.UNSUBSCRIBE,
+ METHODS.PATCH,
+ METHODS.PURGE,
+ METHODS.MKCALENDAR,
+ METHODS.LINK,
+ METHODS.UNLINK,
+ METHODS.PRI,
+ // TODO(indutny): should we allow it with HTTP?
+ METHODS.SOURCE,
+];
+exports.METHODS_ICE = [
+ METHODS.SOURCE,
+];
+exports.METHODS_RTSP = [
+ METHODS.OPTIONS,
+ METHODS.DESCRIBE,
+ METHODS.ANNOUNCE,
+ METHODS.SETUP,
+ METHODS.PLAY,
+ METHODS.PAUSE,
+ METHODS.TEARDOWN,
+ METHODS.GET_PARAMETER,
+ METHODS.SET_PARAMETER,
+ METHODS.REDIRECT,
+ METHODS.RECORD,
+ METHODS.FLUSH,
+ // For AirPlay
+ METHODS.GET,
+ METHODS.POST,
+];
+exports.METHOD_MAP = utils_1.enumToMap(METHODS);
+exports.H_METHOD_MAP = {};
+Object.keys(exports.METHOD_MAP).forEach((key) => {
+ if (/^H/.test(key)) {
+ exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
+ }
+});
+var FINISH;
+(function (FINISH) {
+ FINISH[FINISH["SAFE"] = 0] = "SAFE";
+ FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
+ FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
+})(FINISH = exports.FINISH || (exports.FINISH = {}));
+exports.ALPHA = [];
+for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
+ // Upper case
+ exports.ALPHA.push(String.fromCharCode(i));
+ // Lower case
+ exports.ALPHA.push(String.fromCharCode(i + 0x20));
+}
+exports.NUM_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+};
+exports.HEX_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+ A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
+ a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
+};
+exports.NUM = [
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+];
+exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
+exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
+exports.USERINFO_CHARS = exports.ALPHANUM
+ .concat(exports.MARK)
+ .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
+// TODO(indutny): use RFC
+exports.STRICT_URL_CHAR = [
+ '!', '"', '$', '%', '&', '\'',
+ '(', ')', '*', '+', ',', '-', '.', '/',
+ ':', ';', '<', '=', '>',
+ '@', '[', '\\', ']', '^', '_',
+ '`',
+ '{', '|', '}', '~',
+].concat(exports.ALPHANUM);
+exports.URL_CHAR = exports.STRICT_URL_CHAR
+ .concat(['\t', '\f']);
+// All characters with 0x80 bit set to 1
+for (let i = 0x80; i <= 0xff; i++) {
+ exports.URL_CHAR.push(i);
+}
+exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
+/* Tokens as defined by rfc 2616. Also lowercases them.
+ * token = 1*
+ * separators = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+ * | "{" | "}" | SP | HT
+ */
+exports.STRICT_TOKEN = [
+ '!', '#', '$', '%', '&', '\'',
+ '*', '+', '-', '.',
+ '^', '_', '`',
+ '|', '~',
+].concat(exports.ALPHANUM);
+exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
+/*
+ * Verify that a char is a valid visible (printable) US-ASCII
+ * character or %x80-FF
+ */
+exports.HEADER_CHARS = ['\t'];
+for (let i = 32; i <= 255; i++) {
+ if (i !== 127) {
+ exports.HEADER_CHARS.push(i);
}
+}
+// ',' = \x44
+exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
+exports.MAJOR = exports.NUM_MAP;
+exports.MINOR = exports.MAJOR;
+var HEADER_STATE;
+(function (HEADER_STATE) {
+ HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
+ HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
+ HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
+ HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
+ HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
+ HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
+})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
+exports.SPECIAL_HEADERS = {
+ 'connection': HEADER_STATE.CONNECTION,
+ 'content-length': HEADER_STATE.CONTENT_LENGTH,
+ 'proxy-connection': HEADER_STATE.CONNECTION,
+ 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
+ 'upgrade': HEADER_STATE.UPGRADE,
+};
+//# sourceMappingURL=constants.js.map
- return pause ? constants.ERROR.PAUSED : 0
- }
+/***/ }),
- onBody (buf) {
- const { client, socket, statusCode, maxResponseSize } = this
+/***/ 3870:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (socket.destroyed) {
- return -1
- }
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
- assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
- if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
+const { Buffer } = __nccwpck_require__(4573)
- assert(statusCode >= 200)
+module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0d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ADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqI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QQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJ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AQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64')
- if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
- util.destroy(socket, new ResponseExceededMaxSizeError())
- return -1
- }
- this.bytesRead += buf.length
+/***/ }),
- if (request.onData(buf) === false) {
- return constants.ERROR.PAUSED
- }
- }
+/***/ 3434:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- onMessageComplete () {
- const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
- if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
- return -1
- }
- if (upgrade) {
- return
- }
+const { Buffer } = __nccwpck_require__(4573)
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
+module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wb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YCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETF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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZ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JqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEAN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CFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCB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5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')
- assert(statusCode >= 100)
- this.statusCode = null
- this.statusText = ''
- this.bytesRead = 0
- this.contentLength = ''
- this.keepAlive = ''
- this.connection = ''
+/***/ }),
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
+/***/ 172:
+/***/ ((__unused_webpack_module, exports) => {
- if (statusCode < 200) {
- return
- }
- /* istanbul ignore next: should be handled by llhttp? */
- if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
- util.destroy(socket, new ResponseContentLengthMismatchError())
- return -1
- }
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.enumToMap = void 0;
+function enumToMap(obj) {
+ const res = {};
+ Object.keys(obj).forEach((key) => {
+ const value = obj[key];
+ if (typeof value === 'number') {
+ res[key] = value;
+ }
+ });
+ return res;
+}
+exports.enumToMap = enumToMap;
+//# sourceMappingURL=utils.js.map
- request.onComplete(headers)
+/***/ }),
- client[kQueue][client[kRunningIdx]++] = null
+/***/ 7501:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (socket[kWriting]) {
- assert.strictEqual(client[kRunning], 0)
- // Response completed before request.
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (!shouldKeepAlive) {
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (socket[kReset] && client[kRunning] === 0) {
- // Destroy socket once all requests have completed.
- // The request at the tail of the pipeline is the one
- // that requested reset and no further requests should
- // have been queued since then.
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (client[kPipelining] === 1) {
- // We must wait a full event loop cycle to reuse this socket to make sure
- // that non-spec compliant servers are not closing the connection even if they
- // said they won't.
- setImmediate(resume, client)
- } else {
- resume(client)
- }
- }
-}
-function onParserTimeout (parser) {
- const { socket, timeoutType, client } = parser
- /* istanbul ignore else */
- if (timeoutType === TIMEOUT_HEADERS) {
- if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
- assert(!parser.paused, 'cannot be paused while waiting for headers')
- util.destroy(socket, new HeadersTimeoutError())
- }
- } else if (timeoutType === TIMEOUT_BODY) {
- if (!parser.paused) {
- util.destroy(socket, new BodyTimeoutError())
+const { kClients } = __nccwpck_require__(6443)
+const Agent = __nccwpck_require__(7405)
+const {
+ kAgent,
+ kMockAgentSet,
+ kMockAgentGet,
+ kDispatches,
+ kIsMockActive,
+ kNetConnect,
+ kGetNetConnect,
+ kOptions,
+ kFactory
+} = __nccwpck_require__(1117)
+const MockClient = __nccwpck_require__(7365)
+const MockPool = __nccwpck_require__(4004)
+const { matchValue, buildMockOptions } = __nccwpck_require__(3397)
+const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8707)
+const Dispatcher = __nccwpck_require__(883)
+const Pluralizer = __nccwpck_require__(1529)
+const PendingInterceptorsFormatter = __nccwpck_require__(6142)
+
+class MockAgent extends Dispatcher {
+ constructor (opts) {
+ super(opts)
+
+ this[kNetConnect] = true
+ this[kIsMockActive] = true
+
+ // Instantiate Agent and encapsulate
+ if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
- } else if (timeoutType === TIMEOUT_IDLE) {
- assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
- util.destroy(socket, new InformationalError('socket idle timeout'))
- }
-}
+ const agent = opts?.agent ? opts.agent : new Agent(opts)
+ this[kAgent] = agent
-function onSocketReadable () {
- const { [kParser]: parser } = this
- if (parser) {
- parser.readMore()
+ this[kClients] = agent[kClients]
+ this[kOptions] = buildMockOptions(opts)
}
-}
-function onSocketError (err) {
- const { [kClient]: client, [kParser]: parser } = this
-
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
+ get (origin) {
+ let dispatcher = this[kMockAgentGet](origin)
- if (client[kHTTPConnVersion] !== 'h2') {
- // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
- // to the user.
- if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so for as a valid response.
- parser.onMessageComplete()
- return
+ if (!dispatcher) {
+ dispatcher = this[kFactory](origin)
+ this[kMockAgentSet](origin, dispatcher)
}
+ return dispatcher
}
- this[kError] = err
+ dispatch (opts, handler) {
+ // Call MockAgent.get to perform additional setup before dispatching as normal
+ this.get(opts.origin)
+ return this[kAgent].dispatch(opts, handler)
+ }
- onError(this[kClient], err)
-}
+ async close () {
+ await this[kAgent].close()
+ this[kClients].clear()
+ }
-function onError (client, err) {
- if (
- client[kRunning] === 0 &&
- err.code !== 'UND_ERR_INFO' &&
- err.code !== 'UND_ERR_SOCKET'
- ) {
- // Error is not caused by running request and not a recoverable
- // socket error.
+ deactivate () {
+ this[kIsMockActive] = false
+ }
- assert(client[kPendingIdx] === client[kRunningIdx])
+ activate () {
+ this[kIsMockActive] = true
+ }
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(client, request, err)
+ enableNetConnect (matcher) {
+ if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
+ if (Array.isArray(this[kNetConnect])) {
+ this[kNetConnect].push(matcher)
+ } else {
+ this[kNetConnect] = [matcher]
+ }
+ } else if (typeof matcher === 'undefined') {
+ this[kNetConnect] = true
+ } else {
+ throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
}
- assert(client[kSize] === 0)
}
-}
-function onSocketEnd () {
- const { [kParser]: parser, [kClient]: client } = this
+ disableNetConnect () {
+ this[kNetConnect] = false
+ }
+
+ // This is required to bypass issues caused by using global symbols - see:
+ // https://github.com/nodejs/undici/issues/1447
+ get isMockActive () {
+ return this[kIsMockActive]
+ }
- if (client[kHTTPConnVersion] !== 'h2') {
- if (parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so far as a valid response.
- parser.onMessageComplete()
- return
- }
+ [kMockAgentSet] (origin, dispatcher) {
+ this[kClients].set(origin, dispatcher)
}
- util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
-}
+ [kFactory] (origin) {
+ const mockOptions = Object.assign({ agent: this }, this[kOptions])
+ return this[kOptions] && this[kOptions].connections === 1
+ ? new MockClient(origin, mockOptions)
+ : new MockPool(origin, mockOptions)
+ }
-function onSocketClose () {
- const { [kClient]: client, [kParser]: parser } = this
+ [kMockAgentGet] (origin) {
+ // First check if we can immediately find it
+ const client = this[kClients].get(origin)
+ if (client) {
+ return client
+ }
+
+ // If the origin is not a string create a dummy parent pool and return to user
+ if (typeof origin !== 'string') {
+ const dispatcher = this[kFactory]('http://localhost:9999')
+ this[kMockAgentSet](origin, dispatcher)
+ return dispatcher
+ }
- if (client[kHTTPConnVersion] === 'h1' && parser) {
- if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so far as a valid response.
- parser.onMessageComplete()
+ // If we match, create a pool and assign the same dispatches
+ for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {
+ if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
+ const dispatcher = this[kFactory](origin)
+ this[kMockAgentSet](origin, dispatcher)
+ dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
+ return dispatcher
+ }
}
+ }
- this[kParser].destroy()
- this[kParser] = null
+ [kGetNetConnect] () {
+ return this[kNetConnect]
}
- const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
+ pendingInterceptors () {
+ const mockAgentClients = this[kClients]
- client[kSocket] = null
+ return Array.from(mockAgentClients.entries())
+ .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))
+ .filter(({ pending }) => pending)
+ }
- if (client.destroyed) {
- assert(client[kPending] === 0)
+ assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
+ const pending = this.pendingInterceptors()
- // Fail entire queue.
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(client, request, err)
+ if (pending.length === 0) {
+ return
}
- } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
- // Fail head of pipeline.
- const request = client[kQueue][client[kRunningIdx]]
- client[kQueue][client[kRunningIdx]++] = null
-
- errorRequest(client, request, err)
- }
-
- client[kPendingIdx] = client[kRunningIdx]
- assert(client[kRunning] === 0)
+ const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
- client.emit('disconnect', client[kUrl], [client], err)
+ throw new UndiciError(`
+${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
- resume(client)
+${pendingInterceptorsFormatter.format(pending)}
+`.trim())
+ }
}
-async function connect (client) {
- assert(!client[kConnecting])
- assert(!client[kSocket])
+module.exports = MockAgent
- let { host, hostname, protocol, port } = client[kUrl]
- // Resolve ipv6
- if (hostname[0] === '[') {
- const idx = hostname.indexOf(']')
+/***/ }),
- assert(idx !== -1)
- const ip = hostname.substring(1, idx)
+/***/ 7365:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- assert(net.isIP(ip))
- hostname = ip
- }
- client[kConnecting] = true
- if (channels.beforeConnect.hasSubscribers) {
- channels.beforeConnect.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector]
- })
- }
+const { promisify } = __nccwpck_require__(7975)
+const Client = __nccwpck_require__(3701)
+const { buildMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kMockAgent,
+ kClose,
+ kOriginalClose,
+ kOrigin,
+ kOriginalDispatch,
+ kConnected
+} = __nccwpck_require__(1117)
+const { MockInterceptor } = __nccwpck_require__(1511)
+const Symbols = __nccwpck_require__(6443)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
- try {
- const socket = await new Promise((resolve, reject) => {
- client[kConnector]({
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- }, (err, socket) => {
- if (err) {
- reject(err)
- } else {
- resolve(socket)
- }
- })
- })
+/**
+ * MockClient provides an API that extends the Client to influence the mockDispatches.
+ */
+class MockClient extends Client {
+ constructor (origin, opts) {
+ super(origin, opts)
- if (client.destroyed) {
- util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
- return
+ if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
- client[kConnecting] = false
+ this[kMockAgent] = opts.agent
+ this[kOrigin] = origin
+ this[kDispatches] = []
+ this[kConnected] = 1
+ this[kOriginalDispatch] = this.dispatch
+ this[kOriginalClose] = this.close.bind(this)
- assert(socket)
+ this.dispatch = buildMockDispatch.call(this)
+ this.close = this[kClose]
+ }
- const isH2 = socket.alpnProtocol === 'h2'
- if (isH2) {
- if (!h2ExperimentalWarned) {
- h2ExperimentalWarned = true
- process.emitWarning('H2 support is experimental, expect them to change at any time.', {
- code: 'UNDICI-H2'
- })
- }
+ get [Symbols.kConnected] () {
+ return this[kConnected]
+ }
- const session = http2.connect(client[kUrl], {
- createConnection: () => socket,
- peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
- })
+ /**
+ * Sets up the base interceptor for mocking replies from undici.
+ */
+ intercept (opts) {
+ return new MockInterceptor(opts, this[kDispatches])
+ }
- client[kHTTPConnVersion] = 'h2'
- session[kClient] = client
- session[kSocket] = socket
- session.on('error', onHttp2SessionError)
- session.on('frameError', onHttp2FrameError)
- session.on('end', onHttp2SessionEnd)
- session.on('goaway', onHTTP2GoAway)
- session.on('close', onSocketClose)
- session.unref()
+ async [kClose] () {
+ await promisify(this[kOriginalClose])()
+ this[kConnected] = 0
+ this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ }
+}
- client[kHTTP2Session] = session
- socket[kHTTP2Session] = session
- } else {
- if (!llhttpInstance) {
- llhttpInstance = await llhttpPromise
- llhttpPromise = null
- }
+module.exports = MockClient
- socket[kNoRef] = false
- socket[kWriting] = false
- socket[kReset] = false
- socket[kBlocking] = false
- socket[kParser] = new Parser(client, socket, llhttpInstance)
- }
- socket[kCounter] = 0
- socket[kMaxRequests] = client[kMaxRequests]
- socket[kClient] = client
- socket[kError] = null
+/***/ }),
- socket
- .on('error', onSocketError)
- .on('readable', onSocketReadable)
- .on('end', onSocketEnd)
- .on('close', onSocketClose)
+/***/ 2429:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- client[kSocket] = socket
- if (channels.connected.hasSubscribers) {
- channels.connected.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector],
- socket
- })
- }
- client.emit('connect', client[kUrl], [client])
- } catch (err) {
- if (client.destroyed) {
- return
- }
- client[kConnecting] = false
+const { UndiciError } = __nccwpck_require__(8707)
- if (channels.connectError.hasSubscribers) {
- channels.connectError.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector],
- error: err
- })
- }
+const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')
- if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
- assert(client[kRunning] === 0)
- while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
- const request = client[kQueue][client[kPendingIdx]++]
- errorRequest(client, request, err)
- }
- } else {
- onError(client, err)
- }
+/**
+ * The request does not match any registered mock dispatches.
+ */
+class MockNotMatchedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ Error.captureStackTrace(this, MockNotMatchedError)
+ this.name = 'MockNotMatchedError'
+ this.message = message || 'The request does not match any registered mock dispatches'
+ this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
+ }
- client.emit('connectionError', client[kUrl], [client], err)
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kMockNotMatchedError] === true
}
- resume(client)
+ [kMockNotMatchedError] = true
}
-function emitDrain (client) {
- client[kNeedDrain] = 0
- client.emit('drain', client[kUrl], [client])
+module.exports = {
+ MockNotMatchedError
}
-function resume (client, sync) {
- if (client[kResuming] === 2) {
- return
- }
- client[kResuming] = 2
+/***/ }),
- _resume(client, sync)
- client[kResuming] = 0
+/***/ 1511:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (client[kRunningIdx] > 256) {
- client[kQueue].splice(0, client[kRunningIdx])
- client[kPendingIdx] -= client[kRunningIdx]
- client[kRunningIdx] = 0
- }
-}
-function _resume (client, sync) {
- while (true) {
- if (client.destroyed) {
- assert(client[kPending] === 0)
- return
- }
- if (client[kClosedResolve] && !client[kSize]) {
- client[kClosedResolve]()
- client[kClosedResolve] = null
- return
+const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kDispatchKey,
+ kDefaultHeaders,
+ kDefaultTrailers,
+ kContentLength,
+ kMockDispatch
+} = __nccwpck_require__(1117)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { buildURL } = __nccwpck_require__(3440)
+
+/**
+ * Defines the scope API for an interceptor reply
+ */
+class MockScope {
+ constructor (mockDispatch) {
+ this[kMockDispatch] = mockDispatch
+ }
+
+ /**
+ * Delay a reply by a set amount in ms.
+ */
+ delay (waitInMs) {
+ if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
+ throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
}
- const socket = client[kSocket]
+ this[kMockDispatch].delay = waitInMs
+ return this
+ }
- if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
- if (client[kSize] === 0) {
- if (!socket[kNoRef] && socket.unref) {
- socket.unref()
- socket[kNoRef] = true
- }
- } else if (socket[kNoRef] && socket.ref) {
- socket.ref()
- socket[kNoRef] = false
- }
+ /**
+ * For a defined reply, never mark as consumed.
+ */
+ persist () {
+ this[kMockDispatch].persist = true
+ return this
+ }
- if (client[kSize] === 0) {
- if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
- socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
- }
- } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
- if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
- const request = client[kQueue][client[kRunningIdx]]
- const headersTimeout = request.headersTimeout != null
- ? request.headersTimeout
- : client[kHeadersTimeout]
- socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
- }
- }
+ /**
+ * Allow one to define a reply for a set amount of matching requests.
+ */
+ times (repeatTimes) {
+ if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
+ throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
}
- if (client[kBusy]) {
- client[kNeedDrain] = 2
- } else if (client[kNeedDrain] === 2) {
- if (sync) {
- client[kNeedDrain] = 1
- process.nextTick(emitDrain, client)
+ this[kMockDispatch].times = repeatTimes
+ return this
+ }
+}
+
+/**
+ * Defines an interceptor for a Mock
+ */
+class MockInterceptor {
+ constructor (opts, mockDispatches) {
+ if (typeof opts !== 'object') {
+ throw new InvalidArgumentError('opts must be an object')
+ }
+ if (typeof opts.path === 'undefined') {
+ throw new InvalidArgumentError('opts.path must be defined')
+ }
+ if (typeof opts.method === 'undefined') {
+ opts.method = 'GET'
+ }
+ // See https://github.com/nodejs/undici/issues/1245
+ // As per RFC 3986, clients are not supposed to send URI
+ // fragments to servers when they retrieve a document,
+ if (typeof opts.path === 'string') {
+ if (opts.query) {
+ opts.path = buildURL(opts.path, opts.query)
} else {
- emitDrain(client)
+ // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811
+ const parsedURL = new URL(opts.path, 'data://')
+ opts.path = parsedURL.pathname + parsedURL.search
}
- continue
}
-
- if (client[kPending] === 0) {
- return
+ if (typeof opts.method === 'string') {
+ opts.method = opts.method.toUpperCase()
}
- if (client[kRunning] >= (client[kPipelining] || 1)) {
- return
- }
+ this[kDispatchKey] = buildKey(opts)
+ this[kDispatches] = mockDispatches
+ this[kDefaultHeaders] = {}
+ this[kDefaultTrailers] = {}
+ this[kContentLength] = false
+ }
- const request = client[kQueue][client[kPendingIdx]]
+ createMockScopeDispatchData ({ statusCode, data, responseOptions }) {
+ const responseData = getResponseData(data)
+ const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
+ const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
+ const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
- if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
- if (client[kRunning] > 0) {
- return
- }
+ return { statusCode, data, headers, trailers }
+ }
- client[kServerName] = request.servername
+ validateReplyParameters (replyParameters) {
+ if (typeof replyParameters.statusCode === 'undefined') {
+ throw new InvalidArgumentError('statusCode must be defined')
+ }
+ if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {
+ throw new InvalidArgumentError('responseOptions must be an object')
+ }
+ }
- if (socket && socket.servername !== request.servername) {
- util.destroy(socket, new InformationalError('servername changed'))
- return
+ /**
+ * Mock an undici request with a defined reply.
+ */
+ reply (replyOptionsCallbackOrStatusCode) {
+ // Values of reply aren't available right now as they
+ // can only be available when the reply callback is invoked.
+ if (typeof replyOptionsCallbackOrStatusCode === 'function') {
+ // We'll first wrap the provided callback in another function,
+ // this function will properly resolve the data from the callback
+ // when invoked.
+ const wrappedDefaultsCallback = (opts) => {
+ // Our reply options callback contains the parameter for statusCode, data and options.
+ const resolvedData = replyOptionsCallbackOrStatusCode(opts)
+
+ // Check if it is in the right format
+ if (typeof resolvedData !== 'object' || resolvedData === null) {
+ throw new InvalidArgumentError('reply options callback must return an object')
+ }
+
+ const replyParameters = { data: '', responseOptions: {}, ...resolvedData }
+ this.validateReplyParameters(replyParameters)
+ // Since the values can be obtained immediately we return them
+ // from this higher order function that will be resolved later.
+ return {
+ ...this.createMockScopeDispatchData(replyParameters)
+ }
}
- }
- if (client[kConnecting]) {
- return
+ // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
+ return new MockScope(newMockDispatch)
}
- if (!socket && !client[kHTTP2Session]) {
- connect(client)
- return
+ // We can have either one or three parameters, if we get here,
+ // we should have 1-3 parameters. So we spread the arguments of
+ // this function to obtain the parameters, since replyData will always
+ // just be the statusCode.
+ const replyParameters = {
+ statusCode: replyOptionsCallbackOrStatusCode,
+ data: arguments[1] === undefined ? '' : arguments[1],
+ responseOptions: arguments[2] === undefined ? {} : arguments[2]
}
+ this.validateReplyParameters(replyParameters)
- if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
- return
- }
+ // Send in-already provided data like usual
+ const dispatchData = this.createMockScopeDispatchData(replyParameters)
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
+ return new MockScope(newMockDispatch)
+ }
- if (client[kRunning] > 0 && !request.idempotent) {
- // Non-idempotent request cannot be retried.
- // Ensure that no other requests are inflight and
- // could cause failure.
- return
+ /**
+ * Mock an undici request with a defined error.
+ */
+ replyWithError (error) {
+ if (typeof error === 'undefined') {
+ throw new InvalidArgumentError('error must be defined')
}
- if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
- // Don't dispatch an upgrade until all preceding requests have completed.
- // A misbehaving server might upgrade the connection before all pipelined
- // request has completed.
- return
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
+ return new MockScope(newMockDispatch)
+ }
+
+ /**
+ * Set default reply headers on the interceptor for subsequent replies
+ */
+ defaultReplyHeaders (headers) {
+ if (typeof headers === 'undefined') {
+ throw new InvalidArgumentError('headers must be defined')
}
- if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
- (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
- // Request with stream or iterator body can error while other requests
- // are inflight and indirectly error those as well.
- // Ensure this doesn't happen by waiting for inflight
- // to complete before dispatching.
+ this[kDefaultHeaders] = headers
+ return this
+ }
- // Request with stream or iterator body cannot be retried.
- // Ensure that no other requests are inflight and
- // could cause failure.
- return
+ /**
+ * Set default reply trailers on the interceptor for subsequent replies
+ */
+ defaultReplyTrailers (trailers) {
+ if (typeof trailers === 'undefined') {
+ throw new InvalidArgumentError('trailers must be defined')
}
- if (!request.aborted && write(client, request)) {
- client[kPendingIdx]++
- } else {
- client[kQueue].splice(client[kPendingIdx], 1)
- }
+ this[kDefaultTrailers] = trailers
+ return this
}
-}
-
-// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
-function shouldSendContentLength (method) {
- return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
-}
-function write (client, request) {
- if (client[kHTTPConnVersion] === 'h2') {
- writeH2(client, client[kHTTP2Session], request)
- return
+ /**
+ * Set reply content length header for replies on the interceptor
+ */
+ replyContentLength () {
+ this[kContentLength] = true
+ return this
}
+}
- const { body, method, path, host, upgrade, headers, blocking, reset } = request
+module.exports.MockInterceptor = MockInterceptor
+module.exports.MockScope = MockScope
- // https://tools.ietf.org/html/rfc7231#section-4.3.1
- // https://tools.ietf.org/html/rfc7231#section-4.3.2
- // https://tools.ietf.org/html/rfc7231#section-4.3.5
- // Sending a payload body on a request that does not
- // expect it can cause undefined behavior on some
- // servers and corrupt connection state. Do not
- // re-use the connection for further requests.
+/***/ }),
- const expectsPayload = (
- method === 'PUT' ||
- method === 'POST' ||
- method === 'PATCH'
- )
+/***/ 4004:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (body && typeof body.read === 'function') {
- // Try to read EOF in order to get length.
- body.read(0)
- }
- const bodyLength = util.bodyLength(body)
- let contentLength = bodyLength
+const { promisify } = __nccwpck_require__(7975)
+const Pool = __nccwpck_require__(628)
+const { buildMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kMockAgent,
+ kClose,
+ kOriginalClose,
+ kOrigin,
+ kOriginalDispatch,
+ kConnected
+} = __nccwpck_require__(1117)
+const { MockInterceptor } = __nccwpck_require__(1511)
+const Symbols = __nccwpck_require__(6443)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
- if (contentLength === null) {
- contentLength = request.contentLength
- }
+/**
+ * MockPool provides an API that extends the Pool to influence the mockDispatches.
+ */
+class MockPool extends Pool {
+ constructor (origin, opts) {
+ super(origin, opts)
- if (contentLength === 0 && !expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD NOT send a Content-Length header field when
- // the request message does not contain a payload body and the method
- // semantics do not anticipate such a body.
+ if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
+ }
- contentLength = null
+ this[kMockAgent] = opts.agent
+ this[kOrigin] = origin
+ this[kDispatches] = []
+ this[kConnected] = 1
+ this[kOriginalDispatch] = this.dispatch
+ this[kOriginalClose] = this.close.bind(this)
+
+ this.dispatch = buildMockDispatch.call(this)
+ this.close = this[kClose]
}
- // https://github.com/nodejs/undici/issues/2046
- // A user agent may send a Content-Length header with 0 value, this should be allowed.
- if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
- if (client[kStrictContentLength]) {
- errorRequest(client, request, new RequestContentLengthMismatchError())
- return false
- }
+ get [Symbols.kConnected] () {
+ return this[kConnected]
+ }
- process.emitWarning(new RequestContentLengthMismatchError())
+ /**
+ * Sets up the base interceptor for mocking replies from undici.
+ */
+ intercept (opts) {
+ return new MockInterceptor(opts, this[kDispatches])
}
- const socket = client[kSocket]
+ async [kClose] () {
+ await promisify(this[kOriginalClose])()
+ this[kConnected] = 0
+ this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ }
+}
- try {
- request.onConnect((err) => {
- if (request.aborted || request.completed) {
- return
- }
+module.exports = MockPool
- errorRequest(client, request, err || new RequestAbortedError())
- util.destroy(socket, new InformationalError('aborted'))
- })
- } catch (err) {
- errorRequest(client, request, err)
- }
+/***/ }),
- if (request.aborted) {
- return false
- }
+/***/ 1117:
+/***/ ((module) => {
- if (method === 'HEAD') {
- // https://github.com/mcollina/undici/issues/258
- // Close after a HEAD request to interop with misbehaving servers
- // that may send a body in the response.
- socket[kReset] = true
- }
- if (upgrade || method === 'CONNECT') {
- // On CONNECT or upgrade, block pipeline from dispatching further
- // requests on this connection.
+module.exports = {
+ kAgent: Symbol('agent'),
+ kOptions: Symbol('options'),
+ kFactory: Symbol('factory'),
+ kDispatches: Symbol('dispatches'),
+ kDispatchKey: Symbol('dispatch key'),
+ kDefaultHeaders: Symbol('default headers'),
+ kDefaultTrailers: Symbol('default trailers'),
+ kContentLength: Symbol('content length'),
+ kMockAgent: Symbol('mock agent'),
+ kMockAgentSet: Symbol('mock agent set'),
+ kMockAgentGet: Symbol('mock agent get'),
+ kMockDispatch: Symbol('mock dispatch'),
+ kClose: Symbol('close'),
+ kOriginalClose: Symbol('original agent close'),
+ kOrigin: Symbol('origin'),
+ kIsMockActive: Symbol('is mock active'),
+ kNetConnect: Symbol('net connect'),
+ kGetNetConnect: Symbol('get net connect'),
+ kConnected: Symbol('connected')
+}
- socket[kReset] = true
- }
- if (reset != null) {
- socket[kReset] = reset
- }
+/***/ }),
- if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
- socket[kReset] = true
- }
+/***/ 3397:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (blocking) {
- socket[kBlocking] = true
- }
- let header = `${method} ${path} HTTP/1.1\r\n`
- if (typeof host === 'string') {
- header += `host: ${host}\r\n`
- } else {
- header += client[kHostHeader]
+const { MockNotMatchedError } = __nccwpck_require__(2429)
+const {
+ kDispatches,
+ kMockAgent,
+ kOriginalDispatch,
+ kOrigin,
+ kGetNetConnect
+} = __nccwpck_require__(1117)
+const { buildURL } = __nccwpck_require__(3440)
+const { STATUS_CODES } = __nccwpck_require__(7067)
+const {
+ types: {
+ isPromise
}
+} = __nccwpck_require__(7975)
- if (upgrade) {
- header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
- } else if (client[kPipelining] && !socket[kReset]) {
- header += 'connection: keep-alive\r\n'
- } else {
- header += 'connection: close\r\n'
+function matchValue (match, value) {
+ if (typeof match === 'string') {
+ return match === value
}
-
- if (headers) {
- header += headers
+ if (match instanceof RegExp) {
+ return match.test(value)
}
-
- if (channels.sendHeaders.hasSubscribers) {
- channels.sendHeaders.publish({ request, headers: header, socket })
+ if (typeof match === 'function') {
+ return match(value) === true
}
+ return false
+}
- /* istanbul ignore else: assertion */
- if (!body || bodyLength === 0) {
- if (contentLength === 0) {
- socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
- } else {
- assert(contentLength === null, 'no body must not have content length')
- socket.write(`${header}\r\n`, 'latin1')
- }
- request.onRequestSent()
- } else if (util.isBuffer(body)) {
- assert(contentLength === body.byteLength, 'buffer body must have content length')
+function lowerCaseEntries (headers) {
+ return Object.fromEntries(
+ Object.entries(headers).map(([headerName, headerValue]) => {
+ return [headerName.toLocaleLowerCase(), headerValue]
+ })
+ )
+}
- socket.cork()
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- socket.write(body)
- socket.uncork()
- request.onBodySent(body)
- request.onRequestSent()
- if (!expectsPayload) {
- socket[kReset] = true
- }
- } else if (util.isBlobLike(body)) {
- if (typeof body.stream === 'function') {
- writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
- } else {
- writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
+/**
+ * @param {import('../../index').Headers|string[]|Record} headers
+ * @param {string} key
+ */
+function getHeaderByName (headers, key) {
+ if (Array.isArray(headers)) {
+ for (let i = 0; i < headers.length; i += 2) {
+ if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
+ return headers[i + 1]
+ }
}
- } else if (util.isStream(body)) {
- writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
- } else if (util.isIterable(body)) {
- writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
+
+ return undefined
+ } else if (typeof headers.get === 'function') {
+ return headers.get(key)
} else {
- assert(false)
+ return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
}
-
- return true
}
-function writeH2 (client, session, request) {
- const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
-
- let headers
- if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
- else headers = reqHeaders
-
- if (upgrade) {
- errorRequest(client, request, new Error('Upgrade not supported for H2'))
- return false
+/** @param {string[]} headers */
+function buildHeadersFromArray (headers) { // fetch HeadersList
+ const clone = headers.slice()
+ const entries = []
+ for (let index = 0; index < clone.length; index += 2) {
+ entries.push([clone[index], clone[index + 1]])
}
+ return Object.fromEntries(entries)
+}
- try {
- // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
- request.onConnect((err) => {
- if (request.aborted || request.completed) {
- return
- }
-
- errorRequest(client, request, err || new RequestAbortedError())
- })
- } catch (err) {
- errorRequest(client, request, err)
+function matchHeaders (mockDispatch, headers) {
+ if (typeof mockDispatch.headers === 'function') {
+ if (Array.isArray(headers)) { // fetch HeadersList
+ headers = buildHeadersFromArray(headers)
+ }
+ return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
}
-
- if (request.aborted) {
+ if (typeof mockDispatch.headers === 'undefined') {
+ return true
+ }
+ if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
return false
}
- /** @type {import('node:http2').ClientHttp2Stream} */
- let stream
- const h2State = client[kHTTP2SessionState]
-
- headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
- headers[HTTP2_HEADER_METHOD] = method
-
- if (method === 'CONNECT') {
- session.ref()
- // we are already connected, streams are pending, first request
- // will create a new stream. We trigger a request to create the stream and wait until
- // `ready` event is triggered
- // We disabled endStream to allow the user to write to the stream
- stream = session.request(headers, { endStream: false, signal })
+ for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
+ const headerValue = getHeaderByName(headers, matchHeaderName)
- if (stream.id && !stream.pending) {
- request.onUpgrade(null, null, stream)
- ++h2State.openStreams
- } else {
- stream.once('ready', () => {
- request.onUpgrade(null, null, stream)
- ++h2State.openStreams
- })
+ if (!matchValue(matchHeaderValue, headerValue)) {
+ return false
}
-
- stream.once('close', () => {
- h2State.openStreams -= 1
- // TODO(HTTP/2): unref only if current streams count is 0
- if (h2State.openStreams === 0) session.unref()
- })
-
- return true
}
+ return true
+}
- // https://tools.ietf.org/html/rfc7540#section-8.3
- // :path and :scheme headers must be omited when sending CONNECT
-
- headers[HTTP2_HEADER_PATH] = path
- headers[HTTP2_HEADER_SCHEME] = 'https'
-
- // https://tools.ietf.org/html/rfc7231#section-4.3.1
- // https://tools.ietf.org/html/rfc7231#section-4.3.2
- // https://tools.ietf.org/html/rfc7231#section-4.3.5
-
- // Sending a payload body on a request that does not
- // expect it can cause undefined behavior on some
- // servers and corrupt connection state. Do not
- // re-use the connection for further requests.
-
- const expectsPayload = (
- method === 'PUT' ||
- method === 'POST' ||
- method === 'PATCH'
- )
-
- if (body && typeof body.read === 'function') {
- // Try to read EOF in order to get length.
- body.read(0)
+function safeUrl (path) {
+ if (typeof path !== 'string') {
+ return path
}
- let contentLength = util.bodyLength(body)
+ const pathSegments = path.split('?')
- if (contentLength == null) {
- contentLength = request.contentLength
+ if (pathSegments.length !== 2) {
+ return path
}
- if (contentLength === 0 || !expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD NOT send a Content-Length header field when
- // the request message does not contain a payload body and the method
- // semantics do not anticipate such a body.
+ const qp = new URLSearchParams(pathSegments.pop())
+ qp.sort()
+ return [...pathSegments, qp.toString()].join('?')
+}
- contentLength = null
+function matchKey (mockDispatch, { path, method, body, headers }) {
+ const pathMatch = matchValue(mockDispatch.path, path)
+ const methodMatch = matchValue(mockDispatch.method, method)
+ const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
+ const headersMatch = matchHeaders(mockDispatch, headers)
+ return pathMatch && methodMatch && bodyMatch && headersMatch
+}
+
+function getResponseData (data) {
+ if (Buffer.isBuffer(data)) {
+ return data
+ } else if (data instanceof Uint8Array) {
+ return data
+ } else if (data instanceof ArrayBuffer) {
+ return data
+ } else if (typeof data === 'object') {
+ return JSON.stringify(data)
+ } else {
+ return data.toString()
}
+}
- // https://github.com/nodejs/undici/issues/2046
- // A user agent may send a Content-Length header with 0 value, this should be allowed.
- if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
- if (client[kStrictContentLength]) {
- errorRequest(client, request, new RequestContentLengthMismatchError())
- return false
- }
+function getMockDispatch (mockDispatches, key) {
+ const basePath = key.query ? buildURL(key.path, key.query) : key.path
+ const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
- process.emitWarning(new RequestContentLengthMismatchError())
+ // Match path
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
}
- if (contentLength != null) {
- assert(body, 'no body must not have content length')
- headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
+ // Match method
+ matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)
}
- session.ref()
-
- const shouldEndStream = method === 'GET' || method === 'HEAD'
- if (expectContinue) {
- headers[HTTP2_HEADER_EXPECT] = '100-continue'
- stream = session.request(headers, { endStream: shouldEndStream, signal })
+ // Match body
+ matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)
+ }
- stream.once('continue', writeBodyH2)
- } else {
- stream = session.request(headers, {
- endStream: shouldEndStream,
- signal
- })
- writeBodyH2()
+ // Match headers
+ matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
+ if (matchedMockDispatches.length === 0) {
+ const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers
+ throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)
}
- // Increment counter as we have new several streams open
- ++h2State.openStreams
+ return matchedMockDispatches[0]
+}
- stream.once('response', headers => {
- const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
+function addMockDispatch (mockDispatches, key, data) {
+ const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
+ const replyData = typeof data === 'function' ? { callback: data } : { ...data }
+ const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
+ mockDispatches.push(newMockDispatch)
+ return newMockDispatch
+}
- if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
- stream.pause()
+function deleteMockDispatch (mockDispatches, key) {
+ const index = mockDispatches.findIndex(dispatch => {
+ if (!dispatch.consumed) {
+ return false
}
+ return matchKey(dispatch, key)
})
+ if (index !== -1) {
+ mockDispatches.splice(index, 1)
+ }
+}
- stream.once('end', () => {
- request.onComplete([])
- })
-
- stream.on('data', (chunk) => {
- if (request.onData(chunk) === false) {
- stream.pause()
- }
- })
+function buildKey (opts) {
+ const { path, method, body, headers, query } = opts
+ return {
+ path,
+ method,
+ body,
+ headers,
+ query
+ }
+}
- stream.once('close', () => {
- h2State.openStreams -= 1
- // TODO(HTTP/2): unref only if current streams count is 0
- if (h2State.openStreams === 0) {
- session.unref()
+function generateKeyValues (data) {
+ const keys = Object.keys(data)
+ const result = []
+ for (let i = 0; i < keys.length; ++i) {
+ const key = keys[i]
+ const value = data[key]
+ const name = Buffer.from(`${key}`)
+ if (Array.isArray(value)) {
+ for (let j = 0; j < value.length; ++j) {
+ result.push(name, Buffer.from(`${value[j]}`))
+ }
+ } else {
+ result.push(name, Buffer.from(`${value}`))
}
- })
+ }
+ return result
+}
- stream.once('error', function (err) {
- if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
- h2State.streams -= 1
- util.destroy(stream, err)
- }
- })
+/**
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
+ * @param {number} statusCode
+ */
+function getStatusText (statusCode) {
+ return STATUS_CODES[statusCode] || 'unknown'
+}
- stream.once('frameError', (type, code) => {
- const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
- errorRequest(client, request, err)
+async function getResponse (body) {
+ const buffers = []
+ for await (const data of body) {
+ buffers.push(data)
+ }
+ return Buffer.concat(buffers).toString('utf8')
+}
- if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
- h2State.streams -= 1
- util.destroy(stream, err)
- }
- })
+/**
+ * Mock dispatch function used to simulate undici dispatches
+ */
+function mockDispatch (opts, handler) {
+ // Get mock dispatch from built key
+ const key = buildKey(opts)
+ const mockDispatch = getMockDispatch(this[kDispatches], key)
- // stream.on('aborted', () => {
- // // TODO(HTTP/2): Support aborted
- // })
+ mockDispatch.timesInvoked++
- // stream.on('timeout', () => {
- // // TODO(HTTP/2): Support timeout
- // })
+ // Here's where we resolve a callback if a callback is present for the dispatch data.
+ if (mockDispatch.data.callback) {
+ mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
+ }
- // stream.on('push', headers => {
- // // TODO(HTTP/2): Suppor push
- // })
+ // Parse mockDispatch data
+ const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
+ const { timesInvoked, times } = mockDispatch
- // stream.on('trailers', headers => {
- // // TODO(HTTP/2): Support trailers
- // })
+ // If it's used up and not persistent, mark as consumed
+ mockDispatch.consumed = !persist && timesInvoked >= times
+ mockDispatch.pending = timesInvoked < times
- return true
+ // If specified, trigger dispatch error
+ if (error !== null) {
+ deleteMockDispatch(this[kDispatches], key)
+ handler.onError(error)
+ return true
+ }
- function writeBodyH2 () {
- /* istanbul ignore else: assertion */
- if (!body) {
- request.onRequestSent()
- } else if (util.isBuffer(body)) {
- assert(contentLength === body.byteLength, 'buffer body must have content length')
- stream.cork()
- stream.write(body)
- stream.uncork()
- stream.end()
- request.onBodySent(body)
- request.onRequestSent()
- } else if (util.isBlobLike(body)) {
- if (typeof body.stream === 'function') {
- writeIterable({
- client,
- request,
- contentLength,
- h2stream: stream,
- expectsPayload,
- body: body.stream(),
- socket: client[kSocket],
- header: ''
- })
- } else {
- writeBlob({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- h2stream: stream,
- header: '',
- socket: client[kSocket]
- })
- }
- } else if (util.isStream(body)) {
- writeStream({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- socket: client[kSocket],
- h2stream: stream,
- header: ''
- })
- } else if (util.isIterable(body)) {
- writeIterable({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- header: '',
- h2stream: stream,
- socket: client[kSocket]
- })
- } else {
- assert(false)
- }
+ // Handle the request with a delay if necessary
+ if (typeof delay === 'number' && delay > 0) {
+ setTimeout(() => {
+ handleReply(this[kDispatches])
+ }, delay)
+ } else {
+ handleReply(this[kDispatches])
}
-}
-
-function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
-
- if (client[kHTTPConnVersion] === 'h2') {
- // For HTTP/2, is enough to pipe the stream
- const pipe = pipeline(
- body,
- h2stream,
- (err) => {
- if (err) {
- util.destroy(body, err)
- util.destroy(h2stream, err)
- } else {
- request.onRequestSent()
- }
- }
- )
- pipe.on('data', onPipeData)
- pipe.once('end', () => {
- pipe.removeListener('data', onPipeData)
- util.destroy(pipe)
- })
+ function handleReply (mockDispatches, _data = data) {
+ // fetch's HeadersList is a 1D string array
+ const optsHeaders = Array.isArray(opts.headers)
+ ? buildHeadersFromArray(opts.headers)
+ : opts.headers
+ const body = typeof _data === 'function'
+ ? _data({ ...opts, headers: optsHeaders })
+ : _data
- function onPipeData (chunk) {
- request.onBodySent(chunk)
+ // util.types.isPromise is likely needed for jest.
+ if (isPromise(body)) {
+ // If handleReply is asynchronous, throwing an error
+ // in the callback will reject the promise, rather than
+ // synchronously throw the error, which breaks some tests.
+ // Rather, we wait for the callback to resolve if it is a
+ // promise, and then re-run handleReply with the new body.
+ body.then((newData) => handleReply(mockDispatches, newData))
+ return
}
- return
+ const responseData = getResponseData(body)
+ const responseHeaders = generateKeyValues(headers)
+ const responseTrailers = generateKeyValues(trailers)
+
+ handler.onConnect?.(err => handler.onError(err), null)
+ handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))
+ handler.onData?.(Buffer.from(responseData))
+ handler.onComplete?.(responseTrailers)
+ deleteMockDispatch(mockDispatches, key)
}
- let finished = false
+ function resume () {}
- const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
+ return true
+}
- const onData = function (chunk) {
- if (finished) {
- return
- }
+function buildMockDispatch () {
+ const agent = this[kMockAgent]
+ const origin = this[kOrigin]
+ const originalDispatch = this[kOriginalDispatch]
- try {
- if (!writer.write(chunk) && this.pause) {
- this.pause()
+ return function dispatch (opts, handler) {
+ if (agent.isMockActive) {
+ try {
+ mockDispatch.call(this, opts, handler)
+ } catch (error) {
+ if (error instanceof MockNotMatchedError) {
+ const netConnect = agent[kGetNetConnect]()
+ if (netConnect === false) {
+ throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
+ }
+ if (checkNetConnect(netConnect, origin)) {
+ originalDispatch.call(this, opts, handler)
+ } else {
+ throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
+ }
+ } else {
+ throw error
+ }
}
- } catch (err) {
- util.destroy(this, err)
+ } else {
+ originalDispatch.call(this, opts, handler)
}
}
- const onDrain = function () {
- if (finished) {
- return
- }
+}
- if (body.resume) {
- body.resume()
- }
+function checkNetConnect (netConnect, origin) {
+ const url = new URL(origin)
+ if (netConnect === true) {
+ return true
+ } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
+ return true
}
- const onAbort = function () {
- if (finished) {
- return
- }
- const err = new RequestAbortedError()
- queueMicrotask(() => onFinished(err))
+ return false
+}
+
+function buildMockOptions (opts) {
+ if (opts) {
+ const { agent, ...mockOptions } = opts
+ return mockOptions
}
- const onFinished = function (err) {
- if (finished) {
- return
- }
+}
- finished = true
+module.exports = {
+ getResponseData,
+ getMockDispatch,
+ addMockDispatch,
+ deleteMockDispatch,
+ buildKey,
+ generateKeyValues,
+ matchValue,
+ getResponse,
+ getStatusText,
+ mockDispatch,
+ buildMockDispatch,
+ checkNetConnect,
+ buildMockOptions,
+ getHeaderByName,
+ buildHeadersFromArray
+}
- assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
- socket
- .off('drain', onDrain)
- .off('error', onFinished)
+/***/ }),
- body
- .removeListener('data', onData)
- .removeListener('end', onFinished)
- .removeListener('error', onFinished)
- .removeListener('close', onAbort)
+/***/ 6142:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (!err) {
- try {
- writer.end()
- } catch (er) {
- err = er
- }
- }
- writer.destroy(err)
- if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
- util.destroy(body, err)
- } else {
- util.destroy(body)
- }
- }
+const { Transform } = __nccwpck_require__(7075)
+const { Console } = __nccwpck_require__(7540)
- body
- .on('data', onData)
- .on('end', onFinished)
- .on('error', onFinished)
- .on('close', onAbort)
+const PERSISTENT = process.versions.icu ? '✅' : 'Y '
+const NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '
- if (body.resume) {
- body.resume()
+/**
+ * Gets the output of `console.table(…)` as a string.
+ */
+module.exports = class PendingInterceptorsFormatter {
+ constructor ({ disableColors } = {}) {
+ this.transform = new Transform({
+ transform (chunk, _enc, cb) {
+ cb(null, chunk)
+ }
+ })
+
+ this.logger = new Console({
+ stdout: this.transform,
+ inspectOptions: {
+ colors: !disableColors && !process.env.CI
+ }
+ })
}
- socket
- .on('drain', onDrain)
- .on('error', onFinished)
+ format (pendingInterceptors) {
+ const withPrettyHeaders = pendingInterceptors.map(
+ ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
+ Method: method,
+ Origin: origin,
+ Path: path,
+ 'Status code': statusCode,
+ Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
+ Invocations: timesInvoked,
+ Remaining: persist ? Infinity : times - timesInvoked
+ }))
+
+ this.logger.table(withPrettyHeaders)
+ return this.transform.read().toString()
+ }
}
-async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength === body.size, 'blob body must have content length')
- const isH2 = client[kHTTPConnVersion] === 'h2'
- try {
- if (contentLength != null && contentLength !== body.size) {
- throw new RequestContentLengthMismatchError()
- }
+/***/ }),
- const buffer = Buffer.from(await body.arrayBuffer())
+/***/ 1529:
+/***/ ((module) => {
- if (isH2) {
- h2stream.cork()
- h2stream.write(buffer)
- h2stream.uncork()
- } else {
- socket.cork()
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- socket.write(buffer)
- socket.uncork()
- }
- request.onBodySent(buffer)
- request.onRequestSent()
- if (!expectsPayload) {
- socket[kReset] = true
- }
+const singulars = {
+ pronoun: 'it',
+ is: 'is',
+ was: 'was',
+ this: 'this'
+}
- resume(client)
- } catch (err) {
- util.destroy(isH2 ? h2stream : socket, err)
- }
+const plurals = {
+ pronoun: 'they',
+ is: 'are',
+ was: 'were',
+ this: 'these'
}
-async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
+module.exports = class Pluralizer {
+ constructor (singular, plural) {
+ this.singular = singular
+ this.plural = plural
+ }
- let callback = null
- function onDrain () {
- if (callback) {
- const cb = callback
- callback = null
- cb()
- }
+ pluralize (count) {
+ const one = count === 1
+ const keys = one ? singulars : plurals
+ const noun = one ? this.singular : this.plural
+ return { ...keys, count, noun }
}
+}
- const waitForDrain = () => new Promise((resolve, reject) => {
- assert(callback === null)
- if (socket[kError]) {
- reject(socket[kError])
- } else {
- callback = resolve
- }
- })
+/***/ }),
- if (client[kHTTPConnVersion] === 'h2') {
- h2stream
- .on('close', onDrain)
- .on('drain', onDrain)
+/***/ 6603:
+/***/ ((module) => {
- try {
- // It's up to the user to somehow abort the async iterable.
- for await (const chunk of body) {
- if (socket[kError]) {
- throw socket[kError]
- }
- const res = h2stream.write(chunk)
- request.onBodySent(chunk)
- if (!res) {
- await waitForDrain()
- }
- }
- } catch (err) {
- h2stream.destroy(err)
- } finally {
- request.onRequestSent()
- h2stream.end()
- h2stream
- .off('close', onDrain)
- .off('drain', onDrain)
- }
- return
- }
+/**
+ * This module offers an optimized timer implementation designed for scenarios
+ * where high precision is not critical.
+ *
+ * The timer achieves faster performance by using a low-resolution approach,
+ * with an accuracy target of within 500ms. This makes it particularly useful
+ * for timers with delays of 1 second or more, where exact timing is less
+ * crucial.
+ *
+ * It's important to note that Node.js timers are inherently imprecise, as
+ * delays can occur due to the event loop being blocked by other operations.
+ * Consequently, timers may trigger later than their scheduled time.
+ */
- socket
- .on('close', onDrain)
- .on('drain', onDrain)
+/**
+ * The fastNow variable contains the internal fast timer clock value.
+ *
+ * @type {number}
+ */
+let fastNow = 0
- const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
- try {
- // It's up to the user to somehow abort the async iterable.
- for await (const chunk of body) {
- if (socket[kError]) {
- throw socket[kError]
- }
+/**
+ * RESOLUTION_MS represents the target resolution time in milliseconds.
+ *
+ * @type {number}
+ * @default 1000
+ */
+const RESOLUTION_MS = 1e3
- if (!writer.write(chunk)) {
- await waitForDrain()
- }
- }
+/**
+ * TICK_MS defines the desired interval in milliseconds between each tick.
+ * The target value is set to half the resolution time, minus 1 ms, to account
+ * for potential event loop overhead.
+ *
+ * @type {number}
+ * @default 499
+ */
+const TICK_MS = (RESOLUTION_MS >> 1) - 1
- writer.end()
- } catch (err) {
- writer.destroy(err)
- } finally {
- socket
- .off('close', onDrain)
- .off('drain', onDrain)
- }
-}
+/**
+ * fastNowTimeout is a Node.js timer used to manage and process
+ * the FastTimers stored in the `fastTimers` array.
+ *
+ * @type {NodeJS.Timeout}
+ */
+let fastNowTimeout
-class AsyncWriter {
- constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
- this.socket = socket
- this.request = request
- this.contentLength = contentLength
- this.client = client
- this.bytesWritten = 0
- this.expectsPayload = expectsPayload
- this.header = header
+/**
+ * The kFastTimer symbol is used to identify FastTimer instances.
+ *
+ * @type {Symbol}
+ */
+const kFastTimer = Symbol('kFastTimer')
- socket[kWriting] = true
- }
+/**
+ * The fastTimers array contains all active FastTimers.
+ *
+ * @type {FastTimer[]}
+ */
+const fastTimers = []
- write (chunk) {
- const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
+/**
+ * These constants represent the various states of a FastTimer.
+ */
- if (socket[kError]) {
- throw socket[kError]
- }
+/**
+ * The `NOT_IN_LIST` constant indicates that the FastTimer is not included
+ * in the `fastTimers` array. Timers with this status will not be processed
+ * during the next tick by the `onTick` function.
+ *
+ * A FastTimer can be re-added to the `fastTimers` array by invoking the
+ * `refresh` method on the FastTimer instance.
+ *
+ * @type {-2}
+ */
+const NOT_IN_LIST = -2
- if (socket.destroyed) {
- return false
- }
+/**
+ * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled
+ * for removal from the `fastTimers` array. A FastTimer in this state will
+ * be removed in the next tick by the `onTick` function and will no longer
+ * be processed.
+ *
+ * This status is also set when the `clear` method is called on the FastTimer instance.
+ *
+ * @type {-1}
+ */
+const TO_BE_CLEARED = -1
- const len = Buffer.byteLength(chunk)
- if (!len) {
- return true
- }
+/**
+ * The `PENDING` constant signifies that the FastTimer is awaiting processing
+ * in the next tick by the `onTick` function. Timers with this status will have
+ * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.
+ *
+ * @type {0}
+ */
+const PENDING = 0
- // We should defer writing chunks.
- if (contentLength !== null && bytesWritten + len > contentLength) {
- if (client[kStrictContentLength]) {
- throw new RequestContentLengthMismatchError()
- }
+/**
+ * The `ACTIVE` constant indicates that the FastTimer is active and waiting
+ * for its timer to expire. During the next tick, the `onTick` function will
+ * check if the timer has expired, and if so, it will execute the associated callback.
+ *
+ * @type {1}
+ */
+const ACTIVE = 1
- process.emitWarning(new RequestContentLengthMismatchError())
- }
+/**
+ * The onTick function processes the fastTimers array.
+ *
+ * @returns {void}
+ */
+function onTick () {
+ /**
+ * Increment the fastNow value by the TICK_MS value, despite the actual time
+ * that has passed since the last tick. This approach ensures independence
+ * from the system clock and delays caused by a blocked event loop.
+ *
+ * @type {number}
+ */
+ fastNow += TICK_MS
- socket.cork()
+ /**
+ * The `idx` variable is used to iterate over the `fastTimers` array.
+ * Expired timers are removed by replacing them with the last element in the array.
+ * Consequently, `idx` is only incremented when the current element is not removed.
+ *
+ * @type {number}
+ */
+ let idx = 0
- if (bytesWritten === 0) {
- if (!expectsPayload) {
- socket[kReset] = true
- }
+ /**
+ * The len variable will contain the length of the fastTimers array
+ * and will be decremented when a FastTimer should be removed from the
+ * fastTimers array.
+ *
+ * @type {number}
+ */
+ let len = fastTimers.length
- if (contentLength === null) {
- socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
- } else {
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- }
- }
+ while (idx < len) {
+ /**
+ * @type {FastTimer}
+ */
+ const timer = fastTimers[idx]
- if (contentLength === null) {
- socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
+ // If the timer is in the ACTIVE state and the timer has expired, it will
+ // be processed in the next tick.
+ if (timer._state === PENDING) {
+ // Set the _idleStart value to the fastNow value minus the TICK_MS value
+ // to account for the time the timer was in the PENDING state.
+ timer._idleStart = fastNow - TICK_MS
+ timer._state = ACTIVE
+ } else if (
+ timer._state === ACTIVE &&
+ fastNow >= timer._idleStart + timer._idleTimeout
+ ) {
+ timer._state = TO_BE_CLEARED
+ timer._idleStart = -1
+ timer._onTimeout(timer._timerArg)
}
- this.bytesWritten += len
+ if (timer._state === TO_BE_CLEARED) {
+ timer._state = NOT_IN_LIST
- const ret = socket.write(chunk)
+ // Move the last element to the current index and decrement len if it is
+ // not the only element in the array.
+ if (--len !== 0) {
+ fastTimers[idx] = fastTimers[len]
+ }
+ } else {
+ ++idx
+ }
+ }
- socket.uncork()
+ // Set the length of the fastTimers array to the new length and thus
+ // removing the excess FastTimers elements from the array.
+ fastTimers.length = len
- request.onBodySent(chunk)
+ // If there are still active FastTimers in the array, refresh the Timer.
+ // If there are no active FastTimers, the timer will be refreshed again
+ // when a new FastTimer is instantiated.
+ if (fastTimers.length !== 0) {
+ refreshTimeout()
+ }
+}
- if (!ret) {
- if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
- // istanbul ignore else: only for jest
- if (socket[kParser].timeout.refresh) {
- socket[kParser].timeout.refresh()
- }
- }
- }
+function refreshTimeout () {
+ // If the fastNowTimeout is already set, refresh it.
+ if (fastNowTimeout) {
+ fastNowTimeout.refresh()
+ // fastNowTimeout is not instantiated yet, create a new Timer.
+ } else {
+ clearTimeout(fastNowTimeout)
+ fastNowTimeout = setTimeout(onTick, TICK_MS)
- return ret
+ // If the Timer has an unref method, call it to allow the process to exit if
+ // there are no other active handles.
+ if (fastNowTimeout.unref) {
+ fastNowTimeout.unref()
+ }
}
+}
- end () {
- const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
- request.onRequestSent()
+/**
+ * The `FastTimer` class is a data structure designed to store and manage
+ * timer information.
+ */
+class FastTimer {
+ [kFastTimer] = true
- socket[kWriting] = false
+ /**
+ * The state of the timer, which can be one of the following:
+ * - NOT_IN_LIST (-2)
+ * - TO_BE_CLEARED (-1)
+ * - PENDING (0)
+ * - ACTIVE (1)
+ *
+ * @type {-2|-1|0|1}
+ * @private
+ */
+ _state = NOT_IN_LIST
- if (socket[kError]) {
- throw socket[kError]
- }
+ /**
+ * The number of milliseconds to wait before calling the callback.
+ *
+ * @type {number}
+ * @private
+ */
+ _idleTimeout = -1
- if (socket.destroyed) {
- return
- }
+ /**
+ * The time in milliseconds when the timer was started. This value is used to
+ * calculate when the timer should expire.
+ *
+ * @type {number}
+ * @default -1
+ * @private
+ */
+ _idleStart = -1
- if (bytesWritten === 0) {
- if (expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD send a Content-Length in a request message when
- // no Transfer-Encoding is sent and the request method defines a meaning
- // for an enclosed payload body.
+ /**
+ * The function to be executed when the timer expires.
+ * @type {Function}
+ * @private
+ */
+ _onTimeout
- socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
- } else {
- socket.write(`${header}\r\n`, 'latin1')
- }
- } else if (contentLength === null) {
- socket.write('\r\n0\r\n\r\n', 'latin1')
- }
+ /**
+ * The argument to be passed to the callback when the timer expires.
+ *
+ * @type {*}
+ * @private
+ */
+ _timerArg
- if (contentLength !== null && bytesWritten !== contentLength) {
- if (client[kStrictContentLength]) {
- throw new RequestContentLengthMismatchError()
- } else {
- process.emitWarning(new RequestContentLengthMismatchError())
- }
+ /**
+ * @constructor
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should wait
+ * before the specified function or code is executed.
+ * @param {*} arg
+ */
+ constructor (callback, delay, arg) {
+ this._onTimeout = callback
+ this._idleTimeout = delay
+ this._timerArg = arg
+
+ this.refresh()
+ }
+
+ /**
+ * Sets the timer's start time to the current time, and reschedules the timer
+ * to call its callback at the previously specified duration adjusted to the
+ * current time.
+ * Using this on a timer that has already called its callback will reactivate
+ * the timer.
+ *
+ * @returns {void}
+ */
+ refresh () {
+ // In the special case that the timer is not in the list of active timers,
+ // add it back to the array to be processed in the next tick by the onTick
+ // function.
+ if (this._state === NOT_IN_LIST) {
+ fastTimers.push(this)
}
- if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
- // istanbul ignore else: only for jest
- if (socket[kParser].timeout.refresh) {
- socket[kParser].timeout.refresh()
- }
+ // If the timer is the only active timer, refresh the fastNowTimeout for
+ // better resolution.
+ if (!fastNowTimeout || fastTimers.length === 1) {
+ refreshTimeout()
}
- resume(client)
+ // Setting the state to PENDING will cause the timer to be reset in the
+ // next tick by the onTick function.
+ this._state = PENDING
}
- destroy (err) {
- const { socket, client } = this
-
- socket[kWriting] = false
+ /**
+ * The `clear` method cancels the timer, preventing it from executing.
+ *
+ * @returns {void}
+ * @private
+ */
+ clear () {
+ // Set the state to TO_BE_CLEARED to mark the timer for removal in the next
+ // tick by the onTick function.
+ this._state = TO_BE_CLEARED
- if (err) {
- assert(client[kRunning] <= 1, 'pipeline should only contain this request')
- util.destroy(socket, err)
- }
+ // Reset the _idleStart value to -1 to indicate that the timer is no longer
+ // active.
+ this._idleStart = -1
}
}
-function errorRequest (client, request, err) {
- try {
- request.onError(err)
- assert(request.aborted)
- } catch (err) {
- client.emit('error', err)
- }
+/**
+ * This module exports a setTimeout and clearTimeout function that can be
+ * used as a drop-in replacement for the native functions.
+ */
+module.exports = {
+ /**
+ * The setTimeout() method sets a timer which executes a function once the
+ * timer expires.
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should
+ * wait before the specified function or code is executed.
+ * @param {*} [arg] An optional argument to be passed to the callback function
+ * when the timer expires.
+ * @returns {NodeJS.Timeout|FastTimer}
+ */
+ setTimeout (callback, delay, arg) {
+ // If the delay is less than or equal to the RESOLUTION_MS value return a
+ // native Node.js Timer instance.
+ return delay <= RESOLUTION_MS
+ ? setTimeout(callback, delay, arg)
+ : new FastTimer(callback, delay, arg)
+ },
+ /**
+ * The clearTimeout method cancels an instantiated Timer previously created
+ * by calling setTimeout.
+ *
+ * @param {NodeJS.Timeout|FastTimer} timeout
+ */
+ clearTimeout (timeout) {
+ // If the timeout is a FastTimer, call its own clear method.
+ if (timeout[kFastTimer]) {
+ /**
+ * @type {FastTimer}
+ */
+ timeout.clear()
+ // Otherwise it is an instance of a native NodeJS.Timeout, so call the
+ // Node.js native clearTimeout function.
+ } else {
+ clearTimeout(timeout)
+ }
+ },
+ /**
+ * The setFastTimeout() method sets a fastTimer which executes a function once
+ * the timer expires.
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should
+ * wait before the specified function or code is executed.
+ * @param {*} [arg] An optional argument to be passed to the callback function
+ * when the timer expires.
+ * @returns {FastTimer}
+ */
+ setFastTimeout (callback, delay, arg) {
+ return new FastTimer(callback, delay, arg)
+ },
+ /**
+ * The clearTimeout method cancels an instantiated FastTimer previously
+ * created by calling setFastTimeout.
+ *
+ * @param {FastTimer} timeout
+ */
+ clearFastTimeout (timeout) {
+ timeout.clear()
+ },
+ /**
+ * The now method returns the value of the internal fast timer clock.
+ *
+ * @returns {number}
+ */
+ now () {
+ return fastNow
+ },
+ /**
+ * Trigger the onTick function to process the fastTimers array.
+ * Exported for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ * @param {number} [delay=0] The delay in milliseconds to add to the now value.
+ */
+ tick (delay = 0) {
+ fastNow += delay - RESOLUTION_MS + 1
+ onTick()
+ onTick()
+ },
+ /**
+ * Reset FastTimers.
+ * Exported for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ */
+ reset () {
+ fastNow = 0
+ fastTimers.length = 0
+ clearTimeout(fastNowTimeout)
+ fastNowTimeout = null
+ },
+ /**
+ * Exporting for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ */
+ kFastTimer
}
-module.exports = Client
-
/***/ }),
-/***/ 6436:
+/***/ 9634:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-/* istanbul ignore file: only for Node 12 */
+const { kConstruct } = __nccwpck_require__(109)
+const { urlEquals, getFieldValues } = __nccwpck_require__(6798)
+const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3440)
+const { webidl } = __nccwpck_require__(5893)
+const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(9051)
+const { Request, fromInnerRequest } = __nccwpck_require__(9967)
+const { kState } = __nccwpck_require__(3627)
+const { fetching } = __nccwpck_require__(4398)
+const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(3168)
+const assert = __nccwpck_require__(4589)
-const { kConnected, kSize } = __nccwpck_require__(2785)
-
-class CompatWeakRef {
- constructor (value) {
- this.value = value
- }
+/**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
+ * @typedef {Object} CacheBatchOperation
+ * @property {'delete' | 'put'} type
+ * @property {any} request
+ * @property {any} response
+ * @property {import('../../types/cache').CacheQueryOptions} options
+ */
- deref () {
- return this.value[kConnected] === 0 && this.value[kSize] === 0
- ? undefined
- : this.value
- }
-}
+/**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
+ * @typedef {[any, any][]} requestResponseList
+ */
-class CompatFinalizer {
- constructor (finalizer) {
- this.finalizer = finalizer
- }
+class Cache {
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
+ * @type {requestResponseList}
+ */
+ #relevantRequestResponseList
- register (dispatcher, key) {
- if (dispatcher.on) {
- dispatcher.on('disconnect', () => {
- if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
- this.finalizer(key)
- }
- })
+ constructor () {
+ if (arguments[0] !== kConstruct) {
+ webidl.illegalConstructor()
}
+
+ webidl.util.markAsUncloneable(this)
+ this.#relevantRequestResponseList = arguments[1]
}
-}
-module.exports = function () {
- // FIXME: remove workaround when the Node bug is fixed
- // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
- if (process.env.NODE_V8_COVERAGE) {
- return {
- WeakRef: CompatWeakRef,
- FinalizationRegistry: CompatFinalizer
+ async match (request, options = {}) {
+ webidl.brandCheck(this, Cache)
+
+ const prefix = 'Cache.match'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
+
+ const p = this.#internalMatchAll(request, options, 1)
+
+ if (p.length === 0) {
+ return
}
+
+ return p[0]
}
- return {
- WeakRef: global.WeakRef || CompatWeakRef,
- FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
+
+ async matchAll (request = undefined, options = {}) {
+ webidl.brandCheck(this, Cache)
+
+ const prefix = 'Cache.matchAll'
+ if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
+
+ return this.#internalMatchAll(request, options)
}
-}
+ async add (request) {
+ webidl.brandCheck(this, Cache)
-/***/ }),
+ const prefix = 'Cache.add'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-/***/ 663:
-/***/ ((module) => {
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
-"use strict";
+ // 1.
+ const requests = [request]
+ // 2.
+ const responseArrayPromise = this.addAll(requests)
-// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
-const maxAttributeValueSize = 1024
+ // 3.
+ return await responseArrayPromise
+ }
-// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
-const maxNameValuePairSize = 4096
+ async addAll (requests) {
+ webidl.brandCheck(this, Cache)
-module.exports = {
- maxAttributeValueSize,
- maxNameValuePairSize
-}
+ const prefix = 'Cache.addAll'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+ // 1.
+ const responsePromises = []
-/***/ }),
+ // 2.
+ const requestList = []
-/***/ 1724:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 3.
+ for (let request of requests) {
+ if (request === undefined) {
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: 'Argument 1',
+ types: ['undefined is not allowed']
+ })
+ }
-"use strict";
+ request = webidl.converters.RequestInfo(request)
+ if (typeof request === 'string') {
+ continue
+ }
-const { parseSetCookie } = __nccwpck_require__(4408)
-const { stringify, getHeadersList } = __nccwpck_require__(3121)
-const { webidl } = __nccwpck_require__(1744)
-const { Headers } = __nccwpck_require__(554)
+ // 3.1
+ const r = request[kState]
-/**
- * @typedef {Object} Cookie
- * @property {string} name
- * @property {string} value
- * @property {Date|number|undefined} expires
- * @property {number|undefined} maxAge
- * @property {string|undefined} domain
- * @property {string|undefined} path
- * @property {boolean|undefined} secure
- * @property {boolean|undefined} httpOnly
- * @property {'Strict'|'Lax'|'None'} sameSite
- * @property {string[]} unparsed
- */
+ // 3.2
+ if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected http/s scheme when method is not GET.'
+ })
+ }
+ }
-/**
- * @param {Headers} headers
- * @returns {Record}
- */
-function getCookies (headers) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
+ // 4.
+ /** @type {ReturnType[]} */
+ const fetchControllers = []
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 5.
+ for (const request of requests) {
+ // 5.1
+ const r = new Request(request)[kState]
- const cookie = headers.get('cookie')
- const out = {}
+ // 5.2
+ if (!urlIsHttpHttpsScheme(r.url)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected http/s scheme.'
+ })
+ }
- if (!cookie) {
- return out
- }
+ // 5.4
+ r.initiator = 'fetch'
+ r.destination = 'subresource'
- for (const piece of cookie.split(';')) {
- const [name, ...value] = piece.split('=')
+ // 5.5
+ requestList.push(r)
- out[name.trim()] = value.join('=')
- }
+ // 5.6
+ const responsePromise = createDeferredPromise()
- return out
-}
+ // 5.7
+ fetchControllers.push(fetching({
+ request: r,
+ processResponse (response) {
+ // 1.
+ if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
+ responsePromise.reject(webidl.errors.exception({
+ header: 'Cache.addAll',
+ message: 'Received an invalid status code or the request failed.'
+ }))
+ } else if (response.headersList.contains('vary')) { // 2.
+ // 2.1
+ const fieldValues = getFieldValues(response.headersList.get('vary'))
-/**
- * @param {Headers} headers
- * @param {string} name
- * @param {{ path?: string, domain?: string }|undefined} attributes
- * @returns {void}
- */
-function deleteCookie (headers, name, attributes) {
- webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
+ // 2.2
+ for (const fieldValue of fieldValues) {
+ // 2.2.1
+ if (fieldValue === '*') {
+ responsePromise.reject(webidl.errors.exception({
+ header: 'Cache.addAll',
+ message: 'invalid vary field value'
+ }))
- webidl.brandCheck(headers, Headers, { strict: false })
+ for (const controller of fetchControllers) {
+ controller.abort()
+ }
- name = webidl.converters.DOMString(name)
- attributes = webidl.converters.DeleteCookieAttributes(attributes)
+ return
+ }
+ }
+ }
+ },
+ processResponseEndOfBody (response) {
+ // 1.
+ if (response.aborted) {
+ responsePromise.reject(new DOMException('aborted', 'AbortError'))
+ return
+ }
- // Matches behavior of
- // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
- setCookie(headers, {
- name,
- value: '',
- expires: new Date(0),
- ...attributes
- })
-}
+ // 2.
+ responsePromise.resolve(response)
+ }
+ }))
-/**
- * @param {Headers} headers
- * @returns {Cookie[]}
- */
-function getSetCookies (headers) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
+ // 5.8
+ responsePromises.push(responsePromise.promise)
+ }
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 6.
+ const p = Promise.all(responsePromises)
- const cookies = getHeadersList(headers).cookies
+ // 7.
+ const responses = await p
- if (!cookies) {
- return []
- }
+ // 7.1
+ const operations = []
- // In older versions of undici, cookies is a list of name:value.
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
-}
+ // 7.2
+ let index = 0
-/**
- * @param {Headers} headers
- * @param {Cookie} cookie
- * @returns {void}
- */
-function setCookie (headers, cookie) {
- webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
+ // 7.3
+ for (const response of responses) {
+ // 7.3.1
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'put', // 7.3.2
+ request: requestList[index], // 7.3.3
+ response // 7.3.4
+ }
- webidl.brandCheck(headers, Headers, { strict: false })
+ operations.push(operation) // 7.3.5
- cookie = webidl.converters.Cookie(cookie)
+ index++ // 7.3.6
+ }
- const str = stringify(cookie)
+ // 7.5
+ const cacheJobPromise = createDeferredPromise()
- if (str) {
- headers.append('Set-Cookie', stringify(cookie))
- }
-}
+ // 7.6.1
+ let errorData = null
-webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'path',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'domain',
- defaultValue: null
- }
-])
+ // 7.6.2
+ try {
+ this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
+ }
-webidl.converters.Cookie = webidl.dictionaryConverter([
- {
- converter: webidl.converters.DOMString,
- key: 'name'
- },
- {
- converter: webidl.converters.DOMString,
- key: 'value'
- },
- {
- converter: webidl.nullableConverter((value) => {
- if (typeof value === 'number') {
- return webidl.converters['unsigned long long'](value)
+ // 7.6.3
+ queueMicrotask(() => {
+ // 7.6.3.1
+ if (errorData === null) {
+ cacheJobPromise.resolve(undefined)
+ } else {
+ // 7.6.3.2
+ cacheJobPromise.reject(errorData)
}
+ })
- return new Date(value)
- }),
- key: 'expires',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters['long long']),
- key: 'maxAge',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'domain',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'path',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.boolean),
- key: 'secure',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.boolean),
- key: 'httpOnly',
- defaultValue: null
- },
- {
- converter: webidl.converters.USVString,
- key: 'sameSite',
- allowedValues: ['Strict', 'Lax', 'None']
- },
- {
- converter: webidl.sequenceConverter(webidl.converters.DOMString),
- key: 'unparsed',
- defaultValue: []
+ // 7.7
+ return cacheJobPromise.promise
}
-])
-module.exports = {
- getCookies,
- deleteCookie,
- getSetCookies,
- setCookie
-}
+ async put (request, response) {
+ webidl.brandCheck(this, Cache)
+ const prefix = 'Cache.put'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
-/***/ }),
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ response = webidl.converters.Response(response, prefix, 'response')
-/***/ 4408:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 1.
+ let innerRequest = null
-"use strict";
+ // 2.
+ if (request instanceof Request) {
+ innerRequest = request[kState]
+ } else { // 3.
+ innerRequest = new Request(request)[kState]
+ }
+ // 4.
+ if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected an http/s scheme when method is not GET'
+ })
+ }
-const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
-const { isCTLExcludingHtab } = __nccwpck_require__(3121)
-const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
-const assert = __nccwpck_require__(9491)
+ // 5.
+ const innerResponse = response[kState]
-/**
- * @description Parses the field-value attributes of a set-cookie header string.
- * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
- * @param {string} header
- * @returns if the header is invalid, null will be returned
- */
-function parseSetCookie (header) {
- // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
- // character (CTL characters excluding HTAB): Abort these steps and
- // ignore the set-cookie-string entirely.
- if (isCTLExcludingHtab(header)) {
- return null
- }
+ // 6.
+ if (innerResponse.status === 206) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Got 206 status'
+ })
+ }
- let nameValuePair = ''
- let unparsedAttributes = ''
- let name = ''
- let value = ''
+ // 7.
+ if (innerResponse.headersList.contains('vary')) {
+ // 7.1.
+ const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
- // 2. If the set-cookie-string contains a %x3B (";") character:
- if (header.includes(';')) {
- // 1. The name-value-pair string consists of the characters up to,
- // but not including, the first %x3B (";"), and the unparsed-
- // attributes consist of the remainder of the set-cookie-string
- // (including the %x3B (";") in question).
- const position = { position: 0 }
+ // 7.2.
+ for (const fieldValue of fieldValues) {
+ // 7.2.1
+ if (fieldValue === '*') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Got * vary field value'
+ })
+ }
+ }
+ }
- nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
- unparsedAttributes = header.slice(position.position)
- } else {
- // Otherwise:
+ // 8.
+ if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Response body is locked or disturbed'
+ })
+ }
- // 1. The name-value-pair string consists of all the characters
- // contained in the set-cookie-string, and the unparsed-
- // attributes is the empty string.
- nameValuePair = header
- }
+ // 9.
+ const clonedResponse = cloneResponse(innerResponse)
- // 3. If the name-value-pair string lacks a %x3D ("=") character, then
- // the name string is empty, and the value string is the value of
- // name-value-pair.
- if (!nameValuePair.includes('=')) {
- value = nameValuePair
- } else {
- // Otherwise, the name string consists of the characters up to, but
- // not including, the first %x3D ("=") character, and the (possibly
- // empty) value string consists of the characters after the first
- // %x3D ("=") character.
- const position = { position: 0 }
- name = collectASequenceOfCodePointsFast(
- '=',
- nameValuePair,
- position
- )
- value = nameValuePair.slice(position.position + 1)
- }
+ // 10.
+ const bodyReadPromise = createDeferredPromise()
- // 4. Remove any leading or trailing WSP characters from the name
- // string and the value string.
- name = name.trim()
- value = value.trim()
+ // 11.
+ if (innerResponse.body != null) {
+ // 11.1
+ const stream = innerResponse.body.stream
- // 5. If the sum of the lengths of the name string and the value string
- // is more than 4096 octets, abort these steps and ignore the set-
- // cookie-string entirely.
- if (name.length + value.length > maxNameValuePairSize) {
- return null
- }
+ // 11.2
+ const reader = stream.getReader()
- // 6. The cookie-name is the name string, and the cookie-value is the
- // value string.
- return {
- name, value, ...parseUnparsedAttributes(unparsedAttributes)
- }
-}
+ // 11.3
+ readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
+ } else {
+ bodyReadPromise.resolve(undefined)
+ }
-/**
- * Parses the remaining attributes of a set-cookie header
- * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
- * @param {string} unparsedAttributes
- * @param {[Object.]={}} cookieAttributeList
- */
-function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
- // 1. If the unparsed-attributes string is empty, skip the rest of
- // these steps.
- if (unparsedAttributes.length === 0) {
- return cookieAttributeList
- }
+ // 12.
+ /** @type {CacheBatchOperation[]} */
+ const operations = []
- // 2. Discard the first character of the unparsed-attributes (which
- // will be a %x3B (";") character).
- assert(unparsedAttributes[0] === ';')
- unparsedAttributes = unparsedAttributes.slice(1)
+ // 13.
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'put', // 14.
+ request: innerRequest, // 15.
+ response: clonedResponse // 16.
+ }
- let cookieAv = ''
+ // 17.
+ operations.push(operation)
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
- // character:
- if (unparsedAttributes.includes(';')) {
- // 1. Consume the characters of the unparsed-attributes up to, but
- // not including, the first %x3B (";") character.
- cookieAv = collectASequenceOfCodePointsFast(
- ';',
- unparsedAttributes,
- { position: 0 }
- )
- unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
- } else {
- // Otherwise:
+ // 19.
+ const bytes = await bodyReadPromise.promise
- // 1. Consume the remainder of the unparsed-attributes.
- cookieAv = unparsedAttributes
- unparsedAttributes = ''
- }
+ if (clonedResponse.body != null) {
+ clonedResponse.body.source = bytes
+ }
- // Let the cookie-av string be the characters consumed in this step.
+ // 19.1
+ const cacheJobPromise = createDeferredPromise()
- let attributeName = ''
- let attributeValue = ''
+ // 19.2.1
+ let errorData = null
- // 4. If the cookie-av string contains a %x3D ("=") character:
- if (cookieAv.includes('=')) {
- // 1. The (possibly empty) attribute-name string consists of the
- // characters up to, but not including, the first %x3D ("=")
- // character, and the (possibly empty) attribute-value string
- // consists of the characters after the first %x3D ("=")
- // character.
- const position = { position: 0 }
+ // 19.2.2
+ try {
+ this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
+ }
- attributeName = collectASequenceOfCodePointsFast(
- '=',
- cookieAv,
- position
- )
- attributeValue = cookieAv.slice(position.position + 1)
- } else {
- // Otherwise:
+ // 19.2.3
+ queueMicrotask(() => {
+ // 19.2.3.1
+ if (errorData === null) {
+ cacheJobPromise.resolve()
+ } else { // 19.2.3.2
+ cacheJobPromise.reject(errorData)
+ }
+ })
- // 1. The attribute-name string consists of the entire cookie-av
- // string, and the attribute-value string is empty.
- attributeName = cookieAv
+ return cacheJobPromise.promise
}
- // 5. Remove any leading or trailing WSP characters from the attribute-
- // name string and the attribute-value string.
- attributeName = attributeName.trim()
- attributeValue = attributeValue.trim()
+ async delete (request, options = {}) {
+ webidl.brandCheck(this, Cache)
- // 6. If the attribute-value is longer than 1024 octets, ignore the
- // cookie-av string and return to Step 1 of this algorithm.
- if (attributeValue.length > maxAttributeValueSize) {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
- }
+ const prefix = 'Cache.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- // 7. Process the attribute-name and attribute-value according to the
- // requirements in the following subsections. (Notice that
- // attributes with unrecognized attribute-names are ignored.)
- const attributeNameLowercase = attributeName.toLowerCase()
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
- // If the attribute-name case-insensitively matches the string
- // "Expires", the user agent MUST process the cookie-av as follows.
- if (attributeNameLowercase === 'expires') {
- // 1. Let the expiry-time be the result of parsing the attribute-value
- // as cookie-date (see Section 5.1.1).
- const expiryTime = new Date(attributeValue)
+ /**
+ * @type {Request}
+ */
+ let r = null
- // 2. If the attribute-value failed to parse as a cookie date, ignore
- // the cookie-av.
+ if (request instanceof Request) {
+ r = request[kState]
- cookieAttributeList.expires = expiryTime
- } else if (attributeNameLowercase === 'max-age') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
- // If the attribute-name case-insensitively matches the string "Max-
- // Age", the user agent MUST process the cookie-av as follows.
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return false
+ }
+ } else {
+ assert(typeof request === 'string')
- // 1. If the first character of the attribute-value is not a DIGIT or a
- // "-" character, ignore the cookie-av.
- const charCode = attributeValue.charCodeAt(0)
+ r = new Request(request)[kState]
+ }
- if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+ /** @type {CacheBatchOperation[]} */
+ const operations = []
+
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'delete',
+ request: r,
+ options
}
- // 2. If the remainder of attribute-value contains a non-DIGIT
- // character, ignore the cookie-av.
- if (!/^\d+$/.test(attributeValue)) {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+ operations.push(operation)
+
+ const cacheJobPromise = createDeferredPromise()
+
+ let errorData = null
+ let requestResponses
+
+ try {
+ requestResponses = this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
}
- // 3. Let delta-seconds be the attribute-value converted to an integer.
- const deltaSeconds = Number(attributeValue)
+ queueMicrotask(() => {
+ if (errorData === null) {
+ cacheJobPromise.resolve(!!requestResponses?.length)
+ } else {
+ cacheJobPromise.reject(errorData)
+ }
+ })
- // 4. Let cookie-age-limit be the maximum age of the cookie (which
- // SHOULD be 400 days or less, see Section 4.1.2.2).
+ return cacheJobPromise.promise
+ }
- // 5. Set delta-seconds to the smaller of its present value and cookie-
- // age-limit.
- // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
+ * @param {any} request
+ * @param {import('../../types/cache').CacheQueryOptions} options
+ * @returns {Promise}
+ */
+ async keys (request = undefined, options = {}) {
+ webidl.brandCheck(this, Cache)
- // 6. If delta-seconds is less than or equal to zero (0), let expiry-
- // time be the earliest representable date and time. Otherwise, let
- // the expiry-time be the current date and time plus delta-seconds
- // seconds.
- // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
+ const prefix = 'Cache.keys'
- // 7. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Max-Age and an attribute-value of expiry-time.
- cookieAttributeList.maxAge = deltaSeconds
- } else if (attributeNameLowercase === 'domain') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
- // If the attribute-name case-insensitively matches the string "Domain",
- // the user agent MUST process the cookie-av as follows.
+ if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
- // 1. Let cookie-domain be the attribute-value.
- let cookieDomain = attributeValue
+ // 1.
+ let r = null
- // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
- // cookie-domain without its leading %x2E (".").
- if (cookieDomain[0] === '.') {
- cookieDomain = cookieDomain.slice(1)
+ // 2.
+ if (request !== undefined) {
+ // 2.1
+ if (request instanceof Request) {
+ // 2.1.1
+ r = request[kState]
+
+ // 2.1.2
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return []
+ }
+ } else if (typeof request === 'string') { // 2.2
+ r = new Request(request)[kState]
+ }
}
- // 3. Convert the cookie-domain to lower case.
- cookieDomain = cookieDomain.toLowerCase()
+ // 4.
+ const promise = createDeferredPromise()
- // 4. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Domain and an attribute-value of cookie-domain.
- cookieAttributeList.domain = cookieDomain
- } else if (attributeNameLowercase === 'path') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
- // If the attribute-name case-insensitively matches the string "Path",
- // the user agent MUST process the cookie-av as follows.
+ // 5.
+ // 5.1
+ const requests = []
- // 1. If the attribute-value is empty or if the first character of the
- // attribute-value is not %x2F ("/"):
- let cookiePath = ''
- if (attributeValue.length === 0 || attributeValue[0] !== '/') {
- // 1. Let cookie-path be the default-path.
- cookiePath = '/'
- } else {
- // Otherwise:
+ // 5.2
+ if (request === undefined) {
+ // 5.2.1
+ for (const requestResponse of this.#relevantRequestResponseList) {
+ // 5.2.1.1
+ requests.push(requestResponse[0])
+ }
+ } else { // 5.3
+ // 5.3.1
+ const requestResponses = this.#queryCache(r, options)
- // 1. Let cookie-path be the attribute-value.
- cookiePath = attributeValue
+ // 5.3.2
+ for (const requestResponse of requestResponses) {
+ // 5.3.2.1
+ requests.push(requestResponse[0])
+ }
}
- // 2. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Path and an attribute-value of cookie-path.
- cookieAttributeList.path = cookiePath
- } else if (attributeNameLowercase === 'secure') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
- // If the attribute-name case-insensitively matches the string "Secure",
- // the user agent MUST append an attribute to the cookie-attribute-list
- // with an attribute-name of Secure and an empty attribute-value.
+ // 5.4
+ queueMicrotask(() => {
+ // 5.4.1
+ const requestList = []
- cookieAttributeList.secure = true
- } else if (attributeNameLowercase === 'httponly') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
- // If the attribute-name case-insensitively matches the string
- // "HttpOnly", the user agent MUST append an attribute to the cookie-
- // attribute-list with an attribute-name of HttpOnly and an empty
- // attribute-value.
+ // 5.4.2
+ for (const request of requests) {
+ const requestObject = fromInnerRequest(
+ request,
+ new AbortController().signal,
+ 'immutable'
+ )
+ // 5.4.2.1
+ requestList.push(requestObject)
+ }
- cookieAttributeList.httpOnly = true
- } else if (attributeNameLowercase === 'samesite') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
- // If the attribute-name case-insensitively matches the string
- // "SameSite", the user agent MUST process the cookie-av as follows:
+ // 5.4.3
+ promise.resolve(Object.freeze(requestList))
+ })
- // 1. Let enforcement be "Default".
- let enforcement = 'Default'
+ return promise.promise
+ }
- const attributeValueLowercase = attributeValue.toLowerCase()
- // 2. If cookie-av's attribute-value is a case-insensitive match for
- // "None", set enforcement to "None".
- if (attributeValueLowercase.includes('none')) {
- enforcement = 'None'
- }
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
+ * @param {CacheBatchOperation[]} operations
+ * @returns {requestResponseList}
+ */
+ #batchCacheOperations (operations) {
+ // 1.
+ const cache = this.#relevantRequestResponseList
- // 3. If cookie-av's attribute-value is a case-insensitive match for
- // "Strict", set enforcement to "Strict".
- if (attributeValueLowercase.includes('strict')) {
- enforcement = 'Strict'
- }
+ // 2.
+ const backupCache = [...cache]
- // 4. If cookie-av's attribute-value is a case-insensitive match for
- // "Lax", set enforcement to "Lax".
- if (attributeValueLowercase.includes('lax')) {
- enforcement = 'Lax'
- }
+ // 3.
+ const addedItems = []
- // 5. Append an attribute to the cookie-attribute-list with an
- // attribute-name of "SameSite" and an attribute-value of
- // enforcement.
- cookieAttributeList.sameSite = enforcement
- } else {
- cookieAttributeList.unparsed ??= []
+ // 4.1
+ const resultList = []
- cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
- }
+ try {
+ // 4.2
+ for (const operation of operations) {
+ // 4.2.1
+ if (operation.type !== 'delete' && operation.type !== 'put') {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'operation type does not match "delete" or "put"'
+ })
+ }
- // 8. Return to Step 1 of this algorithm.
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
-}
+ // 4.2.2
+ if (operation.type === 'delete' && operation.response != null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'delete operation should not have an associated response'
+ })
+ }
-module.exports = {
- parseSetCookie,
- parseUnparsedAttributes
-}
+ // 4.2.3
+ if (this.#queryCache(operation.request, operation.options, addedItems).length) {
+ throw new DOMException('???', 'InvalidStateError')
+ }
+ // 4.2.4
+ let requestResponses
-/***/ }),
+ // 4.2.5
+ if (operation.type === 'delete') {
+ // 4.2.5.1
+ requestResponses = this.#queryCache(operation.request, operation.options)
-/***/ 3121:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // TODO: the spec is wrong, this is needed to pass WPTs
+ if (requestResponses.length === 0) {
+ return []
+ }
-"use strict";
+ // 4.2.5.2
+ for (const requestResponse of requestResponses) {
+ const idx = cache.indexOf(requestResponse)
+ assert(idx !== -1)
+ // 4.2.5.2.1
+ cache.splice(idx, 1)
+ }
+ } else if (operation.type === 'put') { // 4.2.6
+ // 4.2.6.1
+ if (operation.response == null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'put operation should have an associated response'
+ })
+ }
-const assert = __nccwpck_require__(9491)
-const { kHeadersList } = __nccwpck_require__(2785)
+ // 4.2.6.2
+ const r = operation.request
-function isCTLExcludingHtab (value) {
- if (value.length === 0) {
- return false
- }
+ // 4.2.6.3
+ if (!urlIsHttpHttpsScheme(r.url)) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'expected http or https scheme'
+ })
+ }
- for (const char of value) {
- const code = char.charCodeAt(0)
+ // 4.2.6.4
+ if (r.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'not get method'
+ })
+ }
- if (
- (code >= 0x00 || code <= 0x08) ||
- (code >= 0x0A || code <= 0x1F) ||
- code === 0x7F
- ) {
- return false
- }
- }
-}
+ // 4.2.6.5
+ if (operation.options != null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'options must not be defined'
+ })
+ }
-/**
- CHAR =
- token = 1*
- separators = "(" | ")" | "<" | ">" | "@"
- | "," | ";" | ":" | "\" | <">
- | "/" | "[" | "]" | "?" | "="
- | "{" | "}" | SP | HT
- * @param {string} name
- */
-function validateCookieName (name) {
- for (const char of name) {
- const code = char.charCodeAt(0)
+ // 4.2.6.6
+ requestResponses = this.#queryCache(operation.request)
- if (
- (code <= 0x20 || code > 0x7F) ||
- char === '(' ||
- char === ')' ||
- char === '>' ||
- char === '<' ||
- char === '@' ||
- char === ',' ||
- char === ';' ||
- char === ':' ||
- char === '\\' ||
- char === '"' ||
- char === '/' ||
- char === '[' ||
- char === ']' ||
- char === '?' ||
- char === '=' ||
- char === '{' ||
- char === '}'
- ) {
- throw new Error('Invalid cookie name')
- }
- }
-}
+ // 4.2.6.7
+ for (const requestResponse of requestResponses) {
+ const idx = cache.indexOf(requestResponse)
+ assert(idx !== -1)
-/**
- cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
- cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
- ; US-ASCII characters excluding CTLs,
- ; whitespace DQUOTE, comma, semicolon,
- ; and backslash
- * @param {string} value
- */
-function validateCookieValue (value) {
- for (const char of value) {
- const code = char.charCodeAt(0)
+ // 4.2.6.7.1
+ cache.splice(idx, 1)
+ }
- if (
- code < 0x21 || // exclude CTLs (0-31)
- code === 0x22 ||
- code === 0x2C ||
- code === 0x3B ||
- code === 0x5C ||
- code > 0x7E // non-ascii
- ) {
- throw new Error('Invalid header value')
- }
- }
-}
+ // 4.2.6.8
+ cache.push([operation.request, operation.response])
-/**
- * path-value =
- * @param {string} path
- */
-function validateCookiePath (path) {
- for (const char of path) {
- const code = char.charCodeAt(0)
+ // 4.2.6.10
+ addedItems.push([operation.request, operation.response])
+ }
- if (code < 0x21 || char === ';') {
- throw new Error('Invalid cookie path')
- }
- }
-}
+ // 4.2.7
+ resultList.push([operation.request, operation.response])
+ }
-/**
- * I have no idea why these values aren't allowed to be honest,
- * but Deno tests these. - Khafra
- * @param {string} domain
- */
-function validateCookieDomain (domain) {
- if (
- domain.startsWith('-') ||
- domain.endsWith('.') ||
- domain.endsWith('-')
- ) {
- throw new Error('Invalid cookie domain')
- }
-}
+ // 4.3
+ return resultList
+ } catch (e) { // 5.
+ // 5.1
+ this.#relevantRequestResponseList.length = 0
-/**
- * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
- * @param {number|Date} date
- IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
- ; fixed length/zone/capitalization subset of the format
- ; see Section 3.3 of [RFC5322]
+ // 5.2
+ this.#relevantRequestResponseList = backupCache
- day-name = %x4D.6F.6E ; "Mon", case-sensitive
- / %x54.75.65 ; "Tue", case-sensitive
- / %x57.65.64 ; "Wed", case-sensitive
- / %x54.68.75 ; "Thu", case-sensitive
- / %x46.72.69 ; "Fri", case-sensitive
- / %x53.61.74 ; "Sat", case-sensitive
- / %x53.75.6E ; "Sun", case-sensitive
- date1 = day SP month SP year
- ; e.g., 02 Jun 1982
+ // 5.3
+ throw e
+ }
+ }
- day = 2DIGIT
- month = %x4A.61.6E ; "Jan", case-sensitive
- / %x46.65.62 ; "Feb", case-sensitive
- / %x4D.61.72 ; "Mar", case-sensitive
- / %x41.70.72 ; "Apr", case-sensitive
- / %x4D.61.79 ; "May", case-sensitive
- / %x4A.75.6E ; "Jun", case-sensitive
- / %x4A.75.6C ; "Jul", case-sensitive
- / %x41.75.67 ; "Aug", case-sensitive
- / %x53.65.70 ; "Sep", case-sensitive
- / %x4F.63.74 ; "Oct", case-sensitive
- / %x4E.6F.76 ; "Nov", case-sensitive
- / %x44.65.63 ; "Dec", case-sensitive
- year = 4DIGIT
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#query-cache
+ * @param {any} requestQuery
+ * @param {import('../../types/cache').CacheQueryOptions} options
+ * @param {requestResponseList} targetStorage
+ * @returns {requestResponseList}
+ */
+ #queryCache (requestQuery, options, targetStorage) {
+ /** @type {requestResponseList} */
+ const resultList = []
- GMT = %x47.4D.54 ; "GMT", case-sensitive
+ const storage = targetStorage ?? this.#relevantRequestResponseList
- time-of-day = hour ":" minute ":" second
- ; 00:00:00 - 23:59:60 (leap second)
+ for (const requestResponse of storage) {
+ const [cachedRequest, cachedResponse] = requestResponse
+ if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
+ resultList.push(requestResponse)
+ }
+ }
- hour = 2DIGIT
- minute = 2DIGIT
- second = 2DIGIT
- */
-function toIMFDate (date) {
- if (typeof date === 'number') {
- date = new Date(date)
+ return resultList
}
- const days = [
- 'Sun', 'Mon', 'Tue', 'Wed',
- 'Thu', 'Fri', 'Sat'
- ]
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
+ * @param {any} requestQuery
+ * @param {any} request
+ * @param {any | null} response
+ * @param {import('../../types/cache').CacheQueryOptions | undefined} options
+ * @returns {boolean}
+ */
+ #requestMatchesCachedItem (requestQuery, request, response = null, options) {
+ // if (options?.ignoreMethod === false && request.method === 'GET') {
+ // return false
+ // }
- const months = [
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
- ]
+ const queryURL = new URL(requestQuery.url)
- const dayName = days[date.getUTCDay()]
- const day = date.getUTCDate().toString().padStart(2, '0')
- const month = months[date.getUTCMonth()]
- const year = date.getUTCFullYear()
- const hour = date.getUTCHours().toString().padStart(2, '0')
- const minute = date.getUTCMinutes().toString().padStart(2, '0')
- const second = date.getUTCSeconds().toString().padStart(2, '0')
+ const cachedURL = new URL(request.url)
- return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
-}
+ if (options?.ignoreSearch) {
+ cachedURL.search = ''
-/**
- max-age-av = "Max-Age=" non-zero-digit *DIGIT
- ; In practice, both expires-av and max-age-av
- ; are limited to dates representable by the
- ; user agent.
- * @param {number} maxAge
- */
-function validateCookieMaxAge (maxAge) {
- if (maxAge < 0) {
- throw new Error('Invalid cookie max-age')
- }
-}
+ queryURL.search = ''
+ }
-/**
- * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
- * @param {import('./index').Cookie} cookie
- */
-function stringify (cookie) {
- if (cookie.name.length === 0) {
- return null
- }
+ if (!urlEquals(queryURL, cachedURL, true)) {
+ return false
+ }
- validateCookieName(cookie.name)
- validateCookieValue(cookie.value)
+ if (
+ response == null ||
+ options?.ignoreVary ||
+ !response.headersList.contains('vary')
+ ) {
+ return true
+ }
- const out = [`${cookie.name}=${cookie.value}`]
+ const fieldValues = getFieldValues(response.headersList.get('vary'))
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
- if (cookie.name.startsWith('__Secure-')) {
- cookie.secure = true
- }
+ for (const fieldValue of fieldValues) {
+ if (fieldValue === '*') {
+ return false
+ }
- if (cookie.name.startsWith('__Host-')) {
- cookie.secure = true
- cookie.domain = null
- cookie.path = '/'
- }
+ const requestValue = request.headersList.get(fieldValue)
+ const queryValue = requestQuery.headersList.get(fieldValue)
- if (cookie.secure) {
- out.push('Secure')
- }
+ // If one has the header and the other doesn't, or one has
+ // a different value than the other, return false
+ if (requestValue !== queryValue) {
+ return false
+ }
+ }
- if (cookie.httpOnly) {
- out.push('HttpOnly')
+ return true
}
- if (typeof cookie.maxAge === 'number') {
- validateCookieMaxAge(cookie.maxAge)
- out.push(`Max-Age=${cookie.maxAge}`)
- }
+ #internalMatchAll (request, options, maxResponses = Infinity) {
+ // 1.
+ let r = null
- if (cookie.domain) {
- validateCookieDomain(cookie.domain)
- out.push(`Domain=${cookie.domain}`)
- }
+ // 2.
+ if (request !== undefined) {
+ if (request instanceof Request) {
+ // 2.1.1
+ r = request[kState]
- if (cookie.path) {
- validateCookiePath(cookie.path)
- out.push(`Path=${cookie.path}`)
- }
+ // 2.1.2
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return []
+ }
+ } else if (typeof request === 'string') {
+ // 2.2.1
+ r = new Request(request)[kState]
+ }
+ }
- if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
- out.push(`Expires=${toIMFDate(cookie.expires)}`)
- }
+ // 5.
+ // 5.1
+ const responses = []
- if (cookie.sameSite) {
- out.push(`SameSite=${cookie.sameSite}`)
- }
+ // 5.2
+ if (request === undefined) {
+ // 5.2.1
+ for (const requestResponse of this.#relevantRequestResponseList) {
+ responses.push(requestResponse[1])
+ }
+ } else { // 5.3
+ // 5.3.1
+ const requestResponses = this.#queryCache(r, options)
- for (const part of cookie.unparsed) {
- if (!part.includes('=')) {
- throw new Error('Invalid unparsed')
+ // 5.3.2
+ for (const requestResponse of requestResponses) {
+ responses.push(requestResponse[1])
+ }
}
- const [key, ...value] = part.split('=')
+ // 5.4
+ // We don't implement CORs so we don't need to loop over the responses, yay!
- out.push(`${key.trim()}=${value.join('=')}`)
- }
+ // 5.5.1
+ const responseList = []
- return out.join('; ')
+ // 5.5.2
+ for (const response of responses) {
+ // 5.5.2.1
+ const responseObject = fromInnerResponse(response, 'immutable')
+
+ responseList.push(responseObject.clone())
+
+ if (responseList.length >= maxResponses) {
+ break
+ }
+ }
+
+ // 6.
+ return Object.freeze(responseList)
+ }
}
-let kHeadersListNode
+Object.defineProperties(Cache.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'Cache',
+ configurable: true
+ },
+ match: kEnumerableProperty,
+ matchAll: kEnumerableProperty,
+ add: kEnumerableProperty,
+ addAll: kEnumerableProperty,
+ put: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ keys: kEnumerableProperty
+})
-function getHeadersList (headers) {
- if (headers[kHeadersList]) {
- return headers[kHeadersList]
+const cacheQueryOptionConverters = [
+ {
+ key: 'ignoreSearch',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'ignoreMethod',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'ignoreVary',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
}
+]
- if (!kHeadersListNode) {
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
- (symbol) => symbol.description === 'headers list'
- )
+webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
- assert(kHeadersListNode, 'Headers cannot be parsed')
+webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
+ ...cacheQueryOptionConverters,
+ {
+ key: 'cacheName',
+ converter: webidl.converters.DOMString
}
+])
- const headersList = headers[kHeadersListNode]
- assert(headersList)
+webidl.converters.Response = webidl.interfaceConverter(Response)
- return headersList
-}
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.RequestInfo
+)
module.exports = {
- isCTLExcludingHtab,
- stringify,
- getHeadersList
+ Cache
}
/***/ }),
-/***/ 2067:
+/***/ 3245:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const net = __nccwpck_require__(1808)
-const assert = __nccwpck_require__(9491)
-const util = __nccwpck_require__(3983)
-const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
-let tls // include tls conditionally since it is not always available
-
-// TODO: session re-use does not wait for the first
-// connection to resolve the session and might therefore
-// resolve the same servername multiple times even when
-// re-use is enabled.
-let SessionCache
-// FIXME: remove workaround when the Node bug is fixed
-// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
-if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
- SessionCache = class WeakSessionCache {
- constructor (maxCachedSessions) {
- this._maxCachedSessions = maxCachedSessions
- this._sessionCache = new Map()
- this._sessionRegistry = new global.FinalizationRegistry((key) => {
- if (this._sessionCache.size < this._maxCachedSessions) {
- return
- }
+const { kConstruct } = __nccwpck_require__(109)
+const { Cache } = __nccwpck_require__(9634)
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
- const ref = this._sessionCache.get(key)
- if (ref !== undefined && ref.deref() === undefined) {
- this._sessionCache.delete(key)
- }
- })
- }
+class CacheStorage {
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
+ * @type {Map= this._maxCachedSessions) {
- // remove the oldest session
- const { value: oldestKey } = this._sessionCache.keys().next()
- this._sessionCache.delete(oldestKey)
- }
+ async match (request, options = {}) {
+ webidl.brandCheck(this, CacheStorage)
+ webidl.argumentLengthCheck(arguments, 1, 'CacheStorage.match')
- this._sessionCache.set(sessionKey, session)
- }
- }
-}
+ request = webidl.converters.RequestInfo(request)
+ options = webidl.converters.MultiCacheQueryOptions(options)
-function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
- if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
- throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
- }
+ // 1.
+ if (options.cacheName != null) {
+ // 1.1.1.1
+ if (this.#caches.has(options.cacheName)) {
+ // 1.1.1.1.1
+ const cacheList = this.#caches.get(options.cacheName)
+ const cache = new Cache(kConstruct, cacheList)
- const options = { path: socketPath, ...opts }
- const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
- timeout = timeout == null ? 10e3 : timeout
- allowH2 = allowH2 != null ? allowH2 : false
- return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
- let socket
- if (protocol === 'https:') {
- if (!tls) {
- tls = __nccwpck_require__(4404)
+ return await cache.match(request, options)
}
- servername = servername || options.servername || util.getServerName(host) || null
-
- const sessionKey = servername || hostname
- const session = sessionCache.get(sessionKey) || null
-
- assert(sessionKey)
-
- socket = tls.connect({
- highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
- ...options,
- servername,
- session,
- localAddress,
- // TODO(HTTP/2): Add support for h2c
- ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
- socket: httpSocket, // upgrade socket connection
- port: port || 443,
- host: hostname
- })
+ } else { // 2.
+ // 2.2
+ for (const cacheList of this.#caches.values()) {
+ const cache = new Cache(kConstruct, cacheList)
- socket
- .on('session', function (session) {
- // TODO (fix): Can a session become invalid once established? Don't think so?
- sessionCache.set(sessionKey, session)
- })
- } else {
- assert(!httpSocket, 'httpSocket can only be sent on TLS update')
- socket = net.connect({
- highWaterMark: 64 * 1024, // Same as nodejs fs streams.
- ...options,
- localAddress,
- port: port || 80,
- host: hostname
- })
- }
+ // 2.2.1.2
+ const response = await cache.match(request, options)
- // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
- if (options.keepAlive == null || options.keepAlive) {
- const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
- socket.setKeepAlive(true, keepAliveInitialDelay)
+ if (response !== undefined) {
+ return response
+ }
+ }
}
+ }
- const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
-
- socket
- .setNoDelay(true)
- .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
- cancelTimeout()
-
- if (callback) {
- const cb = callback
- callback = null
- cb(null, this)
- }
- })
- .on('error', function (err) {
- cancelTimeout()
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
+ * @param {string} cacheName
+ * @returns {Promise}
+ */
+ async has (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
- if (callback) {
- const cb = callback
- callback = null
- cb(err)
- }
- })
+ const prefix = 'CacheStorage.has'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- return socket
- }
-}
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
-function setupTimeout (onConnectTimeout, timeout) {
- if (!timeout) {
- return () => {}
+ // 2.1.1
+ // 2.2
+ return this.#caches.has(cacheName)
}
- let s1 = null
- let s2 = null
- const timeoutId = setTimeout(() => {
- // setImmediate is added to make sure that we priotorise socket error events over timeouts
- s1 = setImmediate(() => {
- if (process.platform === 'win32') {
- // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
- s2 = setImmediate(() => onConnectTimeout())
- } else {
- onConnectTimeout()
- }
- })
- }, timeout)
- return () => {
- clearTimeout(timeoutId)
- clearImmediate(s1)
- clearImmediate(s2)
- }
-}
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
+ * @param {string} cacheName
+ * @returns {Promise}
+ */
+ async open (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
-function onConnectTimeout (socket) {
- util.destroy(socket, new ConnectTimeoutError())
-}
+ const prefix = 'CacheStorage.open'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-module.exports = buildConnector
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
+ // 2.1
+ if (this.#caches.has(cacheName)) {
+ // await caches.open('v1') !== await caches.open('v1')
-/***/ }),
+ // 2.1.1
+ const cache = this.#caches.get(cacheName)
-/***/ 4462:
-/***/ ((module) => {
+ // 2.1.1.1
+ return new Cache(kConstruct, cache)
+ }
-"use strict";
+ // 2.2
+ const cache = []
+ // 2.3
+ this.#caches.set(cacheName, cache)
-/** @type {Record} */
-const headerNameLowerCasedRecord = {}
+ // 2.4
+ return new Cache(kConstruct, cache)
+ }
-// https://developer.mozilla.org/docs/Web/HTTP/Headers
-const wellknownHeaderNames = [
- 'Accept',
- 'Accept-Encoding',
- 'Accept-Language',
- 'Accept-Ranges',
- 'Access-Control-Allow-Credentials',
- 'Access-Control-Allow-Headers',
- 'Access-Control-Allow-Methods',
- 'Access-Control-Allow-Origin',
- 'Access-Control-Expose-Headers',
- 'Access-Control-Max-Age',
- 'Access-Control-Request-Headers',
- 'Access-Control-Request-Method',
- 'Age',
- 'Allow',
- 'Alt-Svc',
- 'Alt-Used',
- 'Authorization',
- 'Cache-Control',
- 'Clear-Site-Data',
- 'Connection',
- 'Content-Disposition',
- 'Content-Encoding',
- 'Content-Language',
- 'Content-Length',
- 'Content-Location',
- 'Content-Range',
- 'Content-Security-Policy',
- 'Content-Security-Policy-Report-Only',
- 'Content-Type',
- 'Cookie',
- 'Cross-Origin-Embedder-Policy',
- 'Cross-Origin-Opener-Policy',
- 'Cross-Origin-Resource-Policy',
- 'Date',
- 'Device-Memory',
- 'Downlink',
- 'ECT',
- 'ETag',
- 'Expect',
- 'Expect-CT',
- 'Expires',
- 'Forwarded',
- 'From',
- 'Host',
- 'If-Match',
- 'If-Modified-Since',
- 'If-None-Match',
- 'If-Range',
- 'If-Unmodified-Since',
- 'Keep-Alive',
- 'Last-Modified',
- 'Link',
- 'Location',
- 'Max-Forwards',
- 'Origin',
- 'Permissions-Policy',
- 'Pragma',
- 'Proxy-Authenticate',
- 'Proxy-Authorization',
- 'RTT',
- 'Range',
- 'Referer',
- 'Referrer-Policy',
- 'Refresh',
- 'Retry-After',
- 'Sec-WebSocket-Accept',
- 'Sec-WebSocket-Extensions',
- 'Sec-WebSocket-Key',
- 'Sec-WebSocket-Protocol',
- 'Sec-WebSocket-Version',
- 'Server',
- 'Server-Timing',
- 'Service-Worker-Allowed',
- 'Service-Worker-Navigation-Preload',
- 'Set-Cookie',
- 'SourceMap',
- 'Strict-Transport-Security',
- 'Supports-Loading-Mode',
- 'TE',
- 'Timing-Allow-Origin',
- 'Trailer',
- 'Transfer-Encoding',
- 'Upgrade',
- 'Upgrade-Insecure-Requests',
- 'User-Agent',
- 'Vary',
- 'Via',
- 'WWW-Authenticate',
- 'X-Content-Type-Options',
- 'X-DNS-Prefetch-Control',
- 'X-Frame-Options',
- 'X-Permitted-Cross-Domain-Policies',
- 'X-Powered-By',
- 'X-Requested-With',
- 'X-XSS-Protection'
-]
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
+ * @param {string} cacheName
+ * @returns {Promise}
+ */
+ async delete (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
-for (let i = 0; i < wellknownHeaderNames.length; ++i) {
- const key = wellknownHeaderNames[i]
- const lowerCasedKey = key.toLowerCase()
- headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
- lowerCasedKey
+ const prefix = 'CacheStorage.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
+
+ return this.#caches.delete(cacheName)
+ }
+
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
+ * @returns {Promise}
+ */
+ async keys () {
+ webidl.brandCheck(this, CacheStorage)
+
+ // 2.1
+ const keys = this.#caches.keys()
+
+ // 2.2
+ return [...keys]
+ }
}
-// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
-Object.setPrototypeOf(headerNameLowerCasedRecord, null)
+Object.defineProperties(CacheStorage.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'CacheStorage',
+ configurable: true
+ },
+ match: kEnumerableProperty,
+ has: kEnumerableProperty,
+ open: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ keys: kEnumerableProperty
+})
module.exports = {
- wellknownHeaderNames,
- headerNameLowerCasedRecord
+ CacheStorage
}
/***/ }),
-/***/ 8045:
-/***/ ((module) => {
+/***/ 109:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-class UndiciError extends Error {
- constructor (message) {
- super(message)
- this.name = 'UndiciError'
- this.code = 'UND_ERR'
- }
+module.exports = {
+ kConstruct: (__nccwpck_require__(6443).kConstruct)
}
-class ConnectTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ConnectTimeoutError)
- this.name = 'ConnectTimeoutError'
- this.message = message || 'Connect Timeout Error'
- this.code = 'UND_ERR_CONNECT_TIMEOUT'
- }
-}
-class HeadersTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, HeadersTimeoutError)
- this.name = 'HeadersTimeoutError'
- this.message = message || 'Headers Timeout Error'
- this.code = 'UND_ERR_HEADERS_TIMEOUT'
- }
-}
+/***/ }),
-class HeadersOverflowError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, HeadersOverflowError)
- this.name = 'HeadersOverflowError'
- this.message = message || 'Headers Overflow Error'
- this.code = 'UND_ERR_HEADERS_OVERFLOW'
- }
-}
+/***/ 6798:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-class BodyTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, BodyTimeoutError)
- this.name = 'BodyTimeoutError'
- this.message = message || 'Body Timeout Error'
- this.code = 'UND_ERR_BODY_TIMEOUT'
- }
-}
-class ResponseStatusCodeError extends UndiciError {
- constructor (message, statusCode, headers, body) {
- super(message)
- Error.captureStackTrace(this, ResponseStatusCodeError)
- this.name = 'ResponseStatusCodeError'
- this.message = message || 'Response Status Code Error'
- this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
- this.body = body
- this.status = statusCode
- this.statusCode = statusCode
- this.headers = headers
- }
-}
-class InvalidArgumentError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InvalidArgumentError)
- this.name = 'InvalidArgumentError'
- this.message = message || 'Invalid Argument Error'
- this.code = 'UND_ERR_INVALID_ARG'
- }
-}
+const assert = __nccwpck_require__(4589)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { isValidHeaderName } = __nccwpck_require__(3168)
-class InvalidReturnValueError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InvalidReturnValueError)
- this.name = 'InvalidReturnValueError'
- this.message = message || 'Invalid Return Value Error'
- this.code = 'UND_ERR_INVALID_RETURN_VALUE'
- }
-}
+/**
+ * @see https://url.spec.whatwg.org/#concept-url-equals
+ * @param {URL} A
+ * @param {URL} B
+ * @param {boolean | undefined} excludeFragment
+ * @returns {boolean}
+ */
+function urlEquals (A, B, excludeFragment = false) {
+ const serializedA = URLSerializer(A, excludeFragment)
-class RequestAbortedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, RequestAbortedError)
- this.name = 'AbortError'
- this.message = message || 'Request aborted'
- this.code = 'UND_ERR_ABORTED'
- }
-}
+ const serializedB = URLSerializer(B, excludeFragment)
-class InformationalError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InformationalError)
- this.name = 'InformationalError'
- this.message = message || 'Request information'
- this.code = 'UND_ERR_INFO'
- }
+ return serializedA === serializedB
}
-class RequestContentLengthMismatchError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, RequestContentLengthMismatchError)
- this.name = 'RequestContentLengthMismatchError'
- this.message = message || 'Request body length does not match content-length header'
- this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
- }
-}
+/**
+ * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
+ * @param {string} header
+ */
+function getFieldValues (header) {
+ assert(header !== null)
-class ResponseContentLengthMismatchError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ResponseContentLengthMismatchError)
- this.name = 'ResponseContentLengthMismatchError'
- this.message = message || 'Response body length does not match content-length header'
- this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
- }
-}
+ const values = []
-class ClientDestroyedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ClientDestroyedError)
- this.name = 'ClientDestroyedError'
- this.message = message || 'The client is destroyed'
- this.code = 'UND_ERR_DESTROYED'
- }
-}
+ for (let value of header.split(',')) {
+ value = value.trim()
-class ClientClosedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ClientClosedError)
- this.name = 'ClientClosedError'
- this.message = message || 'The client is closed'
- this.code = 'UND_ERR_CLOSED'
+ if (isValidHeaderName(value)) {
+ values.push(value)
+ }
}
-}
-class SocketError extends UndiciError {
- constructor (message, socket) {
- super(message)
- Error.captureStackTrace(this, SocketError)
- this.name = 'SocketError'
- this.message = message || 'Socket error'
- this.code = 'UND_ERR_SOCKET'
- this.socket = socket
- }
+ return values
}
-class NotSupportedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, NotSupportedError)
- this.name = 'NotSupportedError'
- this.message = message || 'Not supported error'
- this.code = 'UND_ERR_NOT_SUPPORTED'
- }
+module.exports = {
+ urlEquals,
+ getFieldValues
}
-class BalancedPoolMissingUpstreamError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, NotSupportedError)
- this.name = 'MissingUpstreamError'
- this.message = message || 'No upstream has been added to the BalancedPool'
- this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
- }
-}
-class HTTPParserError extends Error {
- constructor (message, code, data) {
- super(message)
- Error.captureStackTrace(this, HTTPParserError)
- this.name = 'HTTPParserError'
- this.code = code ? `HPE_${code}` : undefined
- this.data = data ? data.toString() : undefined
- }
-}
+/***/ }),
+
+/***/ 1276:
+/***/ ((module) => {
-class ResponseExceededMaxSizeError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ResponseExceededMaxSizeError)
- this.name = 'ResponseExceededMaxSizeError'
- this.message = message || 'Response content exceeded max size'
- this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
- }
-}
-class RequestRetryError extends UndiciError {
- constructor (message, code, { headers, data }) {
- super(message)
- Error.captureStackTrace(this, RequestRetryError)
- this.name = 'RequestRetryError'
- this.message = message || 'Request retry error'
- this.code = 'UND_ERR_REQ_RETRY'
- this.statusCode = code
- this.data = data
- this.headers = headers
- }
-}
+
+// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
+const maxAttributeValueSize = 1024
+
+// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
+const maxNameValuePairSize = 4096
module.exports = {
- HTTPParserError,
- UndiciError,
- HeadersTimeoutError,
- HeadersOverflowError,
- BodyTimeoutError,
- RequestContentLengthMismatchError,
- ConnectTimeoutError,
- ResponseStatusCodeError,
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError,
- ClientDestroyedError,
- ClientClosedError,
- InformationalError,
- SocketError,
- NotSupportedError,
- ResponseContentLengthMismatchError,
- BalancedPoolMissingUpstreamError,
- ResponseExceededMaxSizeError,
- RequestRetryError
+ maxAttributeValueSize,
+ maxNameValuePairSize
}
/***/ }),
-/***/ 2905:
+/***/ 9061:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-const {
- InvalidArgumentError,
- NotSupportedError
-} = __nccwpck_require__(8045)
-const assert = __nccwpck_require__(9491)
-const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
-const util = __nccwpck_require__(3983)
-// tokenRegExp and headerCharRegex have been lifted from
-// https://github.com/nodejs/node/blob/main/lib/_http_common.js
+const { parseSetCookie } = __nccwpck_require__(1978)
+const { stringify } = __nccwpck_require__(7797)
+const { webidl } = __nccwpck_require__(5893)
+const { Headers } = __nccwpck_require__(660)
/**
- * Verifies that the given val is a valid HTTP token
- * per the rules defined in RFC 7230
- * See https://tools.ietf.org/html/rfc7230#section-3.2.6
+ * @typedef {Object} Cookie
+ * @property {string} name
+ * @property {string} value
+ * @property {Date|number|undefined} expires
+ * @property {number|undefined} maxAge
+ * @property {string|undefined} domain
+ * @property {string|undefined} path
+ * @property {boolean|undefined} secure
+ * @property {boolean|undefined} httpOnly
+ * @property {'Strict'|'Lax'|'None'} sameSite
+ * @property {string[]} unparsed
*/
-const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
/**
- * Matches if val contains an invalid field-vchar
- * field-value = *( field-content / obs-fold )
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
- * field-vchar = VCHAR / obs-text
+ * @param {Headers} headers
+ * @returns {Record}
*/
-const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
+function getCookies (headers) {
+ webidl.argumentLengthCheck(arguments, 1, 'getCookies')
-// Verifies that a given path is valid does not contain control chars \x00 to \x20
-const invalidPathRegex = /[^\u0021-\u00ff]/
+ webidl.brandCheck(headers, Headers, { strict: false })
-const kHandler = Symbol('handler')
+ const cookie = headers.get('cookie')
+ const out = {}
-const channels = {}
+ if (!cookie) {
+ return out
+ }
-let extractBody
+ for (const piece of cookie.split(';')) {
+ const [name, ...value] = piece.split('=')
-try {
- const diagnosticsChannel = __nccwpck_require__(7643)
- channels.create = diagnosticsChannel.channel('undici:request:create')
- channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
- channels.headers = diagnosticsChannel.channel('undici:request:headers')
- channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
- channels.error = diagnosticsChannel.channel('undici:request:error')
-} catch {
- channels.create = { hasSubscribers: false }
- channels.bodySent = { hasSubscribers: false }
- channels.headers = { hasSubscribers: false }
- channels.trailers = { hasSubscribers: false }
- channels.error = { hasSubscribers: false }
+ out[name.trim()] = value.join('=')
+ }
+
+ return out
}
-class Request {
- constructor (origin, {
- path,
- method,
- body,
- headers,
- query,
- idempotent,
- blocking,
- upgrade,
- headersTimeout,
- bodyTimeout,
- reset,
- throwOnError,
- expectContinue
- }, handler) {
- if (typeof path !== 'string') {
- throw new InvalidArgumentError('path must be a string')
- } else if (
- path[0] !== '/' &&
- !(path.startsWith('http://') || path.startsWith('https://')) &&
- method !== 'CONNECT'
- ) {
- throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
- } else if (invalidPathRegex.exec(path) !== null) {
- throw new InvalidArgumentError('invalid request path')
- }
+/**
+ * @param {Headers} headers
+ * @param {string} name
+ * @param {{ path?: string, domain?: string }|undefined} attributes
+ * @returns {void}
+ */
+function deleteCookie (headers, name, attributes) {
+ webidl.brandCheck(headers, Headers, { strict: false })
- if (typeof method !== 'string') {
- throw new InvalidArgumentError('method must be a string')
- } else if (tokenRegExp.exec(method) === null) {
- throw new InvalidArgumentError('invalid request method')
- }
+ const prefix = 'deleteCookie'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
- if (upgrade && typeof upgrade !== 'string') {
- throw new InvalidArgumentError('upgrade must be a string')
- }
+ name = webidl.converters.DOMString(name, prefix, 'name')
+ attributes = webidl.converters.DeleteCookieAttributes(attributes)
- if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
- throw new InvalidArgumentError('invalid headersTimeout')
- }
+ // Matches behavior of
+ // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
+ setCookie(headers, {
+ name,
+ value: '',
+ expires: new Date(0),
+ ...attributes
+ })
+}
- if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
- throw new InvalidArgumentError('invalid bodyTimeout')
- }
+/**
+ * @param {Headers} headers
+ * @returns {Cookie[]}
+ */
+function getSetCookies (headers) {
+ webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')
- if (reset != null && typeof reset !== 'boolean') {
- throw new InvalidArgumentError('invalid reset')
- }
+ webidl.brandCheck(headers, Headers, { strict: false })
- if (expectContinue != null && typeof expectContinue !== 'boolean') {
- throw new InvalidArgumentError('invalid expectContinue')
- }
+ const cookies = headers.getSetCookie()
- this.headersTimeout = headersTimeout
+ if (!cookies) {
+ return []
+ }
- this.bodyTimeout = bodyTimeout
+ return cookies.map((pair) => parseSetCookie(pair))
+}
- this.throwOnError = throwOnError === true
+/**
+ * @param {Headers} headers
+ * @param {Cookie} cookie
+ * @returns {void}
+ */
+function setCookie (headers, cookie) {
+ webidl.argumentLengthCheck(arguments, 2, 'setCookie')
- this.method = method
+ webidl.brandCheck(headers, Headers, { strict: false })
- this.abort = null
+ cookie = webidl.converters.Cookie(cookie)
- if (body == null) {
- this.body = null
- } else if (util.isStream(body)) {
- this.body = body
+ const str = stringify(cookie)
- const rState = this.body._readableState
- if (!rState || !rState.autoDestroy) {
- this.endHandler = function autoDestroy () {
- util.destroy(this)
- }
- this.body.on('end', this.endHandler)
- }
+ if (str) {
+ headers.append('Set-Cookie', str)
+ }
+}
- this.errorHandler = err => {
- if (this.abort) {
- this.abort(err)
- } else {
- this.error = err
- }
+webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'path',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'domain',
+ defaultValue: () => null
+ }
+])
+
+webidl.converters.Cookie = webidl.dictionaryConverter([
+ {
+ converter: webidl.converters.DOMString,
+ key: 'name'
+ },
+ {
+ converter: webidl.converters.DOMString,
+ key: 'value'
+ },
+ {
+ converter: webidl.nullableConverter((value) => {
+ if (typeof value === 'number') {
+ return webidl.converters['unsigned long long'](value)
}
- this.body.on('error', this.errorHandler)
- } else if (util.isBuffer(body)) {
- this.body = body.byteLength ? body : null
- } else if (ArrayBuffer.isView(body)) {
- this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
- } else if (body instanceof ArrayBuffer) {
- this.body = body.byteLength ? Buffer.from(body) : null
- } else if (typeof body === 'string') {
- this.body = body.length ? Buffer.from(body) : null
- } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
- this.body = body
- } else {
- throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
- }
- this.completed = false
+ return new Date(value)
+ }),
+ key: 'expires',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters['long long']),
+ key: 'maxAge',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'domain',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'path',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.boolean),
+ key: 'secure',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.boolean),
+ key: 'httpOnly',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.converters.USVString,
+ key: 'sameSite',
+ allowedValues: ['Strict', 'Lax', 'None']
+ },
+ {
+ converter: webidl.sequenceConverter(webidl.converters.DOMString),
+ key: 'unparsed',
+ defaultValue: () => new Array(0)
+ }
+])
- this.aborted = false
+module.exports = {
+ getCookies,
+ deleteCookie,
+ getSetCookies,
+ setCookie
+}
- this.upgrade = upgrade || null
- this.path = query ? util.buildURL(path, query) : path
+/***/ }),
- this.origin = origin
+/***/ 1978:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(1276)
+const { isCTLExcludingHtab } = __nccwpck_require__(7797)
+const { collectASequenceOfCodePointsFast } = __nccwpck_require__(1900)
+const assert = __nccwpck_require__(4589)
+
+/**
+ * @description Parses the field-value attributes of a set-cookie header string.
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
+ * @param {string} header
+ * @returns if the header is invalid, null will be returned
+ */
+function parseSetCookie (header) {
+ // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
+ // character (CTL characters excluding HTAB): Abort these steps and
+ // ignore the set-cookie-string entirely.
+ if (isCTLExcludingHtab(header)) {
+ return null
+ }
+
+ let nameValuePair = ''
+ let unparsedAttributes = ''
+ let name = ''
+ let value = ''
+
+ // 2. If the set-cookie-string contains a %x3B (";") character:
+ if (header.includes(';')) {
+ // 1. The name-value-pair string consists of the characters up to,
+ // but not including, the first %x3B (";"), and the unparsed-
+ // attributes consist of the remainder of the set-cookie-string
+ // (including the %x3B (";") in question).
+ const position = { position: 0 }
- this.idempotent = idempotent == null
- ? method === 'HEAD' || method === 'GET'
- : idempotent
+ nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
+ unparsedAttributes = header.slice(position.position)
+ } else {
+ // Otherwise:
- this.blocking = blocking == null ? false : blocking
+ // 1. The name-value-pair string consists of all the characters
+ // contained in the set-cookie-string, and the unparsed-
+ // attributes is the empty string.
+ nameValuePair = header
+ }
- this.reset = reset == null ? null : reset
+ // 3. If the name-value-pair string lacks a %x3D ("=") character, then
+ // the name string is empty, and the value string is the value of
+ // name-value-pair.
+ if (!nameValuePair.includes('=')) {
+ value = nameValuePair
+ } else {
+ // Otherwise, the name string consists of the characters up to, but
+ // not including, the first %x3D ("=") character, and the (possibly
+ // empty) value string consists of the characters after the first
+ // %x3D ("=") character.
+ const position = { position: 0 }
+ name = collectASequenceOfCodePointsFast(
+ '=',
+ nameValuePair,
+ position
+ )
+ value = nameValuePair.slice(position.position + 1)
+ }
- this.host = null
+ // 4. Remove any leading or trailing WSP characters from the name
+ // string and the value string.
+ name = name.trim()
+ value = value.trim()
- this.contentLength = null
+ // 5. If the sum of the lengths of the name string and the value string
+ // is more than 4096 octets, abort these steps and ignore the set-
+ // cookie-string entirely.
+ if (name.length + value.length > maxNameValuePairSize) {
+ return null
+ }
- this.contentType = null
+ // 6. The cookie-name is the name string, and the cookie-value is the
+ // value string.
+ return {
+ name, value, ...parseUnparsedAttributes(unparsedAttributes)
+ }
+}
- this.headers = ''
+/**
+ * Parses the remaining attributes of a set-cookie header
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
+ * @param {string} unparsedAttributes
+ * @param {[Object.]={}} cookieAttributeList
+ */
+function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
+ // 1. If the unparsed-attributes string is empty, skip the rest of
+ // these steps.
+ if (unparsedAttributes.length === 0) {
+ return cookieAttributeList
+ }
- // Only for H2
- this.expectContinue = expectContinue != null ? expectContinue : false
+ // 2. Discard the first character of the unparsed-attributes (which
+ // will be a %x3B (";") character).
+ assert(unparsedAttributes[0] === ';')
+ unparsedAttributes = unparsedAttributes.slice(1)
- if (Array.isArray(headers)) {
- if (headers.length % 2 !== 0) {
- throw new InvalidArgumentError('headers array must be even')
- }
- for (let i = 0; i < headers.length; i += 2) {
- processHeader(this, headers[i], headers[i + 1])
- }
- } else if (headers && typeof headers === 'object') {
- const keys = Object.keys(headers)
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i]
- processHeader(this, key, headers[key])
- }
- } else if (headers != null) {
- throw new InvalidArgumentError('headers must be an object or an array')
- }
+ let cookieAv = ''
- if (util.isFormDataLike(this.body)) {
- if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
- throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
- }
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
+ // character:
+ if (unparsedAttributes.includes(';')) {
+ // 1. Consume the characters of the unparsed-attributes up to, but
+ // not including, the first %x3B (";") character.
+ cookieAv = collectASequenceOfCodePointsFast(
+ ';',
+ unparsedAttributes,
+ { position: 0 }
+ )
+ unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
+ } else {
+ // Otherwise:
- if (!extractBody) {
- extractBody = (__nccwpck_require__(1472).extractBody)
- }
+ // 1. Consume the remainder of the unparsed-attributes.
+ cookieAv = unparsedAttributes
+ unparsedAttributes = ''
+ }
- const [bodyStream, contentType] = extractBody(body)
- if (this.contentType == null) {
- this.contentType = contentType
- this.headers += `content-type: ${contentType}\r\n`
- }
- this.body = bodyStream.stream
- this.contentLength = bodyStream.length
- } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
- this.contentType = body.type
- this.headers += `content-type: ${body.type}\r\n`
- }
+ // Let the cookie-av string be the characters consumed in this step.
- util.validateHandler(handler, method, upgrade)
+ let attributeName = ''
+ let attributeValue = ''
- this.servername = util.getServerName(this.host)
+ // 4. If the cookie-av string contains a %x3D ("=") character:
+ if (cookieAv.includes('=')) {
+ // 1. The (possibly empty) attribute-name string consists of the
+ // characters up to, but not including, the first %x3D ("=")
+ // character, and the (possibly empty) attribute-value string
+ // consists of the characters after the first %x3D ("=")
+ // character.
+ const position = { position: 0 }
- this[kHandler] = handler
+ attributeName = collectASequenceOfCodePointsFast(
+ '=',
+ cookieAv,
+ position
+ )
+ attributeValue = cookieAv.slice(position.position + 1)
+ } else {
+ // Otherwise:
- if (channels.create.hasSubscribers) {
- channels.create.publish({ request: this })
- }
+ // 1. The attribute-name string consists of the entire cookie-av
+ // string, and the attribute-value string is empty.
+ attributeName = cookieAv
}
- onBodySent (chunk) {
- if (this[kHandler].onBodySent) {
- try {
- return this[kHandler].onBodySent(chunk)
- } catch (err) {
- this.abort(err)
- }
- }
+ // 5. Remove any leading or trailing WSP characters from the attribute-
+ // name string and the attribute-value string.
+ attributeName = attributeName.trim()
+ attributeValue = attributeValue.trim()
+
+ // 6. If the attribute-value is longer than 1024 octets, ignore the
+ // cookie-av string and return to Step 1 of this algorithm.
+ if (attributeValue.length > maxAttributeValueSize) {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
- onRequestSent () {
- if (channels.bodySent.hasSubscribers) {
- channels.bodySent.publish({ request: this })
- }
+ // 7. Process the attribute-name and attribute-value according to the
+ // requirements in the following subsections. (Notice that
+ // attributes with unrecognized attribute-names are ignored.)
+ const attributeNameLowercase = attributeName.toLowerCase()
- if (this[kHandler].onRequestSent) {
- try {
- return this[kHandler].onRequestSent()
- } catch (err) {
- this.abort(err)
- }
- }
- }
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
+ // If the attribute-name case-insensitively matches the string
+ // "Expires", the user agent MUST process the cookie-av as follows.
+ if (attributeNameLowercase === 'expires') {
+ // 1. Let the expiry-time be the result of parsing the attribute-value
+ // as cookie-date (see Section 5.1.1).
+ const expiryTime = new Date(attributeValue)
- onConnect (abort) {
- assert(!this.aborted)
- assert(!this.completed)
+ // 2. If the attribute-value failed to parse as a cookie date, ignore
+ // the cookie-av.
- if (this.error) {
- abort(this.error)
- } else {
- this.abort = abort
- return this[kHandler].onConnect(abort)
- }
- }
+ cookieAttributeList.expires = expiryTime
+ } else if (attributeNameLowercase === 'max-age') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
+ // If the attribute-name case-insensitively matches the string "Max-
+ // Age", the user agent MUST process the cookie-av as follows.
- onHeaders (statusCode, headers, resume, statusText) {
- assert(!this.aborted)
- assert(!this.completed)
+ // 1. If the first character of the attribute-value is not a DIGIT or a
+ // "-" character, ignore the cookie-av.
+ const charCode = attributeValue.charCodeAt(0)
- if (channels.headers.hasSubscribers) {
- channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
+ if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
- try {
- return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
- } catch (err) {
- this.abort(err)
+ // 2. If the remainder of attribute-value contains a non-DIGIT
+ // character, ignore the cookie-av.
+ if (!/^\d+$/.test(attributeValue)) {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
- }
- onData (chunk) {
- assert(!this.aborted)
- assert(!this.completed)
+ // 3. Let delta-seconds be the attribute-value converted to an integer.
+ const deltaSeconds = Number(attributeValue)
- try {
- return this[kHandler].onData(chunk)
- } catch (err) {
- this.abort(err)
- return false
- }
- }
+ // 4. Let cookie-age-limit be the maximum age of the cookie (which
+ // SHOULD be 400 days or less, see Section 4.1.2.2).
- onUpgrade (statusCode, headers, socket) {
- assert(!this.aborted)
- assert(!this.completed)
+ // 5. Set delta-seconds to the smaller of its present value and cookie-
+ // age-limit.
+ // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
- return this[kHandler].onUpgrade(statusCode, headers, socket)
- }
+ // 6. If delta-seconds is less than or equal to zero (0), let expiry-
+ // time be the earliest representable date and time. Otherwise, let
+ // the expiry-time be the current date and time plus delta-seconds
+ // seconds.
+ // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
- onComplete (trailers) {
- this.onFinally()
+ // 7. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Max-Age and an attribute-value of expiry-time.
+ cookieAttributeList.maxAge = deltaSeconds
+ } else if (attributeNameLowercase === 'domain') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
+ // If the attribute-name case-insensitively matches the string "Domain",
+ // the user agent MUST process the cookie-av as follows.
- assert(!this.aborted)
+ // 1. Let cookie-domain be the attribute-value.
+ let cookieDomain = attributeValue
- this.completed = true
- if (channels.trailers.hasSubscribers) {
- channels.trailers.publish({ request: this, trailers })
+ // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
+ // cookie-domain without its leading %x2E (".").
+ if (cookieDomain[0] === '.') {
+ cookieDomain = cookieDomain.slice(1)
}
- try {
- return this[kHandler].onComplete(trailers)
- } catch (err) {
- // TODO (fix): This might be a bad idea?
- this.onError(err)
- }
- }
+ // 3. Convert the cookie-domain to lower case.
+ cookieDomain = cookieDomain.toLowerCase()
- onError (error) {
- this.onFinally()
+ // 4. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Domain and an attribute-value of cookie-domain.
+ cookieAttributeList.domain = cookieDomain
+ } else if (attributeNameLowercase === 'path') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
+ // If the attribute-name case-insensitively matches the string "Path",
+ // the user agent MUST process the cookie-av as follows.
- if (channels.error.hasSubscribers) {
- channels.error.publish({ request: this, error })
- }
+ // 1. If the attribute-value is empty or if the first character of the
+ // attribute-value is not %x2F ("/"):
+ let cookiePath = ''
+ if (attributeValue.length === 0 || attributeValue[0] !== '/') {
+ // 1. Let cookie-path be the default-path.
+ cookiePath = '/'
+ } else {
+ // Otherwise:
- if (this.aborted) {
- return
+ // 1. Let cookie-path be the attribute-value.
+ cookiePath = attributeValue
}
- this.aborted = true
- return this[kHandler].onError(error)
- }
+ // 2. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Path and an attribute-value of cookie-path.
+ cookieAttributeList.path = cookiePath
+ } else if (attributeNameLowercase === 'secure') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
+ // If the attribute-name case-insensitively matches the string "Secure",
+ // the user agent MUST append an attribute to the cookie-attribute-list
+ // with an attribute-name of Secure and an empty attribute-value.
- onFinally () {
- if (this.errorHandler) {
- this.body.off('error', this.errorHandler)
- this.errorHandler = null
- }
+ cookieAttributeList.secure = true
+ } else if (attributeNameLowercase === 'httponly') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
+ // If the attribute-name case-insensitively matches the string
+ // "HttpOnly", the user agent MUST append an attribute to the cookie-
+ // attribute-list with an attribute-name of HttpOnly and an empty
+ // attribute-value.
- if (this.endHandler) {
- this.body.off('end', this.endHandler)
- this.endHandler = null
- }
- }
+ cookieAttributeList.httpOnly = true
+ } else if (attributeNameLowercase === 'samesite') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
+ // If the attribute-name case-insensitively matches the string
+ // "SameSite", the user agent MUST process the cookie-av as follows:
- // TODO: adjust to support H2
- addHeader (key, value) {
- processHeader(this, key, value)
- return this
- }
+ const attributeValueLowercase = attributeValue.toLowerCase()
+
+ // 1. If cookie-av's attribute-value is a case-insensitive match for
+ // "None", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "None".
+ if (attributeValueLowercase === 'none') {
+ cookieAttributeList.sameSite = 'None'
+ } else if (attributeValueLowercase === 'strict') {
+ // 2. If cookie-av's attribute-value is a case-insensitive match for
+ // "Strict", append an attribute to the cookie-attribute-list with
+ // an attribute-name of "SameSite" and an attribute-value of
+ // "Strict".
+ cookieAttributeList.sameSite = 'Strict'
+ } else if (attributeValueLowercase === 'lax') {
+ // 3. If cookie-av's attribute-value is a case-insensitive match for
+ // "Lax", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "Lax".
+ cookieAttributeList.sameSite = 'Lax'
+ }
+ } else {
+ cookieAttributeList.unparsed ??= []
- static [kHTTP1BuildRequest] (origin, opts, handler) {
- // TODO: Migrate header parsing here, to make Requests
- // HTTP agnostic
- return new Request(origin, opts, handler)
+ cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
}
- static [kHTTP2BuildRequest] (origin, opts, handler) {
- const headers = opts.headers
- opts = { ...opts, headers: null }
+ // 8. Return to Step 1 of this algorithm.
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+}
- const request = new Request(origin, opts, handler)
+module.exports = {
+ parseSetCookie,
+ parseUnparsedAttributes
+}
- request.headers = {}
- if (Array.isArray(headers)) {
- if (headers.length % 2 !== 0) {
- throw new InvalidArgumentError('headers array must be even')
- }
- for (let i = 0; i < headers.length; i += 2) {
- processHeader(request, headers[i], headers[i + 1], true)
- }
- } else if (headers && typeof headers === 'object') {
- const keys = Object.keys(headers)
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i]
- processHeader(request, key, headers[key], true)
- }
- } else if (headers != null) {
- throw new InvalidArgumentError('headers must be an object or an array')
- }
+/***/ }),
- return request
- }
+/***/ 7797:
+/***/ ((module) => {
- static [kHTTP2CopyHeaders] (raw) {
- const rawHeaders = raw.split('\r\n')
- const headers = {}
- for (const header of rawHeaders) {
- const [key, value] = header.split(': ')
- if (value == null || value.length === 0) continue
+/**
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isCTLExcludingHtab (value) {
+ for (let i = 0; i < value.length; ++i) {
+ const code = value.charCodeAt(i)
- if (headers[key]) headers[key] += `,${value}`
- else headers[key] = value
+ if (
+ (code >= 0x00 && code <= 0x08) ||
+ (code >= 0x0A && code <= 0x1F) ||
+ code === 0x7F
+ ) {
+ return true
}
-
- return headers
}
+ return false
}
-function processHeaderValue (key, val, skipAppend) {
- if (val && typeof val === 'object') {
- throw new InvalidArgumentError(`invalid ${key} header`)
- }
-
- val = val != null ? `${val}` : ''
+/**
+ CHAR =
+ token = 1*
+ separators = "(" | ")" | "<" | ">" | "@"
+ | "," | ";" | ":" | "\" | <">
+ | "/" | "[" | "]" | "?" | "="
+ | "{" | "}" | SP | HT
+ * @param {string} name
+ */
+function validateCookieName (name) {
+ for (let i = 0; i < name.length; ++i) {
+ const code = name.charCodeAt(i)
- if (headerCharRegex.exec(val) !== null) {
- throw new InvalidArgumentError(`invalid ${key} header`)
+ if (
+ code < 0x21 || // exclude CTLs (0-31), SP and HT
+ code > 0x7E || // exclude non-ascii and DEL
+ code === 0x22 || // "
+ code === 0x28 || // (
+ code === 0x29 || // )
+ code === 0x3C || // <
+ code === 0x3E || // >
+ code === 0x40 || // @
+ code === 0x2C || // ,
+ code === 0x3B || // ;
+ code === 0x3A || // :
+ code === 0x5C || // \
+ code === 0x2F || // /
+ code === 0x5B || // [
+ code === 0x5D || // ]
+ code === 0x3F || // ?
+ code === 0x3D || // =
+ code === 0x7B || // {
+ code === 0x7D // }
+ ) {
+ throw new Error('Invalid cookie name')
+ }
}
-
- return skipAppend ? val : `${key}: ${val}\r\n`
}
-function processHeader (request, key, val, skipAppend = false) {
- if (val && (typeof val === 'object' && !Array.isArray(val))) {
- throw new InvalidArgumentError(`invalid ${key} header`)
- } else if (val === undefined) {
- return
- }
+/**
+ cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
+ cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
+ ; US-ASCII characters excluding CTLs,
+ ; whitespace DQUOTE, comma, semicolon,
+ ; and backslash
+ * @param {string} value
+ */
+function validateCookieValue (value) {
+ let len = value.length
+ let i = 0
- if (
- request.host === null &&
- key.length === 4 &&
- key.toLowerCase() === 'host'
- ) {
- if (headerCharRegex.exec(val) !== null) {
- throw new InvalidArgumentError(`invalid ${key} header`)
- }
- // Consumed by Client
- request.host = val
- } else if (
- request.contentLength === null &&
- key.length === 14 &&
- key.toLowerCase() === 'content-length'
- ) {
- request.contentLength = parseInt(val, 10)
- if (!Number.isFinite(request.contentLength)) {
- throw new InvalidArgumentError('invalid content-length header')
- }
- } else if (
- request.contentType === null &&
- key.length === 12 &&
- key.toLowerCase() === 'content-type'
- ) {
- request.contentType = val
- if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
- else request.headers += processHeaderValue(key, val)
- } else if (
- key.length === 17 &&
- key.toLowerCase() === 'transfer-encoding'
- ) {
- throw new InvalidArgumentError('invalid transfer-encoding header')
- } else if (
- key.length === 10 &&
- key.toLowerCase() === 'connection'
- ) {
- const value = typeof val === 'string' ? val.toLowerCase() : null
- if (value !== 'close' && value !== 'keep-alive') {
- throw new InvalidArgumentError('invalid connection header')
- } else if (value === 'close') {
- request.reset = true
- }
- } else if (
- key.length === 10 &&
- key.toLowerCase() === 'keep-alive'
- ) {
- throw new InvalidArgumentError('invalid keep-alive header')
- } else if (
- key.length === 7 &&
- key.toLowerCase() === 'upgrade'
- ) {
- throw new InvalidArgumentError('invalid upgrade header')
- } else if (
- key.length === 6 &&
- key.toLowerCase() === 'expect'
- ) {
- throw new NotSupportedError('expect header not supported')
- } else if (tokenRegExp.exec(key) === null) {
- throw new InvalidArgumentError('invalid header key')
- } else {
- if (Array.isArray(val)) {
- for (let i = 0; i < val.length; i++) {
- if (skipAppend) {
- if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
- else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
- } else {
- request.headers += processHeaderValue(key, val[i])
- }
- }
- } else {
- if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
- else request.headers += processHeaderValue(key, val)
+ // if the value is wrapped in DQUOTE
+ if (value[0] === '"') {
+ if (len === 1 || value[len - 1] !== '"') {
+ throw new Error('Invalid cookie value')
}
+ --len
+ ++i
}
-}
-
-module.exports = Request
-
-/***/ }),
-
-/***/ 2785:
-/***/ ((module) => {
+ while (i < len) {
+ const code = value.charCodeAt(i++)
-module.exports = {
- kClose: Symbol('close'),
- kDestroy: Symbol('destroy'),
- kDispatch: Symbol('dispatch'),
- kUrl: Symbol('url'),
- kWriting: Symbol('writing'),
- kResuming: Symbol('resuming'),
- kQueue: Symbol('queue'),
- kConnect: Symbol('connect'),
- kConnecting: Symbol('connecting'),
- kHeadersList: Symbol('headers list'),
- kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
- kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
- kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
- kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
- kKeepAlive: Symbol('keep alive'),
- kHeadersTimeout: Symbol('headers timeout'),
- kBodyTimeout: Symbol('body timeout'),
- kServerName: Symbol('server name'),
- kLocalAddress: Symbol('local address'),
- kHost: Symbol('host'),
- kNoRef: Symbol('no ref'),
- kBodyUsed: Symbol('used'),
- kRunning: Symbol('running'),
- kBlocking: Symbol('blocking'),
- kPending: Symbol('pending'),
- kSize: Symbol('size'),
- kBusy: Symbol('busy'),
- kQueued: Symbol('queued'),
- kFree: Symbol('free'),
- kConnected: Symbol('connected'),
- kClosed: Symbol('closed'),
- kNeedDrain: Symbol('need drain'),
- kReset: Symbol('reset'),
- kDestroyed: Symbol.for('nodejs.stream.destroyed'),
- kMaxHeadersSize: Symbol('max headers size'),
- kRunningIdx: Symbol('running index'),
- kPendingIdx: Symbol('pending index'),
- kError: Symbol('error'),
- kClients: Symbol('clients'),
- kClient: Symbol('client'),
- kParser: Symbol('parser'),
- kOnDestroyed: Symbol('destroy callbacks'),
- kPipelining: Symbol('pipelining'),
- kSocket: Symbol('socket'),
- kHostHeader: Symbol('host header'),
- kConnector: Symbol('connector'),
- kStrictContentLength: Symbol('strict content length'),
- kMaxRedirections: Symbol('maxRedirections'),
- kMaxRequests: Symbol('maxRequestsPerClient'),
- kProxy: Symbol('proxy agent options'),
- kCounter: Symbol('socket request counter'),
- kInterceptors: Symbol('dispatch interceptors'),
- kMaxResponseSize: Symbol('max response size'),
- kHTTP2Session: Symbol('http2Session'),
- kHTTP2SessionState: Symbol('http2Session state'),
- kHTTP2BuildRequest: Symbol('http2 build request'),
- kHTTP1BuildRequest: Symbol('http1 build request'),
- kHTTP2CopyHeaders: Symbol('http2 copy headers'),
- kHTTPConnVersion: Symbol('http connection version'),
- kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
- kConstruct: Symbol('constructable')
+ if (
+ code < 0x21 || // exclude CTLs (0-31)
+ code > 0x7E || // non-ascii and DEL (127)
+ code === 0x22 || // "
+ code === 0x2C || // ,
+ code === 0x3B || // ;
+ code === 0x5C // \
+ ) {
+ throw new Error('Invalid cookie value')
+ }
+ }
}
+/**
+ * path-value =
+ * @param {string} path
+ */
+function validateCookiePath (path) {
+ for (let i = 0; i < path.length; ++i) {
+ const code = path.charCodeAt(i)
+
+ if (
+ code < 0x20 || // exclude CTLs (0-31)
+ code === 0x7F || // DEL
+ code === 0x3B // ;
+ ) {
+ throw new Error('Invalid cookie path')
+ }
+ }
+}
-/***/ }),
+/**
+ * I have no idea why these values aren't allowed to be honest,
+ * but Deno tests these. - Khafra
+ * @param {string} domain
+ */
+function validateCookieDomain (domain) {
+ if (
+ domain.startsWith('-') ||
+ domain.endsWith('.') ||
+ domain.endsWith('-')
+ ) {
+ throw new Error('Invalid cookie domain')
+ }
+}
-/***/ 3983:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+const IMFDays = [
+ 'Sun', 'Mon', 'Tue', 'Wed',
+ 'Thu', 'Fri', 'Sat'
+]
-"use strict";
+const IMFMonths = [
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
+]
+const IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))
-const assert = __nccwpck_require__(9491)
-const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
-const { IncomingMessage } = __nccwpck_require__(3685)
-const stream = __nccwpck_require__(2781)
-const net = __nccwpck_require__(1808)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { Blob } = __nccwpck_require__(4300)
-const nodeUtil = __nccwpck_require__(3837)
-const { stringify } = __nccwpck_require__(3477)
-const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
+ * @param {number|Date} date
+ IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
+ ; fixed length/zone/capitalization subset of the format
+ ; see Section 3.3 of [RFC5322]
-const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
+ day-name = %x4D.6F.6E ; "Mon", case-sensitive
+ / %x54.75.65 ; "Tue", case-sensitive
+ / %x57.65.64 ; "Wed", case-sensitive
+ / %x54.68.75 ; "Thu", case-sensitive
+ / %x46.72.69 ; "Fri", case-sensitive
+ / %x53.61.74 ; "Sat", case-sensitive
+ / %x53.75.6E ; "Sun", case-sensitive
+ date1 = day SP month SP year
+ ; e.g., 02 Jun 1982
-function nop () {}
+ day = 2DIGIT
+ month = %x4A.61.6E ; "Jan", case-sensitive
+ / %x46.65.62 ; "Feb", case-sensitive
+ / %x4D.61.72 ; "Mar", case-sensitive
+ / %x41.70.72 ; "Apr", case-sensitive
+ / %x4D.61.79 ; "May", case-sensitive
+ / %x4A.75.6E ; "Jun", case-sensitive
+ / %x4A.75.6C ; "Jul", case-sensitive
+ / %x41.75.67 ; "Aug", case-sensitive
+ / %x53.65.70 ; "Sep", case-sensitive
+ / %x4F.63.74 ; "Oct", case-sensitive
+ / %x4E.6F.76 ; "Nov", case-sensitive
+ / %x44.65.63 ; "Dec", case-sensitive
+ year = 4DIGIT
-function isStream (obj) {
- return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
-}
+ GMT = %x47.4D.54 ; "GMT", case-sensitive
-// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
-function isBlobLike (object) {
- return (Blob && object instanceof Blob) || (
- object &&
- typeof object === 'object' &&
- (typeof object.stream === 'function' ||
- typeof object.arrayBuffer === 'function') &&
- /^(Blob|File)$/.test(object[Symbol.toStringTag])
- )
-}
+ time-of-day = hour ":" minute ":" second
+ ; 00:00:00 - 23:59:60 (leap second)
-function buildURL (url, queryParams) {
- if (url.includes('?') || url.includes('#')) {
- throw new Error('Query params cannot be passed when url already contains "?" or "#".')
+ hour = 2DIGIT
+ minute = 2DIGIT
+ second = 2DIGIT
+ */
+function toIMFDate (date) {
+ if (typeof date === 'number') {
+ date = new Date(date)
}
- const stringified = stringify(queryParams)
+ return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`
+}
- if (stringified) {
- url += '?' + stringified
+/**
+ max-age-av = "Max-Age=" non-zero-digit *DIGIT
+ ; In practice, both expires-av and max-age-av
+ ; are limited to dates representable by the
+ ; user agent.
+ * @param {number} maxAge
+ */
+function validateCookieMaxAge (maxAge) {
+ if (maxAge < 0) {
+ throw new Error('Invalid cookie max-age')
}
-
- return url
}
-function parseURL (url) {
- if (typeof url === 'string') {
- url = new URL(url)
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
+ * @param {import('./index').Cookie} cookie
+ */
+function stringify (cookie) {
+ if (cookie.name.length === 0) {
+ return null
+ }
- if (!/^https?:/.test(url.origin || url.protocol)) {
- throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
- }
+ validateCookieName(cookie.name)
+ validateCookieValue(cookie.value)
- return url
+ const out = [`${cookie.name}=${cookie.value}`]
+
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
+ if (cookie.name.startsWith('__Secure-')) {
+ cookie.secure = true
}
- if (!url || typeof url !== 'object') {
- throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
+ if (cookie.name.startsWith('__Host-')) {
+ cookie.secure = true
+ cookie.domain = null
+ cookie.path = '/'
}
- if (!/^https?:/.test(url.origin || url.protocol)) {
- throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ if (cookie.secure) {
+ out.push('Secure')
}
- if (!(url instanceof URL)) {
- if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
- throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
- }
+ if (cookie.httpOnly) {
+ out.push('HttpOnly')
+ }
- if (url.path != null && typeof url.path !== 'string') {
- throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
- }
+ if (typeof cookie.maxAge === 'number') {
+ validateCookieMaxAge(cookie.maxAge)
+ out.push(`Max-Age=${cookie.maxAge}`)
+ }
- if (url.pathname != null && typeof url.pathname !== 'string') {
- throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
- }
+ if (cookie.domain) {
+ validateCookieDomain(cookie.domain)
+ out.push(`Domain=${cookie.domain}`)
+ }
- if (url.hostname != null && typeof url.hostname !== 'string') {
- throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
- }
+ if (cookie.path) {
+ validateCookiePath(cookie.path)
+ out.push(`Path=${cookie.path}`)
+ }
- if (url.origin != null && typeof url.origin !== 'string') {
- throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
- }
+ if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
+ out.push(`Expires=${toIMFDate(cookie.expires)}`)
+ }
- const port = url.port != null
- ? url.port
- : (url.protocol === 'https:' ? 443 : 80)
- let origin = url.origin != null
- ? url.origin
- : `${url.protocol}//${url.hostname}:${port}`
- let path = url.path != null
- ? url.path
- : `${url.pathname || ''}${url.search || ''}`
+ if (cookie.sameSite) {
+ out.push(`SameSite=${cookie.sameSite}`)
+ }
- if (origin.endsWith('/')) {
- origin = origin.substring(0, origin.length - 1)
+ for (const part of cookie.unparsed) {
+ if (!part.includes('=')) {
+ throw new Error('Invalid unparsed')
}
- if (path && !path.startsWith('/')) {
- path = `/${path}`
- }
- // new URL(path, origin) is unsafe when `path` contains an absolute URL
- // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
- // If first parameter is a relative URL, second param is required, and will be used as the base URL.
- // If first parameter is an absolute URL, a given second param will be ignored.
- url = new URL(origin + path)
+ const [key, ...value] = part.split('=')
+
+ out.push(`${key.trim()}=${value.join('=')}`)
}
- return url
+ return out.join('; ')
}
-function parseOrigin (url) {
- url = parseURL(url)
+module.exports = {
+ isCTLExcludingHtab,
+ validateCookieName,
+ validateCookiePath,
+ validateCookieValue,
+ toIMFDate,
+ stringify
+}
- if (url.pathname !== '/' || url.search || url.hash) {
- throw new InvalidArgumentError('invalid url')
- }
- return url
-}
+/***/ }),
-function getHostname (host) {
- if (host[0] === '[') {
- const idx = host.indexOf(']')
+/***/ 4031:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- assert(idx !== -1)
- return host.substring(1, idx)
- }
- const idx = host.indexOf(':')
- if (idx === -1) return host
+const { Transform } = __nccwpck_require__(7075)
+const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(4811)
- return host.substring(0, idx)
-}
+/**
+ * @type {number[]} BOM
+ */
+const BOM = [0xEF, 0xBB, 0xBF]
+/**
+ * @type {10} LF
+ */
+const LF = 0x0A
+/**
+ * @type {13} CR
+ */
+const CR = 0x0D
+/**
+ * @type {58} COLON
+ */
+const COLON = 0x3A
+/**
+ * @type {32} SPACE
+ */
+const SPACE = 0x20
-// IP addresses are not valid server names per RFC6066
-// > Currently, the only server names supported are DNS hostnames
-function getServerName (host) {
- if (!host) {
- return null
- }
+/**
+ * @typedef {object} EventSourceStreamEvent
+ * @type {object}
+ * @property {string} [event] The event type.
+ * @property {string} [data] The data of the message.
+ * @property {string} [id] A unique ID for the event.
+ * @property {string} [retry] The reconnection time, in milliseconds.
+ */
- assert.strictEqual(typeof host, 'string')
+/**
+ * @typedef eventSourceSettings
+ * @type {object}
+ * @property {string} lastEventId The last event ID received from the server.
+ * @property {string} origin The origin of the event source.
+ * @property {number} reconnectionTime The reconnection time, in milliseconds.
+ */
- const servername = getHostname(host)
- if (net.isIP(servername)) {
- return ''
- }
+class EventSourceStream extends Transform {
+ /**
+ * @type {eventSourceSettings}
+ */
+ state = null
- return servername
-}
+ /**
+ * Leading byte-order-mark check.
+ * @type {boolean}
+ */
+ checkBOM = true
-function deepClone (obj) {
- return JSON.parse(JSON.stringify(obj))
-}
+ /**
+ * @type {boolean}
+ */
+ crlfCheck = false
-function isAsyncIterable (obj) {
- return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
-}
+ /**
+ * @type {boolean}
+ */
+ eventEndCheck = false
-function isIterable (obj) {
- return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
-}
+ /**
+ * @type {Buffer}
+ */
+ buffer = null
-function bodyLength (body) {
- if (body == null) {
- return 0
- } else if (isStream(body)) {
- const state = body._readableState
- return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
- ? state.length
- : null
- } else if (isBlobLike(body)) {
- return body.size != null ? body.size : null
- } else if (isBuffer(body)) {
- return body.byteLength
- }
+ pos = 0
- return null
-}
+ event = {
+ data: undefined,
+ event: undefined,
+ id: undefined,
+ retry: undefined
+ }
-function isDestroyed (stream) {
- return !stream || !!(stream.destroyed || stream[kDestroyed])
-}
+ /**
+ * @param {object} options
+ * @param {eventSourceSettings} options.eventSourceSettings
+ * @param {Function} [options.push]
+ */
+ constructor (options = {}) {
+ // Enable object mode as EventSourceStream emits objects of shape
+ // EventSourceStreamEvent
+ options.readableObjectMode = true
-function isReadableAborted (stream) {
- const state = stream && stream._readableState
- return isDestroyed(stream) && state && !state.endEmitted
-}
+ super(options)
-function destroy (stream, err) {
- if (stream == null || !isStream(stream) || isDestroyed(stream)) {
- return
+ this.state = options.eventSourceSettings || {}
+ if (options.push) {
+ this.push = options.push
+ }
}
- if (typeof stream.destroy === 'function') {
- if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
- // See: https://github.com/nodejs/node/pull/38505/files
- stream.socket = null
+ /**
+ * @param {Buffer} chunk
+ * @param {string} _encoding
+ * @param {Function} callback
+ * @returns {void}
+ */
+ _transform (chunk, _encoding, callback) {
+ if (chunk.length === 0) {
+ callback()
+ return
}
- stream.destroy(err)
- } else if (err) {
- process.nextTick((stream, err) => {
- stream.emit('error', err)
- }, stream, err)
- }
-
- if (stream.destroyed !== true) {
- stream[kDestroyed] = true
- }
-}
+ // Cache the chunk in the buffer, as the data might not be complete while
+ // processing it
+ // TODO: Investigate if there is a more performant way to handle
+ // incoming chunks
+ // see: https://github.com/nodejs/undici/issues/2630
+ if (this.buffer) {
+ this.buffer = Buffer.concat([this.buffer, chunk])
+ } else {
+ this.buffer = chunk
+ }
-const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
-function parseKeepAliveTimeout (val) {
- const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
- return m ? parseInt(m[1], 10) * 1000 : null
-}
+ // Strip leading byte-order-mark if we opened the stream and started
+ // the processing of the incoming data
+ if (this.checkBOM) {
+ switch (this.buffer.length) {
+ case 1:
+ // Check if the first byte is the same as the first byte of the BOM
+ if (this.buffer[0] === BOM[0]) {
+ // If it is, we need to wait for more data
+ callback()
+ return
+ }
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
-/**
- * Retrieves a header name and returns its lowercase value.
- * @param {string | Buffer} value Header name
- * @returns {string}
- */
-function headerNameToString (value) {
- return headerNameLowerCasedRecord[value] || value.toLowerCase()
-}
+ // The buffer only contains one byte so we need to wait for more data
+ callback()
+ return
+ case 2:
+ // Check if the first two bytes are the same as the first two bytes
+ // of the BOM
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1]
+ ) {
+ // If it is, we need to wait for more data, because the third byte
+ // is needed to determine if it is the BOM or not
+ callback()
+ return
+ }
-function parseHeaders (headers, obj = {}) {
- // For H2 support
- if (!Array.isArray(headers)) return headers
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
+ break
+ case 3:
+ // Check if the first three bytes are the same as the first three
+ // bytes of the BOM
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1] &&
+ this.buffer[2] === BOM[2]
+ ) {
+ // If it is, we can drop the buffered data, as it is only the BOM
+ this.buffer = Buffer.alloc(0)
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
- for (let i = 0; i < headers.length; i += 2) {
- const key = headers[i].toString().toLowerCase()
- let val = obj[key]
+ // Await more data
+ callback()
+ return
+ }
+ // If it is not the BOM, we can start processing the data
+ this.checkBOM = false
+ break
+ default:
+ // The buffer is longer than 3 bytes, so we can drop the BOM if it is
+ // present
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1] &&
+ this.buffer[2] === BOM[2]
+ ) {
+ // Remove the BOM from the buffer
+ this.buffer = this.buffer.subarray(3)
+ }
- if (!val) {
- if (Array.isArray(headers[i + 1])) {
- obj[key] = headers[i + 1].map(x => x.toString('utf8'))
- } else {
- obj[key] = headers[i + 1].toString('utf8')
- }
- } else {
- if (!Array.isArray(val)) {
- val = [val]
- obj[key] = val
+ // Set the checkBOM flag to false as we don't need to check for the
+ this.checkBOM = false
+ break
}
- val.push(headers[i + 1].toString('utf8'))
}
- }
-
- // See https://github.com/nodejs/node/pull/46528
- if ('content-length' in obj && 'content-disposition' in obj) {
- obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
- }
- return obj
-}
-
-function parseRawHeaders (headers) {
- const ret = []
- let hasContentLength = false
- let contentDispositionIdx = -1
+ while (this.pos < this.buffer.length) {
+ // If the previous line ended with an end-of-line, we need to check
+ // if the next character is also an end-of-line.
+ if (this.eventEndCheck) {
+ // If the the current character is an end-of-line, then the event
+ // is finished and we can process it
+
+ // If the previous line ended with a carriage return, we need to
+ // check if the current character is a line feed and remove it
+ // from the buffer.
+ if (this.crlfCheck) {
+ // If the current character is a line feed, we can remove it
+ // from the buffer and reset the crlfCheck flag
+ if (this.buffer[this.pos] === LF) {
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ this.pos = 0
+ this.crlfCheck = false
+
+ // It is possible that the line feed is not the end of the
+ // event. We need to check if the next character is an
+ // end-of-line character to determine if the event is
+ // finished. We simply continue the loop to check the next
+ // character.
+
+ // As we removed the line feed from the buffer and set the
+ // crlfCheck flag to false, we basically don't make any
+ // distinction between a line feed and a carriage return.
+ continue
+ }
+ this.crlfCheck = false
+ }
- for (let n = 0; n < headers.length; n += 2) {
- const key = headers[n + 0].toString()
- const val = headers[n + 1].toString('utf8')
+ if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+ // If the current character is a carriage return, we need to
+ // set the crlfCheck flag to true, as we need to check if the
+ // next character is a line feed so we can remove it from the
+ // buffer
+ if (this.buffer[this.pos] === CR) {
+ this.crlfCheck = true
+ }
- if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
- ret.push(key, val)
- hasContentLength = true
- } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
- contentDispositionIdx = ret.push(key, val) - 1
- } else {
- ret.push(key, val)
- }
- }
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ this.pos = 0
+ if (
+ this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
+ this.processEvent(this.event)
+ }
+ this.clearEvent()
+ continue
+ }
+ // If the current character is not an end-of-line, then the event
+ // is not finished and we have to reset the eventEndCheck flag
+ this.eventEndCheck = false
+ continue
+ }
- // See https://github.com/nodejs/node/pull/46528
- if (hasContentLength && contentDispositionIdx !== -1) {
- ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
- }
+ // If the current character is an end-of-line, we can process the
+ // line
+ if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+ // If the current character is a carriage return, we need to
+ // set the crlfCheck flag to true, as we need to check if the
+ // next character is a line feed
+ if (this.buffer[this.pos] === CR) {
+ this.crlfCheck = true
+ }
- return ret
-}
+ // In any case, we can process the line as we reached an
+ // end-of-line character
+ this.parseLine(this.buffer.subarray(0, this.pos), this.event)
+
+ // Remove the processed line from the buffer
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ // Reset the position as we removed the processed line from the buffer
+ this.pos = 0
+ // A line was processed and this could be the end of the event. We need
+ // to check if the next line is empty to determine if the event is
+ // finished.
+ this.eventEndCheck = true
+ continue
+ }
-function isBuffer (buffer) {
- // See, https://github.com/mcollina/undici/pull/319
- return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
-}
+ this.pos++
+ }
-function validateHandler (handler, method, upgrade) {
- if (!handler || typeof handler !== 'object') {
- throw new InvalidArgumentError('handler must be an object')
+ callback()
}
- if (typeof handler.onConnect !== 'function') {
- throw new InvalidArgumentError('invalid onConnect method')
- }
+ /**
+ * @param {Buffer} line
+ * @param {EventStreamEvent} event
+ */
+ parseLine (line, event) {
+ // If the line is empty (a blank line)
+ // Dispatch the event, as defined below.
+ // This will be handled in the _transform method
+ if (line.length === 0) {
+ return
+ }
- if (typeof handler.onError !== 'function') {
- throw new InvalidArgumentError('invalid onError method')
- }
+ // If the line starts with a U+003A COLON character (:)
+ // Ignore the line.
+ const colonPosition = line.indexOf(COLON)
+ if (colonPosition === 0) {
+ return
+ }
- if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
- throw new InvalidArgumentError('invalid onBodySent method')
+ let field = ''
+ let value = ''
+
+ // If the line contains a U+003A COLON character (:)
+ if (colonPosition !== -1) {
+ // Collect the characters on the line before the first U+003A COLON
+ // character (:), and let field be that string.
+ // TODO: Investigate if there is a more performant way to extract the
+ // field
+ // see: https://github.com/nodejs/undici/issues/2630
+ field = line.subarray(0, colonPosition).toString('utf8')
+
+ // Collect the characters on the line after the first U+003A COLON
+ // character (:), and let value be that string.
+ // If value starts with a U+0020 SPACE character, remove it from value.
+ let valueStart = colonPosition + 1
+ if (line[valueStart] === SPACE) {
+ ++valueStart
+ }
+ // TODO: Investigate if there is a more performant way to extract the
+ // value
+ // see: https://github.com/nodejs/undici/issues/2630
+ value = line.subarray(valueStart).toString('utf8')
+
+ // Otherwise, the string is not empty but does not contain a U+003A COLON
+ // character (:)
+ } else {
+ // Process the field using the steps described below, using the whole
+ // line as the field name, and the empty string as the field value.
+ field = line.toString('utf8')
+ value = ''
+ }
+
+ // Modify the event with the field name and value. The value is also
+ // decoded as UTF-8
+ switch (field) {
+ case 'data':
+ if (event[field] === undefined) {
+ event[field] = value
+ } else {
+ event[field] += `\n${value}`
+ }
+ break
+ case 'retry':
+ if (isASCIINumber(value)) {
+ event[field] = value
+ }
+ break
+ case 'id':
+ if (isValidLastEventId(value)) {
+ event[field] = value
+ }
+ break
+ case 'event':
+ if (value.length > 0) {
+ event[field] = value
+ }
+ break
+ }
}
- if (upgrade || method === 'CONNECT') {
- if (typeof handler.onUpgrade !== 'function') {
- throw new InvalidArgumentError('invalid onUpgrade method')
+ /**
+ * @param {EventSourceStreamEvent} event
+ */
+ processEvent (event) {
+ if (event.retry && isASCIINumber(event.retry)) {
+ this.state.reconnectionTime = parseInt(event.retry, 10)
}
- } else {
- if (typeof handler.onHeaders !== 'function') {
- throw new InvalidArgumentError('invalid onHeaders method')
+
+ if (event.id && isValidLastEventId(event.id)) {
+ this.state.lastEventId = event.id
}
- if (typeof handler.onData !== 'function') {
- throw new InvalidArgumentError('invalid onData method')
+ // only dispatch event, when data is provided
+ if (event.data !== undefined) {
+ this.push({
+ type: event.event || 'message',
+ options: {
+ data: event.data,
+ lastEventId: this.state.lastEventId,
+ origin: this.state.origin
+ }
+ })
}
+ }
- if (typeof handler.onComplete !== 'function') {
- throw new InvalidArgumentError('invalid onComplete method')
+ clearEvent () {
+ this.event = {
+ data: undefined,
+ event: undefined,
+ id: undefined,
+ retry: undefined
}
}
}
-// A body is disturbed if it has been read from and it cannot
-// be re-used without losing state or data.
-function isDisturbed (body) {
- return !!(body && (
- stream.isDisturbed
- ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
- : body[kBodyUsed] ||
- body.readableDidRead ||
- (body._readableState && body._readableState.dataEmitted) ||
- isReadableAborted(body)
- ))
+module.exports = {
+ EventSourceStream
}
-function isErrored (body) {
- return !!(body && (
- stream.isErrored
- ? stream.isErrored(body)
- : /state: 'errored'/.test(nodeUtil.inspect(body)
- )))
-}
-function isReadable (body) {
- return !!(body && (
- stream.isReadable
- ? stream.isReadable(body)
- : /state: 'readable'/.test(nodeUtil.inspect(body)
- )))
-}
+/***/ }),
-function getSocketInfo (socket) {
- return {
- localAddress: socket.localAddress,
- localPort: socket.localPort,
- remoteAddress: socket.remoteAddress,
- remotePort: socket.remotePort,
- remoteFamily: socket.remoteFamily,
- timeout: socket.timeout,
- bytesWritten: socket.bytesWritten,
- bytesRead: socket.bytesRead
- }
-}
+/***/ 1238:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-async function * convertIterableToBuffer (iterable) {
- for await (const chunk of iterable) {
- yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
- }
-}
-let ReadableStream
-function ReadableStreamFrom (iterable) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
- if (ReadableStream.from) {
- return ReadableStream.from(convertIterableToBuffer(iterable))
- }
+const { pipeline } = __nccwpck_require__(7075)
+const { fetching } = __nccwpck_require__(4398)
+const { makeRequest } = __nccwpck_require__(9967)
+const { webidl } = __nccwpck_require__(5893)
+const { EventSourceStream } = __nccwpck_require__(4031)
+const { parseMIMEType } = __nccwpck_require__(1900)
+const { createFastMessageEvent } = __nccwpck_require__(5188)
+const { isNetworkError } = __nccwpck_require__(9051)
+const { delay } = __nccwpck_require__(4811)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { environmentSettingsObject } = __nccwpck_require__(3168)
- let iterator
- return new ReadableStream(
- {
- async start () {
- iterator = iterable[Symbol.asyncIterator]()
- },
- async pull (controller) {
- const { done, value } = await iterator.next()
- if (done) {
- queueMicrotask(() => {
- controller.close()
- })
- } else {
- const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
- controller.enqueue(new Uint8Array(buf))
- }
- return controller.desiredSize > 0
- },
- async cancel (reason) {
- await iterator.return()
- }
- },
- 0
- )
-}
+let experimentalWarned = false
-// The chunk should be a FormData instance and contains
-// all the required methods.
-function isFormDataLike (object) {
- return (
- object &&
- typeof object === 'object' &&
- typeof object.append === 'function' &&
- typeof object.delete === 'function' &&
- typeof object.get === 'function' &&
- typeof object.getAll === 'function' &&
- typeof object.has === 'function' &&
- typeof object.set === 'function' &&
- object[Symbol.toStringTag] === 'FormData'
- )
-}
+/**
+ * A reconnection time, in milliseconds. This must initially be an implementation-defined value,
+ * probably in the region of a few seconds.
+ *
+ * In Comparison:
+ * - Chrome uses 3000ms.
+ * - Deno uses 5000ms.
+ *
+ * @type {3000}
+ */
+const defaultReconnectionTime = 3000
-function throwIfAborted (signal) {
- if (!signal) { return }
- if (typeof signal.throwIfAborted === 'function') {
- signal.throwIfAborted()
- } else {
- if (signal.aborted) {
- // DOMException not available < v17.0.0
- const err = new Error('The operation was aborted')
- err.name = 'AbortError'
- throw err
- }
- }
-}
+/**
+ * The readyState attribute represents the state of the connection.
+ * @enum
+ * @readonly
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev
+ */
-function addAbortListener (signal, listener) {
- if ('addEventListener' in signal) {
- signal.addEventListener('abort', listener, { once: true })
- return () => signal.removeEventListener('abort', listener)
- }
- signal.addListener('abort', listener)
- return () => signal.removeListener('abort', listener)
-}
+/**
+ * The connection has not yet been established, or it was closed and the user
+ * agent is reconnecting.
+ * @type {0}
+ */
+const CONNECTING = 0
+
+/**
+ * The user agent has an open connection and is dispatching events as it
+ * receives them.
+ * @type {1}
+ */
+const OPEN = 1
-const hasToWellFormed = !!String.prototype.toWellFormed
+/**
+ * The connection is not open, and the user agent is not trying to reconnect.
+ * @type {2}
+ */
+const CLOSED = 2
/**
- * @param {string} val
+ * Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin".
+ * @type {'anonymous'}
*/
-function toUSVString (val) {
- if (hasToWellFormed) {
- return `${val}`.toWellFormed()
- } else if (nodeUtil.toUSVString) {
- return nodeUtil.toUSVString(val)
+const ANONYMOUS = 'anonymous'
+
+/**
+ * Requests for the element will have their mode set to "cors" and their credentials mode set to "include".
+ * @type {'use-credentials'}
+ */
+const USE_CREDENTIALS = 'use-credentials'
+
+/**
+ * The EventSource interface is used to receive server-sent events. It
+ * connects to a server over HTTP and receives events in text/event-stream
+ * format without closing the connection.
+ * @extends {EventTarget}
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
+ * @api public
+ */
+class EventSource extends EventTarget {
+ #events = {
+ open: null,
+ error: null,
+ message: null
}
- return `${val}`
-}
+ #url = null
+ #withCredentials = false
-// Parsed accordingly to RFC 9110
-// https://www.rfc-editor.org/rfc/rfc9110#field.content-range
-function parseRangeHeader (range) {
- if (range == null || range === '') return { start: 0, end: null, size: null }
+ #readyState = CONNECTING
- const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
- return m
- ? {
- start: parseInt(m[1]),
- end: m[2] ? parseInt(m[2]) : null,
- size: m[3] ? parseInt(m[3]) : null
- }
- : null
-}
+ #request = null
+ #controller = null
-const kEnumerableProperty = Object.create(null)
-kEnumerableProperty.enumerable = true
+ #dispatcher
-module.exports = {
- kEnumerableProperty,
- nop,
- isDisturbed,
- isErrored,
- isReadable,
- toUSVString,
- isReadableAborted,
- isBlobLike,
- parseOrigin,
- parseURL,
- getServerName,
- isStream,
- isIterable,
- isAsyncIterable,
- isDestroyed,
- headerNameToString,
- parseRawHeaders,
- parseHeaders,
- parseKeepAliveTimeout,
- destroy,
- bodyLength,
- deepClone,
- ReadableStreamFrom,
- isBuffer,
- validateHandler,
- getSocketInfo,
- isFormDataLike,
- buildURL,
- throwIfAborted,
- addAbortListener,
- parseRangeHeader,
- nodeMajor,
- nodeMinor,
- nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
- safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
-}
+ /**
+ * @type {import('./eventsource-stream').eventSourceSettings}
+ */
+ #state
+ /**
+ * Creates a new EventSource object.
+ * @param {string} url
+ * @param {EventSourceInit} [eventSourceInitDict]
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface
+ */
+ constructor (url, eventSourceInitDict = {}) {
+ // 1. Let ev be a new EventSource object.
+ super()
-/***/ }),
+ webidl.util.markAsUncloneable(this)
-/***/ 4839:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const prefix = 'EventSource constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-"use strict";
+ if (!experimentalWarned) {
+ experimentalWarned = true
+ process.emitWarning('EventSource is experimental, expect them to change at any time.', {
+ code: 'UNDICI-ES'
+ })
+ }
+ url = webidl.converters.USVString(url, prefix, 'url')
+ eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')
-const Dispatcher = __nccwpck_require__(412)
-const {
- ClientDestroyedError,
- ClientClosedError,
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
+ this.#dispatcher = eventSourceInitDict.dispatcher
+ this.#state = {
+ lastEventId: '',
+ reconnectionTime: defaultReconnectionTime
+ }
-const kDestroyed = Symbol('destroyed')
-const kClosed = Symbol('closed')
-const kOnDestroyed = Symbol('onDestroyed')
-const kOnClosed = Symbol('onClosed')
-const kInterceptedDispatch = Symbol('Intercepted Dispatch')
+ // 2. Let settings be ev's relevant settings object.
+ // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
+ const settings = environmentSettingsObject
-class DispatcherBase extends Dispatcher {
- constructor () {
- super()
+ let urlRecord
- this[kDestroyed] = false
- this[kOnDestroyed] = null
- this[kClosed] = false
- this[kOnClosed] = []
- }
+ try {
+ // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.
+ urlRecord = new URL(url, settings.settingsObject.baseUrl)
+ this.#state.origin = urlRecord.origin
+ } catch (e) {
+ // 4. If urlRecord is failure, then throw a "SyntaxError" DOMException.
+ throw new DOMException(e, 'SyntaxError')
+ }
- get destroyed () {
- return this[kDestroyed]
- }
+ // 5. Set ev's url to urlRecord.
+ this.#url = urlRecord.href
- get closed () {
- return this[kClosed]
+ // 6. Let corsAttributeState be Anonymous.
+ let corsAttributeState = ANONYMOUS
+
+ // 7. If the value of eventSourceInitDict's withCredentials member is true,
+ // then set corsAttributeState to Use Credentials and set ev's
+ // withCredentials attribute to true.
+ if (eventSourceInitDict.withCredentials) {
+ corsAttributeState = USE_CREDENTIALS
+ this.#withCredentials = true
+ }
+
+ // 8. Let request be the result of creating a potential-CORS request given
+ // urlRecord, the empty string, and corsAttributeState.
+ const initRequest = {
+ redirect: 'follow',
+ keepalive: true,
+ // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
+ mode: 'cors',
+ credentials: corsAttributeState === 'anonymous'
+ ? 'same-origin'
+ : 'omit',
+ referrer: 'no-referrer'
+ }
+
+ // 9. Set request's client to settings.
+ initRequest.client = environmentSettingsObject.settingsObject
+
+ // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.
+ initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]
+
+ // 11. Set request's cache mode to "no-store".
+ initRequest.cache = 'no-store'
+
+ // 12. Set request's initiator type to "other".
+ initRequest.initiator = 'other'
+
+ initRequest.urlList = [new URL(this.#url)]
+
+ // 13. Set ev's request to request.
+ this.#request = makeRequest(initRequest)
+
+ this.#connect()
}
- get interceptors () {
- return this[kInterceptors]
+ /**
+ * Returns the state of this EventSource object's connection. It can have the
+ * values described below.
+ * @returns {0|1|2}
+ * @readonly
+ */
+ get readyState () {
+ return this.#readyState
}
- set interceptors (newInterceptors) {
- if (newInterceptors) {
- for (let i = newInterceptors.length - 1; i >= 0; i--) {
- const interceptor = this[kInterceptors][i]
- if (typeof interceptor !== 'function') {
- throw new InvalidArgumentError('interceptor must be an function')
- }
- }
- }
+ /**
+ * Returns the URL providing the event stream.
+ * @readonly
+ * @returns {string}
+ */
+ get url () {
+ return this.#url
+ }
- this[kInterceptors] = newInterceptors
+ /**
+ * Returns a boolean indicating whether the EventSource object was
+ * instantiated with CORS credentials set (true), or not (false, the default).
+ */
+ get withCredentials () {
+ return this.#withCredentials
}
- close (callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- this.close((err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+ #connect () {
+ if (this.#readyState === CLOSED) return
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
+ this.#readyState = CONNECTING
- if (this[kDestroyed]) {
- queueMicrotask(() => callback(new ClientDestroyedError(), null))
- return
+ const fetchParams = {
+ request: this.#request,
+ dispatcher: this.#dispatcher
}
- if (this[kClosed]) {
- if (this[kOnClosed]) {
- this[kOnClosed].push(callback)
- } else {
- queueMicrotask(() => callback(null, null))
+ // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.
+ const processEventSourceEndOfBody = (response) => {
+ if (isNetworkError(response)) {
+ this.dispatchEvent(new Event('error'))
+ this.close()
}
- return
+
+ this.#reconnect()
}
- this[kClosed] = true
- this[kOnClosed].push(callback)
+ // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...
+ fetchParams.processResponseEndOfBody = processEventSourceEndOfBody
- const onClosed = () => {
- const callbacks = this[kOnClosed]
- this[kOnClosed] = null
- for (let i = 0; i < callbacks.length; i++) {
- callbacks[i](null, null)
+ // and processResponse set to the following steps given response res:
+ fetchParams.processResponse = (response) => {
+ // 1. If res is an aborted network error, then fail the connection.
+
+ if (isNetworkError(response)) {
+ // 1. When a user agent is to fail the connection, the user agent
+ // must queue a task which, if the readyState attribute is set to a
+ // value other than CLOSED, sets the readyState attribute to CLOSED
+ // and fires an event named error at the EventSource object. Once the
+ // user agent has failed the connection, it does not attempt to
+ // reconnect.
+ if (response.aborted) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ return
+ // 2. Otherwise, if res is a network error, then reestablish the
+ // connection, unless the user agent knows that to be futile, in
+ // which case the user agent may fail the connection.
+ } else {
+ this.#reconnect()
+ return
+ }
}
- }
- // Should not error.
- this[kClose]()
- .then(() => this.destroy())
- .then(() => {
- queueMicrotask(onClosed)
- })
- }
+ // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`
+ // is not `text/event-stream`, then fail the connection.
+ const contentType = response.headersList.get('content-type', true)
+ const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'
+ const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'
+ if (
+ response.status !== 200 ||
+ contentTypeValid === false
+ ) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ return
+ }
- destroy (err, callback) {
- if (typeof err === 'function') {
- callback = err
- err = null
- }
+ // 4. Otherwise, announce the connection and interpret res's body
+ // line by line.
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- this.destroy(err, (err, data) => {
- return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
- })
+ // When a user agent is to announce the connection, the user agent
+ // must queue a task which, if the readyState attribute is set to a
+ // value other than CLOSED, sets the readyState attribute to OPEN
+ // and fires an event named open at the EventSource object.
+ // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
+ this.#readyState = OPEN
+ this.dispatchEvent(new Event('open'))
+
+ // If redirected to a different origin, set the origin to the new origin.
+ this.#state.origin = response.urlList[response.urlList.length - 1].origin
+
+ const eventSourceStream = new EventSourceStream({
+ eventSourceSettings: this.#state,
+ push: (event) => {
+ this.dispatchEvent(createFastMessageEvent(
+ event.type,
+ event.options
+ ))
+ }
})
- }
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
+ pipeline(response.body.stream,
+ eventSourceStream,
+ (error) => {
+ if (
+ error?.aborted === false
+ ) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ }
+ })
}
- if (this[kDestroyed]) {
- if (this[kOnDestroyed]) {
- this[kOnDestroyed].push(callback)
- } else {
- queueMicrotask(() => callback(null, null))
- }
- return
- }
+ this.#controller = fetching(fetchParams)
+ }
- if (!err) {
- err = new ClientDestroyedError()
- }
+ /**
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
+ * @returns {Promise}
+ */
+ async #reconnect () {
+ // When a user agent is to reestablish the connection, the user agent must
+ // run the following steps. These steps are run in parallel, not as part of
+ // a task. (The tasks that it queues, of course, are run like normal tasks
+ // and not themselves in parallel.)
- this[kDestroyed] = true
- this[kOnDestroyed] = this[kOnDestroyed] || []
- this[kOnDestroyed].push(callback)
+ // 1. Queue a task to run the following steps:
- const onDestroyed = () => {
- const callbacks = this[kOnDestroyed]
- this[kOnDestroyed] = null
- for (let i = 0; i < callbacks.length; i++) {
- callbacks[i](null, null)
- }
+ // 1. If the readyState attribute is set to CLOSED, abort the task.
+ if (this.#readyState === CLOSED) return
+
+ // 2. Set the readyState attribute to CONNECTING.
+ this.#readyState = CONNECTING
+
+ // 3. Fire an event named error at the EventSource object.
+ this.dispatchEvent(new Event('error'))
+
+ // 2. Wait a delay equal to the reconnection time of the event source.
+ await delay(this.#state.reconnectionTime)
+
+ // 5. Queue a task to run the following steps:
+
+ // 1. If the EventSource object's readyState attribute is not set to
+ // CONNECTING, then return.
+ if (this.#readyState !== CONNECTING) return
+
+ // 2. Let request be the EventSource object's request.
+ // 3. If the EventSource object's last event ID string is not the empty
+ // string, then:
+ // 1. Let lastEventIDValue be the EventSource object's last event ID
+ // string, encoded as UTF-8.
+ // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header
+ // list.
+ if (this.#state.lastEventId.length) {
+ this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)
}
- // Should not error.
- this[kDestroy](err).then(() => {
- queueMicrotask(onDestroyed)
- })
+ // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.
+ this.#connect()
}
- [kInterceptedDispatch] (opts, handler) {
- if (!this[kInterceptors] || this[kInterceptors].length === 0) {
- this[kInterceptedDispatch] = this[kDispatch]
- return this[kDispatch](opts, handler)
- }
+ /**
+ * Closes the connection, if any, and sets the readyState attribute to
+ * CLOSED.
+ */
+ close () {
+ webidl.brandCheck(this, EventSource)
- let dispatch = this[kDispatch].bind(this)
- for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
- dispatch = this[kInterceptors][i](dispatch)
- }
- this[kInterceptedDispatch] = dispatch
- return dispatch(opts, handler)
+ if (this.#readyState === CLOSED) return
+ this.#readyState = CLOSED
+ this.#controller.abort()
+ this.#request = null
}
- dispatch (opts, handler) {
- if (!handler || typeof handler !== 'object') {
- throw new InvalidArgumentError('handler must be an object')
+ get onopen () {
+ return this.#events.open
+ }
+
+ set onopen (fn) {
+ if (this.#events.open) {
+ this.removeEventListener('open', this.#events.open)
}
- try {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('opts must be an object.')
- }
+ if (typeof fn === 'function') {
+ this.#events.open = fn
+ this.addEventListener('open', fn)
+ } else {
+ this.#events.open = null
+ }
+ }
- if (this[kDestroyed] || this[kOnDestroyed]) {
- throw new ClientDestroyedError()
- }
+ get onmessage () {
+ return this.#events.message
+ }
- if (this[kClosed]) {
- throw new ClientClosedError()
- }
+ set onmessage (fn) {
+ if (this.#events.message) {
+ this.removeEventListener('message', this.#events.message)
+ }
- return this[kInterceptedDispatch](opts, handler)
- } catch (err) {
- if (typeof handler.onError !== 'function') {
- throw new InvalidArgumentError('invalid onError method')
- }
+ if (typeof fn === 'function') {
+ this.#events.message = fn
+ this.addEventListener('message', fn)
+ } else {
+ this.#events.message = null
+ }
+ }
- handler.onError(err)
+ get onerror () {
+ return this.#events.error
+ }
- return false
+ set onerror (fn) {
+ if (this.#events.error) {
+ this.removeEventListener('error', this.#events.error)
+ }
+
+ if (typeof fn === 'function') {
+ this.#events.error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this.#events.error = null
}
}
}
-module.exports = DispatcherBase
+const constantsPropertyDescriptors = {
+ CONNECTING: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: CONNECTING,
+ writable: false
+ },
+ OPEN: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: OPEN,
+ writable: false
+ },
+ CLOSED: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: CLOSED,
+ writable: false
+ }
+}
+Object.defineProperties(EventSource, constantsPropertyDescriptors)
+Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors)
-/***/ }),
+Object.defineProperties(EventSource.prototype, {
+ close: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onmessage: kEnumerableProperty,
+ onopen: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ url: kEnumerableProperty,
+ withCredentials: kEnumerableProperty
+})
-/***/ 412:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
+ {
+ key: 'withCredentials',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'dispatcher', // undici only
+ converter: webidl.converters.any
+ }
+])
-"use strict";
+module.exports = {
+ EventSource,
+ defaultReconnectionTime
+}
-const EventEmitter = __nccwpck_require__(2361)
+/***/ }),
-class Dispatcher extends EventEmitter {
- dispatch () {
- throw new Error('not implemented')
- }
+/***/ 4811:
+/***/ ((module) => {
- close () {
- throw new Error('not implemented')
- }
- destroy () {
- throw new Error('not implemented')
+
+/**
+ * Checks if the given value is a valid LastEventId.
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isValidLastEventId (value) {
+ // LastEventId should not contain U+0000 NULL
+ return value.indexOf('\u0000') === -1
+}
+
+/**
+ * Checks if the given value is a base 10 digit.
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isASCIINumber (value) {
+ if (value.length === 0) return false
+ for (let i = 0; i < value.length; i++) {
+ if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false
}
+ return true
}
-module.exports = Dispatcher
+// https://github.com/nodejs/undici/issues/2664
+function delay (ms) {
+ return new Promise((resolve) => {
+ setTimeout(resolve, ms).unref()
+ })
+}
+
+module.exports = {
+ isValidLastEventId,
+ isASCIINumber,
+ delay
+}
/***/ }),
-/***/ 1472:
+/***/ 4492:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const Busboy = __nccwpck_require__(727)
-const util = __nccwpck_require__(3983)
+const util = __nccwpck_require__(3440)
const {
ReadableStreamFrom,
isBlobLike,
isReadableStreamLike,
readableStreamClose,
createDeferredPromise,
- fullyReadBody
-} = __nccwpck_require__(2538)
-const { FormData } = __nccwpck_require__(2015)
-const { kState } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { DOMException, structuredClone } = __nccwpck_require__(1037)
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
-const { kBodyUsed } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { isErrored } = __nccwpck_require__(3983)
-const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
-const { File: UndiciFile } = __nccwpck_require__(8511)
-const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
-
-let ReadableStream = globalThis.ReadableStream
+ fullyReadBody,
+ extractMimeType,
+ utf8DecodeBytes
+} = __nccwpck_require__(3168)
+const { FormData } = __nccwpck_require__(5910)
+const { kState } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { Blob } = __nccwpck_require__(4573)
+const assert = __nccwpck_require__(4589)
+const { isErrored, isDisturbed } = __nccwpck_require__(7075)
+const { isArrayBuffer } = __nccwpck_require__(3429)
+const { serializeAMimeType } = __nccwpck_require__(1900)
+const { multipartFormDataParser } = __nccwpck_require__(116)
+let random
+
+try {
+ const crypto = __nccwpck_require__(7598)
+ random = (max) => crypto.randomInt(0, max)
+} catch {
+ random = (max) => Math.floor(Math.random(max))
+}
-/** @type {globalThis['File']} */
-const File = NativeFile ?? UndiciFile
const textEncoder = new TextEncoder()
-const textDecoder = new TextDecoder()
+function noop () {}
+
+const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0
+let streamRegistry
+
+if (hasFinalizationRegistry) {
+ streamRegistry = new FinalizationRegistry((weakRef) => {
+ const stream = weakRef.deref()
+ if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
+ stream.cancel('Response object has been garbage collected').catch(noop)
+ }
+ })
+}
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
function extractBody (object, keepalive = false) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
// 1. Let stream be null.
let stream = null
@@ -23204,16 +26105,19 @@ function extractBody (object, keepalive = false) {
stream = object.stream()
} else {
// 4. Otherwise, set stream to a new ReadableStream object, and set
- // up stream.
+ // up stream with byte reading support.
stream = new ReadableStream({
async pull (controller) {
- controller.enqueue(
- typeof source === 'string' ? textEncoder.encode(source) : source
- )
+ const buffer = typeof source === 'string' ? textEncoder.encode(source) : source
+
+ if (buffer.byteLength) {
+ controller.enqueue(buffer)
+ }
+
queueMicrotask(() => readableStreamClose(controller))
},
start () {},
- type: undefined
+ type: 'bytes'
})
}
@@ -23264,7 +26168,7 @@ function extractBody (object, keepalive = false) {
// Set source to a copy of the bytes held by object.
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
} else if (util.isFormDataLike(object)) {
- const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
+ const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
/*! formdata-polyfill. MIT License. Jimmy Wärting */
@@ -23305,7 +26209,10 @@ function extractBody (object, keepalive = false) {
}
}
- const chunk = textEncoder.encode(`--${boundary}--`)
+ // CRLF is appended to the body to function with legacy servers and match other implementations.
+ // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030
+ // https://github.com/form-data/form-data/issues/63
+ const chunk = textEncoder.encode(`--${boundary}--\r\n`)
blobParts.push(chunk)
length += chunk.byteLength
if (hasUnknownSizeValue) {
@@ -23328,7 +26235,7 @@ function extractBody (object, keepalive = false) {
// Set type to `multipart/form-data; boundary=`,
// followed by the multipart/form-data boundary string generated
// by the multipart/form-data encoding algorithm.
- type = 'multipart/form-data; boundary=' + boundary
+ type = `multipart/form-data; boundary=${boundary}`
} else if (isBlobLike(object)) {
// Blob
@@ -23380,13 +26287,17 @@ function extractBody (object, keepalive = false) {
// When running action is done, close stream.
queueMicrotask(() => {
controller.close()
+ controller.byobRequest?.respond(0)
})
} else {
// Whenever one or more bytes are available and stream is not errored,
// enqueue a Uint8Array wrapping an ArrayBuffer containing the available
// bytes into stream.
if (!isErrored(stream)) {
- controller.enqueue(new Uint8Array(value))
+ const buffer = new Uint8Array(value)
+ if (buffer.byteLength) {
+ controller.enqueue(buffer)
+ }
}
}
return controller.desiredSize > 0
@@ -23394,7 +26305,7 @@ function extractBody (object, keepalive = false) {
async cancel (reason) {
await iterator.return()
},
- type: undefined
+ type: 'bytes'
})
}
@@ -23408,11 +26319,6 @@ function extractBody (object, keepalive = false) {
// https://fetch.spec.whatwg.org/#bodyinit-safely-extract
function safelyExtractBody (object, keepalive = false) {
- if (!ReadableStream) {
- // istanbul ignore next
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
// To safely extract a body and a `Content-Type` value from
// a byte sequence or BodyInit object object, run these steps:
@@ -23429,52 +26335,25 @@ function safelyExtractBody (object, keepalive = false) {
return extractBody(object, keepalive)
}
-function cloneBody (body) {
+function cloneBody (instance, body) {
// To clone a body body, run these steps:
// https://fetch.spec.whatwg.org/#concept-body-clone
// 1. Let « out1, out2 » be the result of teeing body’s stream.
const [out1, out2] = body.stream.tee()
- const out2Clone = structuredClone(out2, { transfer: [out2] })
- // This, for whatever reasons, unrefs out2Clone which allows
- // the process to exit by itself.
- const [, finalClone] = out2Clone.tee()
// 2. Set body’s stream to out1.
body.stream = out1
// 3. Return a body whose stream is out2 and other members are copied from body.
return {
- stream: finalClone,
+ stream: out2,
length: body.length,
source: body.source
}
}
-async function * consumeBody (body) {
- if (body) {
- if (isUint8Array(body)) {
- yield body
- } else {
- const stream = body.stream
-
- if (util.isDisturbed(stream)) {
- throw new TypeError('The body has already been consumed.')
- }
-
- if (stream.locked) {
- throw new TypeError('The stream is locked.')
- }
-
- // Compat.
- stream[kBodyUsed] = true
-
- yield * stream
- }
- }
-}
-
function throwIfAborted (state) {
if (state.aborted) {
throw new DOMException('The operation was aborted.', 'AbortError')
@@ -23489,10 +26368,10 @@ function bodyMixinMethods (instance) {
// given a byte sequence bytes: return a Blob whose
// contents are bytes and whose type attribute is this’s
// MIME type.
- return specConsumeBody(this, (bytes) => {
+ return consumeBody(this, (bytes) => {
let mimeType = bodyMimeType(this)
- if (mimeType === 'failure') {
+ if (mimeType === null) {
mimeType = ''
} else if (mimeType) {
mimeType = serializeAMimeType(mimeType)
@@ -23509,7 +26388,7 @@ function bodyMixinMethods (instance) {
// of running consume body with this and the following step
// given a byte sequence bytes: return a new ArrayBuffer
// whose contents are bytes.
- return specConsumeBody(this, (bytes) => {
+ return consumeBody(this, (bytes) => {
return new Uint8Array(bytes).buffer
}, instance)
},
@@ -23517,126 +26396,74 @@ function bodyMixinMethods (instance) {
text () {
// The text() method steps are to return the result of running
// consume body with this and UTF-8 decode.
- return specConsumeBody(this, utf8DecodeBytes, instance)
+ return consumeBody(this, utf8DecodeBytes, instance)
},
json () {
// The json() method steps are to return the result of running
// consume body with this and parse JSON from bytes.
- return specConsumeBody(this, parseJSONFromBytes, instance)
+ return consumeBody(this, parseJSONFromBytes, instance)
},
- async formData () {
- webidl.brandCheck(this, instance)
-
- throwIfAborted(this[kState])
-
- const contentType = this.headers.get('Content-Type')
-
- // If mimeType’s essence is "multipart/form-data", then:
- if (/multipart\/form-data/.test(contentType)) {
- const headers = {}
- for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
-
- const responseFormData = new FormData()
-
- let busboy
-
- try {
- busboy = new Busboy({
- headers,
- preservePath: true
- })
- } catch (err) {
- throw new DOMException(`${err}`, 'AbortError')
- }
-
- busboy.on('field', (name, value) => {
- responseFormData.append(name, value)
- })
- busboy.on('file', (name, value, filename, encoding, mimeType) => {
- const chunks = []
-
- if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
- let base64chunk = ''
-
- value.on('data', (chunk) => {
- base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
+ formData () {
+ // The formData() method steps are to return the result of running
+ // consume body with this and the following step given a byte sequence bytes:
+ return consumeBody(this, (value) => {
+ // 1. Let mimeType be the result of get the MIME type with this.
+ const mimeType = bodyMimeType(this)
+
+ // 2. If mimeType is non-null, then switch on mimeType’s essence and run
+ // the corresponding steps:
+ if (mimeType !== null) {
+ switch (mimeType.essence) {
+ case 'multipart/form-data': {
+ // 1. ... [long step]
+ const parsed = multipartFormDataParser(value, mimeType)
+
+ // 2. If that fails for some reason, then throw a TypeError.
+ if (parsed === 'failure') {
+ throw new TypeError('Failed to parse body as FormData.')
+ }
- const end = base64chunk.length - base64chunk.length % 4
- chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
+ // 3. Return a new FormData object, appending each entry,
+ // resulting from the parsing operation, to its entry list.
+ const fd = new FormData()
+ fd[kState] = parsed
- base64chunk = base64chunk.slice(end)
- })
- value.on('end', () => {
- chunks.push(Buffer.from(base64chunk, 'base64'))
- responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
- })
- } else {
- value.on('data', (chunk) => {
- chunks.push(chunk)
- })
- value.on('end', () => {
- responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
- })
- }
- })
+ return fd
+ }
+ case 'application/x-www-form-urlencoded': {
+ // 1. Let entries be the result of parsing bytes.
+ const entries = new URLSearchParams(value.toString())
- const busboyResolve = new Promise((resolve, reject) => {
- busboy.on('finish', resolve)
- busboy.on('error', (err) => reject(new TypeError(err)))
- })
+ // 2. If entries is failure, then throw a TypeError.
- if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
- busboy.end()
- await busboyResolve
+ // 3. Return a new FormData object whose entry list is entries.
+ const fd = new FormData()
- return responseFormData
- } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
- // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
+ for (const [name, value] of entries) {
+ fd.append(name, value)
+ }
- // 1. Let entries be the result of parsing bytes.
- let entries
- try {
- let text = ''
- // application/x-www-form-urlencoded parser will keep the BOM.
- // https://url.spec.whatwg.org/#concept-urlencoded-parser
- // Note that streaming decoder is stateful and cannot be reused
- const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
-
- for await (const chunk of consumeBody(this[kState].body)) {
- if (!isUint8Array(chunk)) {
- throw new TypeError('Expected Uint8Array chunk')
+ return fd
}
- text += streamingDecoder.decode(chunk, { stream: true })
}
- text += streamingDecoder.decode()
- entries = new URLSearchParams(text)
- } catch (err) {
- // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
- // 2. If entries is failure, then throw a TypeError.
- throw Object.assign(new TypeError(), { cause: err })
- }
-
- // 3. Return a new FormData object whose entries are entries.
- const formData = new FormData()
- for (const [name, value] of entries) {
- formData.append(name, value)
}
- return formData
- } else {
- // Wait a tick before checking if the request has been aborted.
- // Otherwise, a TypeError can be thrown when an AbortError should.
- await Promise.resolve()
- throwIfAborted(this[kState])
+ // 3. Throw a TypeError.
+ throw new TypeError(
+ 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
+ )
+ }, instance)
+ },
- // Otherwise, throw a TypeError.
- throw webidl.errors.exception({
- header: `${instance.name}.formData`,
- message: 'Could not parse content as FormData.'
- })
- }
+ bytes () {
+ // The bytes() method steps are to return the result of running consume body
+ // with this and the following step given a byte sequence bytes: return the
+ // result of creating a Uint8Array from bytes in this’s relevant realm.
+ return consumeBody(this, (bytes) => {
+ return new Uint8Array(bytes)
+ }, instance)
}
}
@@ -23653,17 +26480,17 @@ function mixinBody (prototype) {
* @param {(value: unknown) => unknown} convertBytesToJSValue
* @param {Response|Request} instance
*/
-async function specConsumeBody (object, convertBytesToJSValue, instance) {
+async function consumeBody (object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance)
- throwIfAborted(object[kState])
-
// 1. If object is unusable, then return a promise rejected
// with a TypeError.
- if (bodyUnusable(object[kState].body)) {
- throw new TypeError('Body is unusable')
+ if (bodyUnusable(object)) {
+ throw new TypeError('Body is unusable: Body has already been read')
}
+ throwIfAborted(object[kState])
+
// 2. Let promise be a new promise.
const promise = createDeferredPromise()
@@ -23685,7 +26512,7 @@ async function specConsumeBody (object, convertBytesToJSValue, instance) {
// 5. If object’s body is null, then run successSteps with an
// empty byte sequence.
if (object[kState].body == null) {
- successSteps(new Uint8Array())
+ successSteps(Buffer.allocUnsafe(0))
return promise.promise
}
@@ -23698,39 +26525,15 @@ async function specConsumeBody (object, convertBytesToJSValue, instance) {
}
// https://fetch.spec.whatwg.org/#body-unusable
-function bodyUnusable (body) {
+function bodyUnusable (object) {
+ const body = object[kState].body
+
// An object including the Body interface mixin is
// said to be unusable if its body is non-null and
// its body’s stream is disturbed or locked.
return body != null && (body.stream.locked || util.isDisturbed(body.stream))
}
-/**
- * @see https://encoding.spec.whatwg.org/#utf-8-decode
- * @param {Buffer} buffer
- */
-function utf8DecodeBytes (buffer) {
- if (buffer.length === 0) {
- return ''
- }
-
- // 1. Let buffer be the result of peeking three bytes from
- // ioQueue, converted to a byte sequence.
-
- // 2. If buffer is 0xEF 0xBB 0xBF, then read three
- // bytes from ioQueue. (Do nothing with those bytes.)
- if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
- buffer = buffer.subarray(3)
- }
-
- // 3. Process a queue with an instance of UTF-8’s
- // decoder, ioQueue, output, and "replacement".
- const output = textDecoder.decode(buffer)
-
- // 4. Return output.
- return output
-}
-
/**
* @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
* @param {Uint8Array} bytes
@@ -23741,59 +26544,70 @@ function parseJSONFromBytes (bytes) {
/**
* @see https://fetch.spec.whatwg.org/#concept-body-mime-type
- * @param {import('./response').Response|import('./request').Request} object
+ * @param {import('./response').Response|import('./request').Request} requestOrResponse
*/
-function bodyMimeType (object) {
- const { headersList } = object[kState]
- const contentType = headersList.get('content-type')
+function bodyMimeType (requestOrResponse) {
+ // 1. Let headers be null.
+ // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.
+ // 3. Otherwise, set headers to requestOrResponse’s response’s header list.
+ /** @type {import('./headers').HeadersList} */
+ const headers = requestOrResponse[kState].headersList
- if (contentType === null) {
- return 'failure'
+ // 4. Let mimeType be the result of extracting a MIME type from headers.
+ const mimeType = extractMimeType(headers)
+
+ // 5. If mimeType is failure, then return null.
+ if (mimeType === 'failure') {
+ return null
}
- return parseMIMEType(contentType)
+ // 6. Return mimeType.
+ return mimeType
}
module.exports = {
extractBody,
safelyExtractBody,
cloneBody,
- mixinBody
+ mixinBody,
+ streamRegistry,
+ hasFinalizationRegistry,
+ bodyUnusable
}
/***/ }),
-/***/ 1037:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+/***/ 4495:
+/***/ ((module) => {
-const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
-const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
+const corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])
const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
-const nullBodyStatus = [101, 204, 205, 304]
+const nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])
-const redirectStatus = [301, 302, 303, 307, 308]
+const redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])
const redirectStatusSet = new Set(redirectStatus)
-// https://fetch.spec.whatwg.org/#block-bad-port
-const badPorts = [
+/**
+ * @see https://fetch.spec.whatwg.org/#block-bad-port
+ */
+const badPorts = /** @type {const} */ ([
'1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
'87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
'139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
'540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
- '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
- '10080'
-]
-
+ '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',
+ '6697', '10080'
+])
const badPortsSet = new Set(badPorts)
-// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
-const referrerPolicy = [
+/**
+ * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
+ */
+const referrerPolicy = /** @type {const} */ ([
'',
'no-referrer',
'no-referrer-when-downgrade',
@@ -23803,29 +26617,31 @@ const referrerPolicy = [
'origin-when-cross-origin',
'strict-origin-when-cross-origin',
'unsafe-url'
-]
+])
const referrerPolicySet = new Set(referrerPolicy)
-const requestRedirect = ['follow', 'manual', 'error']
+const requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])
-const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
+const safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])
const safeMethodsSet = new Set(safeMethods)
-const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
+const requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])
-const requestCredentials = ['omit', 'same-origin', 'include']
+const requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])
-const requestCache = [
+const requestCache = /** @type {const} */ ([
'default',
'no-store',
'reload',
'no-cache',
'force-cache',
'only-if-cached'
-]
+])
-// https://fetch.spec.whatwg.org/#request-body-header-name
-const requestBodyHeader = [
+/**
+ * @see https://fetch.spec.whatwg.org/#request-body-header-name
+ */
+const requestBodyHeader = /** @type {const} */ ([
'content-encoding',
'content-language',
'content-location',
@@ -23835,18 +26651,22 @@ const requestBodyHeader = [
// removed in the Headers implementation. However, undici doesn't
// filter out headers, so we add it here.
'content-length'
-]
+])
-// https://fetch.spec.whatwg.org/#enumdef-requestduplex
-const requestDuplex = [
+/**
+ * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex
+ */
+const requestDuplex = /** @type {const} */ ([
'half'
-]
+])
-// http://fetch.spec.whatwg.org/#forbidden-method
-const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
+/**
+ * @see http://fetch.spec.whatwg.org/#forbidden-method
+ */
+const forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])
const forbiddenMethodsSet = new Set(forbiddenMethods)
-const subresource = [
+const subresource = /** @type {const} */ ([
'audio',
'audioworklet',
'font',
@@ -23859,44 +26679,10 @@ const subresource = [
'video',
'xslt',
''
-]
+])
const subresourceSet = new Set(subresource)
-/** @type {globalThis['DOMException']} */
-const DOMException = globalThis.DOMException ?? (() => {
- // DOMException was only made a global in Node v17.0.0,
- // but fetch supports >= v16.8.
- try {
- atob('~')
- } catch (err) {
- return Object.getPrototypeOf(err).constructor
- }
-})()
-
-let channel
-
-/** @type {globalThis['structuredClone']} */
-const structuredClone =
- globalThis.structuredClone ??
- // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
- // structuredClone was added in v17.0.0, but fetch supports v16.8
- function structuredClone (value, options = undefined) {
- if (arguments.length === 0) {
- throw new TypeError('missing argument')
- }
-
- if (!channel) {
- channel = new MessageChannel()
- }
- channel.port1.unref()
- channel.port2.unref()
- channel.port1.postMessage(value, options?.transfer)
- return receiveMessageOnPort(channel.port2).message
- }
-
module.exports = {
- DOMException,
- structuredClone,
subresource,
forbiddenMethods,
requestBodyHeader,
@@ -23923,24 +26709,25 @@ module.exports = {
/***/ }),
-/***/ 685:
+/***/ 1900:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-const assert = __nccwpck_require__(9491)
-const { atob } = __nccwpck_require__(4300)
-const { isomorphicDecode } = __nccwpck_require__(2538)
+
+
+const assert = __nccwpck_require__(4589)
const encoder = new TextEncoder()
/**
* @see https://mimesniff.spec.whatwg.org/#http-token-code-point
*/
-const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
-const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
+const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/
+const HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/ // eslint-disable-line
+const ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g // eslint-disable-line
/**
* @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
*/
-const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
+const HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/ // eslint-disable-line
// https://fetch.spec.whatwg.org/#data-url-processor
/** @param {URL} dataURL */
@@ -24054,7 +26841,13 @@ function URLSerializer (url, excludeFragment = false) {
const href = url.href
const hashLength = url.hash.length
- return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
+ const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)
+
+ if (!hashLength && href.endsWith('#')) {
+ return serialized.slice(0, -1)
+ }
+
+ return serialized
}
// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
@@ -24110,20 +26903,43 @@ function stringPercentDecode (input) {
return percentDecode(bytes)
}
+/**
+ * @param {number} byte
+ */
+function isHexCharByte (byte) {
+ // 0-9 A-F a-f
+ return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)
+}
+
+/**
+ * @param {number} byte
+ */
+function hexByteToNumber (byte) {
+ return (
+ // 0-9
+ byte >= 0x30 && byte <= 0x39
+ ? (byte - 48)
+ // Convert to uppercase
+ // ((byte & 0xDF) - 65) + 10
+ : ((byte & 0xDF) - 55)
+ )
+}
+
// https://url.spec.whatwg.org/#percent-decode
/** @param {Uint8Array} input */
function percentDecode (input) {
+ const length = input.length
// 1. Let output be an empty byte sequence.
- /** @type {number[]} */
- const output = []
-
+ /** @type {Uint8Array} */
+ const output = new Uint8Array(length)
+ let j = 0
// 2. For each byte byte in input:
- for (let i = 0; i < input.length; i++) {
+ for (let i = 0; i < length; ++i) {
const byte = input[i]
// 1. If byte is not 0x25 (%), then append byte to output.
if (byte !== 0x25) {
- output.push(byte)
+ output[j++] = byte
// 2. Otherwise, if byte is 0x25 (%) and the next two bytes
// after byte in input are not in the ranges
@@ -24132,19 +26948,16 @@ function percentDecode (input) {
// to output.
} else if (
byte === 0x25 &&
- !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
+ !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))
) {
- output.push(0x25)
+ output[j++] = 0x25
// 3. Otherwise:
} else {
// 1. Let bytePoint be the two bytes after byte in input,
// decoded, and then interpreted as hexadecimal number.
- const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
- const bytePoint = Number.parseInt(nextTwoBytes, 16)
-
// 2. Append a byte whose value is bytePoint to output.
- output.push(bytePoint)
+ output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])
// 3. Skip the next two bytes in input.
i += 2
@@ -24152,7 +26965,7 @@ function percentDecode (input) {
}
// 3. Return output.
- return Uint8Array.from(output)
+ return length === j ? output : output.subarray(0, j)
}
// https://mimesniff.spec.whatwg.org/#parse-a-mime-type
@@ -24332,19 +27145,25 @@ function parseMIMEType (input) {
/** @param {string} data */
function forgivingBase64 (data) {
// 1. Remove all ASCII whitespace from data.
- data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
+ data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '') // eslint-disable-line
+ let dataLength = data.length
// 2. If data’s code point length divides by 4 leaving
// no remainder, then:
- if (data.length % 4 === 0) {
+ if (dataLength % 4 === 0) {
// 1. If data ends with one or two U+003D (=) code points,
// then remove them from data.
- data = data.replace(/=?=$/, '')
+ if (data.charCodeAt(dataLength - 1) === 0x003D) {
+ --dataLength
+ if (data.charCodeAt(dataLength - 1) === 0x003D) {
+ --dataLength
+ }
+ }
}
// 3. If data’s code point length divides by 4 leaving
// a remainder of 1, then return failure.
- if (data.length % 4 === 1) {
+ if (dataLength % 4 === 1) {
return 'failure'
}
@@ -24353,18 +27172,12 @@ function forgivingBase64 (data) {
// U+002F (/)
// ASCII alphanumeric
// then return failure.
- if (/[^+/0-9A-Za-z]/.test(data)) {
+ if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {
return 'failure'
}
- const binary = atob(data)
- const bytes = new Uint8Array(binary.length)
-
- for (let byte = 0; byte < binary.length; byte++) {
- bytes[byte] = binary.charCodeAt(byte)
- }
-
- return bytes
+ const buffer = Buffer.from(data, 'base64')
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)
}
// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
@@ -24471,7 +27284,7 @@ function serializeAMimeType (mimeType) {
// 4. If value does not solely contain HTTP token code
// points or value is the empty string, then:
if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
- // 1. Precede each occurence of U+0022 (") or
+ // 1. Precede each occurrence of U+0022 (") or
// U+005C (\) in value with U+005C (\).
value = value.replace(/(\\|")/g, '\\$1')
@@ -24492,55 +27305,140 @@ function serializeAMimeType (mimeType) {
/**
* @see https://fetch.spec.whatwg.org/#http-whitespace
- * @param {string} char
+ * @param {number} char
*/
function isHTTPWhiteSpace (char) {
- return char === '\r' || char === '\n' || char === '\t' || char === ' '
+ // "\r\n\t "
+ return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020
}
/**
* @see https://fetch.spec.whatwg.org/#http-whitespace
* @param {string} str
+ * @param {boolean} [leading=true]
+ * @param {boolean} [trailing=true]
*/
function removeHTTPWhitespace (str, leading = true, trailing = true) {
- let lead = 0
- let trail = str.length - 1
-
- if (leading) {
- for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
- }
-
- if (trailing) {
- for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
- }
-
- return str.slice(lead, trail + 1)
+ return removeChars(str, leading, trailing, isHTTPWhiteSpace)
}
/**
* @see https://infra.spec.whatwg.org/#ascii-whitespace
- * @param {string} char
+ * @param {number} char
*/
function isASCIIWhitespace (char) {
- return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
+ // "\r\n\t\f "
+ return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020
}
/**
* @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
+ * @param {string} str
+ * @param {boolean} [leading=true]
+ * @param {boolean} [trailing=true]
*/
function removeASCIIWhitespace (str, leading = true, trailing = true) {
+ return removeChars(str, leading, trailing, isASCIIWhitespace)
+}
+
+/**
+ * @param {string} str
+ * @param {boolean} leading
+ * @param {boolean} trailing
+ * @param {(charCode: number) => boolean} predicate
+ * @returns
+ */
+function removeChars (str, leading, trailing, predicate) {
let lead = 0
let trail = str.length - 1
if (leading) {
- for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
+ while (lead < str.length && predicate(str.charCodeAt(lead))) lead++
}
if (trailing) {
- for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
+ while (trail > 0 && predicate(str.charCodeAt(trail))) trail--
}
- return str.slice(lead, trail + 1)
+ return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)
+}
+
+/**
+ * @see https://infra.spec.whatwg.org/#isomorphic-decode
+ * @param {Uint8Array} input
+ * @returns {string}
+ */
+function isomorphicDecode (input) {
+ // 1. To isomorphic decode a byte sequence input, return a string whose code point
+ // length is equal to input’s length and whose code points have the same values
+ // as the values of input’s bytes, in the same order.
+ const length = input.length
+ if ((2 << 15) - 1 > length) {
+ return String.fromCharCode.apply(null, input)
+ }
+ let result = ''; let i = 0
+ let addition = (2 << 15) - 1
+ while (i < length) {
+ if (i + addition > length) {
+ addition = length - i
+ }
+ result += String.fromCharCode.apply(null, input.subarray(i, i += addition))
+ }
+ return result
+}
+
+/**
+ * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type
+ * @param {Exclude, 'failure'>} mimeType
+ */
+function minimizeSupportedMimeType (mimeType) {
+ switch (mimeType.essence) {
+ case 'application/ecmascript':
+ case 'application/javascript':
+ case 'application/x-ecmascript':
+ case 'application/x-javascript':
+ case 'text/ecmascript':
+ case 'text/javascript':
+ case 'text/javascript1.0':
+ case 'text/javascript1.1':
+ case 'text/javascript1.2':
+ case 'text/javascript1.3':
+ case 'text/javascript1.4':
+ case 'text/javascript1.5':
+ case 'text/jscript':
+ case 'text/livescript':
+ case 'text/x-ecmascript':
+ case 'text/x-javascript':
+ // 1. If mimeType is a JavaScript MIME type, then return "text/javascript".
+ return 'text/javascript'
+ case 'application/json':
+ case 'text/json':
+ // 2. If mimeType is a JSON MIME type, then return "application/json".
+ return 'application/json'
+ case 'image/svg+xml':
+ // 3. If mimeType’s essence is "image/svg+xml", then return "image/svg+xml".
+ return 'image/svg+xml'
+ case 'text/xml':
+ case 'application/xml':
+ // 4. If mimeType is an XML MIME type, then return "application/xml".
+ return 'application/xml'
+ }
+
+ // 2. If mimeType is a JSON MIME type, then return "application/json".
+ if (mimeType.subtype.endsWith('+json')) {
+ return 'application/json'
+ }
+
+ // 4. If mimeType is an XML MIME type, then return "application/xml".
+ if (mimeType.subtype.endsWith('+xml')) {
+ return 'application/xml'
+ }
+
+ // 5. If mimeType is supported by the user agent, then return mimeType’s essence.
+ // Technically, node doesn't support any mimetypes.
+
+ // 6. Return the empty string.
+ return ''
}
module.exports = {
@@ -24551,111 +27449,80 @@ module.exports = {
stringPercentDecode,
parseMIMEType,
collectAnHTTPQuotedString,
- serializeAMimeType
+ serializeAMimeType,
+ removeChars,
+ removeHTTPWhitespace,
+ minimizeSupportedMimeType,
+ HTTP_TOKEN_CODEPOINTS,
+ isomorphicDecode
}
/***/ }),
-/***/ 8511:
+/***/ 6653:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
-const { types } = __nccwpck_require__(3837)
-const { kState } = __nccwpck_require__(5861)
-const { isBlobLike } = __nccwpck_require__(2538)
-const { webidl } = __nccwpck_require__(1744)
-const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
-const encoder = new TextEncoder()
-
-class File extends Blob {
- constructor (fileBits, fileName, options = {}) {
- // The File constructor is invoked with two or three parameters, depending
- // on whether the optional dictionary parameter is used. When the File()
- // constructor is invoked, user agents must run the following steps:
- webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
+const { kConnected, kSize } = __nccwpck_require__(6443)
- fileBits = webidl.converters['sequence'](fileBits)
- fileName = webidl.converters.USVString(fileName)
- options = webidl.converters.FilePropertyBag(options)
-
- // 1. Let bytes be the result of processing blob parts given fileBits and
- // options.
- // Note: Blob handles this for us
-
- // 2. Let n be the fileName argument to the constructor.
- const n = fileName
-
- // 3. Process FilePropertyBag dictionary argument by running the following
- // substeps:
+class CompatWeakRef {
+ constructor (value) {
+ this.value = value
+ }
- // 1. If the type member is provided and is not the empty string, let t
- // be set to the type dictionary member. If t contains any characters
- // outside the range U+0020 to U+007E, then set t to the empty string
- // and return from these substeps.
- // 2. Convert every character in t to ASCII lowercase.
- let t = options.type
- let d
+ deref () {
+ return this.value[kConnected] === 0 && this.value[kSize] === 0
+ ? undefined
+ : this.value
+ }
+}
- // eslint-disable-next-line no-labels
- substep: {
- if (t) {
- t = parseMIMEType(t)
+class CompatFinalizer {
+ constructor (finalizer) {
+ this.finalizer = finalizer
+ }
- if (t === 'failure') {
- t = ''
- // eslint-disable-next-line no-labels
- break substep
+ register (dispatcher, key) {
+ if (dispatcher.on) {
+ dispatcher.on('disconnect', () => {
+ if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
+ this.finalizer(key)
}
-
- t = serializeAMimeType(t).toLowerCase()
- }
-
- // 3. If the lastModified member is provided, let d be set to the
- // lastModified dictionary member. If it is not provided, set d to the
- // current date and time represented as the number of milliseconds since
- // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
- d = options.lastModified
+ })
}
+ }
- // 4. Return a new File object F such that:
- // F refers to the bytes byte sequence.
- // F.size is set to the number of total bytes in bytes.
- // F.name is set to n.
- // F.type is set to t.
- // F.lastModified is set to d.
+ unregister (key) {}
+}
- super(processBlobParts(fileBits, options), { type: t })
- this[kState] = {
- name: n,
- lastModified: d,
- type: t
+module.exports = function () {
+ // FIXME: remove workaround when the Node bug is backported to v18
+ // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
+ if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {
+ process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')
+ return {
+ WeakRef: CompatWeakRef,
+ FinalizationRegistry: CompatFinalizer
}
}
+ return { WeakRef, FinalizationRegistry }
+}
- get name () {
- webidl.brandCheck(this, File)
- return this[kState].name
- }
+/***/ }),
- get lastModified () {
- webidl.brandCheck(this, File)
+/***/ 7114:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return this[kState].lastModified
- }
- get type () {
- webidl.brandCheck(this, File)
- return this[kState].type
- }
-}
+const { Blob, File } = __nccwpck_require__(4573)
+const { kState } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+// TODO(@KhafraDev): remove
class FileLike {
constructor (blobLike, fileName, options = {}) {
// TODO: argument idl type check
@@ -24757,176 +27624,530 @@ class FileLike {
}
}
-Object.defineProperties(File.prototype, {
- [Symbol.toStringTag]: {
- value: 'File',
- configurable: true
- },
- name: kEnumerableProperty,
- lastModified: kEnumerableProperty
-})
-
webidl.converters.Blob = webidl.interfaceConverter(Blob)
-webidl.converters.BlobPart = function (V, opts) {
- if (webidl.util.Type(V) === 'Object') {
- if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+// If this function is moved to ./util.js, some tools (such as
+// rollup) will warn about circular dependencies. See:
+// https://github.com/nodejs/undici/issues/1629
+function isFileLike (object) {
+ return (
+ (object instanceof File) ||
+ (
+ object &&
+ (typeof object.stream === 'function' ||
+ typeof object.arrayBuffer === 'function') &&
+ object[Symbol.toStringTag] === 'File'
+ )
+ )
+}
+
+module.exports = { FileLike, isFileLike }
+
+
+/***/ }),
+
+/***/ 116:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3440)
+const { utf8DecodeBytes } = __nccwpck_require__(3168)
+const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(1900)
+const { isFileLike } = __nccwpck_require__(7114)
+const { makeEntry } = __nccwpck_require__(5910)
+const assert = __nccwpck_require__(4589)
+const { File: NodeFile } = __nccwpck_require__(4573)
+
+const File = globalThis.File ?? NodeFile
+
+const formDataNameBuffer = Buffer.from('form-data; name="')
+const filenameBuffer = Buffer.from('; filename')
+const dd = Buffer.from('--')
+const ddcrlf = Buffer.from('--\r\n')
+
+/**
+ * @param {string} chars
+ */
+function isAsciiString (chars) {
+ for (let i = 0; i < chars.length; ++i) {
+ if ((chars.charCodeAt(i) & ~0x7F) !== 0) {
+ return false
+ }
+ }
+ return true
+}
+
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary
+ * @param {string} boundary
+ */
+function validateBoundary (boundary) {
+ const length = boundary.length
+
+ // - its length is greater or equal to 27 and lesser or equal to 70, and
+ if (length < 27 || length > 70) {
+ return false
+ }
+
+ // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or
+ // 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),
+ // 0x2D (-) or 0x5F (_).
+ for (let i = 0; i < length; ++i) {
+ const cp = boundary.charCodeAt(i)
+
+ if (!(
+ (cp >= 0x30 && cp <= 0x39) ||
+ (cp >= 0x41 && cp <= 0x5a) ||
+ (cp >= 0x61 && cp <= 0x7a) ||
+ cp === 0x27 ||
+ cp === 0x2d ||
+ cp === 0x5f
+ )) {
+ return false
+ }
+ }
+
+ return true
+}
+
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser
+ * @param {Buffer} input
+ * @param {ReturnType} mimeType
+ */
+function multipartFormDataParser (input, mimeType) {
+ // 1. Assert: mimeType’s essence is "multipart/form-data".
+ assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')
+
+ const boundaryString = mimeType.parameters.get('boundary')
+
+ // 2. If mimeType’s parameters["boundary"] does not exist, return failure.
+ // Otherwise, let boundary be the result of UTF-8 decoding mimeType’s
+ // parameters["boundary"].
+ if (boundaryString === undefined) {
+ return 'failure'
+ }
+
+ const boundary = Buffer.from(`--${boundaryString}`, 'utf8')
+
+ // 3. Let entry list be an empty entry list.
+ const entryList = []
+
+ // 4. Let position be a pointer to a byte in input, initially pointing at
+ // the first byte.
+ const position = { position: 0 }
+
+ // Note: undici addition, allows leading and trailing CRLFs.
+ while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
+ position.position += 2
+ }
+
+ let trailing = input.length
+
+ while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {
+ trailing -= 2
+ }
+
+ if (trailing !== input.length) {
+ input = input.subarray(0, trailing)
+ }
+
+ // 5. While true:
+ while (true) {
+ // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D
+ // (`--`) followed by boundary, advance position by 2 + the length of
+ // boundary. Otherwise, return failure.
+ // Note: boundary is padded with 2 dashes already, no need to add 2.
+ if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {
+ position.position += boundary.length
+ } else {
+ return 'failure'
+ }
+
+ // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A
+ // (`--` followed by CR LF) followed by the end of input, return entry list.
+ // Note: a body does NOT need to end with CRLF. It can end with --.
+ if (
+ (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||
+ (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))
+ ) {
+ return entryList
+ }
+
+ // 5.3. If position does not point to a sequence of bytes starting with 0x0D
+ // 0x0A (CR LF), return failure.
+ if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ }
+
+ // 5.4. Advance position by 2. (This skips past the newline.)
+ position.position += 2
+
+ // 5.5. Let name, filename and contentType be the result of parsing
+ // multipart/form-data headers on input and position, if the result
+ // is not failure. Otherwise, return failure.
+ const result = parseMultipartFormDataHeaders(input, position)
+
+ if (result === 'failure') {
+ return 'failure'
+ }
+
+ let { name, filename, contentType, encoding } = result
+
+ // 5.6. Advance position by 2. (This skips past the empty line that marks
+ // the end of the headers.)
+ position.position += 2
+
+ // 5.7. Let body be the empty byte sequence.
+ let body
+
+ // 5.8. Body loop: While position is not past the end of input:
+ // TODO: the steps here are completely wrong
+ {
+ const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)
+
+ if (boundaryIndex === -1) {
+ return 'failure'
+ }
+
+ body = input.subarray(position.position, boundaryIndex - 4)
+
+ position.position += body.length
+
+ // Note: position must be advanced by the body's length before being
+ // decoded, otherwise the parsing will fail.
+ if (encoding === 'base64') {
+ body = Buffer.from(body.toString(), 'base64')
+ }
+ }
+
+ // 5.9. If position does not point to a sequence of bytes starting with
+ // 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.
+ if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ } else {
+ position.position += 2
+ }
+
+ // 5.10. If filename is not null:
+ let value
+
+ if (filename !== null) {
+ // 5.10.1. If contentType is null, set contentType to "text/plain".
+ contentType ??= 'text/plain'
+
+ // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.
+
+ // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.
+ // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.
+ if (!isAsciiString(contentType)) {
+ contentType = ''
+ }
+
+ // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.
+ value = new File([body], filename, { type: contentType })
+ } else {
+ // 5.11. Otherwise:
+
+ // 5.11.1. Let value be the UTF-8 decoding without BOM of body.
+ value = utf8DecodeBytes(Buffer.from(body))
+ }
+
+ // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.
+ assert(isUSVString(name))
+ assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))
+
+ // 5.13. Create an entry with name and value, and append it to entry list.
+ entryList.push(makeEntry(name, value, filename))
+ }
+}
+
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers
+ * @param {Buffer} input
+ * @param {{ position: number }} position
+ */
+function parseMultipartFormDataHeaders (input, position) {
+ // 1. Let name, filename and contentType be null.
+ let name = null
+ let filename = null
+ let contentType = null
+ let encoding = null
+
+ // 2. While true:
+ while (true) {
+ // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):
+ if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
+ // 2.1.1. If name is null, return failure.
+ if (name === null) {
+ return 'failure'
+ }
+
+ // 2.1.2. Return name, filename and contentType.
+ return { name, filename, contentType, encoding }
+ }
+
+ // 2.2. Let header name be the result of collecting a sequence of bytes that are
+ // not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.
+ let headerName = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,
+ input,
+ position
+ )
+
+ // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.
+ headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)
+
+ // 2.4. If header name does not match the field-name token production, return failure.
+ if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
+ return 'failure'
+ }
+
+ // 2.5. If the byte at position is not 0x3A (:), return failure.
+ if (input[position.position] !== 0x3a) {
+ return 'failure'
+ }
+
+ // 2.6. Advance position by 1.
+ position.position++
+
+ // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.
+ // (Do nothing with those bytes.)
+ collectASequenceOfBytes(
+ (char) => char === 0x20 || char === 0x09,
+ input,
+ position
+ )
+
+ // 2.8. Byte-lowercase header name and switch on the result:
+ switch (bufferToLowerCasedHeaderName(headerName)) {
+ case 'content-disposition': {
+ // 1. Set name and filename to null.
+ name = filename = null
+
+ // 2. If position does not point to a sequence of bytes starting with
+ // `form-data; name="`, return failure.
+ if (!bufferStartsWith(input, formDataNameBuffer, position)) {
+ return 'failure'
+ }
+
+ // 3. Advance position so it points at the byte after the next 0x22 (")
+ // byte (the one in the sequence of bytes matched above).
+ position.position += 17
+
+ // 4. Set name to the result of parsing a multipart/form-data name given
+ // input and position, if the result is not failure. Otherwise, return
+ // failure.
+ name = parseMultipartFormDataName(input, position)
+
+ if (name === null) {
+ return 'failure'
+ }
+
+ // 5. If position points to a sequence of bytes starting with `; filename="`:
+ if (bufferStartsWith(input, filenameBuffer, position)) {
+ // Note: undici also handles filename*
+ let check = position.position + filenameBuffer.length
+
+ if (input[check] === 0x2a) {
+ position.position += 1
+ check += 1
+ }
+
+ if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // ="
+ return 'failure'
+ }
+
+ // 1. Advance position so it points at the byte after the next 0x22 (") byte
+ // (the one in the sequence of bytes matched above).
+ position.position += 12
+
+ // 2. Set filename to the result of parsing a multipart/form-data name given
+ // input and position, if the result is not failure. Otherwise, return failure.
+ filename = parseMultipartFormDataName(input, position)
+
+ if (filename === null) {
+ return 'failure'
+ }
+ }
+
+ break
+ }
+ case 'content-type': {
+ // 1. Let header value be the result of collecting a sequence of bytes that are
+ // not 0x0A (LF) or 0x0D (CR), given position.
+ let headerValue = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
+ )
+
+ // 2. Remove any HTTP tab or space bytes from the end of header value.
+ headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
+
+ // 3. Set contentType to the isomorphic decoding of header value.
+ contentType = isomorphicDecode(headerValue)
+
+ break
+ }
+ case 'content-transfer-encoding': {
+ let headerValue = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
+ )
+
+ headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
+
+ encoding = isomorphicDecode(headerValue)
+
+ break
+ }
+ default: {
+ // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.
+ // (Do nothing with those bytes.)
+ collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
+ )
+ }
}
- if (
- ArrayBuffer.isView(V) ||
- types.isAnyArrayBuffer(V)
- ) {
- return webidl.converters.BufferSource(V, opts)
+ // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A
+ // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).
+ if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ } else {
+ position.position += 2
}
}
-
- return webidl.converters.USVString(V, opts)
}
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.BlobPart
-)
-
-// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
-webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
- {
- key: 'lastModified',
- converter: webidl.converters['long long'],
- get defaultValue () {
- return Date.now()
- }
- },
- {
- key: 'type',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'endings',
- converter: (value) => {
- value = webidl.converters.DOMString(value)
- value = value.toLowerCase()
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name
+ * @param {Buffer} input
+ * @param {{ position: number }} position
+ */
+function parseMultipartFormDataName (input, position) {
+ // 1. Assert: The byte at (position - 1) is 0x22 (").
+ assert(input[position.position - 1] === 0x22)
- if (value !== 'native') {
- value = 'transparent'
- }
+ // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 ("), given position.
+ /** @type {string | Buffer} */
+ let name = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,
+ input,
+ position
+ )
- return value
- },
- defaultValue: 'transparent'
+ // 3. If the byte at position is not 0x22 ("), return failure. Otherwise, advance position by 1.
+ if (input[position.position] !== 0x22) {
+ return null // name could be 'failure'
+ } else {
+ position.position++
}
-])
+
+ // 4. Replace any occurrence of the following subsequences in name with the given byte:
+ // - `%0A`: 0x0A (LF)
+ // - `%0D`: 0x0D (CR)
+ // - `%22`: 0x22 (")
+ name = new TextDecoder().decode(name)
+ .replace(/%0A/ig, '\n')
+ .replace(/%0D/ig, '\r')
+ .replace(/%22/g, '"')
+
+ // 5. Return the UTF-8 decoding without BOM of name.
+ return name
+}
/**
- * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
- * @param {(NodeJS.TypedArray|Blob|string)[]} parts
- * @param {{ type: string, endings: string }} options
+ * @param {(char: number) => boolean} condition
+ * @param {Buffer} input
+ * @param {{ position: number }} position
*/
-function processBlobParts (parts, options) {
- // 1. Let bytes be an empty sequence of bytes.
- /** @type {NodeJS.TypedArray[]} */
- const bytes = []
+function collectASequenceOfBytes (condition, input, position) {
+ let start = position.position
- // 2. For each element in parts:
- for (const element of parts) {
- // 1. If element is a USVString, run the following substeps:
- if (typeof element === 'string') {
- // 1. Let s be element.
- let s = element
+ while (start < input.length && condition(input[start])) {
+ ++start
+ }
- // 2. If the endings member of options is "native", set s
- // to the result of converting line endings to native
- // of element.
- if (options.endings === 'native') {
- s = convertLineEndingsNative(s)
- }
+ return input.subarray(position.position, (position.position = start))
+}
- // 3. Append the result of UTF-8 encoding s to bytes.
- bytes.push(encoder.encode(s))
- } else if (
- types.isAnyArrayBuffer(element) ||
- types.isTypedArray(element)
- ) {
- // 2. If element is a BufferSource, get a copy of the
- // bytes held by the buffer source, and append those
- // bytes to bytes.
- if (!element.buffer) { // ArrayBuffer
- bytes.push(new Uint8Array(element))
- } else {
- bytes.push(
- new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
- )
- }
- } else if (isBlobLike(element)) {
- // 3. If element is a Blob, append the bytes it represents
- // to bytes.
- bytes.push(element)
- }
+/**
+ * @param {Buffer} buf
+ * @param {boolean} leading
+ * @param {boolean} trailing
+ * @param {(charCode: number) => boolean} predicate
+ * @returns {Buffer}
+ */
+function removeChars (buf, leading, trailing, predicate) {
+ let lead = 0
+ let trail = buf.length - 1
+
+ if (leading) {
+ while (lead < buf.length && predicate(buf[lead])) lead++
+ }
+
+ if (trailing) {
+ while (trail > 0 && predicate(buf[trail])) trail--
}
- // 3. Return bytes.
- return bytes
+ return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)
}
/**
- * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
- * @param {string} s
+ * Checks if {@param buffer} starts with {@param start}
+ * @param {Buffer} buffer
+ * @param {Buffer} start
+ * @param {{ position: number }} position
*/
-function convertLineEndingsNative (s) {
- // 1. Let native line ending be be the code point U+000A LF.
- let nativeLineEnding = '\n'
+function bufferStartsWith (buffer, start, position) {
+ if (buffer.length < start.length) {
+ return false
+ }
- // 2. If the underlying platform’s conventions are to
- // represent newlines as a carriage return and line feed
- // sequence, set native line ending to the code point
- // U+000D CR followed by the code point U+000A LF.
- if (process.platform === 'win32') {
- nativeLineEnding = '\r\n'
+ for (let i = 0; i < start.length; i++) {
+ if (start[i] !== buffer[position.position + i]) {
+ return false
+ }
}
- return s.replace(/\r?\n/g, nativeLineEnding)
+ return true
}
-// If this function is moved to ./util.js, some tools (such as
-// rollup) will warn about circular dependencies. See:
-// https://github.com/nodejs/undici/issues/1629
-function isFileLike (object) {
- return (
- (NativeFile && object instanceof NativeFile) ||
- object instanceof File || (
- object &&
- (typeof object.stream === 'function' ||
- typeof object.arrayBuffer === 'function') &&
- object[Symbol.toStringTag] === 'File'
- )
- )
+module.exports = {
+ multipartFormDataParser,
+ validateBoundary
}
-module.exports = { File, FileLike, isFileLike }
-
/***/ }),
-/***/ 2015:
+/***/ 5910:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
-const { kState } = __nccwpck_require__(5861)
-const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
-const { webidl } = __nccwpck_require__(1744)
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
+const { isBlobLike, iteratorMixin } = __nccwpck_require__(3168)
+const { kState } = __nccwpck_require__(3627)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { FileLike, isFileLike } = __nccwpck_require__(7114)
+const { webidl } = __nccwpck_require__(5893)
+const { File: NativeFile } = __nccwpck_require__(4573)
+const nodeUtil = __nccwpck_require__(7975)
/** @type {globalThis['File']} */
-const File = NativeFile ?? UndiciFile
+const File = globalThis.File ?? NativeFile
// https://xhr.spec.whatwg.org/#formdata
class FormData {
constructor (form) {
+ webidl.util.markAsUncloneable(this)
+
if (form !== undefined) {
throw webidl.errors.conversionFailed({
prefix: 'FormData constructor',
@@ -24941,7 +28162,8 @@ class FormData {
append (name, value, filename = undefined) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
+ const prefix = 'FormData.append'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
if (arguments.length === 3 && !isBlobLike(value)) {
throw new TypeError(
@@ -24951,12 +28173,12 @@ class FormData {
// 1. Let value be value if given; otherwise blobValue.
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
value = isBlobLike(value)
- ? webidl.converters.Blob(value, { strict: false })
- : webidl.converters.USVString(value)
+ ? webidl.converters.Blob(value, prefix, 'value', { strict: false })
+ : webidl.converters.USVString(value, prefix, 'value')
filename = arguments.length === 3
- ? webidl.converters.USVString(filename)
+ ? webidl.converters.USVString(filename, prefix, 'filename')
: undefined
// 2. Let entry be the result of creating an entry with
@@ -24970,9 +28192,10 @@ class FormData {
delete (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
+ const prefix = 'FormData.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// The delete(name) method steps are to remove all entries whose name
// is name from this’s entry list.
@@ -24982,9 +28205,10 @@ class FormData {
get (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
+ const prefix = 'FormData.get'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// 1. If there is no entry whose name is name in this’s entry list,
// then return null.
@@ -25001,9 +28225,10 @@ class FormData {
getAll (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
+ const prefix = 'FormData.getAll'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// 1. If there is no entry whose name is name in this’s entry list,
// then return the empty list.
@@ -25017,9 +28242,10 @@ class FormData {
has (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
+ const prefix = 'FormData.has'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// The has(name) method steps are to return true if there is an entry
// whose name is name in this’s entry list; otherwise false.
@@ -25029,7 +28255,8 @@ class FormData {
set (name, value, filename = undefined) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
+ const prefix = 'FormData.set'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
if (arguments.length === 3 && !isBlobLike(value)) {
throw new TypeError(
@@ -25042,12 +28269,12 @@ class FormData {
// 1. Let value be value if given; otherwise blobValue.
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
value = isBlobLike(value)
- ? webidl.converters.Blob(value, { strict: false })
- : webidl.converters.USVString(value)
+ ? webidl.converters.Blob(value, prefix, 'name', { strict: false })
+ : webidl.converters.USVString(value, prefix, 'name')
filename = arguments.length === 3
- ? toUSVString(filename)
+ ? webidl.converters.USVString(filename, prefix, 'name')
: undefined
// 2. Let entry be the result of creating an entry with name, value, and
@@ -25069,60 +28296,40 @@ class FormData {
}
}
- entries () {
- webidl.brandCheck(this, FormData)
-
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'key+value'
- )
- }
-
- keys () {
- webidl.brandCheck(this, FormData)
-
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'key'
- )
- }
-
- values () {
- webidl.brandCheck(this, FormData)
-
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'value'
- )
- }
+ [nodeUtil.inspect.custom] (depth, options) {
+ const state = this[kState].reduce((a, b) => {
+ if (a[b.name]) {
+ if (Array.isArray(a[b.name])) {
+ a[b.name].push(b.value)
+ } else {
+ a[b.name] = [a[b.name], b.value]
+ }
+ } else {
+ a[b.name] = b.value
+ }
- /**
- * @param {(value: string, key: string, self: FormData) => void} callbackFn
- * @param {unknown} thisArg
- */
- forEach (callbackFn, thisArg = globalThis) {
- webidl.brandCheck(this, FormData)
+ return a
+ }, { __proto__: null })
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
+ options.depth ??= depth
+ options.colors ??= true
- if (typeof callbackFn !== 'function') {
- throw new TypeError(
- "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
- )
- }
+ const output = nodeUtil.formatWithOptions(options, state)
- for (const [key, value] of this) {
- callbackFn.apply(thisArg, [value, key, this])
- }
+ // remove [Object null prototype]
+ return `FormData ${output.slice(output.indexOf(']') + 2)}`
}
}
-FormData.prototype[Symbol.iterator] = FormData.prototype.entries
+iteratorMixin('FormData', FormData, kState, 'name', 'value')
Object.defineProperties(FormData.prototype, {
+ append: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ get: kEnumerableProperty,
+ getAll: kEnumerableProperty,
+ has: kEnumerableProperty,
+ set: kEnumerableProperty,
[Symbol.toStringTag]: {
value: 'FormData',
configurable: true
@@ -25138,15 +28345,12 @@ Object.defineProperties(FormData.prototype, {
*/
function makeEntry (name, value, filename) {
// 1. Set name to the result of converting name into a scalar value string.
- // "To convert a string into a scalar value string, replace any surrogates
- // with U+FFFD."
- // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
- name = Buffer.from(name).toString('utf8')
+ // Note: This operation was done by the webidl converter USVString.
// 2. If value is a string, then set value to the result of converting
// value into a scalar value string.
if (typeof value === 'string') {
- value = Buffer.from(value).toString('utf8')
+ // Note: This operation was done by the webidl converter USVString.
} else {
// 3. Otherwise:
@@ -25167,7 +28371,7 @@ function makeEntry (name, value, filename) {
lastModified: value.lastModified
}
- value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
+ value = value instanceof NativeFile
? new File([value], filename, options)
: new FileLike(value, filename, options)
}
@@ -25177,15 +28381,14 @@ function makeEntry (name, value, filename) {
return { name, value }
}
-module.exports = { FormData }
+module.exports = { FormData, makeEntry }
/***/ }),
-/***/ 1246:
+/***/ 1059:
/***/ ((module) => {
-"use strict";
// In case of breaking changes, increase the version
@@ -25230,24 +28433,23 @@ module.exports = {
/***/ }),
-/***/ 554:
+/***/ 660:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
// https://github.com/Ethan-Arrowood/undici-fetch
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const { kGuard } = __nccwpck_require__(5861)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+const { kConstruct } = __nccwpck_require__(6443)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
const {
- makeIterator,
+ iteratorMixin,
isValidHeaderName,
isValidHeaderValue
-} = __nccwpck_require__(2538)
-const { webidl } = __nccwpck_require__(1744)
-const assert = __nccwpck_require__(9491)
+} = __nccwpck_require__(3168)
+const { webidl } = __nccwpck_require__(5893)
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(7975)
const kHeadersMap = Symbol('headers map')
const kHeadersSortedMap = Symbol('headers map sorted')
@@ -25338,24 +28540,27 @@ function appendHeader (headers, name, value) {
// 3. If headers’s guard is "immutable", then throw a TypeError.
// 4. Otherwise, if headers’s guard is "request" and name is a
// forbidden header name, return.
+ // 5. Otherwise, if headers’s guard is "request-no-cors":
+ // TODO
// Note: undici does not implement forbidden header names
- if (headers[kGuard] === 'immutable') {
+ if (getHeadersGuard(headers) === 'immutable') {
throw new TypeError('immutable')
- } else if (headers[kGuard] === 'request-no-cors') {
- // 5. Otherwise, if headers’s guard is "request-no-cors":
- // TODO
}
// 6. Otherwise, if headers’s guard is "response" and name is a
// forbidden response-header name, return.
// 7. Append (name, value) to headers’s header list.
- return headers[kHeadersList].append(name, value)
+ return getHeadersList(headers).append(name, value, false)
// 8. If headers’s guard is "request-no-cors", then remove
// privileged no-CORS request headers from headers
}
+function compareHeaderName (a, b) {
+ return a[0] < b[0] ? -1 : 1
+}
+
class HeadersList {
/** @type {[string, string][]|null} */
cookies = null
@@ -25371,18610 +28576,25030 @@ class HeadersList {
}
}
- // https://fetch.spec.whatwg.org/#header-list-contains
- contains (name) {
+ /**
+ * @see https://fetch.spec.whatwg.org/#header-list-contains
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ */
+ contains (name, isLowerCase) {
// A header list list contains a header name name if list
// contains a header whose name is a byte-case-insensitive
// match for name.
- name = name.toLowerCase()
-
- return this[kHeadersMap].has(name)
- }
-
- clear () {
- this[kHeadersMap].clear()
- this[kHeadersSortedMap] = null
- this.cookies = null
- }
-
- // https://fetch.spec.whatwg.org/#concept-header-list-append
- append (name, value) {
- this[kHeadersSortedMap] = null
-
- // 1. If list contains name, then set name to the first such
- // header’s name.
- const lowercaseName = name.toLowerCase()
- const exists = this[kHeadersMap].get(lowercaseName)
-
- // 2. Append (name, value) to list.
- if (exists) {
- const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
- this[kHeadersMap].set(lowercaseName, {
- name: exists.name,
- value: `${exists.value}${delimiter}${value}`
- })
- } else {
- this[kHeadersMap].set(lowercaseName, { name, value })
- }
-
- if (lowercaseName === 'set-cookie') {
- this.cookies ??= []
- this.cookies.push(value)
- }
- }
-
- // https://fetch.spec.whatwg.org/#concept-header-list-set
- set (name, value) {
- this[kHeadersSortedMap] = null
- const lowercaseName = name.toLowerCase()
-
- if (lowercaseName === 'set-cookie') {
- this.cookies = [value]
- }
-
- // 1. If list contains name, then set the value of
- // the first such header to value and remove the
- // others.
- // 2. Otherwise, append header (name, value) to list.
- this[kHeadersMap].set(lowercaseName, { name, value })
- }
-
- // https://fetch.spec.whatwg.org/#concept-header-list-delete
- delete (name) {
- this[kHeadersSortedMap] = null
-
- name = name.toLowerCase()
-
- if (name === 'set-cookie') {
- this.cookies = null
- }
-
- this[kHeadersMap].delete(name)
- }
-
- // https://fetch.spec.whatwg.org/#concept-header-list-get
- get (name) {
- const value = this[kHeadersMap].get(name.toLowerCase())
-
- // 1. If list does not contain name, then return null.
- // 2. Return the values of all headers in list whose name
- // is a byte-case-insensitive match for name,
- // separated from each other by 0x2C 0x20, in order.
- return value === undefined ? null : value.value
- }
-
- * [Symbol.iterator] () {
- // use the lowercased name
- for (const [name, { value }] of this[kHeadersMap]) {
- yield [name, value]
- }
- }
-
- get entries () {
- const headers = {}
-
- if (this[kHeadersMap].size) {
- for (const { name, value } of this[kHeadersMap].values()) {
- headers[name] = value
- }
- }
-
- return headers
- }
-}
-
-// https://fetch.spec.whatwg.org/#headers-class
-class Headers {
- constructor (init = undefined) {
- if (init === kConstruct) {
- return
- }
- this[kHeadersList] = new HeadersList()
-
- // The new Headers(init) constructor steps are:
-
- // 1. Set this’s guard to "none".
- this[kGuard] = 'none'
-
- // 2. If init is given, then fill this with init.
- if (init !== undefined) {
- init = webidl.converters.HeadersInit(init)
- fill(this, init)
- }
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-append
- append (name, value) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
-
- name = webidl.converters.ByteString(name)
- value = webidl.converters.ByteString(value)
-
- return appendHeader(this, name, value)
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-delete
- delete (name) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
-
- name = webidl.converters.ByteString(name)
-
- // 1. If name is not a header name, then throw a TypeError.
- if (!isValidHeaderName(name)) {
- throw webidl.errors.invalidArgument({
- prefix: 'Headers.delete',
- value: name,
- type: 'header name'
- })
- }
-
- // 2. If this’s guard is "immutable", then throw a TypeError.
- // 3. Otherwise, if this’s guard is "request" and name is a
- // forbidden header name, return.
- // 4. Otherwise, if this’s guard is "request-no-cors", name
- // is not a no-CORS-safelisted request-header name, and
- // name is not a privileged no-CORS request-header name,
- // return.
- // 5. Otherwise, if this’s guard is "response" and name is
- // a forbidden response-header name, return.
- // Note: undici does not implement forbidden header names
- if (this[kGuard] === 'immutable') {
- throw new TypeError('immutable')
- } else if (this[kGuard] === 'request-no-cors') {
- // TODO
- }
-
- // 6. If this’s header list does not contain name, then
- // return.
- if (!this[kHeadersList].contains(name)) {
- return
- }
-
- // 7. Delete name from this’s header list.
- // 8. If this’s guard is "request-no-cors", then remove
- // privileged no-CORS request headers from this.
- this[kHeadersList].delete(name)
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-get
- get (name) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
-
- name = webidl.converters.ByteString(name)
-
- // 1. If name is not a header name, then throw a TypeError.
- if (!isValidHeaderName(name)) {
- throw webidl.errors.invalidArgument({
- prefix: 'Headers.get',
- value: name,
- type: 'header name'
- })
- }
-
- // 2. Return the result of getting name from this’s header
- // list.
- return this[kHeadersList].get(name)
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-has
- has (name) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
-
- name = webidl.converters.ByteString(name)
-
- // 1. If name is not a header name, then throw a TypeError.
- if (!isValidHeaderName(name)) {
- throw webidl.errors.invalidArgument({
- prefix: 'Headers.has',
- value: name,
- type: 'header name'
- })
- }
-
- // 2. Return true if this’s header list contains name;
- // otherwise false.
- return this[kHeadersList].contains(name)
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-set
- set (name, value) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
-
- name = webidl.converters.ByteString(name)
- value = webidl.converters.ByteString(value)
-
- // 1. Normalize value.
- value = headerValueNormalize(value)
-
- // 2. If name is not a header name or value is not a
- // header value, then throw a TypeError.
- if (!isValidHeaderName(name)) {
- throw webidl.errors.invalidArgument({
- prefix: 'Headers.set',
- value: name,
- type: 'header name'
- })
- } else if (!isValidHeaderValue(value)) {
- throw webidl.errors.invalidArgument({
- prefix: 'Headers.set',
- value,
- type: 'header value'
- })
- }
-
- // 3. If this’s guard is "immutable", then throw a TypeError.
- // 4. Otherwise, if this’s guard is "request" and name is a
- // forbidden header name, return.
- // 5. Otherwise, if this’s guard is "request-no-cors" and
- // name/value is not a no-CORS-safelisted request-header,
- // return.
- // 6. Otherwise, if this’s guard is "response" and name is a
- // forbidden response-header name, return.
- // Note: undici does not implement forbidden header names
- if (this[kGuard] === 'immutable') {
- throw new TypeError('immutable')
- } else if (this[kGuard] === 'request-no-cors') {
- // TODO
- }
-
- // 7. Set (name, value) in this’s header list.
- // 8. If this’s guard is "request-no-cors", then remove
- // privileged no-CORS request headers from this
- this[kHeadersList].set(name, value)
- }
-
- // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
- getSetCookie () {
- webidl.brandCheck(this, Headers)
-
- // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
- // 2. Return the values of all headers in this’s header list whose name is
- // a byte-case-insensitive match for `Set-Cookie`, in order.
-
- const list = this[kHeadersList].cookies
-
- if (list) {
- return [...list]
- }
-
- return []
- }
-
- // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
- get [kHeadersSortedMap] () {
- if (this[kHeadersList][kHeadersSortedMap]) {
- return this[kHeadersList][kHeadersSortedMap]
- }
-
- // 1. Let headers be an empty list of headers with the key being the name
- // and value the value.
- const headers = []
-
- // 2. Let names be the result of convert header names to a sorted-lowercase
- // set with all the names of the headers in list.
- const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
- const cookies = this[kHeadersList].cookies
-
- // 3. For each name of names:
- for (let i = 0; i < names.length; ++i) {
- const [name, value] = names[i]
- // 1. If name is `set-cookie`, then:
- if (name === 'set-cookie') {
- // 1. Let values be a list of all values of headers in list whose name
- // is a byte-case-insensitive match for name, in order.
-
- // 2. For each value of values:
- // 1. Append (name, value) to headers.
- for (let j = 0; j < cookies.length; ++j) {
- headers.push([name, cookies[j]])
- }
- } else {
- // 2. Otherwise:
-
- // 1. Let value be the result of getting name from list.
-
- // 2. Assert: value is non-null.
- assert(value !== null)
-
- // 3. Append (name, value) to headers.
- headers.push([name, value])
- }
- }
-
- this[kHeadersList][kHeadersSortedMap] = headers
-
- // 4. Return headers.
- return headers
- }
-
- keys () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'key')
- }
-
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'key'
- )
- }
-
- values () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'value')
- }
-
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'value'
- )
- }
-
- entries () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'key+value')
- }
-
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'key+value'
- )
- }
-
- /**
- * @param {(value: string, key: string, self: Headers) => void} callbackFn
- * @param {unknown} thisArg
- */
- forEach (callbackFn, thisArg = globalThis) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
-
- if (typeof callbackFn !== 'function') {
- throw new TypeError(
- "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
- )
- }
-
- for (const [key, value] of this) {
- callbackFn.apply(thisArg, [value, key, this])
- }
- }
-
- [Symbol.for('nodejs.util.inspect.custom')] () {
- webidl.brandCheck(this, Headers)
-
- return this[kHeadersList]
- }
-}
-
-Headers.prototype[Symbol.iterator] = Headers.prototype.entries
-
-Object.defineProperties(Headers.prototype, {
- append: kEnumerableProperty,
- delete: kEnumerableProperty,
- get: kEnumerableProperty,
- has: kEnumerableProperty,
- set: kEnumerableProperty,
- getSetCookie: kEnumerableProperty,
- keys: kEnumerableProperty,
- values: kEnumerableProperty,
- entries: kEnumerableProperty,
- forEach: kEnumerableProperty,
- [Symbol.iterator]: { enumerable: false },
- [Symbol.toStringTag]: {
- value: 'Headers',
- configurable: true
- }
-})
-
-webidl.converters.HeadersInit = function (V) {
- if (webidl.util.Type(V) === 'Object') {
- if (V[Symbol.iterator]) {
- return webidl.converters['sequence>'](V)
- }
-
- return webidl.converters['record'](V)
- }
-
- throw webidl.errors.conversionFailed({
- prefix: 'Headers constructor',
- argument: 'Argument 1',
- types: ['sequence>', 'record']
- })
-}
-
-module.exports = {
- fill,
- Headers,
- HeadersList
-}
-
-
-/***/ }),
-
-/***/ 4881:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// https://github.com/Ethan-Arrowood/undici-fetch
-
-
-
-const {
- Response,
- makeNetworkError,
- makeAppropriateNetworkError,
- filterResponse,
- makeResponse
-} = __nccwpck_require__(7823)
-const { Headers } = __nccwpck_require__(554)
-const { Request, makeRequest } = __nccwpck_require__(8359)
-const zlib = __nccwpck_require__(9796)
-const {
- bytesMatch,
- makePolicyContainer,
- clonePolicyContainer,
- requestBadPort,
- TAOCheck,
- appendRequestOriginHeader,
- responseLocationURL,
- requestCurrentURL,
- setRequestReferrerPolicyOnRedirect,
- tryUpgradeRequestToAPotentiallyTrustworthyURL,
- createOpaqueTimingInfo,
- appendFetchMetadata,
- corsCheck,
- crossOriginResourcePolicyCheck,
- determineRequestsReferrer,
- coarsenedSharedCurrentTime,
- createDeferredPromise,
- isBlobLike,
- sameOrigin,
- isCancelled,
- isAborted,
- isErrorLike,
- fullyReadBody,
- readableStreamClose,
- isomorphicEncode,
- urlIsLocal,
- urlIsHttpHttpsScheme,
- urlHasHttpsScheme
-} = __nccwpck_require__(2538)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const assert = __nccwpck_require__(9491)
-const { safelyExtractBody } = __nccwpck_require__(1472)
-const {
- redirectStatusSet,
- nullBodyStatus,
- safeMethodsSet,
- requestBodyHeader,
- subresourceSet,
- DOMException
-} = __nccwpck_require__(1037)
-const { kHeadersList } = __nccwpck_require__(2785)
-const EE = __nccwpck_require__(2361)
-const { Readable, pipeline } = __nccwpck_require__(2781)
-const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
-const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
-const { TransformStream } = __nccwpck_require__(5356)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { webidl } = __nccwpck_require__(1744)
-const { STATUS_CODES } = __nccwpck_require__(3685)
-const GET_OR_HEAD = ['GET', 'HEAD']
-
-/** @type {import('buffer').resolveObjectURL} */
-let resolveObjectURL
-let ReadableStream = globalThis.ReadableStream
-
-class Fetch extends EE {
- constructor (dispatcher) {
- super()
- this.dispatcher = dispatcher
- this.connection = null
- this.dump = false
- this.state = 'ongoing'
- // 2 terminated listeners get added per request,
- // but only 1 gets removed. If there are 20 redirects,
- // 21 listeners will be added.
- // See https://github.com/nodejs/undici/issues/1711
- // TODO (fix): Find and fix root cause for leaked listener.
- this.setMaxListeners(21)
+ return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())
}
- terminate (reason) {
- if (this.state !== 'ongoing') {
- return
- }
-
- this.state = 'terminated'
- this.connection?.destroy(reason)
- this.emit('terminated', reason)
+ clear () {
+ this[kHeadersMap].clear()
+ this[kHeadersSortedMap] = null
+ this.cookies = null
}
- // https://fetch.spec.whatwg.org/#fetch-controller-abort
- abort (error) {
- if (this.state !== 'ongoing') {
- return
- }
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-append
+ * @param {string} name
+ * @param {string} value
+ * @param {boolean} isLowerCase
+ */
+ append (name, value, isLowerCase) {
+ this[kHeadersSortedMap] = null
- // 1. Set controller’s state to "aborted".
- this.state = 'aborted'
+ // 1. If list contains name, then set name to the first such
+ // header’s name.
+ const lowercaseName = isLowerCase ? name : name.toLowerCase()
+ const exists = this[kHeadersMap].get(lowercaseName)
- // 2. Let fallbackError be an "AbortError" DOMException.
- // 3. Set error to fallbackError if it is not given.
- if (!error) {
- error = new DOMException('The operation was aborted.', 'AbortError')
+ // 2. Append (name, value) to list.
+ if (exists) {
+ const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
+ this[kHeadersMap].set(lowercaseName, {
+ name: exists.name,
+ value: `${exists.value}${delimiter}${value}`
+ })
+ } else {
+ this[kHeadersMap].set(lowercaseName, { name, value })
}
- // 4. Let serializedError be StructuredSerialize(error).
- // If that threw an exception, catch it, and let
- // serializedError be StructuredSerialize(fallbackError).
-
- // 5. Set controller’s serialized abort reason to serializedError.
- this.serializedAbortReason = error
-
- this.connection?.destroy(error)
- this.emit('terminated', error)
+ if (lowercaseName === 'set-cookie') {
+ (this.cookies ??= []).push(value)
+ }
}
-}
-
-// https://fetch.spec.whatwg.org/#fetch-method
-function fetch (input, init = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
- // 1. Let p be a new promise.
- const p = createDeferredPromise()
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-set
+ * @param {string} name
+ * @param {string} value
+ * @param {boolean} isLowerCase
+ */
+ set (name, value, isLowerCase) {
+ this[kHeadersSortedMap] = null
+ const lowercaseName = isLowerCase ? name : name.toLowerCase()
- // 2. Let requestObject be the result of invoking the initial value of
- // Request as constructor with input and init as arguments. If this throws
- // an exception, reject p with it and return p.
- let requestObject
+ if (lowercaseName === 'set-cookie') {
+ this.cookies = [value]
+ }
- try {
- requestObject = new Request(input, init)
- } catch (e) {
- p.reject(e)
- return p.promise
+ // 1. If list contains name, then set the value of
+ // the first such header to value and remove the
+ // others.
+ // 2. Otherwise, append header (name, value) to list.
+ this[kHeadersMap].set(lowercaseName, { name, value })
}
- // 3. Let request be requestObject’s request.
- const request = requestObject[kState]
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-delete
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ */
+ delete (name, isLowerCase) {
+ this[kHeadersSortedMap] = null
+ if (!isLowerCase) name = name.toLowerCase()
- // 4. If requestObject’s signal’s aborted flag is set, then:
- if (requestObject.signal.aborted) {
- // 1. Abort the fetch() call with p, request, null, and
- // requestObject’s signal’s abort reason.
- abortFetch(p, request, null, requestObject.signal.reason)
+ if (name === 'set-cookie') {
+ this.cookies = null
+ }
- // 2. Return p.
- return p.promise
+ this[kHeadersMap].delete(name)
}
- // 5. Let globalObject be request’s client’s global object.
- const globalObject = request.client.globalObject
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-get
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ * @returns {string | null}
+ */
+ get (name, isLowerCase) {
+ // 1. If list does not contain name, then return null.
+ // 2. Return the values of all headers in list whose name
+ // is a byte-case-insensitive match for name,
+ // separated from each other by 0x2C 0x20, in order.
+ return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null
+ }
- // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
- // request’s service-workers mode to "none".
- if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
- request.serviceWorkers = 'none'
+ * [Symbol.iterator] () {
+ // use the lowercased name
+ for (const { 0: name, 1: { value } } of this[kHeadersMap]) {
+ yield [name, value]
+ }
}
- // 7. Let responseObject be null.
- let responseObject = null
+ get entries () {
+ const headers = {}
- // 8. Let relevantRealm be this’s relevant Realm.
- const relevantRealm = null
+ if (this[kHeadersMap].size !== 0) {
+ for (const { name, value } of this[kHeadersMap].values()) {
+ headers[name] = value
+ }
+ }
- // 9. Let locallyAborted be false.
- let locallyAborted = false
+ return headers
+ }
- // 10. Let controller be null.
- let controller = null
+ rawValues () {
+ return this[kHeadersMap].values()
+ }
- // 11. Add the following abort steps to requestObject’s signal:
- addAbortListener(
- requestObject.signal,
- () => {
- // 1. Set locallyAborted to true.
- locallyAborted = true
+ get entriesList () {
+ const headers = []
- // 2. Assert: controller is non-null.
- assert(controller != null)
+ if (this[kHeadersMap].size !== 0) {
+ for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {
+ if (lowerName === 'set-cookie') {
+ for (const cookie of this.cookies) {
+ headers.push([name, cookie])
+ }
+ } else {
+ headers.push([name, value])
+ }
+ }
+ }
- // 3. Abort controller with requestObject’s signal’s abort reason.
- controller.abort(requestObject.signal.reason)
+ return headers
+ }
- // 4. Abort the fetch() call with p, request, responseObject,
- // and requestObject’s signal’s abort reason.
- abortFetch(p, request, responseObject, requestObject.signal.reason)
+ // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set
+ toSortedArray () {
+ const size = this[kHeadersMap].size
+ const array = new Array(size)
+ // In most cases, you will use the fast-path.
+ // fast-path: Use binary insertion sort for small arrays.
+ if (size <= 32) {
+ if (size === 0) {
+ // If empty, it is an empty array. To avoid the first index assignment.
+ return array
+ }
+ // Improve performance by unrolling loop and avoiding double-loop.
+ // Double-loop-less version of the binary insertion sort.
+ const iterator = this[kHeadersMap][Symbol.iterator]()
+ const firstValue = iterator.next().value
+ // set [name, value] to first index.
+ array[0] = [firstValue[0], firstValue[1].value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(firstValue[1].value !== null)
+ for (
+ let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;
+ i < size;
+ ++i
+ ) {
+ // get next value
+ value = iterator.next().value
+ // set [name, value] to current index.
+ x = array[i] = [value[0], value[1].value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(x[1] !== null)
+ left = 0
+ right = i
+ // binary search
+ while (left < right) {
+ // middle index
+ pivot = left + ((right - left) >> 1)
+ // compare header name
+ if (array[pivot][0] <= x[0]) {
+ left = pivot + 1
+ } else {
+ right = pivot
+ }
+ }
+ if (i !== pivot) {
+ j = i
+ while (j > left) {
+ array[j] = array[--j]
+ }
+ array[left] = x
+ }
+ }
+ /* c8 ignore next 4 */
+ if (!iterator.next().done) {
+ // This is for debugging and will never be called.
+ throw new TypeError('Unreachable')
+ }
+ return array
+ } else {
+ // This case would be a rare occurrence.
+ // slow-path: fallback
+ let i = 0
+ for (const { 0: name, 1: { value } } of this[kHeadersMap]) {
+ array[i++] = [name, value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(value !== null)
+ }
+ return array.sort(compareHeaderName)
}
- )
+ }
+}
- // 12. Let handleFetchDone given response response be to finalize and
- // report timing with response, globalObject, and "fetch".
- const handleFetchDone = (response) =>
- finalizeAndReportTiming(response, 'fetch')
+// https://fetch.spec.whatwg.org/#headers-class
+class Headers {
+ #guard
+ #headersList
- // 13. Set controller to the result of calling fetch given request,
- // with processResponseEndOfBody set to handleFetchDone, and processResponse
- // given response being these substeps:
+ constructor (init = undefined) {
+ webidl.util.markAsUncloneable(this)
- const processResponse = (response) => {
- // 1. If locallyAborted is true, terminate these substeps.
- if (locallyAborted) {
- return Promise.resolve()
+ if (init === kConstruct) {
+ return
}
- // 2. If response’s aborted flag is set, then:
- if (response.aborted) {
- // 1. Let deserializedError be the result of deserialize a serialized
- // abort reason given controller’s serialized abort reason and
- // relevantRealm.
+ this.#headersList = new HeadersList()
- // 2. Abort the fetch() call with p, request, responseObject, and
- // deserializedError.
+ // The new Headers(init) constructor steps are:
- abortFetch(p, request, responseObject, controller.serializedAbortReason)
- return Promise.resolve()
- }
+ // 1. Set this’s guard to "none".
+ this.#guard = 'none'
- // 3. If response is a network error, then reject p with a TypeError
- // and terminate these substeps.
- if (response.type === 'error') {
- p.reject(
- Object.assign(new TypeError('fetch failed'), { cause: response.error })
- )
- return Promise.resolve()
+ // 2. If init is given, then fill this with init.
+ if (init !== undefined) {
+ init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')
+ fill(this, init)
}
-
- // 4. Set responseObject to the result of creating a Response object,
- // given response, "immutable", and relevantRealm.
- responseObject = new Response()
- responseObject[kState] = response
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kHeadersList] = response.headersList
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
-
- // 5. Resolve p with responseObject.
- p.resolve(responseObject)
}
- controller = fetching({
- request,
- processResponseEndOfBody: handleFetchDone,
- processResponse,
- dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
- })
+ // https://fetch.spec.whatwg.org/#dom-headers-append
+ append (name, value) {
+ webidl.brandCheck(this, Headers)
- // 14. Return p.
- return p.promise
-}
+ webidl.argumentLengthCheck(arguments, 2, 'Headers.append')
-// https://fetch.spec.whatwg.org/#finalize-and-report-timing
-function finalizeAndReportTiming (response, initiatorType = 'other') {
- // 1. If response is an aborted network error, then return.
- if (response.type === 'error' && response.aborted) {
- return
- }
+ const prefix = 'Headers.append'
+ name = webidl.converters.ByteString(name, prefix, 'name')
+ value = webidl.converters.ByteString(value, prefix, 'value')
- // 2. If response’s URL list is null or empty, then return.
- if (!response.urlList?.length) {
- return
+ return appendHeader(this, name, value)
}
- // 3. Let originalURL be response’s URL list[0].
- const originalURL = response.urlList[0]
+ // https://fetch.spec.whatwg.org/#dom-headers-delete
+ delete (name) {
+ webidl.brandCheck(this, Headers)
- // 4. Let timingInfo be response’s timing info.
- let timingInfo = response.timingInfo
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')
- // 5. Let cacheState be response’s cache state.
- let cacheState = response.cacheState
+ const prefix = 'Headers.delete'
+ name = webidl.converters.ByteString(name, prefix, 'name')
- // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
- if (!urlIsHttpHttpsScheme(originalURL)) {
- return
- }
+ // 1. If name is not a header name, then throw a TypeError.
+ if (!isValidHeaderName(name)) {
+ throw webidl.errors.invalidArgument({
+ prefix: 'Headers.delete',
+ value: name,
+ type: 'header name'
+ })
+ }
- // 7. If timingInfo is null, then return.
- if (timingInfo === null) {
- return
- }
+ // 2. If this’s guard is "immutable", then throw a TypeError.
+ // 3. Otherwise, if this’s guard is "request" and name is a
+ // forbidden header name, return.
+ // 4. Otherwise, if this’s guard is "request-no-cors", name
+ // is not a no-CORS-safelisted request-header name, and
+ // name is not a privileged no-CORS request-header name,
+ // return.
+ // 5. Otherwise, if this’s guard is "response" and name is
+ // a forbidden response-header name, return.
+ // Note: undici does not implement forbidden header names
+ if (this.#guard === 'immutable') {
+ throw new TypeError('immutable')
+ }
- // 8. If response’s timing allow passed flag is not set, then:
- if (!response.timingAllowPassed) {
- // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
- timingInfo = createOpaqueTimingInfo({
- startTime: timingInfo.startTime
- })
+ // 6. If this’s header list does not contain name, then
+ // return.
+ if (!this.#headersList.contains(name, false)) {
+ return
+ }
- // 2. Set cacheState to the empty string.
- cacheState = ''
+ // 7. Delete name from this’s header list.
+ // 8. If this’s guard is "request-no-cors", then remove
+ // privileged no-CORS request headers from this.
+ this.#headersList.delete(name, false)
}
- // 9. Set timingInfo’s end time to the coarsened shared current time
- // given global’s relevant settings object’s cross-origin isolated
- // capability.
- // TODO: given global’s relevant settings object’s cross-origin isolated
- // capability?
- timingInfo.endTime = coarsenedSharedCurrentTime()
+ // https://fetch.spec.whatwg.org/#dom-headers-get
+ get (name) {
+ webidl.brandCheck(this, Headers)
- // 10. Set response’s timing info to timingInfo.
- response.timingInfo = timingInfo
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.get')
- // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
- // global, and cacheState.
- markResourceTiming(
- timingInfo,
- originalURL,
- initiatorType,
- globalThis,
- cacheState
- )
-}
+ const prefix = 'Headers.get'
+ name = webidl.converters.ByteString(name, prefix, 'name')
-// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
-function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
- if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
- performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
- }
-}
+ // 1. If name is not a header name, then throw a TypeError.
+ if (!isValidHeaderName(name)) {
+ throw webidl.errors.invalidArgument({
+ prefix,
+ value: name,
+ type: 'header name'
+ })
+ }
-// https://fetch.spec.whatwg.org/#abort-fetch
-function abortFetch (p, request, responseObject, error) {
- // Note: AbortSignal.reason was added in node v17.2.0
- // which would give us an undefined error to reject with.
- // Remove this once node v16 is no longer supported.
- if (!error) {
- error = new DOMException('The operation was aborted.', 'AbortError')
+ // 2. Return the result of getting name from this’s header
+ // list.
+ return this.#headersList.get(name, false)
}
- // 1. Reject promise with error.
- p.reject(error)
+ // https://fetch.spec.whatwg.org/#dom-headers-has
+ has (name) {
+ webidl.brandCheck(this, Headers)
- // 2. If request’s body is not null and is readable, then cancel request’s
- // body with error.
- if (request.body != null && isReadable(request.body?.stream)) {
- request.body.stream.cancel(error).catch((err) => {
- if (err.code === 'ERR_INVALID_STATE') {
- // Node bug?
- return
- }
- throw err
- })
- }
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.has')
- // 3. If responseObject is null, then return.
- if (responseObject == null) {
- return
- }
+ const prefix = 'Headers.has'
+ name = webidl.converters.ByteString(name, prefix, 'name')
- // 4. Let response be responseObject’s response.
- const response = responseObject[kState]
+ // 1. If name is not a header name, then throw a TypeError.
+ if (!isValidHeaderName(name)) {
+ throw webidl.errors.invalidArgument({
+ prefix,
+ value: name,
+ type: 'header name'
+ })
+ }
- // 5. If response’s body is not null and is readable, then error response’s
- // body with error.
- if (response.body != null && isReadable(response.body?.stream)) {
- response.body.stream.cancel(error).catch((err) => {
- if (err.code === 'ERR_INVALID_STATE') {
- // Node bug?
- return
- }
- throw err
- })
+ // 2. Return true if this’s header list contains name;
+ // otherwise false.
+ return this.#headersList.contains(name, false)
}
-}
-// https://fetch.spec.whatwg.org/#fetching
-function fetching ({
- request,
- processRequestBodyChunkLength,
- processRequestEndOfBody,
- processResponse,
- processResponseEndOfBody,
- processResponseConsumeBody,
- useParallelQueue = false,
- dispatcher // undici
-}) {
- // 1. Let taskDestination be null.
- let taskDestination = null
+ // https://fetch.spec.whatwg.org/#dom-headers-set
+ set (name, value) {
+ webidl.brandCheck(this, Headers)
- // 2. Let crossOriginIsolatedCapability be false.
- let crossOriginIsolatedCapability = false
+ webidl.argumentLengthCheck(arguments, 2, 'Headers.set')
- // 3. If request’s client is non-null, then:
- if (request.client != null) {
- // 1. Set taskDestination to request’s client’s global object.
- taskDestination = request.client.globalObject
+ const prefix = 'Headers.set'
+ name = webidl.converters.ByteString(name, prefix, 'name')
+ value = webidl.converters.ByteString(value, prefix, 'value')
- // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
- // isolated capability.
- crossOriginIsolatedCapability =
- request.client.crossOriginIsolatedCapability
- }
+ // 1. Normalize value.
+ value = headerValueNormalize(value)
- // 4. If useParallelQueue is true, then set taskDestination to the result of
- // starting a new parallel queue.
- // TODO
+ // 2. If name is not a header name or value is not a
+ // header value, then throw a TypeError.
+ if (!isValidHeaderName(name)) {
+ throw webidl.errors.invalidArgument({
+ prefix,
+ value: name,
+ type: 'header name'
+ })
+ } else if (!isValidHeaderValue(value)) {
+ throw webidl.errors.invalidArgument({
+ prefix,
+ value,
+ type: 'header value'
+ })
+ }
- // 5. Let timingInfo be a new fetch timing info whose start time and
- // post-redirect start time are the coarsened shared current time given
- // crossOriginIsolatedCapability.
- const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
- const timingInfo = createOpaqueTimingInfo({
- startTime: currenTime
- })
+ // 3. If this’s guard is "immutable", then throw a TypeError.
+ // 4. Otherwise, if this’s guard is "request" and name is a
+ // forbidden header name, return.
+ // 5. Otherwise, if this’s guard is "request-no-cors" and
+ // name/value is not a no-CORS-safelisted request-header,
+ // return.
+ // 6. Otherwise, if this’s guard is "response" and name is a
+ // forbidden response-header name, return.
+ // Note: undici does not implement forbidden header names
+ if (this.#guard === 'immutable') {
+ throw new TypeError('immutable')
+ }
- // 6. Let fetchParams be a new fetch params whose
- // request is request,
- // timing info is timingInfo,
- // process request body chunk length is processRequestBodyChunkLength,
- // process request end-of-body is processRequestEndOfBody,
- // process response is processResponse,
- // process response consume body is processResponseConsumeBody,
- // process response end-of-body is processResponseEndOfBody,
- // task destination is taskDestination,
- // and cross-origin isolated capability is crossOriginIsolatedCapability.
- const fetchParams = {
- controller: new Fetch(dispatcher),
- request,
- timingInfo,
- processRequestBodyChunkLength,
- processRequestEndOfBody,
- processResponse,
- processResponseConsumeBody,
- processResponseEndOfBody,
- taskDestination,
- crossOriginIsolatedCapability
+ // 7. Set (name, value) in this’s header list.
+ // 8. If this’s guard is "request-no-cors", then remove
+ // privileged no-CORS request headers from this
+ this.#headersList.set(name, value, false)
}
- // 7. If request’s body is a byte sequence, then set request’s body to
- // request’s body as a body.
- // NOTE: Since fetching is only called from fetch, body should already be
- // extracted.
- assert(!request.body || request.body.stream)
-
- // 8. If request’s window is "client", then set request’s window to request’s
- // client, if request’s client’s global object is a Window object; otherwise
- // "no-window".
- if (request.window === 'client') {
- // TODO: What if request.client is null?
- request.window =
- request.client?.globalObject?.constructor?.name === 'Window'
- ? request.client
- : 'no-window'
- }
+ // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
+ getSetCookie () {
+ webidl.brandCheck(this, Headers)
- // 9. If request’s origin is "client", then set request’s origin to request’s
- // client’s origin.
- if (request.origin === 'client') {
- // TODO: What if request.client is null?
- request.origin = request.client?.origin
- }
+ // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
+ // 2. Return the values of all headers in this’s header list whose name is
+ // a byte-case-insensitive match for `Set-Cookie`, in order.
- // 10. If all of the following conditions are true:
- // TODO
+ const list = this.#headersList.cookies
- // 11. If request’s policy container is "client", then:
- if (request.policyContainer === 'client') {
- // 1. If request’s client is non-null, then set request’s policy
- // container to a clone of request’s client’s policy container. [HTML]
- if (request.client != null) {
- request.policyContainer = clonePolicyContainer(
- request.client.policyContainer
- )
- } else {
- // 2. Otherwise, set request’s policy container to a new policy
- // container.
- request.policyContainer = makePolicyContainer()
+ if (list) {
+ return [...list]
}
+
+ return []
}
- // 12. If request’s header list does not contain `Accept`, then:
- if (!request.headersList.contains('accept')) {
- // 1. Let value be `*/*`.
- const value = '*/*'
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ get [kHeadersSortedMap] () {
+ if (this.#headersList[kHeadersSortedMap]) {
+ return this.#headersList[kHeadersSortedMap]
+ }
- // 2. A user agent should set value to the first matching statement, if
- // any, switching on request’s destination:
- // "document"
- // "frame"
- // "iframe"
- // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
- // "image"
- // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
- // "style"
- // `text/css,*/*;q=0.1`
- // TODO
+ // 1. Let headers be an empty list of headers with the key being the name
+ // and value the value.
+ const headers = []
- // 3. Append `Accept`/value to request’s header list.
- request.headersList.append('accept', value)
- }
+ // 2. Let names be the result of convert header names to a sorted-lowercase
+ // set with all the names of the headers in list.
+ const names = this.#headersList.toSortedArray()
- // 13. If request’s header list does not contain `Accept-Language`, then
- // user agents should append `Accept-Language`/an appropriate value to
- // request’s header list.
- if (!request.headersList.contains('accept-language')) {
- request.headersList.append('accept-language', '*')
- }
+ const cookies = this.#headersList.cookies
- // 14. If request’s priority is null, then use request’s initiator and
- // destination appropriately in setting request’s priority to a
- // user-agent-defined object.
- if (request.priority === null) {
- // TODO
- }
+ // fast-path
+ if (cookies === null || cookies.length === 1) {
+ // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`
+ return (this.#headersList[kHeadersSortedMap] = names)
+ }
- // 15. If request is a subresource request, then:
- if (subresourceSet.has(request.destination)) {
- // TODO
- }
+ // 3. For each name of names:
+ for (let i = 0; i < names.length; ++i) {
+ const { 0: name, 1: value } = names[i]
+ // 1. If name is `set-cookie`, then:
+ if (name === 'set-cookie') {
+ // 1. Let values be a list of all values of headers in list whose name
+ // is a byte-case-insensitive match for name, in order.
- // 16. Run main fetch given fetchParams.
- mainFetch(fetchParams)
- .catch(err => {
- fetchParams.controller.terminate(err)
- })
+ // 2. For each value of values:
+ // 1. Append (name, value) to headers.
+ for (let j = 0; j < cookies.length; ++j) {
+ headers.push([name, cookies[j]])
+ }
+ } else {
+ // 2. Otherwise:
- // 17. Return fetchParam's controller
- return fetchParams.controller
-}
+ // 1. Let value be the result of getting name from list.
-// https://fetch.spec.whatwg.org/#concept-main-fetch
-async function mainFetch (fetchParams, recursive = false) {
- // 1. Let request be fetchParams’s request.
- const request = fetchParams.request
+ // 2. Assert: value is non-null.
+ // Note: This operation was done by `HeadersList#toSortedArray`.
- // 2. Let response be null.
- let response = null
+ // 3. Append (name, value) to headers.
+ headers.push([name, value])
+ }
+ }
- // 3. If request’s local-URLs-only flag is set and request’s current URL is
- // not local, then set response to a network error.
- if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
- response = makeNetworkError('local URLs only')
+ // 4. Return headers.
+ return (this.#headersList[kHeadersSortedMap] = headers)
}
- // 4. Run report Content Security Policy violations for request.
- // TODO
+ [util.inspect.custom] (depth, options) {
+ options.depth ??= depth
- // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
- tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
+ return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`
+ }
- // 6. If should request be blocked due to a bad port, should fetching request
- // be blocked as mixed content, or should request be blocked by Content
- // Security Policy returns blocked, then set response to a network error.
- if (requestBadPort(request) === 'blocked') {
- response = makeNetworkError('bad port')
+ static getHeadersGuard (o) {
+ return o.#guard
}
- // TODO: should fetching request be blocked as mixed content?
- // TODO: should request be blocked by Content Security Policy?
- // 7. If request’s referrer policy is the empty string, then set request’s
- // referrer policy to request’s policy container’s referrer policy.
- if (request.referrerPolicy === '') {
- request.referrerPolicy = request.policyContainer.referrerPolicy
+ static setHeadersGuard (o, guard) {
+ o.#guard = guard
}
- // 8. If request’s referrer is not "no-referrer", then set request’s
- // referrer to the result of invoking determine request’s referrer.
- if (request.referrer !== 'no-referrer') {
- request.referrer = determineRequestsReferrer(request)
+ static getHeadersList (o) {
+ return o.#headersList
}
- // 9. Set request’s current URL’s scheme to "https" if all of the following
- // conditions are true:
- // - request’s current URL’s scheme is "http"
- // - request’s current URL’s host is a domain
- // - Matching request’s current URL’s host per Known HSTS Host Domain Name
- // Matching results in either a superdomain match with an asserted
- // includeSubDomains directive or a congruent match (with or without an
- // asserted includeSubDomains directive). [HSTS]
- // TODO
+ static setHeadersList (o, list) {
+ o.#headersList = list
+ }
+}
- // 10. If recursive is false, then run the remaining steps in parallel.
- // TODO
+const { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers
+Reflect.deleteProperty(Headers, 'getHeadersGuard')
+Reflect.deleteProperty(Headers, 'setHeadersGuard')
+Reflect.deleteProperty(Headers, 'getHeadersList')
+Reflect.deleteProperty(Headers, 'setHeadersList')
- // 11. If response is null, then set response to the result of running
- // the steps corresponding to the first matching statement:
- if (response === null) {
- response = await (async () => {
- const currentURL = requestCurrentURL(request)
+iteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)
- if (
- // - request’s current URL’s origin is same origin with request’s origin,
- // and request’s response tainting is "basic"
- (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
- // request’s current URL’s scheme is "data"
- (currentURL.protocol === 'data:') ||
- // - request’s mode is "navigate" or "websocket"
- (request.mode === 'navigate' || request.mode === 'websocket')
- ) {
- // 1. Set request’s response tainting to "basic".
- request.responseTainting = 'basic'
+Object.defineProperties(Headers.prototype, {
+ append: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ get: kEnumerableProperty,
+ has: kEnumerableProperty,
+ set: kEnumerableProperty,
+ getSetCookie: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'Headers',
+ configurable: true
+ },
+ [util.inspect.custom]: {
+ enumerable: false
+ }
+})
- // 2. Return the result of running scheme fetch given fetchParams.
- return await schemeFetch(fetchParams)
- }
+webidl.converters.HeadersInit = function (V, prefix, argument) {
+ if (webidl.util.Type(V) === 'Object') {
+ const iterator = Reflect.get(V, Symbol.iterator)
- // request’s mode is "same-origin"
- if (request.mode === 'same-origin') {
- // 1. Return a network error.
- return makeNetworkError('request mode cannot be "same-origin"')
+ // A work-around to ensure we send the properly-cased Headers when V is a Headers object.
+ // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.
+ if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object
+ try {
+ return getHeadersList(V).entriesList
+ } catch {
+ // fall-through
}
+ }
- // request’s mode is "no-cors"
- if (request.mode === 'no-cors') {
- // 1. If request’s redirect mode is not "follow", then return a network
- // error.
- if (request.redirect !== 'follow') {
- return makeNetworkError(
- 'redirect mode cannot be "follow" for "no-cors" request'
- )
- }
+ if (typeof iterator === 'function') {
+ return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))
+ }
- // 2. Set request’s response tainting to "opaque".
- request.responseTainting = 'opaque'
+ return webidl.converters['record'](V, prefix, argument)
+ }
- // 3. Return the result of running scheme fetch given fetchParams.
- return await schemeFetch(fetchParams)
- }
+ throw webidl.errors.conversionFailed({
+ prefix: 'Headers constructor',
+ argument: 'Argument 1',
+ types: ['sequence>', 'record']
+ })
+}
- // request’s current URL’s scheme is not an HTTP(S) scheme
- if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
- // Return a network error.
- return makeNetworkError('URL scheme must be a HTTP(S) scheme')
- }
+module.exports = {
+ fill,
+ // for test.
+ compareHeaderName,
+ Headers,
+ HeadersList,
+ getHeadersGuard,
+ setHeadersGuard,
+ setHeadersList,
+ getHeadersList
+}
- // - request’s use-CORS-preflight flag is set
- // - request’s unsafe-request flag is set and either request’s method is
- // not a CORS-safelisted method or CORS-unsafe request-header names with
- // request’s header list is not empty
- // 1. Set request’s response tainting to "cors".
- // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
- // given fetchParams and true.
- // 3. If corsWithPreflightResponse is a network error, then clear cache
- // entries using request.
- // 4. Return corsWithPreflightResponse.
- // TODO
- // Otherwise
- // 1. Set request’s response tainting to "cors".
- request.responseTainting = 'cors'
+/***/ }),
- // 2. Return the result of running HTTP fetch given fetchParams.
- return await httpFetch(fetchParams)
- })()
- }
+/***/ 4398:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 12. If recursive is true, then return response.
- if (recursive) {
- return response
- }
+// https://github.com/Ethan-Arrowood/undici-fetch
- // 13. If response is not a network error and response is not a filtered
- // response, then:
- if (response.status !== 0 && !response.internalResponse) {
- // If request’s response tainting is "cors", then:
- if (request.responseTainting === 'cors') {
- // 1. Let headerNames be the result of extracting header list values
- // given `Access-Control-Expose-Headers` and response’s header list.
- // TODO
- // 2. If request’s credentials mode is not "include" and headerNames
- // contains `*`, then set response’s CORS-exposed header-name list to
- // all unique header names in response’s header list.
- // TODO
- // 3. Otherwise, if headerNames is not null or failure, then set
- // response’s CORS-exposed header-name list to headerNames.
- // TODO
- }
- // Set response to the following filtered response with response as its
- // internal response, depending on request’s response tainting:
- if (request.responseTainting === 'basic') {
- response = filterResponse(response, 'basic')
- } else if (request.responseTainting === 'cors') {
- response = filterResponse(response, 'cors')
- } else if (request.responseTainting === 'opaque') {
- response = filterResponse(response, 'opaque')
- } else {
- assert(false)
- }
- }
- // 14. Let internalResponse be response, if response is a network error,
- // and response’s internal response otherwise.
- let internalResponse =
- response.status === 0 ? response : response.internalResponse
+const {
+ makeNetworkError,
+ makeAppropriateNetworkError,
+ filterResponse,
+ makeResponse,
+ fromInnerResponse
+} = __nccwpck_require__(9051)
+const { HeadersList } = __nccwpck_require__(660)
+const { Request, cloneRequest } = __nccwpck_require__(9967)
+const zlib = __nccwpck_require__(8522)
+const {
+ bytesMatch,
+ makePolicyContainer,
+ clonePolicyContainer,
+ requestBadPort,
+ TAOCheck,
+ appendRequestOriginHeader,
+ responseLocationURL,
+ requestCurrentURL,
+ setRequestReferrerPolicyOnRedirect,
+ tryUpgradeRequestToAPotentiallyTrustworthyURL,
+ createOpaqueTimingInfo,
+ appendFetchMetadata,
+ corsCheck,
+ crossOriginResourcePolicyCheck,
+ determineRequestsReferrer,
+ coarsenedSharedCurrentTime,
+ createDeferredPromise,
+ isBlobLike,
+ sameOrigin,
+ isCancelled,
+ isAborted,
+ isErrorLike,
+ fullyReadBody,
+ readableStreamClose,
+ isomorphicEncode,
+ urlIsLocal,
+ urlIsHttpHttpsScheme,
+ urlHasHttpsScheme,
+ clampAndCoarsenConnectionTimingInfo,
+ simpleRangeHeaderValue,
+ buildContentRange,
+ createInflate,
+ extractMimeType
+} = __nccwpck_require__(3168)
+const { kState, kDispatcher } = __nccwpck_require__(3627)
+const assert = __nccwpck_require__(4589)
+const { safelyExtractBody, extractBody } = __nccwpck_require__(4492)
+const {
+ redirectStatusSet,
+ nullBodyStatus,
+ safeMethodsSet,
+ requestBodyHeader,
+ subresourceSet
+} = __nccwpck_require__(4495)
+const EE = __nccwpck_require__(8474)
+const { Readable, pipeline, finished } = __nccwpck_require__(7075)
+const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3440)
+const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(1900)
+const { getGlobalDispatcher } = __nccwpck_require__(2581)
+const { webidl } = __nccwpck_require__(5893)
+const { STATUS_CODES } = __nccwpck_require__(7067)
+const GET_OR_HEAD = ['GET', 'HEAD']
- // 15. If internalResponse’s URL list is empty, then set it to a clone of
- // request’s URL list.
- if (internalResponse.urlList.length === 0) {
- internalResponse.urlList.push(...request.urlList)
- }
+const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'
+ ? 'node'
+ : 'undici'
- // 16. If request’s timing allow failed flag is unset, then set
- // internalResponse’s timing allow passed flag.
- if (!request.timingAllowFailed) {
- response.timingAllowPassed = true
- }
+/** @type {import('buffer').resolveObjectURL} */
+let resolveObjectURL
- // 17. If response is not a network error and any of the following returns
- // blocked
- // - should internalResponse to request be blocked as mixed content
- // - should internalResponse to request be blocked by Content Security Policy
- // - should internalResponse to request be blocked due to its MIME type
- // - should internalResponse to request be blocked due to nosniff
- // TODO
+class Fetch extends EE {
+ constructor (dispatcher) {
+ super()
- // 18. If response’s type is "opaque", internalResponse’s status is 206,
- // internalResponse’s range-requested flag is set, and request’s header
- // list does not contain `Range`, then set response and internalResponse
- // to a network error.
- if (
- response.type === 'opaque' &&
- internalResponse.status === 206 &&
- internalResponse.rangeRequested &&
- !request.headers.contains('range')
- ) {
- response = internalResponse = makeNetworkError()
+ this.dispatcher = dispatcher
+ this.connection = null
+ this.dump = false
+ this.state = 'ongoing'
}
- // 19. If response is not a network error and either request’s method is
- // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
- // set internalResponse’s body to null and disregard any enqueuing toward
- // it (if any).
- if (
- response.status !== 0 &&
- (request.method === 'HEAD' ||
- request.method === 'CONNECT' ||
- nullBodyStatus.includes(internalResponse.status))
- ) {
- internalResponse.body = null
- fetchParams.controller.dump = true
- }
+ terminate (reason) {
+ if (this.state !== 'ongoing') {
+ return
+ }
- // 20. If request’s integrity metadata is not the empty string, then:
- if (request.integrity) {
- // 1. Let processBodyError be this step: run fetch finale given fetchParams
- // and a network error.
- const processBodyError = (reason) =>
- fetchFinale(fetchParams, makeNetworkError(reason))
+ this.state = 'terminated'
+ this.connection?.destroy(reason)
+ this.emit('terminated', reason)
+ }
- // 2. If request’s response tainting is "opaque", or response’s body is null,
- // then run processBodyError and abort these steps.
- if (request.responseTainting === 'opaque' || response.body == null) {
- processBodyError(response.error)
+ // https://fetch.spec.whatwg.org/#fetch-controller-abort
+ abort (error) {
+ if (this.state !== 'ongoing') {
return
}
- // 3. Let processBody given bytes be these steps:
- const processBody = (bytes) => {
- // 1. If bytes do not match request’s integrity metadata,
- // then run processBodyError and abort these steps. [SRI]
- if (!bytesMatch(bytes, request.integrity)) {
- processBodyError('integrity mismatch')
- return
- }
-
- // 2. Set response’s body to bytes as a body.
- response.body = safelyExtractBody(bytes)[0]
+ // 1. Set controller’s state to "aborted".
+ this.state = 'aborted'
- // 3. Run fetch finale given fetchParams and response.
- fetchFinale(fetchParams, response)
+ // 2. Let fallbackError be an "AbortError" DOMException.
+ // 3. Set error to fallbackError if it is not given.
+ if (!error) {
+ error = new DOMException('The operation was aborted.', 'AbortError')
}
- // 4. Fully read response’s body given processBody and processBodyError.
- await fullyReadBody(response.body, processBody, processBodyError)
- } else {
- // 21. Otherwise, run fetch finale given fetchParams and response.
- fetchFinale(fetchParams, response)
- }
-}
+ // 4. Let serializedError be StructuredSerialize(error).
+ // If that threw an exception, catch it, and let
+ // serializedError be StructuredSerialize(fallbackError).
-// https://fetch.spec.whatwg.org/#concept-scheme-fetch
-// given a fetch params fetchParams
-function schemeFetch (fetchParams) {
- // Note: since the connection is destroyed on redirect, which sets fetchParams to a
- // cancelled state, we do not want this condition to trigger *unless* there have been
- // no redirects. See https://github.com/nodejs/undici/issues/1776
- // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
- if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
- return Promise.resolve(makeAppropriateNetworkError(fetchParams))
+ // 5. Set controller’s serialized abort reason to serializedError.
+ this.serializedAbortReason = error
+
+ this.connection?.destroy(error)
+ this.emit('terminated', error)
}
+}
- // 2. Let request be fetchParams’s request.
- const { request } = fetchParams
+function handleFetchDone (response) {
+ finalizeAndReportTiming(response, 'fetch')
+}
- const { protocol: scheme } = requestCurrentURL(request)
+// https://fetch.spec.whatwg.org/#fetch-method
+function fetch (input, init = undefined) {
+ webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')
- // 3. Switch on request’s current URL’s scheme and run the associated steps:
- switch (scheme) {
- case 'about:': {
- // If request’s current URL’s path is the string "blank", then return a new response
- // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
- // and body is the empty byte sequence as a body.
+ // 1. Let p be a new promise.
+ let p = createDeferredPromise()
- // Otherwise, return a network error.
- return Promise.resolve(makeNetworkError('about scheme is not supported'))
- }
- case 'blob:': {
- if (!resolveObjectURL) {
- resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
- }
+ // 2. Let requestObject be the result of invoking the initial value of
+ // Request as constructor with input and init as arguments. If this throws
+ // an exception, reject p with it and return p.
+ let requestObject
- // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
- const blobURLEntry = requestCurrentURL(request)
+ try {
+ requestObject = new Request(input, init)
+ } catch (e) {
+ p.reject(e)
+ return p.promise
+ }
- // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
- // Buffer.resolveObjectURL does not ignore URL queries.
- if (blobURLEntry.search.length !== 0) {
- return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
- }
+ // 3. Let request be requestObject’s request.
+ const request = requestObject[kState]
- const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
+ // 4. If requestObject’s signal’s aborted flag is set, then:
+ if (requestObject.signal.aborted) {
+ // 1. Abort the fetch() call with p, request, null, and
+ // requestObject’s signal’s abort reason.
+ abortFetch(p, request, null, requestObject.signal.reason)
- // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
- // object is not a Blob object, then return a network error.
- if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
- return Promise.resolve(makeNetworkError('invalid method'))
- }
+ // 2. Return p.
+ return p.promise
+ }
- // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
- const bodyWithType = safelyExtractBody(blobURLEntryObject)
+ // 5. Let globalObject be request’s client’s global object.
+ const globalObject = request.client.globalObject
- // 4. Let body be bodyWithType’s body.
- const body = bodyWithType[0]
+ // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
+ // request’s service-workers mode to "none".
+ if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
+ request.serviceWorkers = 'none'
+ }
- // 5. Let length be body’s length, serialized and isomorphic encoded.
- const length = isomorphicEncode(`${body.length}`)
+ // 7. Let responseObject be null.
+ let responseObject = null
- // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
- const type = bodyWithType[1] ?? ''
+ // 8. Let relevantRealm be this’s relevant Realm.
- // 7. Return a new response whose status message is `OK`, header list is
- // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
- const response = makeResponse({
- statusText: 'OK',
- headersList: [
- ['content-length', { name: 'Content-Length', value: length }],
- ['content-type', { name: 'Content-Type', value: type }]
- ]
- })
+ // 9. Let locallyAborted be false.
+ let locallyAborted = false
- response.body = body
+ // 10. Let controller be null.
+ let controller = null
- return Promise.resolve(response)
- }
- case 'data:': {
- // 1. Let dataURLStruct be the result of running the
- // data: URL processor on request’s current URL.
- const currentURL = requestCurrentURL(request)
- const dataURLStruct = dataURLProcessor(currentURL)
+ // 11. Add the following abort steps to requestObject’s signal:
+ addAbortListener(
+ requestObject.signal,
+ () => {
+ // 1. Set locallyAborted to true.
+ locallyAborted = true
- // 2. If dataURLStruct is failure, then return a
- // network error.
- if (dataURLStruct === 'failure') {
- return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
- }
+ // 2. Assert: controller is non-null.
+ assert(controller != null)
- // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
- const mimeType = serializeAMimeType(dataURLStruct.mimeType)
+ // 3. Abort controller with requestObject’s signal’s abort reason.
+ controller.abort(requestObject.signal.reason)
- // 4. Return a response whose status message is `OK`,
- // header list is « (`Content-Type`, mimeType) »,
- // and body is dataURLStruct’s body as a body.
- return Promise.resolve(makeResponse({
- statusText: 'OK',
- headersList: [
- ['content-type', { name: 'Content-Type', value: mimeType }]
- ],
- body: safelyExtractBody(dataURLStruct.body)[0]
- }))
- }
- case 'file:': {
- // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
- // When in doubt, return a network error.
- return Promise.resolve(makeNetworkError('not implemented... yet...'))
- }
- case 'http:':
- case 'https:': {
- // Return the result of running HTTP fetch given fetchParams.
+ const realResponse = responseObject?.deref()
- return httpFetch(fetchParams)
- .catch((err) => makeNetworkError(err))
- }
- default: {
- return Promise.resolve(makeNetworkError('unknown scheme'))
+ // 4. Abort the fetch() call with p, request, responseObject,
+ // and requestObject’s signal’s abort reason.
+ abortFetch(p, request, realResponse, requestObject.signal.reason)
}
- }
-}
-
-// https://fetch.spec.whatwg.org/#finalize-response
-function finalizeResponse (fetchParams, response) {
- // 1. Set fetchParams’s request’s done flag.
- fetchParams.request.done = true
-
- // 2, If fetchParams’s process response done is not null, then queue a fetch
- // task to run fetchParams’s process response done given response, with
- // fetchParams’s task destination.
- if (fetchParams.processResponseDone != null) {
- queueMicrotask(() => fetchParams.processResponseDone(response))
- }
-}
+ )
-// https://fetch.spec.whatwg.org/#fetch-finale
-function fetchFinale (fetchParams, response) {
- // 1. If response is a network error, then:
- if (response.type === 'error') {
- // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
- response.urlList = [fetchParams.request.urlList[0]]
-
- // 2. Set response’s timing info to the result of creating an opaque timing
- // info for fetchParams’s timing info.
- response.timingInfo = createOpaqueTimingInfo({
- startTime: fetchParams.timingInfo.startTime
- })
- }
+ // 12. Let handleFetchDone given response response be to finalize and
+ // report timing with response, globalObject, and "fetch".
+ // see function handleFetchDone
- // 2. Let processResponseEndOfBody be the following steps:
- const processResponseEndOfBody = () => {
- // 1. Set fetchParams’s request’s done flag.
- fetchParams.request.done = true
+ // 13. Set controller to the result of calling fetch given request,
+ // with processResponseEndOfBody set to handleFetchDone, and processResponse
+ // given response being these substeps:
- // If fetchParams’s process response end-of-body is not null,
- // then queue a fetch task to run fetchParams’s process response
- // end-of-body given response with fetchParams’s task destination.
- if (fetchParams.processResponseEndOfBody != null) {
- queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
+ const processResponse = (response) => {
+ // 1. If locallyAborted is true, terminate these substeps.
+ if (locallyAborted) {
+ return
}
- }
- // 3. If fetchParams’s process response is non-null, then queue a fetch task
- // to run fetchParams’s process response given response, with fetchParams’s
- // task destination.
- if (fetchParams.processResponse != null) {
- queueMicrotask(() => fetchParams.processResponse(response))
- }
+ // 2. If response’s aborted flag is set, then:
+ if (response.aborted) {
+ // 1. Let deserializedError be the result of deserialize a serialized
+ // abort reason given controller’s serialized abort reason and
+ // relevantRealm.
- // 4. If response’s body is null, then run processResponseEndOfBody.
- if (response.body == null) {
- processResponseEndOfBody()
- } else {
- // 5. Otherwise:
+ // 2. Abort the fetch() call with p, request, responseObject, and
+ // deserializedError.
- // 1. Let transformStream be a new a TransformStream.
+ abortFetch(p, request, responseObject, controller.serializedAbortReason)
+ return
+ }
- // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
- // enqueues chunk in transformStream.
- const identityTransformAlgorithm = (chunk, controller) => {
- controller.enqueue(chunk)
+ // 3. If response is a network error, then reject p with a TypeError
+ // and terminate these substeps.
+ if (response.type === 'error') {
+ p.reject(new TypeError('fetch failed', { cause: response.error }))
+ return
}
- // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
- // and flushAlgorithm set to processResponseEndOfBody.
- const transformStream = new TransformStream({
- start () {},
- transform: identityTransformAlgorithm,
- flush: processResponseEndOfBody
- }, {
- size () {
- return 1
- }
- }, {
- size () {
- return 1
- }
- })
+ // 4. Set responseObject to the result of creating a Response object,
+ // given response, "immutable", and relevantRealm.
+ responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))
- // 4. Set response’s body to the result of piping response’s body through transformStream.
- response.body = { stream: response.body.stream.pipeThrough(transformStream) }
+ // 5. Resolve p with responseObject.
+ p.resolve(responseObject.deref())
+ p = null
}
- // 6. If fetchParams’s process response consume body is non-null, then:
- if (fetchParams.processResponseConsumeBody != null) {
- // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
- // process response consume body given response and nullOrBytes.
- const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
+ controller = fetching({
+ request,
+ processResponseEndOfBody: handleFetchDone,
+ processResponse,
+ dispatcher: requestObject[kDispatcher] // undici
+ })
- // 2. Let processBodyError be this step: run fetchParams’s process
- // response consume body given response and failure.
- const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
+ // 14. Return p.
+ return p.promise
+}
- // 3. If response’s body is null, then queue a fetch task to run processBody
- // given null, with fetchParams’s task destination.
- if (response.body == null) {
- queueMicrotask(() => processBody(null))
- } else {
- // 4. Otherwise, fully read response’s body given processBody, processBodyError,
- // and fetchParams’s task destination.
- return fullyReadBody(response.body, processBody, processBodyError)
- }
- return Promise.resolve()
+// https://fetch.spec.whatwg.org/#finalize-and-report-timing
+function finalizeAndReportTiming (response, initiatorType = 'other') {
+ // 1. If response is an aborted network error, then return.
+ if (response.type === 'error' && response.aborted) {
+ return
}
-}
-// https://fetch.spec.whatwg.org/#http-fetch
-async function httpFetch (fetchParams) {
- // 1. Let request be fetchParams’s request.
- const request = fetchParams.request
+ // 2. If response’s URL list is null or empty, then return.
+ if (!response.urlList?.length) {
+ return
+ }
- // 2. Let response be null.
- let response = null
+ // 3. Let originalURL be response’s URL list[0].
+ const originalURL = response.urlList[0]
- // 3. Let actualResponse be null.
- let actualResponse = null
+ // 4. Let timingInfo be response’s timing info.
+ let timingInfo = response.timingInfo
- // 4. Let timingInfo be fetchParams’s timing info.
- const timingInfo = fetchParams.timingInfo
+ // 5. Let cacheState be response’s cache state.
+ let cacheState = response.cacheState
- // 5. If request’s service-workers mode is "all", then:
- if (request.serviceWorkers === 'all') {
- // TODO
+ // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
+ if (!urlIsHttpHttpsScheme(originalURL)) {
+ return
}
- // 6. If response is null, then:
- if (response === null) {
- // 1. If makeCORSPreflight is true and one of these conditions is true:
- // TODO
+ // 7. If timingInfo is null, then return.
+ if (timingInfo === null) {
+ return
+ }
- // 2. If request’s redirect mode is "follow", then set request’s
- // service-workers mode to "none".
- if (request.redirect === 'follow') {
- request.serviceWorkers = 'none'
- }
+ // 8. If response’s timing allow passed flag is not set, then:
+ if (!response.timingAllowPassed) {
+ // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
+ timingInfo = createOpaqueTimingInfo({
+ startTime: timingInfo.startTime
+ })
- // 3. Set response and actualResponse to the result of running
- // HTTP-network-or-cache fetch given fetchParams.
- actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
+ // 2. Set cacheState to the empty string.
+ cacheState = ''
+ }
- // 4. If request’s response tainting is "cors" and a CORS check
- // for request and response returns failure, then return a network error.
- if (
- request.responseTainting === 'cors' &&
- corsCheck(request, response) === 'failure'
- ) {
- return makeNetworkError('cors failure')
- }
+ // 9. Set timingInfo’s end time to the coarsened shared current time
+ // given global’s relevant settings object’s cross-origin isolated
+ // capability.
+ // TODO: given global’s relevant settings object’s cross-origin isolated
+ // capability?
+ timingInfo.endTime = coarsenedSharedCurrentTime()
- // 5. If the TAO check for request and response returns failure, then set
- // request’s timing allow failed flag.
- if (TAOCheck(request, response) === 'failure') {
- request.timingAllowFailed = true
- }
- }
+ // 10. Set response’s timing info to timingInfo.
+ response.timingInfo = timingInfo
- // 7. If either request’s response tainting or response’s type
- // is "opaque", and the cross-origin resource policy check with
- // request’s origin, request’s client, request’s destination,
- // and actualResponse returns blocked, then return a network error.
- if (
- (request.responseTainting === 'opaque' || response.type === 'opaque') &&
- crossOriginResourcePolicyCheck(
- request.origin,
- request.client,
- request.destination,
- actualResponse
- ) === 'blocked'
- ) {
- return makeNetworkError('blocked')
+ // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
+ // global, and cacheState.
+ markResourceTiming(
+ timingInfo,
+ originalURL.href,
+ initiatorType,
+ globalThis,
+ cacheState
+ )
+}
+
+// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
+const markResourceTiming = performance.markResourceTiming
+
+// https://fetch.spec.whatwg.org/#abort-fetch
+function abortFetch (p, request, responseObject, error) {
+ // 1. Reject promise with error.
+ if (p) {
+ // We might have already resolved the promise at this stage
+ p.reject(error)
}
- // 8. If actualResponse’s status is a redirect status, then:
- if (redirectStatusSet.has(actualResponse.status)) {
- // 1. If actualResponse’s status is not 303, request’s body is not null,
- // and the connection uses HTTP/2, then user agents may, and are even
- // encouraged to, transmit an RST_STREAM frame.
- // See, https://github.com/whatwg/fetch/issues/1288
- if (request.redirect !== 'manual') {
- fetchParams.controller.connection.destroy()
- }
+ // 2. If request’s body is not null and is readable, then cancel request’s
+ // body with error.
+ if (request.body != null && isReadable(request.body?.stream)) {
+ request.body.stream.cancel(error).catch((err) => {
+ if (err.code === 'ERR_INVALID_STATE') {
+ // Node bug?
+ return
+ }
+ throw err
+ })
+ }
- // 2. Switch on request’s redirect mode:
- if (request.redirect === 'error') {
- // Set response to a network error.
- response = makeNetworkError('unexpected redirect')
- } else if (request.redirect === 'manual') {
- // Set response to an opaque-redirect filtered response whose internal
- // response is actualResponse.
- // NOTE(spec): On the web this would return an `opaqueredirect` response,
- // but that doesn't make sense server side.
- // See https://github.com/nodejs/undici/issues/1193.
- response = actualResponse
- } else if (request.redirect === 'follow') {
- // Set response to the result of running HTTP-redirect fetch given
- // fetchParams and response.
- response = await httpRedirectFetch(fetchParams, response)
- } else {
- assert(false)
- }
+ // 3. If responseObject is null, then return.
+ if (responseObject == null) {
+ return
}
- // 9. Set response’s timing info to timingInfo.
- response.timingInfo = timingInfo
+ // 4. Let response be responseObject’s response.
+ const response = responseObject[kState]
- // 10. Return response.
- return response
+ // 5. If response’s body is not null and is readable, then error response’s
+ // body with error.
+ if (response.body != null && isReadable(response.body?.stream)) {
+ response.body.stream.cancel(error).catch((err) => {
+ if (err.code === 'ERR_INVALID_STATE') {
+ // Node bug?
+ return
+ }
+ throw err
+ })
+ }
}
-// https://fetch.spec.whatwg.org/#http-redirect-fetch
-function httpRedirectFetch (fetchParams, response) {
- // 1. Let request be fetchParams’s request.
- const request = fetchParams.request
-
- // 2. Let actualResponse be response, if response is not a filtered response,
- // and response’s internal response otherwise.
- const actualResponse = response.internalResponse
- ? response.internalResponse
- : response
+// https://fetch.spec.whatwg.org/#fetching
+function fetching ({
+ request,
+ processRequestBodyChunkLength,
+ processRequestEndOfBody,
+ processResponse,
+ processResponseEndOfBody,
+ processResponseConsumeBody,
+ useParallelQueue = false,
+ dispatcher = getGlobalDispatcher() // undici
+}) {
+ // Ensure that the dispatcher is set accordingly
+ assert(dispatcher)
- // 3. Let locationURL be actualResponse’s location URL given request’s current
- // URL’s fragment.
- let locationURL
+ // 1. Let taskDestination be null.
+ let taskDestination = null
- try {
- locationURL = responseLocationURL(
- actualResponse,
- requestCurrentURL(request).hash
- )
+ // 2. Let crossOriginIsolatedCapability be false.
+ let crossOriginIsolatedCapability = false
- // 4. If locationURL is null, then return response.
- if (locationURL == null) {
- return response
- }
- } catch (err) {
- // 5. If locationURL is failure, then return a network error.
- return Promise.resolve(makeNetworkError(err))
- }
+ // 3. If request’s client is non-null, then:
+ if (request.client != null) {
+ // 1. Set taskDestination to request’s client’s global object.
+ taskDestination = request.client.globalObject
- // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
- // error.
- if (!urlIsHttpHttpsScheme(locationURL)) {
- return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
+ // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
+ // isolated capability.
+ crossOriginIsolatedCapability =
+ request.client.crossOriginIsolatedCapability
}
- // 7. If request’s redirect count is 20, then return a network error.
- if (request.redirectCount === 20) {
- return Promise.resolve(makeNetworkError('redirect count exceeded'))
- }
+ // 4. If useParallelQueue is true, then set taskDestination to the result of
+ // starting a new parallel queue.
+ // TODO
- // 8. Increase request’s redirect count by 1.
- request.redirectCount += 1
+ // 5. Let timingInfo be a new fetch timing info whose start time and
+ // post-redirect start time are the coarsened shared current time given
+ // crossOriginIsolatedCapability.
+ const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
+ const timingInfo = createOpaqueTimingInfo({
+ startTime: currentTime
+ })
- // 9. If request’s mode is "cors", locationURL includes credentials, and
- // request’s origin is not same origin with locationURL’s origin, then return
- // a network error.
- if (
- request.mode === 'cors' &&
- (locationURL.username || locationURL.password) &&
- !sameOrigin(request, locationURL)
- ) {
- return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
+ // 6. Let fetchParams be a new fetch params whose
+ // request is request,
+ // timing info is timingInfo,
+ // process request body chunk length is processRequestBodyChunkLength,
+ // process request end-of-body is processRequestEndOfBody,
+ // process response is processResponse,
+ // process response consume body is processResponseConsumeBody,
+ // process response end-of-body is processResponseEndOfBody,
+ // task destination is taskDestination,
+ // and cross-origin isolated capability is crossOriginIsolatedCapability.
+ const fetchParams = {
+ controller: new Fetch(dispatcher),
+ request,
+ timingInfo,
+ processRequestBodyChunkLength,
+ processRequestEndOfBody,
+ processResponse,
+ processResponseConsumeBody,
+ processResponseEndOfBody,
+ taskDestination,
+ crossOriginIsolatedCapability
}
- // 10. If request’s response tainting is "cors" and locationURL includes
- // credentials, then return a network error.
- if (
- request.responseTainting === 'cors' &&
- (locationURL.username || locationURL.password)
- ) {
- return Promise.resolve(makeNetworkError(
- 'URL cannot contain credentials for request mode "cors"'
- ))
+ // 7. If request’s body is a byte sequence, then set request’s body to
+ // request’s body as a body.
+ // NOTE: Since fetching is only called from fetch, body should already be
+ // extracted.
+ assert(!request.body || request.body.stream)
+
+ // 8. If request’s window is "client", then set request’s window to request’s
+ // client, if request’s client’s global object is a Window object; otherwise
+ // "no-window".
+ if (request.window === 'client') {
+ // TODO: What if request.client is null?
+ request.window =
+ request.client?.globalObject?.constructor?.name === 'Window'
+ ? request.client
+ : 'no-window'
}
- // 11. If actualResponse’s status is not 303, request’s body is non-null,
- // and request’s body’s source is null, then return a network error.
- if (
- actualResponse.status !== 303 &&
- request.body != null &&
- request.body.source == null
- ) {
- return Promise.resolve(makeNetworkError())
+ // 9. If request’s origin is "client", then set request’s origin to request’s
+ // client’s origin.
+ if (request.origin === 'client') {
+ request.origin = request.client.origin
}
- // 12. If one of the following is true
- // - actualResponse’s status is 301 or 302 and request’s method is `POST`
- // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
- if (
- ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
- (actualResponse.status === 303 &&
- !GET_OR_HEAD.includes(request.method))
- ) {
- // then:
- // 1. Set request’s method to `GET` and request’s body to null.
- request.method = 'GET'
- request.body = null
+ // 10. If all of the following conditions are true:
+ // TODO
- // 2. For each headerName of request-body-header name, delete headerName from
- // request’s header list.
- for (const headerName of requestBodyHeader) {
- request.headersList.delete(headerName)
+ // 11. If request’s policy container is "client", then:
+ if (request.policyContainer === 'client') {
+ // 1. If request’s client is non-null, then set request’s policy
+ // container to a clone of request’s client’s policy container. [HTML]
+ if (request.client != null) {
+ request.policyContainer = clonePolicyContainer(
+ request.client.policyContainer
+ )
+ } else {
+ // 2. Otherwise, set request’s policy container to a new policy
+ // container.
+ request.policyContainer = makePolicyContainer()
}
}
- // 13. If request’s current URL’s origin is not same origin with locationURL’s
- // origin, then for each headerName of CORS non-wildcard request-header name,
- // delete headerName from request’s header list.
- if (!sameOrigin(requestCurrentURL(request), locationURL)) {
- // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
- request.headersList.delete('authorization')
+ // 12. If request’s header list does not contain `Accept`, then:
+ if (!request.headersList.contains('accept', true)) {
+ // 1. Let value be `*/*`.
+ const value = '*/*'
- // https://fetch.spec.whatwg.org/#authentication-entries
- request.headersList.delete('proxy-authorization', true)
+ // 2. A user agent should set value to the first matching statement, if
+ // any, switching on request’s destination:
+ // "document"
+ // "frame"
+ // "iframe"
+ // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
+ // "image"
+ // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
+ // "style"
+ // `text/css,*/*;q=0.1`
+ // TODO
- // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
- request.headersList.delete('cookie')
- request.headersList.delete('host')
+ // 3. Append `Accept`/value to request’s header list.
+ request.headersList.append('accept', value, true)
}
- // 14. If request’s body is non-null, then set request’s body to the first return
- // value of safely extracting request’s body’s source.
- if (request.body != null) {
- assert(request.body.source != null)
- request.body = safelyExtractBody(request.body.source)[0]
+ // 13. If request’s header list does not contain `Accept-Language`, then
+ // user agents should append `Accept-Language`/an appropriate value to
+ // request’s header list.
+ if (!request.headersList.contains('accept-language', true)) {
+ request.headersList.append('accept-language', '*', true)
}
- // 15. Let timingInfo be fetchParams’s timing info.
- const timingInfo = fetchParams.timingInfo
-
- // 16. Set timingInfo’s redirect end time and post-redirect start time to the
- // coarsened shared current time given fetchParams’s cross-origin isolated
- // capability.
- timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
- coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
-
- // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
- // redirect start time to timingInfo’s start time.
- if (timingInfo.redirectStartTime === 0) {
- timingInfo.redirectStartTime = timingInfo.startTime
+ // 14. If request’s priority is null, then use request’s initiator and
+ // destination appropriately in setting request’s priority to a
+ // user-agent-defined object.
+ if (request.priority === null) {
+ // TODO
}
- // 18. Append locationURL to request’s URL list.
- request.urlList.push(locationURL)
+ // 15. If request is a subresource request, then:
+ if (subresourceSet.has(request.destination)) {
+ // TODO
+ }
- // 19. Invoke set request’s referrer policy on redirect on request and
- // actualResponse.
- setRequestReferrerPolicyOnRedirect(request, actualResponse)
+ // 16. Run main fetch given fetchParams.
+ mainFetch(fetchParams)
+ .catch(err => {
+ fetchParams.controller.terminate(err)
+ })
- // 20. Return the result of running main fetch given fetchParams and true.
- return mainFetch(fetchParams, true)
+ // 17. Return fetchParam's controller
+ return fetchParams.controller
}
-// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
-async function httpNetworkOrCacheFetch (
- fetchParams,
- isAuthenticationFetch = false,
- isNewConnectionFetch = false
-) {
+// https://fetch.spec.whatwg.org/#concept-main-fetch
+async function mainFetch (fetchParams, recursive = false) {
// 1. Let request be fetchParams’s request.
const request = fetchParams.request
- // 2. Let httpFetchParams be null.
- let httpFetchParams = null
+ // 2. Let response be null.
+ let response = null
- // 3. Let httpRequest be null.
- let httpRequest = null
+ // 3. If request’s local-URLs-only flag is set and request’s current URL is
+ // not local, then set response to a network error.
+ if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
+ response = makeNetworkError('local URLs only')
+ }
- // 4. Let response be null.
- let response = null
+ // 4. Run report Content Security Policy violations for request.
+ // TODO
- // 5. Let storedResponse be null.
- // TODO: cache
+ // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
+ tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
- // 6. Let httpCache be null.
- const httpCache = null
+ // 6. If should request be blocked due to a bad port, should fetching request
+ // be blocked as mixed content, or should request be blocked by Content
+ // Security Policy returns blocked, then set response to a network error.
+ if (requestBadPort(request) === 'blocked') {
+ response = makeNetworkError('bad port')
+ }
+ // TODO: should fetching request be blocked as mixed content?
+ // TODO: should request be blocked by Content Security Policy?
- // 7. Let the revalidatingFlag be unset.
- const revalidatingFlag = false
+ // 7. If request’s referrer policy is the empty string, then set request’s
+ // referrer policy to request’s policy container’s referrer policy.
+ if (request.referrerPolicy === '') {
+ request.referrerPolicy = request.policyContainer.referrerPolicy
+ }
- // 8. Run these steps, but abort when the ongoing fetch is terminated:
+ // 8. If request’s referrer is not "no-referrer", then set request’s
+ // referrer to the result of invoking determine request’s referrer.
+ if (request.referrer !== 'no-referrer') {
+ request.referrer = determineRequestsReferrer(request)
+ }
- // 1. If request’s window is "no-window" and request’s redirect mode is
- // "error", then set httpFetchParams to fetchParams and httpRequest to
- // request.
- if (request.window === 'no-window' && request.redirect === 'error') {
- httpFetchParams = fetchParams
- httpRequest = request
- } else {
- // Otherwise:
+ // 9. Set request’s current URL’s scheme to "https" if all of the following
+ // conditions are true:
+ // - request’s current URL’s scheme is "http"
+ // - request’s current URL’s host is a domain
+ // - Matching request’s current URL’s host per Known HSTS Host Domain Name
+ // Matching results in either a superdomain match with an asserted
+ // includeSubDomains directive or a congruent match (with or without an
+ // asserted includeSubDomains directive). [HSTS]
+ // TODO
+
+ // 10. If recursive is false, then run the remaining steps in parallel.
+ // TODO
+
+ // 11. If response is null, then set response to the result of running
+ // the steps corresponding to the first matching statement:
+ if (response === null) {
+ response = await (async () => {
+ const currentURL = requestCurrentURL(request)
+
+ if (
+ // - request’s current URL’s origin is same origin with request’s origin,
+ // and request’s response tainting is "basic"
+ (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
+ // request’s current URL’s scheme is "data"
+ (currentURL.protocol === 'data:') ||
+ // - request’s mode is "navigate" or "websocket"
+ (request.mode === 'navigate' || request.mode === 'websocket')
+ ) {
+ // 1. Set request’s response tainting to "basic".
+ request.responseTainting = 'basic'
- // 1. Set httpRequest to a clone of request.
- httpRequest = makeRequest(request)
+ // 2. Return the result of running scheme fetch given fetchParams.
+ return await schemeFetch(fetchParams)
+ }
- // 2. Set httpFetchParams to a copy of fetchParams.
- httpFetchParams = { ...fetchParams }
+ // request’s mode is "same-origin"
+ if (request.mode === 'same-origin') {
+ // 1. Return a network error.
+ return makeNetworkError('request mode cannot be "same-origin"')
+ }
- // 3. Set httpFetchParams’s request to httpRequest.
- httpFetchParams.request = httpRequest
- }
+ // request’s mode is "no-cors"
+ if (request.mode === 'no-cors') {
+ // 1. If request’s redirect mode is not "follow", then return a network
+ // error.
+ if (request.redirect !== 'follow') {
+ return makeNetworkError(
+ 'redirect mode cannot be "follow" for "no-cors" request'
+ )
+ }
- // 3. Let includeCredentials be true if one of
- const includeCredentials =
- request.credentials === 'include' ||
- (request.credentials === 'same-origin' &&
- request.responseTainting === 'basic')
+ // 2. Set request’s response tainting to "opaque".
+ request.responseTainting = 'opaque'
- // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
- // body is non-null; otherwise null.
- const contentLength = httpRequest.body ? httpRequest.body.length : null
+ // 3. Return the result of running scheme fetch given fetchParams.
+ return await schemeFetch(fetchParams)
+ }
- // 5. Let contentLengthHeaderValue be null.
- let contentLengthHeaderValue = null
+ // request’s current URL’s scheme is not an HTTP(S) scheme
+ if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
+ // Return a network error.
+ return makeNetworkError('URL scheme must be a HTTP(S) scheme')
+ }
- // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
- // `PUT`, then set contentLengthHeaderValue to `0`.
- if (
- httpRequest.body == null &&
- ['POST', 'PUT'].includes(httpRequest.method)
- ) {
- contentLengthHeaderValue = '0'
- }
+ // - request’s use-CORS-preflight flag is set
+ // - request’s unsafe-request flag is set and either request’s method is
+ // not a CORS-safelisted method or CORS-unsafe request-header names with
+ // request’s header list is not empty
+ // 1. Set request’s response tainting to "cors".
+ // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
+ // given fetchParams and true.
+ // 3. If corsWithPreflightResponse is a network error, then clear cache
+ // entries using request.
+ // 4. Return corsWithPreflightResponse.
+ // TODO
- // 7. If contentLength is non-null, then set contentLengthHeaderValue to
- // contentLength, serialized and isomorphic encoded.
- if (contentLength != null) {
- contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
- }
+ // Otherwise
+ // 1. Set request’s response tainting to "cors".
+ request.responseTainting = 'cors'
- // 8. If contentLengthHeaderValue is non-null, then append
- // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
- // list.
- if (contentLengthHeaderValue != null) {
- httpRequest.headersList.append('content-length', contentLengthHeaderValue)
+ // 2. Return the result of running HTTP fetch given fetchParams.
+ return await httpFetch(fetchParams)
+ })()
}
- // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
- // contentLengthHeaderValue) to httpRequest’s header list.
-
- // 10. If contentLength is non-null and httpRequest’s keepalive is true,
- // then:
- if (contentLength != null && httpRequest.keepalive) {
- // NOTE: keepalive is a noop outside of browser context.
+ // 12. If recursive is true, then return response.
+ if (recursive) {
+ return response
}
- // 11. If httpRequest’s referrer is a URL, then append
- // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
- // to httpRequest’s header list.
- if (httpRequest.referrer instanceof URL) {
- httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
+ // 13. If response is not a network error and response is not a filtered
+ // response, then:
+ if (response.status !== 0 && !response.internalResponse) {
+ // If request’s response tainting is "cors", then:
+ if (request.responseTainting === 'cors') {
+ // 1. Let headerNames be the result of extracting header list values
+ // given `Access-Control-Expose-Headers` and response’s header list.
+ // TODO
+ // 2. If request’s credentials mode is not "include" and headerNames
+ // contains `*`, then set response’s CORS-exposed header-name list to
+ // all unique header names in response’s header list.
+ // TODO
+ // 3. Otherwise, if headerNames is not null or failure, then set
+ // response’s CORS-exposed header-name list to headerNames.
+ // TODO
+ }
+
+ // Set response to the following filtered response with response as its
+ // internal response, depending on request’s response tainting:
+ if (request.responseTainting === 'basic') {
+ response = filterResponse(response, 'basic')
+ } else if (request.responseTainting === 'cors') {
+ response = filterResponse(response, 'cors')
+ } else if (request.responseTainting === 'opaque') {
+ response = filterResponse(response, 'opaque')
+ } else {
+ assert(false)
+ }
}
- // 12. Append a request `Origin` header for httpRequest.
- appendRequestOriginHeader(httpRequest)
+ // 14. Let internalResponse be response, if response is a network error,
+ // and response’s internal response otherwise.
+ let internalResponse =
+ response.status === 0 ? response : response.internalResponse
- // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
- appendFetchMetadata(httpRequest)
+ // 15. If internalResponse’s URL list is empty, then set it to a clone of
+ // request’s URL list.
+ if (internalResponse.urlList.length === 0) {
+ internalResponse.urlList.push(...request.urlList)
+ }
- // 14. If httpRequest’s header list does not contain `User-Agent`, then
- // user agents should append `User-Agent`/default `User-Agent` value to
- // httpRequest’s header list.
- if (!httpRequest.headersList.contains('user-agent')) {
- httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
+ // 16. If request’s timing allow failed flag is unset, then set
+ // internalResponse’s timing allow passed flag.
+ if (!request.timingAllowFailed) {
+ response.timingAllowPassed = true
}
- // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
- // list contains `If-Modified-Since`, `If-None-Match`,
- // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
- // httpRequest’s cache mode to "no-store".
+ // 17. If response is not a network error and any of the following returns
+ // blocked
+ // - should internalResponse to request be blocked as mixed content
+ // - should internalResponse to request be blocked by Content Security Policy
+ // - should internalResponse to request be blocked due to its MIME type
+ // - should internalResponse to request be blocked due to nosniff
+ // TODO
+
+ // 18. If response’s type is "opaque", internalResponse’s status is 206,
+ // internalResponse’s range-requested flag is set, and request’s header
+ // list does not contain `Range`, then set response and internalResponse
+ // to a network error.
if (
- httpRequest.cache === 'default' &&
- (httpRequest.headersList.contains('if-modified-since') ||
- httpRequest.headersList.contains('if-none-match') ||
- httpRequest.headersList.contains('if-unmodified-since') ||
- httpRequest.headersList.contains('if-match') ||
- httpRequest.headersList.contains('if-range'))
+ response.type === 'opaque' &&
+ internalResponse.status === 206 &&
+ internalResponse.rangeRequested &&
+ !request.headers.contains('range', true)
) {
- httpRequest.cache = 'no-store'
+ response = internalResponse = makeNetworkError()
}
- // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
- // no-cache cache-control header modification flag is unset, and
- // httpRequest’s header list does not contain `Cache-Control`, then append
- // `Cache-Control`/`max-age=0` to httpRequest’s header list.
+ // 19. If response is not a network error and either request’s method is
+ // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
+ // set internalResponse’s body to null and disregard any enqueuing toward
+ // it (if any).
if (
- httpRequest.cache === 'no-cache' &&
- !httpRequest.preventNoCacheCacheControlHeaderModification &&
- !httpRequest.headersList.contains('cache-control')
+ response.status !== 0 &&
+ (request.method === 'HEAD' ||
+ request.method === 'CONNECT' ||
+ nullBodyStatus.includes(internalResponse.status))
) {
- httpRequest.headersList.append('cache-control', 'max-age=0')
- }
-
- // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
- if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
- // 1. If httpRequest’s header list does not contain `Pragma`, then append
- // `Pragma`/`no-cache` to httpRequest’s header list.
- if (!httpRequest.headersList.contains('pragma')) {
- httpRequest.headersList.append('pragma', 'no-cache')
- }
-
- // 2. If httpRequest’s header list does not contain `Cache-Control`,
- // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
- if (!httpRequest.headersList.contains('cache-control')) {
- httpRequest.headersList.append('cache-control', 'no-cache')
- }
+ internalResponse.body = null
+ fetchParams.controller.dump = true
}
- // 18. If httpRequest’s header list contains `Range`, then append
- // `Accept-Encoding`/`identity` to httpRequest’s header list.
- if (httpRequest.headersList.contains('range')) {
- httpRequest.headersList.append('accept-encoding', 'identity')
- }
+ // 20. If request’s integrity metadata is not the empty string, then:
+ if (request.integrity) {
+ // 1. Let processBodyError be this step: run fetch finale given fetchParams
+ // and a network error.
+ const processBodyError = (reason) =>
+ fetchFinale(fetchParams, makeNetworkError(reason))
- // 19. Modify httpRequest’s header list per HTTP. Do not append a given
- // header if httpRequest’s header list contains that header’s name.
- // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
- if (!httpRequest.headersList.contains('accept-encoding')) {
- if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
- httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
- } else {
- httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
+ // 2. If request’s response tainting is "opaque", or response’s body is null,
+ // then run processBodyError and abort these steps.
+ if (request.responseTainting === 'opaque' || response.body == null) {
+ processBodyError(response.error)
+ return
}
- }
- httpRequest.headersList.delete('host')
-
- // 20. If includeCredentials is true, then:
- if (includeCredentials) {
- // 1. If the user agent is not configured to block cookies for httpRequest
- // (see section 7 of [COOKIES]), then:
- // TODO: credentials
- // 2. If httpRequest’s header list does not contain `Authorization`, then:
- // TODO: credentials
- }
+ // 3. Let processBody given bytes be these steps:
+ const processBody = (bytes) => {
+ // 1. If bytes do not match request’s integrity metadata,
+ // then run processBodyError and abort these steps. [SRI]
+ if (!bytesMatch(bytes, request.integrity)) {
+ processBodyError('integrity mismatch')
+ return
+ }
- // 21. If there’s a proxy-authentication entry, use it as appropriate.
- // TODO: proxy-authentication
+ // 2. Set response’s body to bytes as a body.
+ response.body = safelyExtractBody(bytes)[0]
- // 22. Set httpCache to the result of determining the HTTP cache
- // partition, given httpRequest.
- // TODO: cache
+ // 3. Run fetch finale given fetchParams and response.
+ fetchFinale(fetchParams, response)
+ }
- // 23. If httpCache is null, then set httpRequest’s cache mode to
- // "no-store".
- if (httpCache == null) {
- httpRequest.cache = 'no-store'
+ // 4. Fully read response’s body given processBody and processBodyError.
+ await fullyReadBody(response.body, processBody, processBodyError)
+ } else {
+ // 21. Otherwise, run fetch finale given fetchParams and response.
+ fetchFinale(fetchParams, response)
}
+}
- // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
- // then:
- if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
- // TODO: cache
+// https://fetch.spec.whatwg.org/#concept-scheme-fetch
+// given a fetch params fetchParams
+function schemeFetch (fetchParams) {
+ // Note: since the connection is destroyed on redirect, which sets fetchParams to a
+ // cancelled state, we do not want this condition to trigger *unless* there have been
+ // no redirects. See https://github.com/nodejs/undici/issues/1776
+ // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
+ if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
+ return Promise.resolve(makeAppropriateNetworkError(fetchParams))
}
- // 9. If aborted, then return the appropriate network error for fetchParams.
- // TODO
-
- // 10. If response is null, then:
- if (response == null) {
- // 1. If httpRequest’s cache mode is "only-if-cached", then return a
- // network error.
- if (httpRequest.mode === 'only-if-cached') {
- return makeNetworkError('only if cached')
- }
+ // 2. Let request be fetchParams’s request.
+ const { request } = fetchParams
- // 2. Let forwardResponse be the result of running HTTP-network fetch
- // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
- const forwardResponse = await httpNetworkFetch(
- httpFetchParams,
- includeCredentials,
- isNewConnectionFetch
- )
+ const { protocol: scheme } = requestCurrentURL(request)
- // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
- // in the range 200 to 399, inclusive, invalidate appropriate stored
- // responses in httpCache, as per the "Invalidation" chapter of HTTP
- // Caching, and set storedResponse to null. [HTTP-CACHING]
- if (
- !safeMethodsSet.has(httpRequest.method) &&
- forwardResponse.status >= 200 &&
- forwardResponse.status <= 399
- ) {
- // TODO: cache
- }
+ // 3. Switch on request’s current URL’s scheme and run the associated steps:
+ switch (scheme) {
+ case 'about:': {
+ // If request’s current URL’s path is the string "blank", then return a new response
+ // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
+ // and body is the empty byte sequence as a body.
- // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
- // then:
- if (revalidatingFlag && forwardResponse.status === 304) {
- // TODO: cache
+ // Otherwise, return a network error.
+ return Promise.resolve(makeNetworkError('about scheme is not supported'))
}
+ case 'blob:': {
+ if (!resolveObjectURL) {
+ resolveObjectURL = (__nccwpck_require__(4573).resolveObjectURL)
+ }
- // 5. If response is null, then:
- if (response == null) {
- // 1. Set response to forwardResponse.
- response = forwardResponse
-
- // 2. Store httpRequest and forwardResponse in httpCache, as per the
- // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
- // TODO: cache
- }
- }
+ // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
+ const blobURLEntry = requestCurrentURL(request)
- // 11. Set response’s URL list to a clone of httpRequest’s URL list.
- response.urlList = [...httpRequest.urlList]
+ // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
+ // Buffer.resolveObjectURL does not ignore URL queries.
+ if (blobURLEntry.search.length !== 0) {
+ return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
+ }
- // 12. If httpRequest’s header list contains `Range`, then set response’s
- // range-requested flag.
- if (httpRequest.headersList.contains('range')) {
- response.rangeRequested = true
- }
+ const blob = resolveObjectURL(blobURLEntry.toString())
- // 13. Set response’s request-includes-credentials to includeCredentials.
- response.requestIncludesCredentials = includeCredentials
+ // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
+ // object is not a Blob object, then return a network error.
+ if (request.method !== 'GET' || !isBlobLike(blob)) {
+ return Promise.resolve(makeNetworkError('invalid method'))
+ }
- // 14. If response’s status is 401, httpRequest’s response tainting is not
- // "cors", includeCredentials is true, and request’s window is an environment
- // settings object, then:
- // TODO
+ // 3. Let blob be blobURLEntry’s object.
+ // Note: done above
- // 15. If response’s status is 407, then:
- if (response.status === 407) {
- // 1. If request’s window is "no-window", then return a network error.
- if (request.window === 'no-window') {
- return makeNetworkError()
- }
+ // 4. Let response be a new response.
+ const response = makeResponse()
- // 2. ???
+ // 5. Let fullLength be blob’s size.
+ const fullLength = blob.size
- // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
- if (isCancelled(fetchParams)) {
- return makeAppropriateNetworkError(fetchParams)
- }
+ // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.
+ const serializedFullLength = isomorphicEncode(`${fullLength}`)
- // 4. Prompt the end user as appropriate in request’s window and store
- // the result as a proxy-authentication entry. [HTTP-AUTH]
- // TODO: Invoke some kind of callback?
+ // 7. Let type be blob’s type.
+ const type = blob.type
- // 5. Set response to the result of running HTTP-network-or-cache fetch given
- // fetchParams.
- // TODO
- return makeNetworkError('proxy authentication required')
- }
+ // 8. If request’s header list does not contain `Range`:
+ // 9. Otherwise:
+ if (!request.headersList.contains('range', true)) {
+ // 1. Let bodyWithType be the result of safely extracting blob.
+ // Note: in the FileAPI a blob "object" is a Blob *or* a MediaSource.
+ // In node, this can only ever be a Blob. Therefore we can safely
+ // use extractBody directly.
+ const bodyWithType = extractBody(blob)
- // 16. If all of the following are true
- if (
- // response’s status is 421
- response.status === 421 &&
- // isNewConnectionFetch is false
- !isNewConnectionFetch &&
- // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
- (request.body == null || request.body.source != null)
- ) {
- // then:
+ // 2. Set response’s status message to `OK`.
+ response.statusText = 'OK'
- // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
- if (isCancelled(fetchParams)) {
- return makeAppropriateNetworkError(fetchParams)
- }
+ // 3. Set response’s body to bodyWithType’s body.
+ response.body = bodyWithType[0]
- // 2. Set response to the result of running HTTP-network-or-cache
- // fetch given fetchParams, isAuthenticationFetch, and true.
+ // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».
+ response.headersList.set('content-length', serializedFullLength, true)
+ response.headersList.set('content-type', type, true)
+ } else {
+ // 1. Set response’s range-requested flag.
+ response.rangeRequested = true
- // TODO (spec): The spec doesn't specify this but we need to cancel
- // the active response before we can start a new one.
- // https://github.com/whatwg/fetch/issues/1293
- fetchParams.controller.connection.destroy()
+ // 2. Let rangeHeader be the result of getting `Range` from request’s header list.
+ const rangeHeader = request.headersList.get('range', true)
- response = await httpNetworkOrCacheFetch(
- fetchParams,
- isAuthenticationFetch,
- true
- )
- }
+ // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.
+ const rangeValue = simpleRangeHeaderValue(rangeHeader, true)
- // 17. If isAuthenticationFetch is true, then create an authentication entry
- if (isAuthenticationFetch) {
- // TODO
- }
+ // 4. If rangeValue is failure, then return a network error.
+ if (rangeValue === 'failure') {
+ return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
+ }
- // 18. Return response.
- return response
-}
+ // 5. Let (rangeStart, rangeEnd) be rangeValue.
+ let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue
-// https://fetch.spec.whatwg.org/#http-network-fetch
-async function httpNetworkFetch (
- fetchParams,
- includeCredentials = false,
- forceNewConnection = false
-) {
- assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
+ // 6. If rangeStart is null:
+ // 7. Otherwise:
+ if (rangeStart === null) {
+ // 1. Set rangeStart to fullLength − rangeEnd.
+ rangeStart = fullLength - rangeEnd
- fetchParams.controller.connection = {
- abort: null,
- destroyed: false,
- destroy (err) {
- if (!this.destroyed) {
- this.destroyed = true
- this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
- }
- }
- }
+ // 2. Set rangeEnd to rangeStart + rangeEnd − 1.
+ rangeEnd = rangeStart + rangeEnd - 1
+ } else {
+ // 1. If rangeStart is greater than or equal to fullLength, then return a network error.
+ if (rangeStart >= fullLength) {
+ return Promise.resolve(makeNetworkError('Range start is greater than the blob\'s size.'))
+ }
- // 1. Let request be fetchParams’s request.
- const request = fetchParams.request
+ // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set
+ // rangeEnd to fullLength − 1.
+ if (rangeEnd === null || rangeEnd >= fullLength) {
+ rangeEnd = fullLength - 1
+ }
+ }
- // 2. Let response be null.
- let response = null
+ // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,
+ // rangeEnd + 1, and type.
+ const slicedBlob = blob.slice(rangeStart, rangeEnd, type)
- // 3. Let timingInfo be fetchParams’s timing info.
- const timingInfo = fetchParams.timingInfo
+ // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.
+ // Note: same reason as mentioned above as to why we use extractBody
+ const slicedBodyWithType = extractBody(slicedBlob)
- // 4. Let httpCache be the result of determining the HTTP cache partition,
- // given request.
- // TODO: cache
- const httpCache = null
+ // 10. Set response’s body to slicedBodyWithType’s body.
+ response.body = slicedBodyWithType[0]
- // 5. If httpCache is null, then set request’s cache mode to "no-store".
- if (httpCache == null) {
- request.cache = 'no-store'
- }
+ // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.
+ const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)
- // 6. Let networkPartitionKey be the result of determining the network
- // partition key given request.
- // TODO
+ // 12. Let contentRange be the result of invoking build a content range given rangeStart,
+ // rangeEnd, and fullLength.
+ const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)
- // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
- // "no".
- const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
+ // 13. Set response’s status to 206.
+ response.status = 206
- // 8. Switch on request’s mode:
- if (request.mode === 'websocket') {
- // Let connection be the result of obtaining a WebSocket connection,
- // given request’s current URL.
- // TODO
- } else {
- // Let connection be the result of obtaining a connection, given
- // networkPartitionKey, request’s current URL’s origin,
- // includeCredentials, and forceNewConnection.
- // TODO
- }
+ // 14. Set response’s status message to `Partial Content`.
+ response.statusText = 'Partial Content'
- // 9. Run these steps, but abort when the ongoing fetch is terminated:
+ // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),
+ // (`Content-Type`, type), (`Content-Range`, contentRange) ».
+ response.headersList.set('content-length', serializedSlicedLength, true)
+ response.headersList.set('content-type', type, true)
+ response.headersList.set('content-range', contentRange, true)
+ }
- // 1. If connection is failure, then return a network error.
+ // 10. Return response.
+ return Promise.resolve(response)
+ }
+ case 'data:': {
+ // 1. Let dataURLStruct be the result of running the
+ // data: URL processor on request’s current URL.
+ const currentURL = requestCurrentURL(request)
+ const dataURLStruct = dataURLProcessor(currentURL)
- // 2. Set timingInfo’s final connection timing info to the result of
- // calling clamp and coarsen connection timing info with connection’s
- // timing info, timingInfo’s post-redirect start time, and fetchParams’s
- // cross-origin isolated capability.
+ // 2. If dataURLStruct is failure, then return a
+ // network error.
+ if (dataURLStruct === 'failure') {
+ return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
+ }
- // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
- // and request’s body’s source is null, then append (`Transfer-Encoding`,
- // `chunked`) to request’s header list.
+ // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
+ const mimeType = serializeAMimeType(dataURLStruct.mimeType)
- // 4. Set timingInfo’s final network-request start time to the coarsened
- // shared current time given fetchParams’s cross-origin isolated
- // capability.
+ // 4. Return a response whose status message is `OK`,
+ // header list is « (`Content-Type`, mimeType) »,
+ // and body is dataURLStruct’s body as a body.
+ return Promise.resolve(makeResponse({
+ statusText: 'OK',
+ headersList: [
+ ['content-type', { name: 'Content-Type', value: mimeType }]
+ ],
+ body: safelyExtractBody(dataURLStruct.body)[0]
+ }))
+ }
+ case 'file:': {
+ // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
+ // When in doubt, return a network error.
+ return Promise.resolve(makeNetworkError('not implemented... yet...'))
+ }
+ case 'http:':
+ case 'https:': {
+ // Return the result of running HTTP fetch given fetchParams.
- // 5. Set response to the result of making an HTTP request over connection
- // using request with the following caveats:
+ return httpFetch(fetchParams)
+ .catch((err) => makeNetworkError(err))
+ }
+ default: {
+ return Promise.resolve(makeNetworkError('unknown scheme'))
+ }
+ }
+}
- // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
- // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
+// https://fetch.spec.whatwg.org/#finalize-response
+function finalizeResponse (fetchParams, response) {
+ // 1. Set fetchParams’s request’s done flag.
+ fetchParams.request.done = true
- // - If request’s body is non-null, and request’s body’s source is null,
- // then the user agent may have a buffer of up to 64 kibibytes and store
- // a part of request’s body in that buffer. If the user agent reads from
- // request’s body beyond that buffer’s size and the user agent needs to
- // resend request, then instead return a network error.
+ // 2, If fetchParams’s process response done is not null, then queue a fetch
+ // task to run fetchParams’s process response done given response, with
+ // fetchParams’s task destination.
+ if (fetchParams.processResponseDone != null) {
+ queueMicrotask(() => fetchParams.processResponseDone(response))
+ }
+}
- // - Set timingInfo’s final network-response start time to the coarsened
- // shared current time given fetchParams’s cross-origin isolated capability,
- // immediately after the user agent’s HTTP parser receives the first byte
- // of the response (e.g., frame header bytes for HTTP/2 or response status
- // line for HTTP/1.x).
+// https://fetch.spec.whatwg.org/#fetch-finale
+function fetchFinale (fetchParams, response) {
+ // 1. Let timingInfo be fetchParams’s timing info.
+ let timingInfo = fetchParams.timingInfo
- // - Wait until all the headers are transmitted.
+ // 2. If response is not a network error and fetchParams’s request’s client is a secure context,
+ // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting
+ // `Server-Timing` from response’s internal response’s header list.
+ // TODO
- // - Any responses whose status is in the range 100 to 199, inclusive,
- // and is not 101, are to be ignored, except for the purposes of setting
- // timingInfo’s final network-response start time above.
+ // 3. Let processResponseEndOfBody be the following steps:
+ const processResponseEndOfBody = () => {
+ // 1. Let unsafeEndTime be the unsafe shared current time.
+ const unsafeEndTime = Date.now() // ?
- // - If request’s header list contains `Transfer-Encoding`/`chunked` and
- // response is transferred via HTTP/1.0 or older, then return a network
- // error.
+ // 2. If fetchParams’s request’s destination is "document", then set fetchParams’s controller’s
+ // full timing info to fetchParams’s timing info.
+ if (fetchParams.request.destination === 'document') {
+ fetchParams.controller.fullTimingInfo = timingInfo
+ }
- // - If the HTTP request results in a TLS client certificate dialog, then:
+ // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:
+ fetchParams.controller.reportTimingSteps = () => {
+ // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.
+ if (fetchParams.request.url.protocol !== 'https:') {
+ return
+ }
- // 1. If request’s window is an environment settings object, make the
- // dialog available in request’s window.
+ // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.
+ timingInfo.endTime = unsafeEndTime
- // 2. Otherwise, return a network error.
+ // 3. Let cacheState be response’s cache state.
+ let cacheState = response.cacheState
- // To transmit request’s body body, run these steps:
- let requestBody = null
- // 1. If body is null and fetchParams’s process request end-of-body is
- // non-null, then queue a fetch task given fetchParams’s process request
- // end-of-body and fetchParams’s task destination.
- if (request.body == null && fetchParams.processRequestEndOfBody) {
- queueMicrotask(() => fetchParams.processRequestEndOfBody())
- } else if (request.body != null) {
- // 2. Otherwise, if body is non-null:
+ // 4. Let bodyInfo be response’s body info.
+ const bodyInfo = response.bodyInfo
- // 1. Let processBodyChunk given bytes be these steps:
- const processBodyChunk = async function * (bytes) {
- // 1. If the ongoing fetch is terminated, then abort these steps.
- if (isCancelled(fetchParams)) {
- return
+ // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an
+ // opaque timing info for timingInfo and set cacheState to the empty string.
+ if (!response.timingAllowPassed) {
+ timingInfo = createOpaqueTimingInfo(timingInfo)
+
+ cacheState = ''
}
- // 2. Run this step in parallel: transmit bytes.
- yield bytes
+ // 6. Let responseStatus be 0.
+ let responseStatus = 0
- // 3. If fetchParams’s process request body is non-null, then run
- // fetchParams’s process request body given bytes’s length.
- fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
- }
+ // 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false:
+ if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {
+ // 1. Set responseStatus to response’s status.
+ responseStatus = response.status
- // 2. Let processEndOfBody be these steps:
- const processEndOfBody = () => {
- // 1. If fetchParams is canceled, then abort these steps.
- if (isCancelled(fetchParams)) {
- return
+ // 2. Let mimeType be the result of extracting a MIME type from response’s header list.
+ const mimeType = extractMimeType(response.headersList)
+
+ // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.
+ if (mimeType !== 'failure') {
+ bodyInfo.contentType = minimizeSupportedMimeType(mimeType)
+ }
}
- // 2. If fetchParams’s process request end-of-body is non-null,
- // then run fetchParams’s process request end-of-body.
- if (fetchParams.processRequestEndOfBody) {
- fetchParams.processRequestEndOfBody()
+ // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,
+ // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,
+ // and responseStatus.
+ if (fetchParams.request.initiatorType != null) {
+ // TODO: update markresourcetiming
+ markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)
}
}
- // 3. Let processBodyError given e be these steps:
- const processBodyError = (e) => {
- // 1. If fetchParams is canceled, then abort these steps.
- if (isCancelled(fetchParams)) {
- return
+ // 4. Let processResponseEndOfBodyTask be the following steps:
+ const processResponseEndOfBodyTask = () => {
+ // 1. Set fetchParams’s request’s done flag.
+ fetchParams.request.done = true
+
+ // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process
+ // response end-of-body given response.
+ if (fetchParams.processResponseEndOfBody != null) {
+ queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
}
- // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
- if (e.name === 'AbortError') {
- fetchParams.controller.abort()
- } else {
- fetchParams.controller.terminate(e)
+ // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s
+ // global object is fetchParams’s task destination, then run fetchParams’s controller’s report
+ // timing steps given fetchParams’s request’s client’s global object.
+ if (fetchParams.request.initiatorType != null) {
+ fetchParams.controller.reportTimingSteps()
}
}
- // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
- // processBodyError, and fetchParams’s task destination.
- requestBody = (async function * () {
- try {
- for await (const bytes of request.body.stream) {
- yield * processBodyChunk(bytes)
- }
- processEndOfBody()
- } catch (err) {
- processBodyError(err)
- }
- })()
+ // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination
+ queueMicrotask(() => processResponseEndOfBodyTask())
}
- try {
- // socket is only provided for websockets
- const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
+ // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s
+ // process response given response, with fetchParams’s task destination.
+ if (fetchParams.processResponse != null) {
+ queueMicrotask(() => {
+ fetchParams.processResponse(response)
+ fetchParams.processResponse = null
+ })
+ }
- if (socket) {
- response = makeResponse({ status, statusText, headersList, socket })
- } else {
- const iterator = body[Symbol.asyncIterator]()
- fetchParams.controller.next = () => iterator.next()
+ // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.
+ const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)
- response = makeResponse({ status, statusText, headersList })
+ // 6. If internalResponse’s body is null, then run processResponseEndOfBody.
+ // 7. Otherwise:
+ if (internalResponse.body == null) {
+ processResponseEndOfBody()
+ } else {
+ // mcollina: all the following steps of the specs are skipped.
+ // The internal transform stream is not needed.
+ // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541
+
+ // 1. Let transformStream be a new TransformStream.
+ // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.
+ // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm
+ // set to processResponseEndOfBody.
+ // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.
+
+ finished(internalResponse.body.stream, () => {
+ processResponseEndOfBody()
+ })
+ }
+}
+
+// https://fetch.spec.whatwg.org/#http-fetch
+async function httpFetch (fetchParams) {
+ // 1. Let request be fetchParams’s request.
+ const request = fetchParams.request
+
+ // 2. Let response be null.
+ let response = null
+
+ // 3. Let actualResponse be null.
+ let actualResponse = null
+
+ // 4. Let timingInfo be fetchParams’s timing info.
+ const timingInfo = fetchParams.timingInfo
+
+ // 5. If request’s service-workers mode is "all", then:
+ if (request.serviceWorkers === 'all') {
+ // TODO
+ }
+
+ // 6. If response is null, then:
+ if (response === null) {
+ // 1. If makeCORSPreflight is true and one of these conditions is true:
+ // TODO
+
+ // 2. If request’s redirect mode is "follow", then set request’s
+ // service-workers mode to "none".
+ if (request.redirect === 'follow') {
+ request.serviceWorkers = 'none'
}
- } catch (err) {
- // 10. If aborted, then:
- if (err.name === 'AbortError') {
- // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
- fetchParams.controller.connection.destroy()
- // 2. Return the appropriate network error for fetchParams.
- return makeAppropriateNetworkError(fetchParams, err)
+ // 3. Set response and actualResponse to the result of running
+ // HTTP-network-or-cache fetch given fetchParams.
+ actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
+
+ // 4. If request’s response tainting is "cors" and a CORS check
+ // for request and response returns failure, then return a network error.
+ if (
+ request.responseTainting === 'cors' &&
+ corsCheck(request, response) === 'failure'
+ ) {
+ return makeNetworkError('cors failure')
}
- return makeNetworkError(err)
+ // 5. If the TAO check for request and response returns failure, then set
+ // request’s timing allow failed flag.
+ if (TAOCheck(request, response) === 'failure') {
+ request.timingAllowFailed = true
+ }
}
- // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
- // if it is suspended.
- const pullAlgorithm = () => {
- fetchParams.controller.resume()
+ // 7. If either request’s response tainting or response’s type
+ // is "opaque", and the cross-origin resource policy check with
+ // request’s origin, request’s client, request’s destination,
+ // and actualResponse returns blocked, then return a network error.
+ if (
+ (request.responseTainting === 'opaque' || response.type === 'opaque') &&
+ crossOriginResourcePolicyCheck(
+ request.origin,
+ request.client,
+ request.destination,
+ actualResponse
+ ) === 'blocked'
+ ) {
+ return makeNetworkError('blocked')
}
- // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
- // controller with reason, given reason.
- const cancelAlgorithm = (reason) => {
- fetchParams.controller.abort(reason)
+ // 8. If actualResponse’s status is a redirect status, then:
+ if (redirectStatusSet.has(actualResponse.status)) {
+ // 1. If actualResponse’s status is not 303, request’s body is not null,
+ // and the connection uses HTTP/2, then user agents may, and are even
+ // encouraged to, transmit an RST_STREAM frame.
+ // See, https://github.com/whatwg/fetch/issues/1288
+ if (request.redirect !== 'manual') {
+ fetchParams.controller.connection.destroy(undefined, false)
+ }
+
+ // 2. Switch on request’s redirect mode:
+ if (request.redirect === 'error') {
+ // Set response to a network error.
+ response = makeNetworkError('unexpected redirect')
+ } else if (request.redirect === 'manual') {
+ // Set response to an opaque-redirect filtered response whose internal
+ // response is actualResponse.
+ // NOTE(spec): On the web this would return an `opaqueredirect` response,
+ // but that doesn't make sense server side.
+ // See https://github.com/nodejs/undici/issues/1193.
+ response = actualResponse
+ } else if (request.redirect === 'follow') {
+ // Set response to the result of running HTTP-redirect fetch given
+ // fetchParams and response.
+ response = await httpRedirectFetch(fetchParams, response)
+ } else {
+ assert(false)
+ }
}
- // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
- // the user agent.
- // TODO
+ // 9. Set response’s timing info to timingInfo.
+ response.timingInfo = timingInfo
- // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
- // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
- // TODO
+ // 10. Return response.
+ return response
+}
- // 15. Let stream be a new ReadableStream.
- // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
- // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
- // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
+// https://fetch.spec.whatwg.org/#http-redirect-fetch
+function httpRedirectFetch (fetchParams, response) {
+ // 1. Let request be fetchParams’s request.
+ const request = fetchParams.request
- const stream = new ReadableStream(
- {
- async start (controller) {
- fetchParams.controller.controller = controller
- },
- async pull (controller) {
- await pullAlgorithm(controller)
- },
- async cancel (reason) {
- await cancelAlgorithm(reason)
- }
- },
- {
- highWaterMark: 0,
- size () {
- return 1
- }
+ // 2. Let actualResponse be response, if response is not a filtered response,
+ // and response’s internal response otherwise.
+ const actualResponse = response.internalResponse
+ ? response.internalResponse
+ : response
+
+ // 3. Let locationURL be actualResponse’s location URL given request’s current
+ // URL’s fragment.
+ let locationURL
+
+ try {
+ locationURL = responseLocationURL(
+ actualResponse,
+ requestCurrentURL(request).hash
+ )
+
+ // 4. If locationURL is null, then return response.
+ if (locationURL == null) {
+ return response
}
- )
+ } catch (err) {
+ // 5. If locationURL is failure, then return a network error.
+ return Promise.resolve(makeNetworkError(err))
+ }
- // 17. Run these steps, but abort when the ongoing fetch is terminated:
+ // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
+ // error.
+ if (!urlIsHttpHttpsScheme(locationURL)) {
+ return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
+ }
- // 1. Set response’s body to a new body whose stream is stream.
- response.body = { stream }
+ // 7. If request’s redirect count is 20, then return a network error.
+ if (request.redirectCount === 20) {
+ return Promise.resolve(makeNetworkError('redirect count exceeded'))
+ }
- // 2. If response is not a network error and request’s cache mode is
- // not "no-store", then update response in httpCache for request.
- // TODO
+ // 8. Increase request’s redirect count by 1.
+ request.redirectCount += 1
- // 3. If includeCredentials is true and the user agent is not configured
- // to block cookies for request (see section 7 of [COOKIES]), then run the
- // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
- // the value of each header whose name is a byte-case-insensitive match for
- // `Set-Cookie` in response’s header list, if any, and request’s current URL.
- // TODO
+ // 9. If request’s mode is "cors", locationURL includes credentials, and
+ // request’s origin is not same origin with locationURL’s origin, then return
+ // a network error.
+ if (
+ request.mode === 'cors' &&
+ (locationURL.username || locationURL.password) &&
+ !sameOrigin(request, locationURL)
+ ) {
+ return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
+ }
- // 18. If aborted, then:
- // TODO
+ // 10. If request’s response tainting is "cors" and locationURL includes
+ // credentials, then return a network error.
+ if (
+ request.responseTainting === 'cors' &&
+ (locationURL.username || locationURL.password)
+ ) {
+ return Promise.resolve(makeNetworkError(
+ 'URL cannot contain credentials for request mode "cors"'
+ ))
+ }
- // 19. Run these steps in parallel:
+ // 11. If actualResponse’s status is not 303, request’s body is non-null,
+ // and request’s body’s source is null, then return a network error.
+ if (
+ actualResponse.status !== 303 &&
+ request.body != null &&
+ request.body.source == null
+ ) {
+ return Promise.resolve(makeNetworkError())
+ }
- // 1. Run these steps, but abort when fetchParams is canceled:
- fetchParams.controller.on('terminated', onAborted)
- fetchParams.controller.resume = async () => {
- // 1. While true
- while (true) {
- // 1-3. See onData...
+ // 12. If one of the following is true
+ // - actualResponse’s status is 301 or 302 and request’s method is `POST`
+ // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
+ if (
+ ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
+ (actualResponse.status === 303 &&
+ !GET_OR_HEAD.includes(request.method))
+ ) {
+ // then:
+ // 1. Set request’s method to `GET` and request’s body to null.
+ request.method = 'GET'
+ request.body = null
- // 4. Set bytes to the result of handling content codings given
- // codings and bytes.
- let bytes
- let isFailure
- try {
- const { done, value } = await fetchParams.controller.next()
+ // 2. For each headerName of request-body-header name, delete headerName from
+ // request’s header list.
+ for (const headerName of requestBodyHeader) {
+ request.headersList.delete(headerName)
+ }
+ }
- if (isAborted(fetchParams)) {
- break
- }
+ // 13. If request’s current URL’s origin is not same origin with locationURL’s
+ // origin, then for each headerName of CORS non-wildcard request-header name,
+ // delete headerName from request’s header list.
+ if (!sameOrigin(requestCurrentURL(request), locationURL)) {
+ // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
+ request.headersList.delete('authorization', true)
- bytes = done ? undefined : value
- } catch (err) {
- if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
- // zlib doesn't like empty streams.
- bytes = undefined
- } else {
- bytes = err
+ // https://fetch.spec.whatwg.org/#authentication-entries
+ request.headersList.delete('proxy-authorization', true)
- // err may be propagated from the result of calling readablestream.cancel,
- // which might not be an error. https://github.com/nodejs/undici/issues/2009
- isFailure = true
- }
- }
+ // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
+ request.headersList.delete('cookie', true)
+ request.headersList.delete('host', true)
+ }
- if (bytes === undefined) {
- // 2. Otherwise, if the bytes transmission for response’s message
- // body is done normally and stream is readable, then close
- // stream, finalize response for fetchParams and response, and
- // abort these in-parallel steps.
- readableStreamClose(fetchParams.controller.controller)
+ // 14. If request’s body is non-null, then set request’s body to the first return
+ // value of safely extracting request’s body’s source.
+ if (request.body != null) {
+ assert(request.body.source != null)
+ request.body = safelyExtractBody(request.body.source)[0]
+ }
- finalizeResponse(fetchParams, response)
+ // 15. Let timingInfo be fetchParams’s timing info.
+ const timingInfo = fetchParams.timingInfo
- return
- }
+ // 16. Set timingInfo’s redirect end time and post-redirect start time to the
+ // coarsened shared current time given fetchParams’s cross-origin isolated
+ // capability.
+ timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
+ coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
- // 5. Increase timingInfo’s decoded body size by bytes’s length.
- timingInfo.decodedBodySize += bytes?.byteLength ?? 0
+ // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
+ // redirect start time to timingInfo’s start time.
+ if (timingInfo.redirectStartTime === 0) {
+ timingInfo.redirectStartTime = timingInfo.startTime
+ }
- // 6. If bytes is failure, then terminate fetchParams’s controller.
- if (isFailure) {
- fetchParams.controller.terminate(bytes)
- return
- }
+ // 18. Append locationURL to request’s URL list.
+ request.urlList.push(locationURL)
- // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
- // into stream.
- fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
+ // 19. Invoke set request’s referrer policy on redirect on request and
+ // actualResponse.
+ setRequestReferrerPolicyOnRedirect(request, actualResponse)
- // 8. If stream is errored, then terminate the ongoing fetch.
- if (isErrored(stream)) {
- fetchParams.controller.terminate()
- return
- }
+ // 20. Return the result of running main fetch given fetchParams and true.
+ return mainFetch(fetchParams, true)
+}
- // 9. If stream doesn’t need more data ask the user agent to suspend
- // the ongoing fetch.
- if (!fetchParams.controller.controller.desiredSize) {
- return
- }
- }
- }
+// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
+async function httpNetworkOrCacheFetch (
+ fetchParams,
+ isAuthenticationFetch = false,
+ isNewConnectionFetch = false
+) {
+ // 1. Let request be fetchParams’s request.
+ const request = fetchParams.request
- // 2. If aborted, then:
- function onAborted (reason) {
- // 2. If fetchParams is aborted, then:
- if (isAborted(fetchParams)) {
- // 1. Set response’s aborted flag.
- response.aborted = true
+ // 2. Let httpFetchParams be null.
+ let httpFetchParams = null
- // 2. If stream is readable, then error stream with the result of
- // deserialize a serialized abort reason given fetchParams’s
- // controller’s serialized abort reason and an
- // implementation-defined realm.
- if (isReadable(stream)) {
- fetchParams.controller.controller.error(
- fetchParams.controller.serializedAbortReason
- )
- }
- } else {
- // 3. Otherwise, if stream is readable, error stream with a TypeError.
- if (isReadable(stream)) {
- fetchParams.controller.controller.error(new TypeError('terminated', {
- cause: isErrorLike(reason) ? reason : undefined
- }))
- }
- }
+ // 3. Let httpRequest be null.
+ let httpRequest = null
- // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
- // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
- fetchParams.controller.connection.destroy()
- }
+ // 4. Let response be null.
+ let response = null
- // 20. Return response.
- return response
+ // 5. Let storedResponse be null.
+ // TODO: cache
- async function dispatch ({ body }) {
- const url = requestCurrentURL(request)
- /** @type {import('../..').Agent} */
- const agent = fetchParams.controller.dispatcher
+ // 6. Let httpCache be null.
+ const httpCache = null
- return new Promise((resolve, reject) => agent.dispatch(
- {
- path: url.pathname + url.search,
- origin: url.origin,
- method: request.method,
- body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
- headers: request.headersList.entries,
- maxRedirections: 0,
- upgrade: request.mode === 'websocket' ? 'websocket' : undefined
- },
- {
- body: null,
- abort: null,
+ // 7. Let the revalidatingFlag be unset.
+ const revalidatingFlag = false
- onConnect (abort) {
- // TODO (fix): Do we need connection here?
- const { connection } = fetchParams.controller
+ // 8. Run these steps, but abort when the ongoing fetch is terminated:
- if (connection.destroyed) {
- abort(new DOMException('The operation was aborted.', 'AbortError'))
- } else {
- fetchParams.controller.on('terminated', abort)
- this.abort = connection.abort = abort
- }
- },
+ // 1. If request’s window is "no-window" and request’s redirect mode is
+ // "error", then set httpFetchParams to fetchParams and httpRequest to
+ // request.
+ if (request.window === 'no-window' && request.redirect === 'error') {
+ httpFetchParams = fetchParams
+ httpRequest = request
+ } else {
+ // Otherwise:
+
+ // 1. Set httpRequest to a clone of request.
+ httpRequest = cloneRequest(request)
+
+ // 2. Set httpFetchParams to a copy of fetchParams.
+ httpFetchParams = { ...fetchParams }
+
+ // 3. Set httpFetchParams’s request to httpRequest.
+ httpFetchParams.request = httpRequest
+ }
+
+ // 3. Let includeCredentials be true if one of
+ const includeCredentials =
+ request.credentials === 'include' ||
+ (request.credentials === 'same-origin' &&
+ request.responseTainting === 'basic')
- onHeaders (status, headersList, resume, statusText) {
- if (status < 200) {
- return
- }
+ // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
+ // body is non-null; otherwise null.
+ const contentLength = httpRequest.body ? httpRequest.body.length : null
- let codings = []
- let location = ''
+ // 5. Let contentLengthHeaderValue be null.
+ let contentLengthHeaderValue = null
- const headers = new Headers()
-
- // For H2, the headers are a plain JS object
- // We distinguish between them and iterate accordingly
- if (Array.isArray(headersList)) {
- for (let n = 0; n < headersList.length; n += 2) {
- const key = headersList[n + 0].toString('latin1')
- const val = headersList[n + 1].toString('latin1')
- if (key.toLowerCase() === 'content-encoding') {
- // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
- // "All content-coding values are case-insensitive..."
- codings = val.toLowerCase().split(',').map((x) => x.trim())
- } else if (key.toLowerCase() === 'location') {
- location = val
- }
+ // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
+ // `PUT`, then set contentLengthHeaderValue to `0`.
+ if (
+ httpRequest.body == null &&
+ ['POST', 'PUT'].includes(httpRequest.method)
+ ) {
+ contentLengthHeaderValue = '0'
+ }
- headers[kHeadersList].append(key, val)
- }
- } else {
- const keys = Object.keys(headersList)
- for (const key of keys) {
- const val = headersList[key]
- if (key.toLowerCase() === 'content-encoding') {
- // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
- // "All content-coding values are case-insensitive..."
- codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
- } else if (key.toLowerCase() === 'location') {
- location = val
- }
+ // 7. If contentLength is non-null, then set contentLengthHeaderValue to
+ // contentLength, serialized and isomorphic encoded.
+ if (contentLength != null) {
+ contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
+ }
- headers[kHeadersList].append(key, val)
- }
- }
+ // 8. If contentLengthHeaderValue is non-null, then append
+ // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
+ // list.
+ if (contentLengthHeaderValue != null) {
+ httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)
+ }
- this.body = new Readable({ read: resume })
+ // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
+ // contentLengthHeaderValue) to httpRequest’s header list.
- const decoders = []
+ // 10. If contentLength is non-null and httpRequest’s keepalive is true,
+ // then:
+ if (contentLength != null && httpRequest.keepalive) {
+ // NOTE: keepalive is a noop outside of browser context.
+ }
- const willFollow = request.redirect === 'follow' &&
- location &&
- redirectStatusSet.has(status)
+ // 11. If httpRequest’s referrer is a URL, then append
+ // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
+ // to httpRequest’s header list.
+ if (httpRequest.referrer instanceof URL) {
+ httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)
+ }
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
- if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
- for (const coding of codings) {
- // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
- if (coding === 'x-gzip' || coding === 'gzip') {
- decoders.push(zlib.createGunzip({
- // Be less strict when decoding compressed responses, since sometimes
- // servers send slightly invalid responses that are still accepted
- // by common browsers.
- // Always using Z_SYNC_FLUSH is what cURL does.
- flush: zlib.constants.Z_SYNC_FLUSH,
- finishFlush: zlib.constants.Z_SYNC_FLUSH
- }))
- } else if (coding === 'deflate') {
- decoders.push(zlib.createInflate())
- } else if (coding === 'br') {
- decoders.push(zlib.createBrotliDecompress())
- } else {
- decoders.length = 0
- break
- }
- }
- }
+ // 12. Append a request `Origin` header for httpRequest.
+ appendRequestOriginHeader(httpRequest)
- resolve({
- status,
- statusText,
- headersList: headers[kHeadersList],
- body: decoders.length
- ? pipeline(this.body, ...decoders, () => { })
- : this.body.on('error', () => {})
- })
+ // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
+ appendFetchMetadata(httpRequest)
- return true
- },
+ // 14. If httpRequest’s header list does not contain `User-Agent`, then
+ // user agents should append `User-Agent`/default `User-Agent` value to
+ // httpRequest’s header list.
+ if (!httpRequest.headersList.contains('user-agent', true)) {
+ httpRequest.headersList.append('user-agent', defaultUserAgent)
+ }
- onData (chunk) {
- if (fetchParams.controller.dump) {
- return
- }
+ // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
+ // list contains `If-Modified-Since`, `If-None-Match`,
+ // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
+ // httpRequest’s cache mode to "no-store".
+ if (
+ httpRequest.cache === 'default' &&
+ (httpRequest.headersList.contains('if-modified-since', true) ||
+ httpRequest.headersList.contains('if-none-match', true) ||
+ httpRequest.headersList.contains('if-unmodified-since', true) ||
+ httpRequest.headersList.contains('if-match', true) ||
+ httpRequest.headersList.contains('if-range', true))
+ ) {
+ httpRequest.cache = 'no-store'
+ }
- // 1. If one or more bytes have been transmitted from response’s
- // message body, then:
+ // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
+ // no-cache cache-control header modification flag is unset, and
+ // httpRequest’s header list does not contain `Cache-Control`, then append
+ // `Cache-Control`/`max-age=0` to httpRequest’s header list.
+ if (
+ httpRequest.cache === 'no-cache' &&
+ !httpRequest.preventNoCacheCacheControlHeaderModification &&
+ !httpRequest.headersList.contains('cache-control', true)
+ ) {
+ httpRequest.headersList.append('cache-control', 'max-age=0', true)
+ }
- // 1. Let bytes be the transmitted bytes.
- const bytes = chunk
+ // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
+ if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
+ // 1. If httpRequest’s header list does not contain `Pragma`, then append
+ // `Pragma`/`no-cache` to httpRequest’s header list.
+ if (!httpRequest.headersList.contains('pragma', true)) {
+ httpRequest.headersList.append('pragma', 'no-cache', true)
+ }
- // 2. Let codings be the result of extracting header list values
- // given `Content-Encoding` and response’s header list.
- // See pullAlgorithm.
+ // 2. If httpRequest’s header list does not contain `Cache-Control`,
+ // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
+ if (!httpRequest.headersList.contains('cache-control', true)) {
+ httpRequest.headersList.append('cache-control', 'no-cache', true)
+ }
+ }
- // 3. Increase timingInfo’s encoded body size by bytes’s length.
- timingInfo.encodedBodySize += bytes.byteLength
+ // 18. If httpRequest’s header list contains `Range`, then append
+ // `Accept-Encoding`/`identity` to httpRequest’s header list.
+ if (httpRequest.headersList.contains('range', true)) {
+ httpRequest.headersList.append('accept-encoding', 'identity', true)
+ }
- // 4. See pullAlgorithm...
+ // 19. Modify httpRequest’s header list per HTTP. Do not append a given
+ // header if httpRequest’s header list contains that header’s name.
+ // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
+ if (!httpRequest.headersList.contains('accept-encoding', true)) {
+ if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
+ httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)
+ } else {
+ httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)
+ }
+ }
- return this.body.push(bytes)
- },
+ httpRequest.headersList.delete('host', true)
- onComplete () {
- if (this.abort) {
- fetchParams.controller.off('terminated', this.abort)
- }
+ // 20. If includeCredentials is true, then:
+ if (includeCredentials) {
+ // 1. If the user agent is not configured to block cookies for httpRequest
+ // (see section 7 of [COOKIES]), then:
+ // TODO: credentials
+ // 2. If httpRequest’s header list does not contain `Authorization`, then:
+ // TODO: credentials
+ }
- fetchParams.controller.ended = true
+ // 21. If there’s a proxy-authentication entry, use it as appropriate.
+ // TODO: proxy-authentication
- this.body.push(null)
- },
+ // 22. Set httpCache to the result of determining the HTTP cache
+ // partition, given httpRequest.
+ // TODO: cache
- onError (error) {
- if (this.abort) {
- fetchParams.controller.off('terminated', this.abort)
- }
+ // 23. If httpCache is null, then set httpRequest’s cache mode to
+ // "no-store".
+ if (httpCache == null) {
+ httpRequest.cache = 'no-store'
+ }
- this.body?.destroy(error)
+ // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
+ // then:
+ if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {
+ // TODO: cache
+ }
- fetchParams.controller.terminate(error)
+ // 9. If aborted, then return the appropriate network error for fetchParams.
+ // TODO
- reject(error)
- },
+ // 10. If response is null, then:
+ if (response == null) {
+ // 1. If httpRequest’s cache mode is "only-if-cached", then return a
+ // network error.
+ if (httpRequest.cache === 'only-if-cached') {
+ return makeNetworkError('only if cached')
+ }
- onUpgrade (status, headersList, socket) {
- if (status !== 101) {
- return
- }
+ // 2. Let forwardResponse be the result of running HTTP-network fetch
+ // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
+ const forwardResponse = await httpNetworkFetch(
+ httpFetchParams,
+ includeCredentials,
+ isNewConnectionFetch
+ )
+
+ // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
+ // in the range 200 to 399, inclusive, invalidate appropriate stored
+ // responses in httpCache, as per the "Invalidation" chapter of HTTP
+ // Caching, and set storedResponse to null. [HTTP-CACHING]
+ if (
+ !safeMethodsSet.has(httpRequest.method) &&
+ forwardResponse.status >= 200 &&
+ forwardResponse.status <= 399
+ ) {
+ // TODO: cache
+ }
- const headers = new Headers()
+ // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
+ // then:
+ if (revalidatingFlag && forwardResponse.status === 304) {
+ // TODO: cache
+ }
- for (let n = 0; n < headersList.length; n += 2) {
- const key = headersList[n + 0].toString('latin1')
- const val = headersList[n + 1].toString('latin1')
+ // 5. If response is null, then:
+ if (response == null) {
+ // 1. Set response to forwardResponse.
+ response = forwardResponse
- headers[kHeadersList].append(key, val)
- }
+ // 2. Store httpRequest and forwardResponse in httpCache, as per the
+ // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
+ // TODO: cache
+ }
+ }
- resolve({
- status,
- statusText: STATUS_CODES[status],
- headersList: headers[kHeadersList],
- socket
- })
+ // 11. Set response’s URL list to a clone of httpRequest’s URL list.
+ response.urlList = [...httpRequest.urlList]
- return true
- }
- }
- ))
+ // 12. If httpRequest’s header list contains `Range`, then set response’s
+ // range-requested flag.
+ if (httpRequest.headersList.contains('range', true)) {
+ response.rangeRequested = true
}
-}
-module.exports = {
- fetch,
- Fetch,
- fetching,
- finalizeAndReportTiming
-}
+ // 13. Set response’s request-includes-credentials to includeCredentials.
+ response.requestIncludesCredentials = includeCredentials
+ // 14. If response’s status is 401, httpRequest’s response tainting is not
+ // "cors", includeCredentials is true, and request’s window is an environment
+ // settings object, then:
+ // TODO
-/***/ }),
+ // 15. If response’s status is 407, then:
+ if (response.status === 407) {
+ // 1. If request’s window is "no-window", then return a network error.
+ if (request.window === 'no-window') {
+ return makeNetworkError()
+ }
-/***/ 8359:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. ???
-"use strict";
-/* globals AbortController */
+ // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
+ if (isCancelled(fetchParams)) {
+ return makeAppropriateNetworkError(fetchParams)
+ }
+ // 4. Prompt the end user as appropriate in request’s window and store
+ // the result as a proxy-authentication entry. [HTTP-AUTH]
+ // TODO: Invoke some kind of callback?
+ // 5. Set response to the result of running HTTP-network-or-cache fetch given
+ // fetchParams.
+ // TODO
+ return makeNetworkError('proxy authentication required')
+ }
-const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(1472)
-const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
-const { FinalizationRegistry } = __nccwpck_require__(6436)()
-const util = __nccwpck_require__(3983)
-const {
- isValidHTTPToken,
- sameOrigin,
- normalizeMethod,
- makePolicyContainer,
- normalizeMethodRecord
-} = __nccwpck_require__(2538)
-const {
- forbiddenMethodsSet,
- corsSafeListedMethodsSet,
- referrerPolicy,
- requestRedirect,
- requestMode,
- requestCredentials,
- requestCache,
- requestDuplex
-} = __nccwpck_require__(1037)
-const { kEnumerableProperty } = util
-const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { URLSerializer } = __nccwpck_require__(685)
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
+ // 16. If all of the following are true
+ if (
+ // response’s status is 421
+ response.status === 421 &&
+ // isNewConnectionFetch is false
+ !isNewConnectionFetch &&
+ // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
+ (request.body == null || request.body.source != null)
+ ) {
+ // then:
-let TransformStream = globalThis.TransformStream
+ // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
+ if (isCancelled(fetchParams)) {
+ return makeAppropriateNetworkError(fetchParams)
+ }
-const kAbortController = Symbol('abortController')
+ // 2. Set response to the result of running HTTP-network-or-cache
+ // fetch given fetchParams, isAuthenticationFetch, and true.
-const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
- signal.removeEventListener('abort', abort)
-})
+ // TODO (spec): The spec doesn't specify this but we need to cancel
+ // the active response before we can start a new one.
+ // https://github.com/whatwg/fetch/issues/1293
+ fetchParams.controller.connection.destroy()
-// https://fetch.spec.whatwg.org/#request-class
-class Request {
- // https://fetch.spec.whatwg.org/#dom-request
- constructor (input, init = {}) {
- if (input === kConstruct) {
- return
- }
+ response = await httpNetworkOrCacheFetch(
+ fetchParams,
+ isAuthenticationFetch,
+ true
+ )
+ }
+
+ // 17. If isAuthenticationFetch is true, then create an authentication entry
+ if (isAuthenticationFetch) {
+ // TODO
+ }
- webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
+ // 18. Return response.
+ return response
+}
- input = webidl.converters.RequestInfo(input)
- init = webidl.converters.RequestInit(init)
+// https://fetch.spec.whatwg.org/#http-network-fetch
+async function httpNetworkFetch (
+ fetchParams,
+ includeCredentials = false,
+ forceNewConnection = false
+) {
+ assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
- // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
- this[kRealm] = {
- settingsObject: {
- baseUrl: getGlobalOrigin(),
- get origin () {
- return this.baseUrl?.origin
- },
- policyContainer: makePolicyContainer()
+ fetchParams.controller.connection = {
+ abort: null,
+ destroyed: false,
+ destroy (err, abort = true) {
+ if (!this.destroyed) {
+ this.destroyed = true
+ if (abort) {
+ this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
+ }
}
}
+ }
- // 1. Let request be null.
- let request = null
+ // 1. Let request be fetchParams’s request.
+ const request = fetchParams.request
- // 2. Let fallbackMode be null.
- let fallbackMode = null
+ // 2. Let response be null.
+ let response = null
- // 3. Let baseURL be this’s relevant settings object’s API base URL.
- const baseUrl = this[kRealm].settingsObject.baseUrl
+ // 3. Let timingInfo be fetchParams’s timing info.
+ const timingInfo = fetchParams.timingInfo
- // 4. Let signal be null.
- let signal = null
+ // 4. Let httpCache be the result of determining the HTTP cache partition,
+ // given request.
+ // TODO: cache
+ const httpCache = null
- // 5. If input is a string, then:
- if (typeof input === 'string') {
- // 1. Let parsedURL be the result of parsing input with baseURL.
- // 2. If parsedURL is failure, then throw a TypeError.
- let parsedURL
- try {
- parsedURL = new URL(input, baseUrl)
- } catch (err) {
- throw new TypeError('Failed to parse URL from ' + input, { cause: err })
- }
+ // 5. If httpCache is null, then set request’s cache mode to "no-store".
+ if (httpCache == null) {
+ request.cache = 'no-store'
+ }
- // 3. If parsedURL includes credentials, then throw a TypeError.
- if (parsedURL.username || parsedURL.password) {
- throw new TypeError(
- 'Request cannot be constructed from a URL that includes credentials: ' +
- input
- )
- }
+ // 6. Let networkPartitionKey be the result of determining the network
+ // partition key given request.
+ // TODO
- // 4. Set request to a new request whose URL is parsedURL.
- request = makeRequest({ urlList: [parsedURL] })
+ // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
+ // "no".
+ const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
- // 5. Set fallbackMode to "cors".
- fallbackMode = 'cors'
- } else {
- // 6. Otherwise:
+ // 8. Switch on request’s mode:
+ if (request.mode === 'websocket') {
+ // Let connection be the result of obtaining a WebSocket connection,
+ // given request’s current URL.
+ // TODO
+ } else {
+ // Let connection be the result of obtaining a connection, given
+ // networkPartitionKey, request’s current URL’s origin,
+ // includeCredentials, and forceNewConnection.
+ // TODO
+ }
- // 7. Assert: input is a Request object.
- assert(input instanceof Request)
+ // 9. Run these steps, but abort when the ongoing fetch is terminated:
- // 8. Set request to input’s request.
- request = input[kState]
+ // 1. If connection is failure, then return a network error.
- // 9. Set signal to input’s signal.
- signal = input[kSignal]
- }
+ // 2. Set timingInfo’s final connection timing info to the result of
+ // calling clamp and coarsen connection timing info with connection’s
+ // timing info, timingInfo’s post-redirect start time, and fetchParams’s
+ // cross-origin isolated capability.
- // 7. Let origin be this’s relevant settings object’s origin.
- const origin = this[kRealm].settingsObject.origin
+ // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
+ // and request’s body’s source is null, then append (`Transfer-Encoding`,
+ // `chunked`) to request’s header list.
- // 8. Let window be "client".
- let window = 'client'
+ // 4. Set timingInfo’s final network-request start time to the coarsened
+ // shared current time given fetchParams’s cross-origin isolated
+ // capability.
- // 9. If request’s window is an environment settings object and its origin
- // is same origin with origin, then set window to request’s window.
- if (
- request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
- sameOrigin(request.window, origin)
- ) {
- window = request.window
- }
+ // 5. Set response to the result of making an HTTP request over connection
+ // using request with the following caveats:
- // 10. If init["window"] exists and is non-null, then throw a TypeError.
- if (init.window != null) {
- throw new TypeError(`'window' option '${window}' must be null`)
- }
+ // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
+ // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
- // 11. If init["window"] exists, then set window to "no-window".
- if ('window' in init) {
- window = 'no-window'
- }
+ // - If request’s body is non-null, and request’s body’s source is null,
+ // then the user agent may have a buffer of up to 64 kibibytes and store
+ // a part of request’s body in that buffer. If the user agent reads from
+ // request’s body beyond that buffer’s size and the user agent needs to
+ // resend request, then instead return a network error.
- // 12. Set request to a new request with the following properties:
- request = makeRequest({
- // URL request’s URL.
- // undici implementation note: this is set as the first item in request's urlList in makeRequest
- // method request’s method.
- method: request.method,
- // header list A copy of request’s header list.
- // undici implementation note: headersList is cloned in makeRequest
- headersList: request.headersList,
- // unsafe-request flag Set.
- unsafeRequest: request.unsafeRequest,
- // client This’s relevant settings object.
- client: this[kRealm].settingsObject,
- // window window.
- window,
- // priority request’s priority.
- priority: request.priority,
- // origin request’s origin. The propagation of the origin is only significant for navigation requests
- // being handled by a service worker. In this scenario a request can have an origin that is different
- // from the current client.
- origin: request.origin,
- // referrer request’s referrer.
- referrer: request.referrer,
- // referrer policy request’s referrer policy.
- referrerPolicy: request.referrerPolicy,
- // mode request’s mode.
- mode: request.mode,
- // credentials mode request’s credentials mode.
- credentials: request.credentials,
- // cache mode request’s cache mode.
- cache: request.cache,
- // redirect mode request’s redirect mode.
- redirect: request.redirect,
- // integrity metadata request’s integrity metadata.
- integrity: request.integrity,
- // keepalive request’s keepalive.
- keepalive: request.keepalive,
- // reload-navigation flag request’s reload-navigation flag.
- reloadNavigation: request.reloadNavigation,
- // history-navigation flag request’s history-navigation flag.
- historyNavigation: request.historyNavigation,
- // URL list A clone of request’s URL list.
- urlList: [...request.urlList]
- })
+ // - Set timingInfo’s final network-response start time to the coarsened
+ // shared current time given fetchParams’s cross-origin isolated capability,
+ // immediately after the user agent’s HTTP parser receives the first byte
+ // of the response (e.g., frame header bytes for HTTP/2 or response status
+ // line for HTTP/1.x).
- const initHasKey = Object.keys(init).length !== 0
+ // - Wait until all the headers are transmitted.
- // 13. If init is not empty, then:
- if (initHasKey) {
- // 1. If request’s mode is "navigate", then set it to "same-origin".
- if (request.mode === 'navigate') {
- request.mode = 'same-origin'
- }
+ // - Any responses whose status is in the range 100 to 199, inclusive,
+ // and is not 101, are to be ignored, except for the purposes of setting
+ // timingInfo’s final network-response start time above.
+
+ // - If request’s header list contains `Transfer-Encoding`/`chunked` and
+ // response is transferred via HTTP/1.0 or older, then return a network
+ // error.
- // 2. Unset request’s reload-navigation flag.
- request.reloadNavigation = false
+ // - If the HTTP request results in a TLS client certificate dialog, then:
- // 3. Unset request’s history-navigation flag.
- request.historyNavigation = false
+ // 1. If request’s window is an environment settings object, make the
+ // dialog available in request’s window.
- // 4. Set request’s origin to "client".
- request.origin = 'client'
+ // 2. Otherwise, return a network error.
- // 5. Set request’s referrer to "client"
- request.referrer = 'client'
+ // To transmit request’s body body, run these steps:
+ let requestBody = null
+ // 1. If body is null and fetchParams’s process request end-of-body is
+ // non-null, then queue a fetch task given fetchParams’s process request
+ // end-of-body and fetchParams’s task destination.
+ if (request.body == null && fetchParams.processRequestEndOfBody) {
+ queueMicrotask(() => fetchParams.processRequestEndOfBody())
+ } else if (request.body != null) {
+ // 2. Otherwise, if body is non-null:
- // 6. Set request’s referrer policy to the empty string.
- request.referrerPolicy = ''
+ // 1. Let processBodyChunk given bytes be these steps:
+ const processBodyChunk = async function * (bytes) {
+ // 1. If the ongoing fetch is terminated, then abort these steps.
+ if (isCancelled(fetchParams)) {
+ return
+ }
- // 7. Set request’s URL to request’s current URL.
- request.url = request.urlList[request.urlList.length - 1]
+ // 2. Run this step in parallel: transmit bytes.
+ yield bytes
- // 8. Set request’s URL list to « request’s URL ».
- request.urlList = [request.url]
+ // 3. If fetchParams’s process request body is non-null, then run
+ // fetchParams’s process request body given bytes’s length.
+ fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
}
- // 14. If init["referrer"] exists, then:
- if (init.referrer !== undefined) {
- // 1. Let referrer be init["referrer"].
- const referrer = init.referrer
+ // 2. Let processEndOfBody be these steps:
+ const processEndOfBody = () => {
+ // 1. If fetchParams is canceled, then abort these steps.
+ if (isCancelled(fetchParams)) {
+ return
+ }
- // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
- if (referrer === '') {
- request.referrer = 'no-referrer'
+ // 2. If fetchParams’s process request end-of-body is non-null,
+ // then run fetchParams’s process request end-of-body.
+ if (fetchParams.processRequestEndOfBody) {
+ fetchParams.processRequestEndOfBody()
+ }
+ }
+
+ // 3. Let processBodyError given e be these steps:
+ const processBodyError = (e) => {
+ // 1. If fetchParams is canceled, then abort these steps.
+ if (isCancelled(fetchParams)) {
+ return
+ }
+
+ // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
+ if (e.name === 'AbortError') {
+ fetchParams.controller.abort()
} else {
- // 1. Let parsedReferrer be the result of parsing referrer with
- // baseURL.
- // 2. If parsedReferrer is failure, then throw a TypeError.
- let parsedReferrer
- try {
- parsedReferrer = new URL(referrer, baseUrl)
- } catch (err) {
- throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
- }
+ fetchParams.controller.terminate(e)
+ }
+ }
- // 3. If one of the following is true
- // - parsedReferrer’s scheme is "about" and path is the string "client"
- // - parsedReferrer’s origin is not same origin with origin
- // then set request’s referrer to "client".
- if (
- (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
- (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
- ) {
- request.referrer = 'client'
- } else {
- // 4. Otherwise, set request’s referrer to parsedReferrer.
- request.referrer = parsedReferrer
+ // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
+ // processBodyError, and fetchParams’s task destination.
+ requestBody = (async function * () {
+ try {
+ for await (const bytes of request.body.stream) {
+ yield * processBodyChunk(bytes)
}
+ processEndOfBody()
+ } catch (err) {
+ processBodyError(err)
}
- }
+ })()
+ }
- // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
- // to it.
- if (init.referrerPolicy !== undefined) {
- request.referrerPolicy = init.referrerPolicy
- }
+ try {
+ // socket is only provided for websockets
+ const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
- // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
- let mode
- if (init.mode !== undefined) {
- mode = init.mode
+ if (socket) {
+ response = makeResponse({ status, statusText, headersList, socket })
} else {
- mode = fallbackMode
- }
+ const iterator = body[Symbol.asyncIterator]()
+ fetchParams.controller.next = () => iterator.next()
- // 17. If mode is "navigate", then throw a TypeError.
- if (mode === 'navigate') {
- throw webidl.errors.exception({
- header: 'Request constructor',
- message: 'invalid request mode navigate.'
- })
+ response = makeResponse({ status, statusText, headersList })
}
+ } catch (err) {
+ // 10. If aborted, then:
+ if (err.name === 'AbortError') {
+ // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
+ fetchParams.controller.connection.destroy()
- // 18. If mode is non-null, set request’s mode to mode.
- if (mode != null) {
- request.mode = mode
+ // 2. Return the appropriate network error for fetchParams.
+ return makeAppropriateNetworkError(fetchParams, err)
}
- // 19. If init["credentials"] exists, then set request’s credentials mode
- // to it.
- if (init.credentials !== undefined) {
- request.credentials = init.credentials
- }
+ return makeNetworkError(err)
+ }
- // 18. If init["cache"] exists, then set request’s cache mode to it.
- if (init.cache !== undefined) {
- request.cache = init.cache
- }
+ // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
+ // if it is suspended.
+ const pullAlgorithm = async () => {
+ await fetchParams.controller.resume()
+ }
- // 21. If request’s cache mode is "only-if-cached" and request’s mode is
- // not "same-origin", then throw a TypeError.
- if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
- throw new TypeError(
- "'only-if-cached' can be set only with 'same-origin' mode"
- )
+ // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
+ // controller with reason, given reason.
+ const cancelAlgorithm = (reason) => {
+ // If the aborted fetch was already terminated, then we do not
+ // need to do anything.
+ if (!isCancelled(fetchParams)) {
+ fetchParams.controller.abort(reason)
}
+ }
- // 22. If init["redirect"] exists, then set request’s redirect mode to it.
- if (init.redirect !== undefined) {
- request.redirect = init.redirect
- }
+ // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
+ // the user agent.
+ // TODO
- // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
- if (init.integrity != null) {
- request.integrity = String(init.integrity)
- }
+ // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
+ // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
+ // TODO
- // 24. If init["keepalive"] exists, then set request’s keepalive to it.
- if (init.keepalive !== undefined) {
- request.keepalive = Boolean(init.keepalive)
+ // 15. Let stream be a new ReadableStream.
+ // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,
+ // cancelAlgorithm set to cancelAlgorithm.
+ const stream = new ReadableStream(
+ {
+ async start (controller) {
+ fetchParams.controller.controller = controller
+ },
+ async pull (controller) {
+ await pullAlgorithm(controller)
+ },
+ async cancel (reason) {
+ await cancelAlgorithm(reason)
+ },
+ type: 'bytes'
}
+ )
- // 25. If init["method"] exists, then:
- if (init.method !== undefined) {
- // 1. Let method be init["method"].
- let method = init.method
+ // 17. Run these steps, but abort when the ongoing fetch is terminated:
- // 2. If method is not a method or method is a forbidden method, then
- // throw a TypeError.
- if (!isValidHTTPToken(method)) {
- throw new TypeError(`'${method}' is not a valid HTTP method.`)
- }
+ // 1. Set response’s body to a new body whose stream is stream.
+ response.body = { stream, source: null, length: null }
- if (forbiddenMethodsSet.has(method.toUpperCase())) {
- throw new TypeError(`'${method}' HTTP method is unsupported.`)
- }
+ // 2. If response is not a network error and request’s cache mode is
+ // not "no-store", then update response in httpCache for request.
+ // TODO
- // 3. Normalize method.
- method = normalizeMethodRecord[method] ?? normalizeMethod(method)
+ // 3. If includeCredentials is true and the user agent is not configured
+ // to block cookies for request (see section 7 of [COOKIES]), then run the
+ // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
+ // the value of each header whose name is a byte-case-insensitive match for
+ // `Set-Cookie` in response’s header list, if any, and request’s current URL.
+ // TODO
- // 4. Set request’s method to method.
- request.method = method
- }
+ // 18. If aborted, then:
+ // TODO
- // 26. If init["signal"] exists, then set signal to it.
- if (init.signal !== undefined) {
- signal = init.signal
- }
+ // 19. Run these steps in parallel:
- // 27. Set this’s request to request.
- this[kState] = request
+ // 1. Run these steps, but abort when fetchParams is canceled:
+ fetchParams.controller.onAborted = onAborted
+ fetchParams.controller.on('terminated', onAborted)
+ fetchParams.controller.resume = async () => {
+ // 1. While true
+ while (true) {
+ // 1-3. See onData...
- // 28. Set this’s signal to a new AbortSignal object with this’s relevant
- // Realm.
- // TODO: could this be simplified with AbortSignal.any
- // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
- const ac = new AbortController()
- this[kSignal] = ac.signal
- this[kSignal][kRealm] = this[kRealm]
+ // 4. Set bytes to the result of handling content codings given
+ // codings and bytes.
+ let bytes
+ let isFailure
+ try {
+ const { done, value } = await fetchParams.controller.next()
- // 29. If signal is not null, then make this’s signal follow signal.
- if (signal != null) {
- if (
- !signal ||
- typeof signal.aborted !== 'boolean' ||
- typeof signal.addEventListener !== 'function'
- ) {
- throw new TypeError(
- "Failed to construct 'Request': member signal is not of type AbortSignal."
- )
- }
+ if (isAborted(fetchParams)) {
+ break
+ }
- if (signal.aborted) {
- ac.abort(signal.reason)
- } else {
- // Keep a strong ref to ac while request object
- // is alive. This is needed to prevent AbortController
- // from being prematurely garbage collected.
- // See, https://github.com/nodejs/undici/issues/1926.
- this[kAbortController] = ac
+ bytes = done ? undefined : value
+ } catch (err) {
+ if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
+ // zlib doesn't like empty streams.
+ bytes = undefined
+ } else {
+ bytes = err
- const acRef = new WeakRef(ac)
- const abort = function () {
- const ac = acRef.deref()
- if (ac !== undefined) {
- ac.abort(this.reason)
- }
+ // err may be propagated from the result of calling readablestream.cancel,
+ // which might not be an error. https://github.com/nodejs/undici/issues/2009
+ isFailure = true
}
+ }
- // Third-party AbortControllers may not work with these.
- // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
- try {
- // If the max amount of listeners is equal to the default, increase it
- // This is only available in node >= v19.9.0
- if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
- setMaxListeners(100, signal)
- } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
- setMaxListeners(100, signal)
- }
- } catch {}
+ if (bytes === undefined) {
+ // 2. Otherwise, if the bytes transmission for response’s message
+ // body is done normally and stream is readable, then close
+ // stream, finalize response for fetchParams and response, and
+ // abort these in-parallel steps.
+ readableStreamClose(fetchParams.controller.controller)
- util.addAbortListener(signal, abort)
- requestFinalizer.register(ac, { signal, abort })
+ finalizeResponse(fetchParams, response)
+
+ return
}
- }
- // 30. Set this’s headers to a new Headers object with this’s relevant
- // Realm, whose header list is request’s header list and guard is
- // "request".
- this[kHeaders] = new Headers(kConstruct)
- this[kHeaders][kHeadersList] = request.headersList
- this[kHeaders][kGuard] = 'request'
- this[kHeaders][kRealm] = this[kRealm]
+ // 5. Increase timingInfo’s decoded body size by bytes’s length.
+ timingInfo.decodedBodySize += bytes?.byteLength ?? 0
- // 31. If this’s request’s mode is "no-cors", then:
- if (mode === 'no-cors') {
- // 1. If this’s request’s method is not a CORS-safelisted method,
- // then throw a TypeError.
- if (!corsSafeListedMethodsSet.has(request.method)) {
- throw new TypeError(
- `'${request.method} is unsupported in no-cors mode.`
- )
+ // 6. If bytes is failure, then terminate fetchParams’s controller.
+ if (isFailure) {
+ fetchParams.controller.terminate(bytes)
+ return
}
- // 2. Set this’s headers’s guard to "request-no-cors".
- this[kHeaders][kGuard] = 'request-no-cors'
- }
-
- // 32. If init is not empty, then:
- if (initHasKey) {
- /** @type {HeadersList} */
- const headersList = this[kHeaders][kHeadersList]
- // 1. Let headers be a copy of this’s headers and its associated header
- // list.
- // 2. If init["headers"] exists, then set headers to init["headers"].
- const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
+ // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
+ // into stream.
+ const buffer = new Uint8Array(bytes)
+ if (buffer.byteLength) {
+ fetchParams.controller.controller.enqueue(buffer)
+ }
- // 3. Empty this’s headers’s header list.
- headersList.clear()
+ // 8. If stream is errored, then terminate the ongoing fetch.
+ if (isErrored(stream)) {
+ fetchParams.controller.terminate()
+ return
+ }
- // 4. If headers is a Headers object, then for each header in its header
- // list, append header’s name/header’s value to this’s headers.
- if (headers instanceof HeadersList) {
- for (const [key, val] of headers) {
- headersList.append(key, val)
- }
- // Note: Copy the `set-cookie` meta-data.
- headersList.cookies = headers.cookies
- } else {
- // 5. Otherwise, fill this’s headers with headers.
- fillHeaders(this[kHeaders], headers)
+ // 9. If stream doesn’t need more data ask the user agent to suspend
+ // the ongoing fetch.
+ if (fetchParams.controller.controller.desiredSize <= 0) {
+ return
}
}
+ }
- // 33. Let inputBody be input’s request’s body if input is a Request
- // object; otherwise null.
- const inputBody = input instanceof Request ? input[kState].body : null
+ // 2. If aborted, then:
+ function onAborted (reason) {
+ // 2. If fetchParams is aborted, then:
+ if (isAborted(fetchParams)) {
+ // 1. Set response’s aborted flag.
+ response.aborted = true
- // 34. If either init["body"] exists and is non-null or inputBody is
- // non-null, and request’s method is `GET` or `HEAD`, then throw a
- // TypeError.
- if (
- (init.body != null || inputBody != null) &&
- (request.method === 'GET' || request.method === 'HEAD')
- ) {
- throw new TypeError('Request with GET/HEAD method cannot have body.')
+ // 2. If stream is readable, then error stream with the result of
+ // deserialize a serialized abort reason given fetchParams’s
+ // controller’s serialized abort reason and an
+ // implementation-defined realm.
+ if (isReadable(stream)) {
+ fetchParams.controller.controller.error(
+ fetchParams.controller.serializedAbortReason
+ )
+ }
+ } else {
+ // 3. Otherwise, if stream is readable, error stream with a TypeError.
+ if (isReadable(stream)) {
+ fetchParams.controller.controller.error(new TypeError('terminated', {
+ cause: isErrorLike(reason) ? reason : undefined
+ }))
+ }
}
- // 35. Let initBody be null.
- let initBody = null
+ // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
+ // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
+ fetchParams.controller.connection.destroy()
+ }
- // 36. If init["body"] exists and is non-null, then:
- if (init.body != null) {
- // 1. Let Content-Type be null.
- // 2. Set initBody and Content-Type to the result of extracting
- // init["body"], with keepalive set to request’s keepalive.
- const [extractedBody, contentType] = extractBody(
- init.body,
- request.keepalive
- )
- initBody = extractedBody
+ // 20. Return response.
+ return response
- // 3, If Content-Type is non-null and this’s headers’s header list does
- // not contain `Content-Type`, then append `Content-Type`/Content-Type to
- // this’s headers.
- if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
- this[kHeaders].append('content-type', contentType)
- }
- }
+ function dispatch ({ body }) {
+ const url = requestCurrentURL(request)
+ /** @type {import('../..').Agent} */
+ const agent = fetchParams.controller.dispatcher
- // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
- // inputBody.
- const inputOrInitBody = initBody ?? inputBody
+ return new Promise((resolve, reject) => agent.dispatch(
+ {
+ path: url.pathname + url.search,
+ origin: url.origin,
+ method: request.method,
+ body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
+ headers: request.headersList.entries,
+ maxRedirections: 0,
+ upgrade: request.mode === 'websocket' ? 'websocket' : undefined
+ },
+ {
+ body: null,
+ abort: null,
- // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
- // null, then:
- if (inputOrInitBody != null && inputOrInitBody.source == null) {
- // 1. If initBody is non-null and init["duplex"] does not exist,
- // then throw a TypeError.
- if (initBody != null && init.duplex == null) {
- throw new TypeError('RequestInit: duplex option is required when sending a body.')
- }
+ onConnect (abort) {
+ // TODO (fix): Do we need connection here?
+ const { connection } = fetchParams.controller
- // 2. If this’s request’s mode is neither "same-origin" nor "cors",
- // then throw a TypeError.
- if (request.mode !== 'same-origin' && request.mode !== 'cors') {
- throw new TypeError(
- 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
- )
- }
+ // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
+ // connection timing info with connection’s timing info, timingInfo’s post-redirect start
+ // time, and fetchParams’s cross-origin isolated capability.
+ // TODO: implement connection timing
+ timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
- // 3. Set this’s request’s use-CORS-preflight flag.
- request.useCORSPreflightFlag = true
- }
+ if (connection.destroyed) {
+ abort(new DOMException('The operation was aborted.', 'AbortError'))
+ } else {
+ fetchParams.controller.on('terminated', abort)
+ this.abort = connection.abort = abort
+ }
- // 39. Let finalBody be inputOrInitBody.
- let finalBody = inputOrInitBody
+ // Set timingInfo’s final network-request start time to the coarsened shared current time given
+ // fetchParams’s cross-origin isolated capability.
+ timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
+ },
- // 40. If initBody is null and inputBody is non-null, then:
- if (initBody == null && inputBody != null) {
- // 1. If input is unusable, then throw a TypeError.
- if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
- throw new TypeError(
- 'Cannot construct a Request with a Request object that has already been used.'
- )
- }
+ onResponseStarted () {
+ // Set timingInfo’s final network-response start time to the coarsened shared current
+ // time given fetchParams’s cross-origin isolated capability, immediately after the
+ // user agent’s HTTP parser receives the first byte of the response (e.g., frame header
+ // bytes for HTTP/2 or response status line for HTTP/1.x).
+ timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
+ },
- // 2. Set finalBody to the result of creating a proxy for inputBody.
- if (!TransformStream) {
- TransformStream = (__nccwpck_require__(5356).TransformStream)
- }
+ onHeaders (status, rawHeaders, resume, statusText) {
+ if (status < 200) {
+ return
+ }
- // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
- const identityTransform = new TransformStream()
- inputBody.stream.pipeThrough(identityTransform)
- finalBody = {
- source: inputBody.source,
- length: inputBody.length,
- stream: identityTransform.readable
- }
- }
+ let location = ''
- // 41. Set this’s request’s body to finalBody.
- this[kState].body = finalBody
- }
+ const headersList = new HeadersList()
- // Returns request’s HTTP method, which is "GET" by default.
- get method () {
- webidl.brandCheck(this, Request)
+ for (let i = 0; i < rawHeaders.length; i += 2) {
+ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
+ }
+ location = headersList.get('location', true)
- // The method getter steps are to return this’s request’s method.
- return this[kState].method
- }
+ this.body = new Readable({ read: resume })
+
+ const decoders = []
+
+ const willFollow = location && request.redirect === 'follow' &&
+ redirectStatusSet.has(status)
+
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
+ if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
+ // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
+ const contentEncoding = headersList.get('content-encoding', true)
+ // "All content-coding values are case-insensitive..."
+ /** @type {string[]} */
+ const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
+
+ // Limit the number of content-encodings to prevent resource exhaustion.
+ // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
+ const maxContentEncodings = 5
+ if (codings.length > maxContentEncodings) {
+ reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
+ return true
+ }
+
+ for (let i = codings.length - 1; i >= 0; --i) {
+ const coding = codings[i].trim()
+ // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
+ if (coding === 'x-gzip' || coding === 'gzip') {
+ decoders.push(zlib.createGunzip({
+ // Be less strict when decoding compressed responses, since sometimes
+ // servers send slightly invalid responses that are still accepted
+ // by common browsers.
+ // Always using Z_SYNC_FLUSH is what cURL does.
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+ }))
+ } else if (coding === 'deflate') {
+ decoders.push(createInflate({
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+ }))
+ } else if (coding === 'br') {
+ decoders.push(zlib.createBrotliDecompress({
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+ }))
+ } else {
+ decoders.length = 0
+ break
+ }
+ }
+ }
- // Returns the URL of request as a string.
- get url () {
- webidl.brandCheck(this, Request)
+ const onError = this.onError.bind(this)
- // The url getter steps are to return this’s request’s URL, serialized.
- return URLSerializer(this[kState].url)
- }
+ resolve({
+ status,
+ statusText,
+ headersList,
+ body: decoders.length
+ ? pipeline(this.body, ...decoders, (err) => {
+ if (err) {
+ this.onError(err)
+ }
+ }).on('error', onError)
+ : this.body.on('error', onError)
+ })
- // Returns a Headers object consisting of the headers associated with request.
- // Note that headers added in the network layer by the user agent will not
- // be accounted for in this object, e.g., the "Host" header.
- get headers () {
- webidl.brandCheck(this, Request)
+ return true
+ },
- // The headers getter steps are to return this’s headers.
- return this[kHeaders]
- }
+ onData (chunk) {
+ if (fetchParams.controller.dump) {
+ return
+ }
- // Returns the kind of resource requested by request, e.g., "document"
- // or "script".
- get destination () {
- webidl.brandCheck(this, Request)
+ // 1. If one or more bytes have been transmitted from response’s
+ // message body, then:
- // The destination getter are to return this’s request’s destination.
- return this[kState].destination
- }
+ // 1. Let bytes be the transmitted bytes.
+ const bytes = chunk
- // Returns the referrer of request. Its value can be a same-origin URL if
- // explicitly set in init, the empty string to indicate no referrer, and
- // "about:client" when defaulting to the global’s default. This is used
- // during fetching to determine the value of the `Referer` header of the
- // request being made.
- get referrer () {
- webidl.brandCheck(this, Request)
+ // 2. Let codings be the result of extracting header list values
+ // given `Content-Encoding` and response’s header list.
+ // See pullAlgorithm.
- // 1. If this’s request’s referrer is "no-referrer", then return the
- // empty string.
- if (this[kState].referrer === 'no-referrer') {
- return ''
- }
+ // 3. Increase timingInfo’s encoded body size by bytes’s length.
+ timingInfo.encodedBodySize += bytes.byteLength
- // 2. If this’s request’s referrer is "client", then return
- // "about:client".
- if (this[kState].referrer === 'client') {
- return 'about:client'
- }
+ // 4. See pullAlgorithm...
- // Return this’s request’s referrer, serialized.
- return this[kState].referrer.toString()
- }
+ return this.body.push(bytes)
+ },
- // Returns the referrer policy associated with request.
- // This is used during fetching to compute the value of the request’s
- // referrer.
- get referrerPolicy () {
- webidl.brandCheck(this, Request)
+ onComplete () {
+ if (this.abort) {
+ fetchParams.controller.off('terminated', this.abort)
+ }
- // The referrerPolicy getter steps are to return this’s request’s referrer policy.
- return this[kState].referrerPolicy
- }
+ if (fetchParams.controller.onAborted) {
+ fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
+ }
- // Returns the mode associated with request, which is a string indicating
- // whether the request will use CORS, or will be restricted to same-origin
- // URLs.
- get mode () {
- webidl.brandCheck(this, Request)
+ fetchParams.controller.ended = true
- // The mode getter steps are to return this’s request’s mode.
- return this[kState].mode
- }
+ this.body.push(null)
+ },
- // Returns the credentials mode associated with request,
- // which is a string indicating whether credentials will be sent with the
- // request always, never, or only when sent to a same-origin URL.
- get credentials () {
- // The credentials getter steps are to return this’s request’s credentials mode.
- return this[kState].credentials
- }
+ onError (error) {
+ if (this.abort) {
+ fetchParams.controller.off('terminated', this.abort)
+ }
- // Returns the cache mode associated with request,
- // which is a string indicating how the request will
- // interact with the browser’s cache when fetching.
- get cache () {
- webidl.brandCheck(this, Request)
+ this.body?.destroy(error)
- // The cache getter steps are to return this’s request’s cache mode.
- return this[kState].cache
- }
+ fetchParams.controller.terminate(error)
- // Returns the redirect mode associated with request,
- // which is a string indicating how redirects for the
- // request will be handled during fetching. A request
- // will follow redirects by default.
- get redirect () {
- webidl.brandCheck(this, Request)
+ reject(error)
+ },
- // The redirect getter steps are to return this’s request’s redirect mode.
- return this[kState].redirect
- }
+ onUpgrade (status, rawHeaders, socket) {
+ if (status !== 101) {
+ return
+ }
- // Returns request’s subresource integrity metadata, which is a
- // cryptographic hash of the resource being fetched. Its value
- // consists of multiple hashes separated by whitespace. [SRI]
- get integrity () {
- webidl.brandCheck(this, Request)
+ const headersList = new HeadersList()
- // The integrity getter steps are to return this’s request’s integrity
- // metadata.
- return this[kState].integrity
- }
+ for (let i = 0; i < rawHeaders.length; i += 2) {
+ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
+ }
- // Returns a boolean indicating whether or not request can outlive the
- // global in which it was created.
- get keepalive () {
- webidl.brandCheck(this, Request)
+ resolve({
+ status,
+ statusText: STATUS_CODES[status],
+ headersList,
+ socket
+ })
- // The keepalive getter steps are to return this’s request’s keepalive.
- return this[kState].keepalive
+ return true
+ }
+ }
+ ))
}
+}
- // Returns a boolean indicating whether or not request is for a reload
- // navigation.
- get isReloadNavigation () {
- webidl.brandCheck(this, Request)
+module.exports = {
+ fetch,
+ Fetch,
+ fetching,
+ finalizeAndReportTiming
+}
- // The isReloadNavigation getter steps are to return true if this’s
- // request’s reload-navigation flag is set; otherwise false.
- return this[kState].reloadNavigation
- }
- // Returns a boolean indicating whether or not request is for a history
- // navigation (a.k.a. back-foward navigation).
- get isHistoryNavigation () {
- webidl.brandCheck(this, Request)
+/***/ }),
- // The isHistoryNavigation getter steps are to return true if this’s request’s
- // history-navigation flag is set; otherwise false.
- return this[kState].historyNavigation
- }
+/***/ 9967:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // Returns the signal associated with request, which is an AbortSignal
- // object indicating whether or not request has been aborted, and its
- // abort event handler.
- get signal () {
- webidl.brandCheck(this, Request)
+/* globals AbortController */
- // The signal getter steps are to return this’s signal.
- return this[kSignal]
- }
- get body () {
- webidl.brandCheck(this, Request)
- return this[kState].body ? this[kState].body.stream : null
- }
+const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(4492)
+const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(660)
+const { FinalizationRegistry } = __nccwpck_require__(6653)()
+const util = __nccwpck_require__(3440)
+const nodeUtil = __nccwpck_require__(7975)
+const {
+ isValidHTTPToken,
+ sameOrigin,
+ environmentSettingsObject
+} = __nccwpck_require__(3168)
+const {
+ forbiddenMethodsSet,
+ corsSafeListedMethodsSet,
+ referrerPolicy,
+ requestRedirect,
+ requestMode,
+ requestCredentials,
+ requestCache,
+ requestDuplex
+} = __nccwpck_require__(4495)
+const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util
+const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { kConstruct } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474)
- get bodyUsed () {
- webidl.brandCheck(this, Request)
+const kAbortController = Symbol('abortController')
- return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
- }
+const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
+ signal.removeEventListener('abort', abort)
+})
- get duplex () {
- webidl.brandCheck(this, Request)
+const dependentControllerMap = new WeakMap()
- return 'half'
- }
+function buildAbort (acRef) {
+ return abort
- // Returns a clone of request.
- clone () {
- webidl.brandCheck(this, Request)
+ function abort () {
+ const ac = acRef.deref()
+ if (ac !== undefined) {
+ // Currently, there is a problem with FinalizationRegistry.
+ // https://github.com/nodejs/node/issues/49344
+ // https://github.com/nodejs/node/issues/47748
+ // In the case of abort, the first step is to unregister from it.
+ // If the controller can refer to it, it is still registered.
+ // It will be removed in the future.
+ requestFinalizer.unregister(abort)
- // 1. If this is unusable, then throw a TypeError.
- if (this.bodyUsed || this.body?.locked) {
- throw new TypeError('unusable')
- }
+ // Unsubscribe a listener.
+ // FinalizationRegistry will no longer be called, so this must be done.
+ this.removeEventListener('abort', abort)
- // 2. Let clonedRequest be the result of cloning this’s request.
- const clonedRequest = cloneRequest(this[kState])
+ ac.abort(this.reason)
- // 3. Let clonedRequestObject be the result of creating a Request object,
- // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
- const clonedRequestObject = new Request(kConstruct)
- clonedRequestObject[kState] = clonedRequest
- clonedRequestObject[kRealm] = this[kRealm]
- clonedRequestObject[kHeaders] = new Headers(kConstruct)
- clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
- clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
- clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
+ const controllerList = dependentControllerMap.get(ac.signal)
- // 4. Make clonedRequestObject’s signal follow this’s signal.
- const ac = new AbortController()
- if (this.signal.aborted) {
- ac.abort(this.signal.reason)
- } else {
- util.addAbortListener(
- this.signal,
- () => {
- ac.abort(this.signal.reason)
+ if (controllerList !== undefined) {
+ if (controllerList.size !== 0) {
+ for (const ref of controllerList) {
+ const ctrl = ref.deref()
+ if (ctrl !== undefined) {
+ ctrl.abort(this.reason)
+ }
+ }
+ controllerList.clear()
}
- )
+ dependentControllerMap.delete(ac.signal)
+ }
}
- clonedRequestObject[kSignal] = ac.signal
-
- // 4. Return clonedRequestObject.
- return clonedRequestObject
- }
-}
-
-mixinBody(Request)
-
-function makeRequest (init) {
- // https://fetch.spec.whatwg.org/#requests
- const request = {
- method: 'GET',
- localURLsOnly: false,
- unsafeRequest: false,
- body: null,
- client: null,
- reservedClient: null,
- replacesClientId: '',
- window: 'client',
- keepalive: false,
- serviceWorkers: 'all',
- initiator: '',
- destination: '',
- priority: null,
- origin: 'client',
- policyContainer: 'client',
- referrer: 'client',
- referrerPolicy: '',
- mode: 'no-cors',
- useCORSPreflightFlag: false,
- credentials: 'same-origin',
- useCredentials: false,
- cache: 'default',
- redirect: 'follow',
- integrity: '',
- cryptoGraphicsNonceMetadata: '',
- parserMetadata: '',
- reloadNavigation: false,
- historyNavigation: false,
- userActivation: false,
- taintedOrigin: false,
- redirectCount: 0,
- responseTainting: 'basic',
- preventNoCacheCacheControlHeaderModification: false,
- done: false,
- timingAllowFailed: false,
- ...init,
- headersList: init.headersList
- ? new HeadersList(init.headersList)
- : new HeadersList()
}
- request.url = request.urlList[0]
- return request
}
-// https://fetch.spec.whatwg.org/#concept-request-clone
-function cloneRequest (request) {
- // To clone a request request, run these steps:
+let patchMethodWarning = false
- // 1. Let newRequest be a copy of request, except for its body.
- const newRequest = makeRequest({ ...request, body: null })
+// https://fetch.spec.whatwg.org/#request-class
+class Request {
+ // https://fetch.spec.whatwg.org/#dom-request
+ constructor (input, init = {}) {
+ webidl.util.markAsUncloneable(this)
+ if (input === kConstruct) {
+ return
+ }
- // 2. If request’s body is non-null, set newRequest’s body to the
- // result of cloning request’s body.
- if (request.body != null) {
- newRequest.body = cloneBody(request.body)
- }
+ const prefix = 'Request constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- // 3. Return newRequest.
- return newRequest
-}
+ input = webidl.converters.RequestInfo(input, prefix, 'input')
+ init = webidl.converters.RequestInit(init, prefix, 'init')
-Object.defineProperties(Request.prototype, {
- method: kEnumerableProperty,
- url: kEnumerableProperty,
- headers: kEnumerableProperty,
- redirect: kEnumerableProperty,
- clone: kEnumerableProperty,
- signal: kEnumerableProperty,
- duplex: kEnumerableProperty,
- destination: kEnumerableProperty,
- body: kEnumerableProperty,
- bodyUsed: kEnumerableProperty,
- isHistoryNavigation: kEnumerableProperty,
- isReloadNavigation: kEnumerableProperty,
- keepalive: kEnumerableProperty,
- integrity: kEnumerableProperty,
- cache: kEnumerableProperty,
- credentials: kEnumerableProperty,
- attribute: kEnumerableProperty,
- referrerPolicy: kEnumerableProperty,
- referrer: kEnumerableProperty,
- mode: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'Request',
- configurable: true
- }
-})
+ // 1. Let request be null.
+ let request = null
-webidl.converters.Request = webidl.interfaceConverter(
- Request
-)
+ // 2. Let fallbackMode be null.
+ let fallbackMode = null
-// https://fetch.spec.whatwg.org/#requestinfo
-webidl.converters.RequestInfo = function (V) {
- if (typeof V === 'string') {
- return webidl.converters.USVString(V)
- }
+ // 3. Let baseURL be this’s relevant settings object’s API base URL.
+ const baseUrl = environmentSettingsObject.settingsObject.baseUrl
- if (V instanceof Request) {
- return webidl.converters.Request(V)
- }
+ // 4. Let signal be null.
+ let signal = null
- return webidl.converters.USVString(V)
-}
+ // 5. If input is a string, then:
+ if (typeof input === 'string') {
+ this[kDispatcher] = init.dispatcher
-webidl.converters.AbortSignal = webidl.interfaceConverter(
- AbortSignal
-)
+ // 1. Let parsedURL be the result of parsing input with baseURL.
+ // 2. If parsedURL is failure, then throw a TypeError.
+ let parsedURL
+ try {
+ parsedURL = new URL(input, baseUrl)
+ } catch (err) {
+ throw new TypeError('Failed to parse URL from ' + input, { cause: err })
+ }
-// https://fetch.spec.whatwg.org/#requestinit
-webidl.converters.RequestInit = webidl.dictionaryConverter([
- {
- key: 'method',
- converter: webidl.converters.ByteString
- },
- {
- key: 'headers',
- converter: webidl.converters.HeadersInit
- },
- {
- key: 'body',
- converter: webidl.nullableConverter(
- webidl.converters.BodyInit
- )
- },
- {
- key: 'referrer',
- converter: webidl.converters.USVString
- },
- {
- key: 'referrerPolicy',
- converter: webidl.converters.DOMString,
- // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
- allowedValues: referrerPolicy
- },
- {
- key: 'mode',
- converter: webidl.converters.DOMString,
- // https://fetch.spec.whatwg.org/#concept-request-mode
- allowedValues: requestMode
- },
- {
- key: 'credentials',
- converter: webidl.converters.DOMString,
- // https://fetch.spec.whatwg.org/#requestcredentials
- allowedValues: requestCredentials
- },
- {
- key: 'cache',
- converter: webidl.converters.DOMString,
- // https://fetch.spec.whatwg.org/#requestcache
- allowedValues: requestCache
- },
- {
- key: 'redirect',
- converter: webidl.converters.DOMString,
- // https://fetch.spec.whatwg.org/#requestredirect
- allowedValues: requestRedirect
- },
- {
- key: 'integrity',
- converter: webidl.converters.DOMString
- },
- {
- key: 'keepalive',
- converter: webidl.converters.boolean
- },
- {
- key: 'signal',
- converter: webidl.nullableConverter(
- (signal) => webidl.converters.AbortSignal(
- signal,
- { strict: false }
- )
- )
- },
- {
- key: 'window',
- converter: webidl.converters.any
- },
- {
- key: 'duplex',
- converter: webidl.converters.DOMString,
- allowedValues: requestDuplex
- }
-])
+ // 3. If parsedURL includes credentials, then throw a TypeError.
+ if (parsedURL.username || parsedURL.password) {
+ throw new TypeError(
+ 'Request cannot be constructed from a URL that includes credentials: ' +
+ input
+ )
+ }
-module.exports = { Request, makeRequest }
+ // 4. Set request to a new request whose URL is parsedURL.
+ request = makeRequest({ urlList: [parsedURL] })
+ // 5. Set fallbackMode to "cors".
+ fallbackMode = 'cors'
+ } else {
+ this[kDispatcher] = init.dispatcher || input[kDispatcher]
-/***/ }),
+ // 6. Otherwise:
-/***/ 7823:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 7. Assert: input is a Request object.
+ assert(input instanceof Request)
-"use strict";
+ // 8. Set request to input’s request.
+ request = input[kState]
+ // 9. Set signal to input’s signal.
+ signal = input[kSignal]
+ }
-const { Headers, HeadersList, fill } = __nccwpck_require__(554)
-const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(1472)
-const util = __nccwpck_require__(3983)
-const { kEnumerableProperty } = util
-const {
- isValidReasonPhrase,
- isCancelled,
- isAborted,
- isBlobLike,
- serializeJavascriptValueToJSONString,
- isErrorLike,
- isomorphicEncode
-} = __nccwpck_require__(2538)
-const {
- redirectStatusSet,
- nullBodyStatus,
- DOMException
-} = __nccwpck_require__(1037)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { FormData } = __nccwpck_require__(2015)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { URLSerializer } = __nccwpck_require__(685)
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { types } = __nccwpck_require__(3837)
-
-const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
-const textEncoder = new TextEncoder('utf-8')
+ // 7. Let origin be this’s relevant settings object’s origin.
+ const origin = environmentSettingsObject.settingsObject.origin
-// https://fetch.spec.whatwg.org/#response-class
-class Response {
- // Creates network error Response.
- static error () {
- // TODO
- const relevantRealm = { settingsObject: {} }
+ // 8. Let window be "client".
+ let window = 'client'
- // The static error() method steps are to return the result of creating a
- // Response object, given a new network error, "immutable", and this’s
- // relevant Realm.
- const responseObject = new Response()
- responseObject[kState] = makeNetworkError()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
- return responseObject
- }
+ // 9. If request’s window is an environment settings object and its origin
+ // is same origin with origin, then set window to request’s window.
+ if (
+ request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
+ sameOrigin(request.window, origin)
+ ) {
+ window = request.window
+ }
- // https://fetch.spec.whatwg.org/#dom-response-json
- static json (data, init = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
+ // 10. If init["window"] exists and is non-null, then throw a TypeError.
+ if (init.window != null) {
+ throw new TypeError(`'window' option '${window}' must be null`)
+ }
- if (init !== null) {
- init = webidl.converters.ResponseInit(init)
+ // 11. If init["window"] exists, then set window to "no-window".
+ if ('window' in init) {
+ window = 'no-window'
}
- // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
- const bytes = textEncoder.encode(
- serializeJavascriptValueToJSONString(data)
- )
+ // 12. Set request to a new request with the following properties:
+ request = makeRequest({
+ // URL request’s URL.
+ // undici implementation note: this is set as the first item in request's urlList in makeRequest
+ // method request’s method.
+ method: request.method,
+ // header list A copy of request’s header list.
+ // undici implementation note: headersList is cloned in makeRequest
+ headersList: request.headersList,
+ // unsafe-request flag Set.
+ unsafeRequest: request.unsafeRequest,
+ // client This’s relevant settings object.
+ client: environmentSettingsObject.settingsObject,
+ // window window.
+ window,
+ // priority request’s priority.
+ priority: request.priority,
+ // origin request’s origin. The propagation of the origin is only significant for navigation requests
+ // being handled by a service worker. In this scenario a request can have an origin that is different
+ // from the current client.
+ origin: request.origin,
+ // referrer request’s referrer.
+ referrer: request.referrer,
+ // referrer policy request’s referrer policy.
+ referrerPolicy: request.referrerPolicy,
+ // mode request’s mode.
+ mode: request.mode,
+ // credentials mode request’s credentials mode.
+ credentials: request.credentials,
+ // cache mode request’s cache mode.
+ cache: request.cache,
+ // redirect mode request’s redirect mode.
+ redirect: request.redirect,
+ // integrity metadata request’s integrity metadata.
+ integrity: request.integrity,
+ // keepalive request’s keepalive.
+ keepalive: request.keepalive,
+ // reload-navigation flag request’s reload-navigation flag.
+ reloadNavigation: request.reloadNavigation,
+ // history-navigation flag request’s history-navigation flag.
+ historyNavigation: request.historyNavigation,
+ // URL list A clone of request’s URL list.
+ urlList: [...request.urlList]
+ })
- // 2. Let body be the result of extracting bytes.
- const body = extractBody(bytes)
+ const initHasKey = Object.keys(init).length !== 0
- // 3. Let responseObject be the result of creating a Response object, given a new response,
- // "response", and this’s relevant Realm.
- const relevantRealm = { settingsObject: {} }
- const responseObject = new Response()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kGuard] = 'response'
- responseObject[kHeaders][kRealm] = relevantRealm
+ // 13. If init is not empty, then:
+ if (initHasKey) {
+ // 1. If request’s mode is "navigate", then set it to "same-origin".
+ if (request.mode === 'navigate') {
+ request.mode = 'same-origin'
+ }
- // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
- initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
+ // 2. Unset request’s reload-navigation flag.
+ request.reloadNavigation = false
- // 5. Return responseObject.
- return responseObject
- }
+ // 3. Unset request’s history-navigation flag.
+ request.historyNavigation = false
- // Creates a redirect Response that redirects to url with status status.
- static redirect (url, status = 302) {
- const relevantRealm = { settingsObject: {} }
+ // 4. Set request’s origin to "client".
+ request.origin = 'client'
- webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
+ // 5. Set request’s referrer to "client"
+ request.referrer = 'client'
- url = webidl.converters.USVString(url)
- status = webidl.converters['unsigned short'](status)
+ // 6. Set request’s referrer policy to the empty string.
+ request.referrerPolicy = ''
- // 1. Let parsedURL be the result of parsing url with current settings
- // object’s API base URL.
- // 2. If parsedURL is failure, then throw a TypeError.
- // TODO: base-URL?
- let parsedURL
- try {
- parsedURL = new URL(url, getGlobalOrigin())
- } catch (err) {
- throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
- cause: err
- })
- }
+ // 7. Set request’s URL to request’s current URL.
+ request.url = request.urlList[request.urlList.length - 1]
- // 3. If status is not a redirect status, then throw a RangeError.
- if (!redirectStatusSet.has(status)) {
- throw new RangeError('Invalid status code ' + status)
+ // 8. Set request’s URL list to « request’s URL ».
+ request.urlList = [request.url]
}
- // 4. Let responseObject be the result of creating a Response object,
- // given a new response, "immutable", and this’s relevant Realm.
- const responseObject = new Response()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
-
- // 5. Set responseObject’s response’s status to status.
- responseObject[kState].status = status
-
- // 6. Let value be parsedURL, serialized and isomorphic encoded.
- const value = isomorphicEncode(URLSerializer(parsedURL))
-
- // 7. Append `Location`/value to responseObject’s response’s header list.
- responseObject[kState].headersList.append('location', value)
+ // 14. If init["referrer"] exists, then:
+ if (init.referrer !== undefined) {
+ // 1. Let referrer be init["referrer"].
+ const referrer = init.referrer
- // 8. Return responseObject.
- return responseObject
- }
+ // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
+ if (referrer === '') {
+ request.referrer = 'no-referrer'
+ } else {
+ // 1. Let parsedReferrer be the result of parsing referrer with
+ // baseURL.
+ // 2. If parsedReferrer is failure, then throw a TypeError.
+ let parsedReferrer
+ try {
+ parsedReferrer = new URL(referrer, baseUrl)
+ } catch (err) {
+ throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
+ }
- // https://fetch.spec.whatwg.org/#dom-response
- constructor (body = null, init = {}) {
- if (body !== null) {
- body = webidl.converters.BodyInit(body)
+ // 3. If one of the following is true
+ // - parsedReferrer’s scheme is "about" and path is the string "client"
+ // - parsedReferrer’s origin is not same origin with origin
+ // then set request’s referrer to "client".
+ if (
+ (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
+ (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))
+ ) {
+ request.referrer = 'client'
+ } else {
+ // 4. Otherwise, set request’s referrer to parsedReferrer.
+ request.referrer = parsedReferrer
+ }
+ }
}
- init = webidl.converters.ResponseInit(init)
-
- // TODO
- this[kRealm] = { settingsObject: {} }
-
- // 1. Set this’s response to a new response.
- this[kState] = makeResponse({})
-
- // 2. Set this’s headers to a new Headers object with this’s relevant
- // Realm, whose header list is this’s response’s header list and guard
- // is "response".
- this[kHeaders] = new Headers(kConstruct)
- this[kHeaders][kGuard] = 'response'
- this[kHeaders][kHeadersList] = this[kState].headersList
- this[kHeaders][kRealm] = this[kRealm]
+ // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
+ // to it.
+ if (init.referrerPolicy !== undefined) {
+ request.referrerPolicy = init.referrerPolicy
+ }
- // 3. Let bodyWithType be null.
- let bodyWithType = null
+ // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
+ let mode
+ if (init.mode !== undefined) {
+ mode = init.mode
+ } else {
+ mode = fallbackMode
+ }
- // 4. If body is non-null, then set bodyWithType to the result of extracting body.
- if (body != null) {
- const [extractedBody, type] = extractBody(body)
- bodyWithType = { body: extractedBody, type }
+ // 17. If mode is "navigate", then throw a TypeError.
+ if (mode === 'navigate') {
+ throw webidl.errors.exception({
+ header: 'Request constructor',
+ message: 'invalid request mode navigate.'
+ })
}
- // 5. Perform initialize a response given this, init, and bodyWithType.
- initializeResponse(this, init, bodyWithType)
- }
+ // 18. If mode is non-null, set request’s mode to mode.
+ if (mode != null) {
+ request.mode = mode
+ }
- // Returns response’s type, e.g., "cors".
- get type () {
- webidl.brandCheck(this, Response)
+ // 19. If init["credentials"] exists, then set request’s credentials mode
+ // to it.
+ if (init.credentials !== undefined) {
+ request.credentials = init.credentials
+ }
- // The type getter steps are to return this’s response’s type.
- return this[kState].type
- }
+ // 18. If init["cache"] exists, then set request’s cache mode to it.
+ if (init.cache !== undefined) {
+ request.cache = init.cache
+ }
- // Returns response’s URL, if it has one; otherwise the empty string.
- get url () {
- webidl.brandCheck(this, Response)
+ // 21. If request’s cache mode is "only-if-cached" and request’s mode is
+ // not "same-origin", then throw a TypeError.
+ if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
+ throw new TypeError(
+ "'only-if-cached' can be set only with 'same-origin' mode"
+ )
+ }
- const urlList = this[kState].urlList
+ // 22. If init["redirect"] exists, then set request’s redirect mode to it.
+ if (init.redirect !== undefined) {
+ request.redirect = init.redirect
+ }
- // The url getter steps are to return the empty string if this’s
- // response’s URL is null; otherwise this’s response’s URL,
- // serialized with exclude fragment set to true.
- const url = urlList[urlList.length - 1] ?? null
+ // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
+ if (init.integrity != null) {
+ request.integrity = String(init.integrity)
+ }
- if (url === null) {
- return ''
+ // 24. If init["keepalive"] exists, then set request’s keepalive to it.
+ if (init.keepalive !== undefined) {
+ request.keepalive = Boolean(init.keepalive)
}
- return URLSerializer(url, true)
- }
+ // 25. If init["method"] exists, then:
+ if (init.method !== undefined) {
+ // 1. Let method be init["method"].
+ let method = init.method
- // Returns whether response was obtained through a redirect.
- get redirected () {
- webidl.brandCheck(this, Response)
+ const mayBeNormalized = normalizedMethodRecords[method]
- // The redirected getter steps are to return true if this’s response’s URL
- // list has more than one item; otherwise false.
- return this[kState].urlList.length > 1
- }
+ if (mayBeNormalized !== undefined) {
+ // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones
+ request.method = mayBeNormalized
+ } else {
+ // 2. If method is not a method or method is a forbidden method, then
+ // throw a TypeError.
+ if (!isValidHTTPToken(method)) {
+ throw new TypeError(`'${method}' is not a valid HTTP method.`)
+ }
- // Returns response’s status.
- get status () {
- webidl.brandCheck(this, Response)
+ const upperCase = method.toUpperCase()
- // The status getter steps are to return this’s response’s status.
- return this[kState].status
- }
+ if (forbiddenMethodsSet.has(upperCase)) {
+ throw new TypeError(`'${method}' HTTP method is unsupported.`)
+ }
- // Returns whether response’s status is an ok status.
- get ok () {
- webidl.brandCheck(this, Response)
+ // 3. Normalize method.
+ // https://fetch.spec.whatwg.org/#concept-method-normalize
+ // Note: must be in uppercase
+ method = normalizedMethodRecordsBase[upperCase] ?? method
- // The ok getter steps are to return true if this’s response’s status is an
- // ok status; otherwise false.
- return this[kState].status >= 200 && this[kState].status <= 299
- }
+ // 4. Set request’s method to method.
+ request.method = method
+ }
- // Returns response’s status message.
- get statusText () {
- webidl.brandCheck(this, Response)
+ if (!patchMethodWarning && request.method === 'patch') {
+ process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {
+ code: 'UNDICI-FETCH-patch'
+ })
- // The statusText getter steps are to return this’s response’s status
- // message.
- return this[kState].statusText
- }
+ patchMethodWarning = true
+ }
+ }
- // Returns response’s headers as Headers.
- get headers () {
- webidl.brandCheck(this, Response)
+ // 26. If init["signal"] exists, then set signal to it.
+ if (init.signal !== undefined) {
+ signal = init.signal
+ }
- // The headers getter steps are to return this’s headers.
- return this[kHeaders]
- }
+ // 27. Set this’s request to request.
+ this[kState] = request
- get body () {
- webidl.brandCheck(this, Response)
+ // 28. Set this’s signal to a new AbortSignal object with this’s relevant
+ // Realm.
+ // TODO: could this be simplified with AbortSignal.any
+ // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
+ const ac = new AbortController()
+ this[kSignal] = ac.signal
- return this[kState].body ? this[kState].body.stream : null
- }
+ // 29. If signal is not null, then make this’s signal follow signal.
+ if (signal != null) {
+ if (
+ !signal ||
+ typeof signal.aborted !== 'boolean' ||
+ typeof signal.addEventListener !== 'function'
+ ) {
+ throw new TypeError(
+ "Failed to construct 'Request': member signal is not of type AbortSignal."
+ )
+ }
- get bodyUsed () {
- webidl.brandCheck(this, Response)
+ if (signal.aborted) {
+ ac.abort(signal.reason)
+ } else {
+ // Keep a strong ref to ac while request object
+ // is alive. This is needed to prevent AbortController
+ // from being prematurely garbage collected.
+ // See, https://github.com/nodejs/undici/issues/1926.
+ this[kAbortController] = ac
- return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
- }
+ const acRef = new WeakRef(ac)
+ const abort = buildAbort(acRef)
- // Returns a clone of response.
- clone () {
- webidl.brandCheck(this, Response)
+ // Third-party AbortControllers may not work with these.
+ // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
+ try {
+ // If the max amount of listeners is equal to the default, increase it
+ // This is only available in node >= v19.9.0
+ if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
+ setMaxListeners(1500, signal)
+ } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
+ setMaxListeners(1500, signal)
+ }
+ } catch {}
- // 1. If this is unusable, then throw a TypeError.
- if (this.bodyUsed || (this.body && this.body.locked)) {
- throw webidl.errors.exception({
- header: 'Response.clone',
- message: 'Body has already been consumed.'
- })
+ util.addAbortListener(signal, abort)
+ // The third argument must be a registry key to be unregistered.
+ // Without it, you cannot unregister.
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
+ // abort is used as the unregister key. (because it is unique)
+ requestFinalizer.register(ac, { signal, abort }, abort)
+ }
}
- // 2. Let clonedResponse be the result of cloning this’s response.
- const clonedResponse = cloneResponse(this[kState])
-
- // 3. Return the result of creating a Response object, given
- // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
- const clonedResponseObject = new Response()
- clonedResponseObject[kState] = clonedResponse
- clonedResponseObject[kRealm] = this[kRealm]
- clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
- clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
- clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
-
- return clonedResponseObject
- }
-}
-
-mixinBody(Response)
-
-Object.defineProperties(Response.prototype, {
- type: kEnumerableProperty,
- url: kEnumerableProperty,
- status: kEnumerableProperty,
- ok: kEnumerableProperty,
- redirected: kEnumerableProperty,
- statusText: kEnumerableProperty,
- headers: kEnumerableProperty,
- clone: kEnumerableProperty,
- body: kEnumerableProperty,
- bodyUsed: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'Response',
- configurable: true
- }
-})
+ // 30. Set this’s headers to a new Headers object with this’s relevant
+ // Realm, whose header list is request’s header list and guard is
+ // "request".
+ this[kHeaders] = new Headers(kConstruct)
+ setHeadersList(this[kHeaders], request.headersList)
+ setHeadersGuard(this[kHeaders], 'request')
-Object.defineProperties(Response, {
- json: kEnumerableProperty,
- redirect: kEnumerableProperty,
- error: kEnumerableProperty
-})
+ // 31. If this’s request’s mode is "no-cors", then:
+ if (mode === 'no-cors') {
+ // 1. If this’s request’s method is not a CORS-safelisted method,
+ // then throw a TypeError.
+ if (!corsSafeListedMethodsSet.has(request.method)) {
+ throw new TypeError(
+ `'${request.method} is unsupported in no-cors mode.`
+ )
+ }
-// https://fetch.spec.whatwg.org/#concept-response-clone
-function cloneResponse (response) {
- // To clone a response response, run these steps:
+ // 2. Set this’s headers’s guard to "request-no-cors".
+ setHeadersGuard(this[kHeaders], 'request-no-cors')
+ }
- // 1. If response is a filtered response, then return a new identical
- // filtered response whose internal response is a clone of response’s
- // internal response.
- if (response.internalResponse) {
- return filterResponse(
- cloneResponse(response.internalResponse),
- response.type
- )
- }
+ // 32. If init is not empty, then:
+ if (initHasKey) {
+ /** @type {HeadersList} */
+ const headersList = getHeadersList(this[kHeaders])
+ // 1. Let headers be a copy of this’s headers and its associated header
+ // list.
+ // 2. If init["headers"] exists, then set headers to init["headers"].
+ const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
- // 2. Let newResponse be a copy of response, except for its body.
- const newResponse = makeResponse({ ...response, body: null })
+ // 3. Empty this’s headers’s header list.
+ headersList.clear()
- // 3. If response’s body is non-null, then set newResponse’s body to the
- // result of cloning response’s body.
- if (response.body != null) {
- newResponse.body = cloneBody(response.body)
- }
+ // 4. If headers is a Headers object, then for each header in its header
+ // list, append header’s name/header’s value to this’s headers.
+ if (headers instanceof HeadersList) {
+ for (const { name, value } of headers.rawValues()) {
+ headersList.append(name, value, false)
+ }
+ // Note: Copy the `set-cookie` meta-data.
+ headersList.cookies = headers.cookies
+ } else {
+ // 5. Otherwise, fill this’s headers with headers.
+ fillHeaders(this[kHeaders], headers)
+ }
+ }
- // 4. Return newResponse.
- return newResponse
-}
+ // 33. Let inputBody be input’s request’s body if input is a Request
+ // object; otherwise null.
+ const inputBody = input instanceof Request ? input[kState].body : null
-function makeResponse (init) {
- return {
- aborted: false,
- rangeRequested: false,
- timingAllowPassed: false,
- requestIncludesCredentials: false,
- type: 'default',
- status: 200,
- timingInfo: null,
- cacheState: '',
- statusText: '',
- ...init,
- headersList: init.headersList
- ? new HeadersList(init.headersList)
- : new HeadersList(),
- urlList: init.urlList ? [...init.urlList] : []
- }
-}
+ // 34. If either init["body"] exists and is non-null or inputBody is
+ // non-null, and request’s method is `GET` or `HEAD`, then throw a
+ // TypeError.
+ if (
+ (init.body != null || inputBody != null) &&
+ (request.method === 'GET' || request.method === 'HEAD')
+ ) {
+ throw new TypeError('Request with GET/HEAD method cannot have body.')
+ }
-function makeNetworkError (reason) {
- const isError = isErrorLike(reason)
- return makeResponse({
- type: 'error',
- status: 0,
- error: isError
- ? reason
- : new Error(reason ? String(reason) : reason),
- aborted: reason && reason.name === 'AbortError'
- })
-}
+ // 35. Let initBody be null.
+ let initBody = null
-function makeFilteredResponse (response, state) {
- state = {
- internalResponse: response,
- ...state
- }
+ // 36. If init["body"] exists and is non-null, then:
+ if (init.body != null) {
+ // 1. Let Content-Type be null.
+ // 2. Set initBody and Content-Type to the result of extracting
+ // init["body"], with keepalive set to request’s keepalive.
+ const [extractedBody, contentType] = extractBody(
+ init.body,
+ request.keepalive
+ )
+ initBody = extractedBody
- return new Proxy(response, {
- get (target, p) {
- return p in state ? state[p] : target[p]
- },
- set (target, p, value) {
- assert(!(p in state))
- target[p] = value
- return true
+ // 3, If Content-Type is non-null and this’s headers’s header list does
+ // not contain `Content-Type`, then append `Content-Type`/Content-Type to
+ // this’s headers.
+ if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {
+ this[kHeaders].append('content-type', contentType)
+ }
}
- })
-}
-// https://fetch.spec.whatwg.org/#concept-filtered-response
-function filterResponse (response, type) {
- // Set response to the following filtered response with response as its
- // internal response, depending on request’s response tainting:
- if (type === 'basic') {
- // A basic filtered response is a filtered response whose type is "basic"
- // and header list excludes any headers in internal response’s header list
- // whose name is a forbidden response-header name.
+ // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
+ // inputBody.
+ const inputOrInitBody = initBody ?? inputBody
- // Note: undici does not implement forbidden response-header names
- return makeFilteredResponse(response, {
- type: 'basic',
- headersList: response.headersList
- })
- } else if (type === 'cors') {
- // A CORS filtered response is a filtered response whose type is "cors"
- // and header list excludes any headers in internal response’s header
- // list whose name is not a CORS-safelisted response-header name, given
- // internal response’s CORS-exposed header-name list.
+ // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
+ // null, then:
+ if (inputOrInitBody != null && inputOrInitBody.source == null) {
+ // 1. If initBody is non-null and init["duplex"] does not exist,
+ // then throw a TypeError.
+ if (initBody != null && init.duplex == null) {
+ throw new TypeError('RequestInit: duplex option is required when sending a body.')
+ }
- // Note: undici does not implement CORS-safelisted response-header names
- return makeFilteredResponse(response, {
- type: 'cors',
- headersList: response.headersList
- })
- } else if (type === 'opaque') {
- // An opaque filtered response is a filtered response whose type is
- // "opaque", URL list is the empty list, status is 0, status message
- // is the empty byte sequence, header list is empty, and body is null.
+ // 2. If this’s request’s mode is neither "same-origin" nor "cors",
+ // then throw a TypeError.
+ if (request.mode !== 'same-origin' && request.mode !== 'cors') {
+ throw new TypeError(
+ 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
+ )
+ }
- return makeFilteredResponse(response, {
- type: 'opaque',
- urlList: Object.freeze([]),
- status: 0,
- statusText: '',
- body: null
- })
- } else if (type === 'opaqueredirect') {
- // An opaque-redirect filtered response is a filtered response whose type
- // is "opaqueredirect", status is 0, status message is the empty byte
- // sequence, header list is empty, and body is null.
+ // 3. Set this’s request’s use-CORS-preflight flag.
+ request.useCORSPreflightFlag = true
+ }
- return makeFilteredResponse(response, {
- type: 'opaqueredirect',
- status: 0,
- statusText: '',
- headersList: [],
- body: null
- })
- } else {
- assert(false)
- }
-}
+ // 39. Let finalBody be inputOrInitBody.
+ let finalBody = inputOrInitBody
-// https://fetch.spec.whatwg.org/#appropriate-network-error
-function makeAppropriateNetworkError (fetchParams, err = null) {
- // 1. Assert: fetchParams is canceled.
- assert(isCancelled(fetchParams))
+ // 40. If initBody is null and inputBody is non-null, then:
+ if (initBody == null && inputBody != null) {
+ // 1. If input is unusable, then throw a TypeError.
+ if (bodyUnusable(input)) {
+ throw new TypeError(
+ 'Cannot construct a Request with a Request object that has already been used.'
+ )
+ }
- // 2. Return an aborted network error if fetchParams is aborted;
- // otherwise return a network error.
- return isAborted(fetchParams)
- ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
- : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
-}
+ // 2. Set finalBody to the result of creating a proxy for inputBody.
+ // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
+ const identityTransform = new TransformStream()
+ inputBody.stream.pipeThrough(identityTransform)
+ finalBody = {
+ source: inputBody.source,
+ length: inputBody.length,
+ stream: identityTransform.readable
+ }
+ }
-// https://whatpr.org/fetch/1392.html#initialize-a-response
-function initializeResponse (response, init, body) {
- // 1. If init["status"] is not in the range 200 to 599, inclusive, then
- // throw a RangeError.
- if (init.status !== null && (init.status < 200 || init.status > 599)) {
- throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
+ // 41. Set this’s request’s body to finalBody.
+ this[kState].body = finalBody
}
- // 2. If init["statusText"] does not match the reason-phrase token production,
- // then throw a TypeError.
- if ('statusText' in init && init.statusText != null) {
- // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
- // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
- if (!isValidReasonPhrase(String(init.statusText))) {
- throw new TypeError('Invalid statusText')
- }
+ // Returns request’s HTTP method, which is "GET" by default.
+ get method () {
+ webidl.brandCheck(this, Request)
+
+ // The method getter steps are to return this’s request’s method.
+ return this[kState].method
}
- // 3. Set response’s response’s status to init["status"].
- if ('status' in init && init.status != null) {
- response[kState].status = init.status
+ // Returns the URL of request as a string.
+ get url () {
+ webidl.brandCheck(this, Request)
+
+ // The url getter steps are to return this’s request’s URL, serialized.
+ return URLSerializer(this[kState].url)
}
- // 4. Set response’s response’s status message to init["statusText"].
- if ('statusText' in init && init.statusText != null) {
- response[kState].statusText = init.statusText
+ // Returns a Headers object consisting of the headers associated with request.
+ // Note that headers added in the network layer by the user agent will not
+ // be accounted for in this object, e.g., the "Host" header.
+ get headers () {
+ webidl.brandCheck(this, Request)
+
+ // The headers getter steps are to return this’s headers.
+ return this[kHeaders]
}
- // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
- if ('headers' in init && init.headers != null) {
- fill(response[kHeaders], init.headers)
+ // Returns the kind of resource requested by request, e.g., "document"
+ // or "script".
+ get destination () {
+ webidl.brandCheck(this, Request)
+
+ // The destination getter are to return this’s request’s destination.
+ return this[kState].destination
}
- // 6. If body was given, then:
- if (body) {
- // 1. If response's status is a null body status, then throw a TypeError.
- if (nullBodyStatus.includes(response.status)) {
- throw webidl.errors.exception({
- header: 'Response constructor',
- message: 'Invalid response status code ' + response.status
- })
- }
+ // Returns the referrer of request. Its value can be a same-origin URL if
+ // explicitly set in init, the empty string to indicate no referrer, and
+ // "about:client" when defaulting to the global’s default. This is used
+ // during fetching to determine the value of the `Referer` header of the
+ // request being made.
+ get referrer () {
+ webidl.brandCheck(this, Request)
- // 2. Set response's body to body's body.
- response[kState].body = body.body
+ // 1. If this’s request’s referrer is "no-referrer", then return the
+ // empty string.
+ if (this[kState].referrer === 'no-referrer') {
+ return ''
+ }
- // 3. If body's type is non-null and response's header list does not contain
- // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
- if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
- response[kState].headersList.append('content-type', body.type)
+ // 2. If this’s request’s referrer is "client", then return
+ // "about:client".
+ if (this[kState].referrer === 'client') {
+ return 'about:client'
}
+
+ // Return this’s request’s referrer, serialized.
+ return this[kState].referrer.toString()
}
-}
-webidl.converters.ReadableStream = webidl.interfaceConverter(
- ReadableStream
-)
+ // Returns the referrer policy associated with request.
+ // This is used during fetching to compute the value of the request’s
+ // referrer.
+ get referrerPolicy () {
+ webidl.brandCheck(this, Request)
-webidl.converters.FormData = webidl.interfaceConverter(
- FormData
-)
+ // The referrerPolicy getter steps are to return this’s request’s referrer policy.
+ return this[kState].referrerPolicy
+ }
-webidl.converters.URLSearchParams = webidl.interfaceConverter(
- URLSearchParams
-)
+ // Returns the mode associated with request, which is a string indicating
+ // whether the request will use CORS, or will be restricted to same-origin
+ // URLs.
+ get mode () {
+ webidl.brandCheck(this, Request)
-// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
-webidl.converters.XMLHttpRequestBodyInit = function (V) {
- if (typeof V === 'string') {
- return webidl.converters.USVString(V)
+ // The mode getter steps are to return this’s request’s mode.
+ return this[kState].mode
}
- if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+ // Returns the credentials mode associated with request,
+ // which is a string indicating whether credentials will be sent with the
+ // request always, never, or only when sent to a same-origin URL.
+ get credentials () {
+ // The credentials getter steps are to return this’s request’s credentials mode.
+ return this[kState].credentials
}
- if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
- return webidl.converters.BufferSource(V)
+ // Returns the cache mode associated with request,
+ // which is a string indicating how the request will
+ // interact with the browser’s cache when fetching.
+ get cache () {
+ webidl.brandCheck(this, Request)
+
+ // The cache getter steps are to return this’s request’s cache mode.
+ return this[kState].cache
}
- if (util.isFormDataLike(V)) {
- return webidl.converters.FormData(V, { strict: false })
+ // Returns the redirect mode associated with request,
+ // which is a string indicating how redirects for the
+ // request will be handled during fetching. A request
+ // will follow redirects by default.
+ get redirect () {
+ webidl.brandCheck(this, Request)
+
+ // The redirect getter steps are to return this’s request’s redirect mode.
+ return this[kState].redirect
}
- if (V instanceof URLSearchParams) {
- return webidl.converters.URLSearchParams(V)
+ // Returns request’s subresource integrity metadata, which is a
+ // cryptographic hash of the resource being fetched. Its value
+ // consists of multiple hashes separated by whitespace. [SRI]
+ get integrity () {
+ webidl.brandCheck(this, Request)
+
+ // The integrity getter steps are to return this’s request’s integrity
+ // metadata.
+ return this[kState].integrity
}
- return webidl.converters.DOMString(V)
-}
+ // Returns a boolean indicating whether or not request can outlive the
+ // global in which it was created.
+ get keepalive () {
+ webidl.brandCheck(this, Request)
-// https://fetch.spec.whatwg.org/#bodyinit
-webidl.converters.BodyInit = function (V) {
- if (V instanceof ReadableStream) {
- return webidl.converters.ReadableStream(V)
+ // The keepalive getter steps are to return this’s request’s keepalive.
+ return this[kState].keepalive
}
- // Note: the spec doesn't include async iterables,
- // this is an undici extension.
- if (V?.[Symbol.asyncIterator]) {
- return V
+ // Returns a boolean indicating whether or not request is for a reload
+ // navigation.
+ get isReloadNavigation () {
+ webidl.brandCheck(this, Request)
+
+ // The isReloadNavigation getter steps are to return true if this’s
+ // request’s reload-navigation flag is set; otherwise false.
+ return this[kState].reloadNavigation
}
- return webidl.converters.XMLHttpRequestBodyInit(V)
-}
+ // Returns a boolean indicating whether or not request is for a history
+ // navigation (a.k.a. back-forward navigation).
+ get isHistoryNavigation () {
+ webidl.brandCheck(this, Request)
-webidl.converters.ResponseInit = webidl.dictionaryConverter([
- {
- key: 'status',
- converter: webidl.converters['unsigned short'],
- defaultValue: 200
- },
- {
- key: 'statusText',
- converter: webidl.converters.ByteString,
- defaultValue: ''
- },
- {
- key: 'headers',
- converter: webidl.converters.HeadersInit
+ // The isHistoryNavigation getter steps are to return true if this’s request’s
+ // history-navigation flag is set; otherwise false.
+ return this[kState].historyNavigation
}
-])
-module.exports = {
- makeNetworkError,
- makeResponse,
- makeAppropriateNetworkError,
- filterResponse,
- Response,
- cloneResponse
-}
+ // Returns the signal associated with request, which is an AbortSignal
+ // object indicating whether or not request has been aborted, and its
+ // abort event handler.
+ get signal () {
+ webidl.brandCheck(this, Request)
+ // The signal getter steps are to return this’s signal.
+ return this[kSignal]
+ }
-/***/ }),
+ get body () {
+ webidl.brandCheck(this, Request)
-/***/ 5861:
-/***/ ((module) => {
+ return this[kState].body ? this[kState].body.stream : null
+ }
-"use strict";
+ get bodyUsed () {
+ webidl.brandCheck(this, Request)
+ return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
+ }
-module.exports = {
- kUrl: Symbol('url'),
- kHeaders: Symbol('headers'),
- kSignal: Symbol('signal'),
- kState: Symbol('state'),
- kGuard: Symbol('guard'),
- kRealm: Symbol('realm')
-}
+ get duplex () {
+ webidl.brandCheck(this, Request)
+ return 'half'
+ }
-/***/ }),
+ // Returns a clone of request.
+ clone () {
+ webidl.brandCheck(this, Request)
-/***/ 2538:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 1. If this is unusable, then throw a TypeError.
+ if (bodyUnusable(this)) {
+ throw new TypeError('unusable')
+ }
-"use strict";
+ // 2. Let clonedRequest be the result of cloning this’s request.
+ const clonedRequest = cloneRequest(this[kState])
+ // 3. Let clonedRequestObject be the result of creating a Request object,
+ // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
+ // 4. Make clonedRequestObject’s signal follow this’s signal.
+ const ac = new AbortController()
+ if (this.signal.aborted) {
+ ac.abort(this.signal.reason)
+ } else {
+ let list = dependentControllerMap.get(this.signal)
+ if (list === undefined) {
+ list = new Set()
+ dependentControllerMap.set(this.signal, list)
+ }
+ const acRef = new WeakRef(ac)
+ list.add(acRef)
+ util.addAbortListener(
+ ac.signal,
+ buildAbort(acRef)
+ )
+ }
-const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { performance } = __nccwpck_require__(4074)
-const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
-const assert = __nccwpck_require__(9491)
-const { isUint8Array } = __nccwpck_require__(9830)
+ // 4. Return clonedRequestObject.
+ return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))
+ }
-let supportedHashes = []
+ [nodeUtil.inspect.custom] (depth, options) {
+ if (options.depth === null) {
+ options.depth = 2
+ }
-// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
-/** @type {import('crypto')|undefined} */
-let crypto
+ options.colors ??= true
-try {
- crypto = __nccwpck_require__(6113)
- const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
- supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
-/* c8 ignore next 3 */
-} catch {
-}
+ const properties = {
+ method: this.method,
+ url: this.url,
+ headers: this.headers,
+ destination: this.destination,
+ referrer: this.referrer,
+ referrerPolicy: this.referrerPolicy,
+ mode: this.mode,
+ credentials: this.credentials,
+ cache: this.cache,
+ redirect: this.redirect,
+ integrity: this.integrity,
+ keepalive: this.keepalive,
+ isReloadNavigation: this.isReloadNavigation,
+ isHistoryNavigation: this.isHistoryNavigation,
+ signal: this.signal
+ }
-function responseURL (response) {
- // https://fetch.spec.whatwg.org/#responses
- // A response has an associated URL. It is a pointer to the last URL
- // in response’s URL list and null if response’s URL list is empty.
- const urlList = response.urlList
- const length = urlList.length
- return length === 0 ? null : urlList[length - 1].toString()
+ return `Request ${nodeUtil.formatWithOptions(options, properties)}`
+ }
}
-// https://fetch.spec.whatwg.org/#concept-response-location-url
-function responseLocationURL (response, requestFragment) {
- // 1. If response’s status is not a redirect status, then return null.
- if (!redirectStatusSet.has(response.status)) {
- return null
+mixinBody(Request)
+
+// https://fetch.spec.whatwg.org/#requests
+function makeRequest (init) {
+ return {
+ method: init.method ?? 'GET',
+ localURLsOnly: init.localURLsOnly ?? false,
+ unsafeRequest: init.unsafeRequest ?? false,
+ body: init.body ?? null,
+ client: init.client ?? null,
+ reservedClient: init.reservedClient ?? null,
+ replacesClientId: init.replacesClientId ?? '',
+ window: init.window ?? 'client',
+ keepalive: init.keepalive ?? false,
+ serviceWorkers: init.serviceWorkers ?? 'all',
+ initiator: init.initiator ?? '',
+ destination: init.destination ?? '',
+ priority: init.priority ?? null,
+ origin: init.origin ?? 'client',
+ policyContainer: init.policyContainer ?? 'client',
+ referrer: init.referrer ?? 'client',
+ referrerPolicy: init.referrerPolicy ?? '',
+ mode: init.mode ?? 'no-cors',
+ useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,
+ credentials: init.credentials ?? 'same-origin',
+ useCredentials: init.useCredentials ?? false,
+ cache: init.cache ?? 'default',
+ redirect: init.redirect ?? 'follow',
+ integrity: init.integrity ?? '',
+ cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',
+ parserMetadata: init.parserMetadata ?? '',
+ reloadNavigation: init.reloadNavigation ?? false,
+ historyNavigation: init.historyNavigation ?? false,
+ userActivation: init.userActivation ?? false,
+ taintedOrigin: init.taintedOrigin ?? false,
+ redirectCount: init.redirectCount ?? 0,
+ responseTainting: init.responseTainting ?? 'basic',
+ preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,
+ done: init.done ?? false,
+ timingAllowFailed: init.timingAllowFailed ?? false,
+ urlList: init.urlList,
+ url: init.urlList[0],
+ headersList: init.headersList
+ ? new HeadersList(init.headersList)
+ : new HeadersList()
}
+}
- // 2. Let location be the result of extracting header list values given
- // `Location` and response’s header list.
- let location = response.headersList.get('location')
+// https://fetch.spec.whatwg.org/#concept-request-clone
+function cloneRequest (request) {
+ // To clone a request request, run these steps:
- // 3. If location is a header value, then set location to the result of
- // parsing location with response’s URL.
- if (location !== null && isValidHeaderValue(location)) {
- location = new URL(location, responseURL(response))
- }
+ // 1. Let newRequest be a copy of request, except for its body.
+ const newRequest = makeRequest({ ...request, body: null })
- // 4. If location is a URL whose fragment is null, then set location’s
- // fragment to requestFragment.
- if (location && !location.hash) {
- location.hash = requestFragment
+ // 2. If request’s body is non-null, set newRequest’s body to the
+ // result of cloning request’s body.
+ if (request.body != null) {
+ newRequest.body = cloneBody(newRequest, request.body)
}
- // 5. Return location.
- return location
+ // 3. Return newRequest.
+ return newRequest
}
-/** @returns {URL} */
-function requestCurrentURL (request) {
- return request.urlList[request.urlList.length - 1]
+/**
+ * @see https://fetch.spec.whatwg.org/#request-create
+ * @param {any} innerRequest
+ * @param {AbortSignal} signal
+ * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard
+ * @returns {Request}
+ */
+function fromInnerRequest (innerRequest, signal, guard) {
+ const request = new Request(kConstruct)
+ request[kState] = innerRequest
+ request[kSignal] = signal
+ request[kHeaders] = new Headers(kConstruct)
+ setHeadersList(request[kHeaders], innerRequest.headersList)
+ setHeadersGuard(request[kHeaders], guard)
+ return request
}
-function requestBadPort (request) {
- // 1. Let url be request’s current URL.
- const url = requestCurrentURL(request)
-
- // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
- // then return blocked.
- if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
- return 'blocked'
+Object.defineProperties(Request.prototype, {
+ method: kEnumerableProperty,
+ url: kEnumerableProperty,
+ headers: kEnumerableProperty,
+ redirect: kEnumerableProperty,
+ clone: kEnumerableProperty,
+ signal: kEnumerableProperty,
+ duplex: kEnumerableProperty,
+ destination: kEnumerableProperty,
+ body: kEnumerableProperty,
+ bodyUsed: kEnumerableProperty,
+ isHistoryNavigation: kEnumerableProperty,
+ isReloadNavigation: kEnumerableProperty,
+ keepalive: kEnumerableProperty,
+ integrity: kEnumerableProperty,
+ cache: kEnumerableProperty,
+ credentials: kEnumerableProperty,
+ attribute: kEnumerableProperty,
+ referrerPolicy: kEnumerableProperty,
+ referrer: kEnumerableProperty,
+ mode: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'Request',
+ configurable: true
}
+})
- // 3. Return allowed.
- return 'allowed'
-}
+webidl.converters.Request = webidl.interfaceConverter(
+ Request
+)
-function isErrorLike (object) {
- return object instanceof Error || (
- object?.constructor?.name === 'Error' ||
- object?.constructor?.name === 'DOMException'
- )
-}
+// https://fetch.spec.whatwg.org/#requestinfo
+webidl.converters.RequestInfo = function (V, prefix, argument) {
+ if (typeof V === 'string') {
+ return webidl.converters.USVString(V, prefix, argument)
+ }
-// Check whether |statusText| is a ByteString and
-// matches the Reason-Phrase token production.
-// RFC 2616: https://tools.ietf.org/html/rfc2616
-// RFC 7230: https://tools.ietf.org/html/rfc7230
-// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
-// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
-function isValidReasonPhrase (statusText) {
- for (let i = 0; i < statusText.length; ++i) {
- const c = statusText.charCodeAt(i)
- if (
- !(
- (
- c === 0x09 || // HTAB
- (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
- (c >= 0x80 && c <= 0xff)
- ) // obs-text
- )
- ) {
- return false
- }
+ if (V instanceof Request) {
+ return webidl.converters.Request(V, prefix, argument)
}
- return true
+
+ return webidl.converters.USVString(V, prefix, argument)
}
-/**
- * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
- * @param {number} c
- */
-function isTokenCharCode (c) {
- switch (c) {
- case 0x22:
- case 0x28:
- case 0x29:
- case 0x2c:
- case 0x2f:
- case 0x3a:
- case 0x3b:
- case 0x3c:
- case 0x3d:
- case 0x3e:
- case 0x3f:
- case 0x40:
- case 0x5b:
- case 0x5c:
- case 0x5d:
- case 0x7b:
- case 0x7d:
- // DQUOTE and "(),/:;<=>?@[\]{}"
- return false
- default:
- // VCHAR %x21-7E
- return c >= 0x21 && c <= 0x7e
+webidl.converters.AbortSignal = webidl.interfaceConverter(
+ AbortSignal
+)
+
+// https://fetch.spec.whatwg.org/#requestinit
+webidl.converters.RequestInit = webidl.dictionaryConverter([
+ {
+ key: 'method',
+ converter: webidl.converters.ByteString
+ },
+ {
+ key: 'headers',
+ converter: webidl.converters.HeadersInit
+ },
+ {
+ key: 'body',
+ converter: webidl.nullableConverter(
+ webidl.converters.BodyInit
+ )
+ },
+ {
+ key: 'referrer',
+ converter: webidl.converters.USVString
+ },
+ {
+ key: 'referrerPolicy',
+ converter: webidl.converters.DOMString,
+ // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
+ allowedValues: referrerPolicy
+ },
+ {
+ key: 'mode',
+ converter: webidl.converters.DOMString,
+ // https://fetch.spec.whatwg.org/#concept-request-mode
+ allowedValues: requestMode
+ },
+ {
+ key: 'credentials',
+ converter: webidl.converters.DOMString,
+ // https://fetch.spec.whatwg.org/#requestcredentials
+ allowedValues: requestCredentials
+ },
+ {
+ key: 'cache',
+ converter: webidl.converters.DOMString,
+ // https://fetch.spec.whatwg.org/#requestcache
+ allowedValues: requestCache
+ },
+ {
+ key: 'redirect',
+ converter: webidl.converters.DOMString,
+ // https://fetch.spec.whatwg.org/#requestredirect
+ allowedValues: requestRedirect
+ },
+ {
+ key: 'integrity',
+ converter: webidl.converters.DOMString
+ },
+ {
+ key: 'keepalive',
+ converter: webidl.converters.boolean
+ },
+ {
+ key: 'signal',
+ converter: webidl.nullableConverter(
+ (signal) => webidl.converters.AbortSignal(
+ signal,
+ 'RequestInit',
+ 'signal',
+ { strict: false }
+ )
+ )
+ },
+ {
+ key: 'window',
+ converter: webidl.converters.any
+ },
+ {
+ key: 'duplex',
+ converter: webidl.converters.DOMString,
+ allowedValues: requestDuplex
+ },
+ {
+ key: 'dispatcher', // undici specific option
+ converter: webidl.converters.any
}
-}
+])
-/**
- * @param {string} characters
- */
-function isValidHTTPToken (characters) {
- if (characters.length === 0) {
- return false
- }
- for (let i = 0; i < characters.length; ++i) {
- if (!isTokenCharCode(characters.charCodeAt(i))) {
- return false
- }
- }
- return true
-}
+module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
-/**
- * @see https://fetch.spec.whatwg.org/#header-name
- * @param {string} potentialValue
- */
-function isValidHeaderName (potentialValue) {
- return isValidHTTPToken(potentialValue)
-}
-/**
- * @see https://fetch.spec.whatwg.org/#header-value
- * @param {string} potentialValue
- */
-function isValidHeaderValue (potentialValue) {
- // - Has no leading or trailing HTTP tab or space bytes.
- // - Contains no 0x00 (NUL) or HTTP newline bytes.
- if (
- potentialValue.startsWith('\t') ||
- potentialValue.startsWith(' ') ||
- potentialValue.endsWith('\t') ||
- potentialValue.endsWith(' ')
- ) {
- return false
- }
+/***/ }),
- if (
- potentialValue.includes('\0') ||
- potentialValue.includes('\r') ||
- potentialValue.includes('\n')
- ) {
- return false
- }
+/***/ 9051:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return true
-}
-// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
-function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
- // Given a request request and a response actualResponse, this algorithm
- // updates request’s referrer policy according to the Referrer-Policy
- // header (if any) in actualResponse.
- // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
- // from a Referrer-Policy header on actualResponse.
+const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(660)
+const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(4492)
+const util = __nccwpck_require__(3440)
+const nodeUtil = __nccwpck_require__(7975)
+const { kEnumerableProperty } = util
+const {
+ isValidReasonPhrase,
+ isCancelled,
+ isAborted,
+ isBlobLike,
+ serializeJavascriptValueToJSONString,
+ isErrorLike,
+ isomorphicEncode,
+ environmentSettingsObject: relevantRealm
+} = __nccwpck_require__(3168)
+const {
+ redirectStatusSet,
+ nullBodyStatus
+} = __nccwpck_require__(4495)
+const { kState, kHeaders } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { FormData } = __nccwpck_require__(5910)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { kConstruct } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { types } = __nccwpck_require__(7975)
- // 8.1 Parse a referrer policy from a Referrer-Policy header
- // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
- const { headersList } = actualResponse
- // 2. Let policy be the empty string.
- // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.
- // 4. Return policy.
- const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
+const textEncoder = new TextEncoder('utf-8')
- // Note: As the referrer-policy can contain multiple policies
- // separated by comma, we need to loop through all of them
- // and pick the first valid one.
- // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
- let policy = ''
- if (policyHeader.length > 0) {
- // The right-most policy takes precedence.
- // The left-most policy is the fallback.
- for (let i = policyHeader.length; i !== 0; i--) {
- const token = policyHeader[i - 1].trim()
- if (referrerPolicyTokens.has(token)) {
- policy = token
- break
- }
- }
- }
+// https://fetch.spec.whatwg.org/#response-class
+class Response {
+ // Creates network error Response.
+ static error () {
+ // The static error() method steps are to return the result of creating a
+ // Response object, given a new network error, "immutable", and this’s
+ // relevant Realm.
+ const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')
- // 2. If policy is not the empty string, then set request’s referrer policy to policy.
- if (policy !== '') {
- request.referrerPolicy = policy
+ return responseObject
}
-}
-
-// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
-function crossOriginResourcePolicyCheck () {
- // TODO
- return 'allowed'
-}
-
-// https://fetch.spec.whatwg.org/#concept-cors-check
-function corsCheck () {
- // TODO
- return 'success'
-}
-
-// https://fetch.spec.whatwg.org/#concept-tao-check
-function TAOCheck () {
- // TODO
- return 'success'
-}
-function appendFetchMetadata (httpRequest) {
- // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
- // TODO
+ // https://fetch.spec.whatwg.org/#dom-response-json
+ static json (data, init = {}) {
+ webidl.argumentLengthCheck(arguments, 1, 'Response.json')
- // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
+ if (init !== null) {
+ init = webidl.converters.ResponseInit(init)
+ }
- // 1. Assert: r’s url is a potentially trustworthy URL.
- // TODO
+ // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
+ const bytes = textEncoder.encode(
+ serializeJavascriptValueToJSONString(data)
+ )
- // 2. Let header be a Structured Header whose value is a token.
- let header = null
+ // 2. Let body be the result of extracting bytes.
+ const body = extractBody(bytes)
- // 3. Set header’s value to r’s mode.
- header = httpRequest.mode
+ // 3. Let responseObject be the result of creating a Response object, given a new response,
+ // "response", and this’s relevant Realm.
+ const responseObject = fromInnerResponse(makeResponse({}), 'response')
- // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
- httpRequest.headersList.set('sec-fetch-mode', header)
+ // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
+ initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
- // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
- // TODO
+ // 5. Return responseObject.
+ return responseObject
+ }
- // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
- // TODO
-}
+ // Creates a redirect Response that redirects to url with status status.
+ static redirect (url, status = 302) {
+ webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')
-// https://fetch.spec.whatwg.org/#append-a-request-origin-header
-function appendRequestOriginHeader (request) {
- // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
- let serializedOrigin = request.origin
+ url = webidl.converters.USVString(url)
+ status = webidl.converters['unsigned short'](status)
- // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
- if (request.responseTainting === 'cors' || request.mode === 'websocket') {
- if (serializedOrigin) {
- request.headersList.append('origin', serializedOrigin)
+ // 1. Let parsedURL be the result of parsing url with current settings
+ // object’s API base URL.
+ // 2. If parsedURL is failure, then throw a TypeError.
+ // TODO: base-URL?
+ let parsedURL
+ try {
+ parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)
+ } catch (err) {
+ throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })
}
- // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
- } else if (request.method !== 'GET' && request.method !== 'HEAD') {
- // 1. Switch on request’s referrer policy:
- switch (request.referrerPolicy) {
- case 'no-referrer':
- // Set serializedOrigin to `null`.
- serializedOrigin = null
- break
- case 'no-referrer-when-downgrade':
- case 'strict-origin':
- case 'strict-origin-when-cross-origin':
- // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`.
- if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
- serializedOrigin = null
- }
- break
- case 'same-origin':
- // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
- if (!sameOrigin(request, requestCurrentURL(request))) {
- serializedOrigin = null
- }
- break
- default:
- // Do nothing.
+ // 3. If status is not a redirect status, then throw a RangeError.
+ if (!redirectStatusSet.has(status)) {
+ throw new RangeError(`Invalid status code ${status}`)
}
- if (serializedOrigin) {
- // 2. Append (`Origin`, serializedOrigin) to request’s header list.
- request.headersList.append('origin', serializedOrigin)
- }
- }
-}
+ // 4. Let responseObject be the result of creating a Response object,
+ // given a new response, "immutable", and this’s relevant Realm.
+ const responseObject = fromInnerResponse(makeResponse({}), 'immutable')
-function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
- // TODO
- return performance.now()
-}
+ // 5. Set responseObject’s response’s status to status.
+ responseObject[kState].status = status
-// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
-function createOpaqueTimingInfo (timingInfo) {
- return {
- startTime: timingInfo.startTime ?? 0,
- redirectStartTime: 0,
- redirectEndTime: 0,
- postRedirectStartTime: timingInfo.startTime ?? 0,
- finalServiceWorkerStartTime: 0,
- finalNetworkResponseStartTime: 0,
- finalNetworkRequestStartTime: 0,
- endTime: 0,
- encodedBodySize: 0,
- decodedBodySize: 0,
- finalConnectionTimingInfo: null
- }
-}
+ // 6. Let value be parsedURL, serialized and isomorphic encoded.
+ const value = isomorphicEncode(URLSerializer(parsedURL))
-// https://html.spec.whatwg.org/multipage/origin.html#policy-container
-function makePolicyContainer () {
- // Note: the fetch spec doesn't make use of embedder policy or CSP list
- return {
- referrerPolicy: 'strict-origin-when-cross-origin'
- }
-}
+ // 7. Append `Location`/value to responseObject’s response’s header list.
+ responseObject[kState].headersList.append('location', value, true)
-// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
-function clonePolicyContainer (policyContainer) {
- return {
- referrerPolicy: policyContainer.referrerPolicy
+ // 8. Return responseObject.
+ return responseObject
}
-}
-// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
-function determineRequestsReferrer (request) {
- // 1. Let policy be request's referrer policy.
- const policy = request.referrerPolicy
+ // https://fetch.spec.whatwg.org/#dom-response
+ constructor (body = null, init = {}) {
+ webidl.util.markAsUncloneable(this)
+ if (body === kConstruct) {
+ return
+ }
- // Note: policy cannot (shouldn't) be null or an empty string.
- assert(policy)
+ if (body !== null) {
+ body = webidl.converters.BodyInit(body)
+ }
- // 2. Let environment be request’s client.
+ init = webidl.converters.ResponseInit(init)
- let referrerSource = null
+ // 1. Set this’s response to a new response.
+ this[kState] = makeResponse({})
- // 3. Switch on request’s referrer:
- if (request.referrer === 'client') {
- // Note: node isn't a browser and doesn't implement document/iframes,
- // so we bypass this step and replace it with our own.
+ // 2. Set this’s headers to a new Headers object with this’s relevant
+ // Realm, whose header list is this’s response’s header list and guard
+ // is "response".
+ this[kHeaders] = new Headers(kConstruct)
+ setHeadersGuard(this[kHeaders], 'response')
+ setHeadersList(this[kHeaders], this[kState].headersList)
- const globalOrigin = getGlobalOrigin()
+ // 3. Let bodyWithType be null.
+ let bodyWithType = null
- if (!globalOrigin || globalOrigin.origin === 'null') {
- return 'no-referrer'
+ // 4. If body is non-null, then set bodyWithType to the result of extracting body.
+ if (body != null) {
+ const [extractedBody, type] = extractBody(body)
+ bodyWithType = { body: extractedBody, type }
}
- // note: we need to clone it as it's mutated
- referrerSource = new URL(globalOrigin)
- } else if (request.referrer instanceof URL) {
- // Let referrerSource be request’s referrer.
- referrerSource = request.referrer
+ // 5. Perform initialize a response given this, init, and bodyWithType.
+ initializeResponse(this, init, bodyWithType)
}
- // 4. Let request’s referrerURL be the result of stripping referrerSource for
- // use as a referrer.
- let referrerURL = stripURLForReferrer(referrerSource)
-
- // 5. Let referrerOrigin be the result of stripping referrerSource for use as
- // a referrer, with the origin-only flag set to true.
- const referrerOrigin = stripURLForReferrer(referrerSource, true)
+ // Returns response’s type, e.g., "cors".
+ get type () {
+ webidl.brandCheck(this, Response)
- // 6. If the result of serializing referrerURL is a string whose length is
- // greater than 4096, set referrerURL to referrerOrigin.
- if (referrerURL.toString().length > 4096) {
- referrerURL = referrerOrigin
+ // The type getter steps are to return this’s response’s type.
+ return this[kState].type
}
- const areSameOrigin = sameOrigin(request, referrerURL)
- const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
- !isURLPotentiallyTrustworthy(request.url)
-
- // 8. Execute the switch statements corresponding to the value of policy:
- switch (policy) {
- case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
- case 'unsafe-url': return referrerURL
- case 'same-origin':
- return areSameOrigin ? referrerOrigin : 'no-referrer'
- case 'origin-when-cross-origin':
- return areSameOrigin ? referrerURL : referrerOrigin
- case 'strict-origin-when-cross-origin': {
- const currentURL = requestCurrentURL(request)
+ // Returns response’s URL, if it has one; otherwise the empty string.
+ get url () {
+ webidl.brandCheck(this, Response)
- // 1. If the origin of referrerURL and the origin of request’s current
- // URL are the same, then return referrerURL.
- if (sameOrigin(referrerURL, currentURL)) {
- return referrerURL
- }
+ const urlList = this[kState].urlList
- // 2. If referrerURL is a potentially trustworthy URL and request’s
- // current URL is not a potentially trustworthy URL, then return no
- // referrer.
- if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
- return 'no-referrer'
- }
+ // The url getter steps are to return the empty string if this’s
+ // response’s URL is null; otherwise this’s response’s URL,
+ // serialized with exclude fragment set to true.
+ const url = urlList[urlList.length - 1] ?? null
- // 3. Return referrerOrigin.
- return referrerOrigin
+ if (url === null) {
+ return ''
}
- case 'strict-origin': // eslint-disable-line
- /**
- * 1. If referrerURL is a potentially trustworthy URL and
- * request’s current URL is not a potentially trustworthy URL,
- * then return no referrer.
- * 2. Return referrerOrigin
- */
- case 'no-referrer-when-downgrade': // eslint-disable-line
- /**
- * 1. If referrerURL is a potentially trustworthy URL and
- * request’s current URL is not a potentially trustworthy URL,
- * then return no referrer.
- * 2. Return referrerOrigin
- */
- default: // eslint-disable-line
- return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
+ return URLSerializer(url, true)
}
-}
-/**
- * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
- * @param {URL} url
- * @param {boolean|undefined} originOnly
- */
-function stripURLForReferrer (url, originOnly) {
- // 1. Assert: url is a URL.
- assert(url instanceof URL)
+ // Returns whether response was obtained through a redirect.
+ get redirected () {
+ webidl.brandCheck(this, Response)
- // 2. If url’s scheme is a local scheme, then return no referrer.
- if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
- return 'no-referrer'
+ // The redirected getter steps are to return true if this’s response’s URL
+ // list has more than one item; otherwise false.
+ return this[kState].urlList.length > 1
}
- // 3. Set url’s username to the empty string.
- url.username = ''
-
- // 4. Set url’s password to the empty string.
- url.password = ''
+ // Returns response’s status.
+ get status () {
+ webidl.brandCheck(this, Response)
- // 5. Set url’s fragment to null.
- url.hash = ''
+ // The status getter steps are to return this’s response’s status.
+ return this[kState].status
+ }
- // 6. If the origin-only flag is true, then:
- if (originOnly) {
- // 1. Set url’s path to « the empty string ».
- url.pathname = ''
+ // Returns whether response’s status is an ok status.
+ get ok () {
+ webidl.brandCheck(this, Response)
- // 2. Set url’s query to null.
- url.search = ''
+ // The ok getter steps are to return true if this’s response’s status is an
+ // ok status; otherwise false.
+ return this[kState].status >= 200 && this[kState].status <= 299
}
- // 7. Return url.
- return url
-}
+ // Returns response’s status message.
+ get statusText () {
+ webidl.brandCheck(this, Response)
-function isURLPotentiallyTrustworthy (url) {
- if (!(url instanceof URL)) {
- return false
+ // The statusText getter steps are to return this’s response’s status
+ // message.
+ return this[kState].statusText
}
- // If child of about, return true
- if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
- return true
+ // Returns response’s headers as Headers.
+ get headers () {
+ webidl.brandCheck(this, Response)
+
+ // The headers getter steps are to return this’s headers.
+ return this[kHeaders]
}
- // If scheme is data, return true
- if (url.protocol === 'data:') return true
+ get body () {
+ webidl.brandCheck(this, Response)
- // If file, return true
- if (url.protocol === 'file:') return true
+ return this[kState].body ? this[kState].body.stream : null
+ }
- return isOriginPotentiallyTrustworthy(url.origin)
+ get bodyUsed () {
+ webidl.brandCheck(this, Response)
- function isOriginPotentiallyTrustworthy (origin) {
- // If origin is explicitly null, return false
- if (origin == null || origin === 'null') return false
+ return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
+ }
- const originAsURL = new URL(origin)
+ // Returns a clone of response.
+ clone () {
+ webidl.brandCheck(this, Response)
- // If secure, return true
- if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
- return true
+ // 1. If this is unusable, then throw a TypeError.
+ if (bodyUnusable(this)) {
+ throw webidl.errors.exception({
+ header: 'Response.clone',
+ message: 'Body has already been consumed.'
+ })
}
- // If localhost or variants, return true
- if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
- (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
- (originAsURL.hostname.endsWith('.localhost'))) {
- return true
+ // 2. Let clonedResponse be the result of cloning this’s response.
+ const clonedResponse = cloneResponse(this[kState])
+
+ // Note: To re-register because of a new stream.
+ if (hasFinalizationRegistry && this[kState].body?.stream) {
+ streamRegistry.register(this, new WeakRef(this[kState].body.stream))
}
- // If any other, return false
- return false
+ // 3. Return the result of creating a Response object, given
+ // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
+ return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))
}
-}
-/**
- * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
- * @param {Uint8Array} bytes
- * @param {string} metadataList
- */
-function bytesMatch (bytes, metadataList) {
- // If node is not built with OpenSSL support, we cannot check
- // a request's integrity, so allow it by default (the spec will
- // allow requests if an invalid hash is given, as precedence).
- /* istanbul ignore if: only if node is built with --without-ssl */
- if (crypto === undefined) {
- return true
- }
+ [nodeUtil.inspect.custom] (depth, options) {
+ if (options.depth === null) {
+ options.depth = 2
+ }
- // 1. Let parsedMetadata be the result of parsing metadataList.
- const parsedMetadata = parseMetadata(metadataList)
+ options.colors ??= true
- // 2. If parsedMetadata is no metadata, return true.
- if (parsedMetadata === 'no metadata') {
- return true
+ const properties = {
+ status: this.status,
+ statusText: this.statusText,
+ headers: this.headers,
+ body: this.body,
+ bodyUsed: this.bodyUsed,
+ ok: this.ok,
+ redirected: this.redirected,
+ type: this.type,
+ url: this.url
+ }
+
+ return `Response ${nodeUtil.formatWithOptions(options, properties)}`
}
+}
- // 3. If response is not eligible for integrity validation, return false.
- // TODO
+mixinBody(Response)
- // 4. If parsedMetadata is the empty set, return true.
- if (parsedMetadata.length === 0) {
- return true
+Object.defineProperties(Response.prototype, {
+ type: kEnumerableProperty,
+ url: kEnumerableProperty,
+ status: kEnumerableProperty,
+ ok: kEnumerableProperty,
+ redirected: kEnumerableProperty,
+ statusText: kEnumerableProperty,
+ headers: kEnumerableProperty,
+ clone: kEnumerableProperty,
+ body: kEnumerableProperty,
+ bodyUsed: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'Response',
+ configurable: true
}
+})
- // 5. Let metadata be the result of getting the strongest
- // metadata from parsedMetadata.
- const strongest = getStrongestMetadata(parsedMetadata)
- const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
+Object.defineProperties(Response, {
+ json: kEnumerableProperty,
+ redirect: kEnumerableProperty,
+ error: kEnumerableProperty
+})
- // 6. For each item in metadata:
- for (const item of metadata) {
- // 1. Let algorithm be the alg component of item.
- const algorithm = item.algo
+// https://fetch.spec.whatwg.org/#concept-response-clone
+function cloneResponse (response) {
+ // To clone a response response, run these steps:
- // 2. Let expectedValue be the val component of item.
- const expectedValue = item.hash
+ // 1. If response is a filtered response, then return a new identical
+ // filtered response whose internal response is a clone of response’s
+ // internal response.
+ if (response.internalResponse) {
+ return filterResponse(
+ cloneResponse(response.internalResponse),
+ response.type
+ )
+ }
- // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
- // "be liberal with padding". This is annoying, and it's not even in the spec.
+ // 2. Let newResponse be a copy of response, except for its body.
+ const newResponse = makeResponse({ ...response, body: null })
- // 3. Let actualValue be the result of applying algorithm to bytes.
- let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
+ // 3. If response’s body is non-null, then set newResponse’s body to the
+ // result of cloning response’s body.
+ if (response.body != null) {
+ newResponse.body = cloneBody(newResponse, response.body)
+ }
- if (actualValue[actualValue.length - 1] === '=') {
- if (actualValue[actualValue.length - 2] === '=') {
- actualValue = actualValue.slice(0, -2)
- } else {
- actualValue = actualValue.slice(0, -1)
- }
- }
+ // 4. Return newResponse.
+ return newResponse
+}
- // 4. If actualValue is a case-sensitive match for expectedValue,
- // return true.
- if (compareBase64Mixed(actualValue, expectedValue)) {
- return true
- }
+function makeResponse (init) {
+ return {
+ aborted: false,
+ rangeRequested: false,
+ timingAllowPassed: false,
+ requestIncludesCredentials: false,
+ type: 'default',
+ status: 200,
+ timingInfo: null,
+ cacheState: '',
+ statusText: '',
+ ...init,
+ headersList: init?.headersList
+ ? new HeadersList(init?.headersList)
+ : new HeadersList(),
+ urlList: init?.urlList ? [...init.urlList] : []
}
+}
- // 7. Return false.
- return false
+function makeNetworkError (reason) {
+ const isError = isErrorLike(reason)
+ return makeResponse({
+ type: 'error',
+ status: 0,
+ error: isError
+ ? reason
+ : new Error(reason ? String(reason) : reason),
+ aborted: reason && reason.name === 'AbortError'
+ })
}
-// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
-// https://www.w3.org/TR/CSP2/#source-list-syntax
-// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
-const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
+// @see https://fetch.spec.whatwg.org/#concept-network-error
+function isNetworkError (response) {
+ return (
+ // A network error is a response whose type is "error",
+ response.type === 'error' &&
+ // status is 0
+ response.status === 0
+ )
+}
-/**
- * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
- * @param {string} metadata
- */
-function parseMetadata (metadata) {
- // 1. Let result be the empty set.
- /** @type {{ algo: string, hash: string }[]} */
- const result = []
+function makeFilteredResponse (response, state) {
+ state = {
+ internalResponse: response,
+ ...state
+ }
- // 2. Let empty be equal to true.
- let empty = true
+ return new Proxy(response, {
+ get (target, p) {
+ return p in state ? state[p] : target[p]
+ },
+ set (target, p, value) {
+ assert(!(p in state))
+ target[p] = value
+ return true
+ }
+ })
+}
- // 3. For each token returned by splitting metadata on spaces:
- for (const token of metadata.split(' ')) {
- // 1. Set empty to false.
- empty = false
+// https://fetch.spec.whatwg.org/#concept-filtered-response
+function filterResponse (response, type) {
+ // Set response to the following filtered response with response as its
+ // internal response, depending on request’s response tainting:
+ if (type === 'basic') {
+ // A basic filtered response is a filtered response whose type is "basic"
+ // and header list excludes any headers in internal response’s header list
+ // whose name is a forbidden response-header name.
- // 2. Parse token as a hash-with-options.
- const parsedToken = parseHashWithOptions.exec(token)
+ // Note: undici does not implement forbidden response-header names
+ return makeFilteredResponse(response, {
+ type: 'basic',
+ headersList: response.headersList
+ })
+ } else if (type === 'cors') {
+ // A CORS filtered response is a filtered response whose type is "cors"
+ // and header list excludes any headers in internal response’s header
+ // list whose name is not a CORS-safelisted response-header name, given
+ // internal response’s CORS-exposed header-name list.
- // 3. If token does not parse, continue to the next token.
- if (
- parsedToken === null ||
- parsedToken.groups === undefined ||
- parsedToken.groups.algo === undefined
- ) {
- // Note: Chromium blocks the request at this point, but Firefox
- // gives a warning that an invalid integrity was given. The
- // correct behavior is to ignore these, and subsequently not
- // check the integrity of the resource.
- continue
- }
+ // Note: undici does not implement CORS-safelisted response-header names
+ return makeFilteredResponse(response, {
+ type: 'cors',
+ headersList: response.headersList
+ })
+ } else if (type === 'opaque') {
+ // An opaque filtered response is a filtered response whose type is
+ // "opaque", URL list is the empty list, status is 0, status message
+ // is the empty byte sequence, header list is empty, and body is null.
- // 4. Let algorithm be the hash-algo component of token.
- const algorithm = parsedToken.groups.algo.toLowerCase()
+ return makeFilteredResponse(response, {
+ type: 'opaque',
+ urlList: Object.freeze([]),
+ status: 0,
+ statusText: '',
+ body: null
+ })
+ } else if (type === 'opaqueredirect') {
+ // An opaque-redirect filtered response is a filtered response whose type
+ // is "opaqueredirect", status is 0, status message is the empty byte
+ // sequence, header list is empty, and body is null.
- // 5. If algorithm is a hash function recognized by the user
- // agent, add the parsed token to result.
- if (supportedHashes.includes(algorithm)) {
- result.push(parsedToken.groups)
- }
+ return makeFilteredResponse(response, {
+ type: 'opaqueredirect',
+ status: 0,
+ statusText: '',
+ headersList: [],
+ body: null
+ })
+ } else {
+ assert(false)
}
+}
- // 4. Return no metadata if empty is true, otherwise return result.
- if (empty === true) {
- return 'no metadata'
- }
+// https://fetch.spec.whatwg.org/#appropriate-network-error
+function makeAppropriateNetworkError (fetchParams, err = null) {
+ // 1. Assert: fetchParams is canceled.
+ assert(isCancelled(fetchParams))
- return result
+ // 2. Return an aborted network error if fetchParams is aborted;
+ // otherwise return a network error.
+ return isAborted(fetchParams)
+ ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
+ : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
}
-/**
- * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
- */
-function getStrongestMetadata (metadataList) {
- // Let algorithm be the algo component of the first item in metadataList.
- // Can be sha256
- let algorithm = metadataList[0].algo
- // If the algorithm is sha512, then it is the strongest
- // and we can return immediately
- if (algorithm[3] === '5') {
- return algorithm
+// https://whatpr.org/fetch/1392.html#initialize-a-response
+function initializeResponse (response, init, body) {
+ // 1. If init["status"] is not in the range 200 to 599, inclusive, then
+ // throw a RangeError.
+ if (init.status !== null && (init.status < 200 || init.status > 599)) {
+ throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
}
- for (let i = 1; i < metadataList.length; ++i) {
- const metadata = metadataList[i]
- // If the algorithm is sha512, then it is the strongest
- // and we can break the loop immediately
- if (metadata.algo[3] === '5') {
- algorithm = 'sha512'
- break
- // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
- } else if (algorithm[3] === '3') {
- continue
- // algorithm is sha256, check if algorithm is sha384 and if so, set it as
- // the strongest
- } else if (metadata.algo[3] === '3') {
- algorithm = 'sha384'
+ // 2. If init["statusText"] does not match the reason-phrase token production,
+ // then throw a TypeError.
+ if ('statusText' in init && init.statusText != null) {
+ // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
+ // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
+ if (!isValidReasonPhrase(String(init.statusText))) {
+ throw new TypeError('Invalid statusText')
}
}
- return algorithm
-}
-function filterMetadataListByAlgorithm (metadataList, algorithm) {
- if (metadataList.length === 1) {
- return metadataList
+ // 3. Set response’s response’s status to init["status"].
+ if ('status' in init && init.status != null) {
+ response[kState].status = init.status
}
- let pos = 0
- for (let i = 0; i < metadataList.length; ++i) {
- if (metadataList[i].algo === algorithm) {
- metadataList[pos++] = metadataList[i]
- }
+ // 4. Set response’s response’s status message to init["statusText"].
+ if ('statusText' in init && init.statusText != null) {
+ response[kState].statusText = init.statusText
}
- metadataList.length = pos
-
- return metadataList
-}
-
-/**
- * Compares two base64 strings, allowing for base64url
- * in the second string.
- *
-* @param {string} actualValue always base64
- * @param {string} expectedValue base64 or base64url
- * @returns {boolean}
- */
-function compareBase64Mixed (actualValue, expectedValue) {
- if (actualValue.length !== expectedValue.length) {
- return false
+ // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
+ if ('headers' in init && init.headers != null) {
+ fill(response[kHeaders], init.headers)
}
- for (let i = 0; i < actualValue.length; ++i) {
- if (actualValue[i] !== expectedValue[i]) {
- if (
- (actualValue[i] === '+' && expectedValue[i] === '-') ||
- (actualValue[i] === '/' && expectedValue[i] === '_')
- ) {
- continue
- }
- return false
+
+ // 6. If body was given, then:
+ if (body) {
+ // 1. If response's status is a null body status, then throw a TypeError.
+ if (nullBodyStatus.includes(response.status)) {
+ throw webidl.errors.exception({
+ header: 'Response constructor',
+ message: `Invalid response status code ${response.status}`
+ })
}
- }
- return true
-}
+ // 2. Set response's body to body's body.
+ response[kState].body = body.body
-// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
-function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
- // TODO
+ // 3. If body's type is non-null and response's header list does not contain
+ // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
+ if (body.type != null && !response[kState].headersList.contains('content-type', true)) {
+ response[kState].headersList.append('content-type', body.type, true)
+ }
+ }
}
/**
- * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
- * @param {URL} A
- * @param {URL} B
+ * @see https://fetch.spec.whatwg.org/#response-create
+ * @param {any} innerResponse
+ * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard
+ * @returns {Response}
*/
-function sameOrigin (A, B) {
- // 1. If A and B are the same opaque origin, then return true.
- if (A.origin === B.origin && A.origin === 'null') {
- return true
- }
+function fromInnerResponse (innerResponse, guard) {
+ const response = new Response(kConstruct)
+ response[kState] = innerResponse
+ response[kHeaders] = new Headers(kConstruct)
+ setHeadersList(response[kHeaders], innerResponse.headersList)
+ setHeadersGuard(response[kHeaders], guard)
- // 2. If A and B are both tuple origins and their schemes,
- // hosts, and port are identical, then return true.
- if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
- return true
+ if (hasFinalizationRegistry && innerResponse.body?.stream) {
+ // If the target (response) is reclaimed, the cleanup callback may be called at some point with
+ // the held value provided for it (innerResponse.body.stream). The held value can be any value:
+ // a primitive or an object, even undefined. If the held value is an object, the registry keeps
+ // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
+ streamRegistry.register(response, new WeakRef(innerResponse.body.stream))
}
- // 3. Return false.
- return false
-}
-
-function createDeferredPromise () {
- let res
- let rej
- const promise = new Promise((resolve, reject) => {
- res = resolve
- rej = reject
- })
-
- return { promise, resolve: res, reject: rej }
+ return response
}
-function isAborted (fetchParams) {
- return fetchParams.controller.state === 'aborted'
-}
+webidl.converters.ReadableStream = webidl.interfaceConverter(
+ ReadableStream
+)
-function isCancelled (fetchParams) {
- return fetchParams.controller.state === 'aborted' ||
- fetchParams.controller.state === 'terminated'
-}
+webidl.converters.FormData = webidl.interfaceConverter(
+ FormData
+)
-const normalizeMethodRecord = {
- delete: 'DELETE',
- DELETE: 'DELETE',
- get: 'GET',
- GET: 'GET',
- head: 'HEAD',
- HEAD: 'HEAD',
- options: 'OPTIONS',
- OPTIONS: 'OPTIONS',
- post: 'POST',
- POST: 'POST',
- put: 'PUT',
- PUT: 'PUT'
-}
+webidl.converters.URLSearchParams = webidl.interfaceConverter(
+ URLSearchParams
+)
-// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
-Object.setPrototypeOf(normalizeMethodRecord, null)
+// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
+webidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {
+ if (typeof V === 'string') {
+ return webidl.converters.USVString(V, prefix, name)
+ }
-/**
- * @see https://fetch.spec.whatwg.org/#concept-method-normalize
- * @param {string} method
- */
-function normalizeMethod (method) {
- return normalizeMethodRecord[method.toLowerCase()] ?? method
-}
+ if (isBlobLike(V)) {
+ return webidl.converters.Blob(V, prefix, name, { strict: false })
+ }
-// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
-function serializeJavascriptValueToJSONString (value) {
- // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
- const result = JSON.stringify(value)
+ if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {
+ return webidl.converters.BufferSource(V, prefix, name)
+ }
- // 2. If result is undefined, then throw a TypeError.
- if (result === undefined) {
- throw new TypeError('Value is not JSON serializable')
+ if (util.isFormDataLike(V)) {
+ return webidl.converters.FormData(V, prefix, name, { strict: false })
}
- // 3. Assert: result is a string.
- assert(typeof result === 'string')
+ if (V instanceof URLSearchParams) {
+ return webidl.converters.URLSearchParams(V, prefix, name)
+ }
- // 4. Return result.
- return result
+ return webidl.converters.DOMString(V, prefix, name)
}
-// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
-const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
+// https://fetch.spec.whatwg.org/#bodyinit
+webidl.converters.BodyInit = function (V, prefix, argument) {
+ if (V instanceof ReadableStream) {
+ return webidl.converters.ReadableStream(V, prefix, argument)
+ }
-/**
- * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
- * @param {() => unknown[]} iterator
- * @param {string} name name of the instance
- * @param {'key'|'value'|'key+value'} kind
- */
-function makeIterator (iterator, name, kind) {
- const object = {
- index: 0,
- kind,
- target: iterator
+ // Note: the spec doesn't include async iterables,
+ // this is an undici extension.
+ if (V?.[Symbol.asyncIterator]) {
+ return V
}
- const i = {
- next () {
- // 1. Let interface be the interface for which the iterator prototype object exists.
+ return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)
+}
- // 2. Let thisValue be the this value.
+webidl.converters.ResponseInit = webidl.dictionaryConverter([
+ {
+ key: 'status',
+ converter: webidl.converters['unsigned short'],
+ defaultValue: () => 200
+ },
+ {
+ key: 'statusText',
+ converter: webidl.converters.ByteString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'headers',
+ converter: webidl.converters.HeadersInit
+ }
+])
- // 3. Let object be ? ToObject(thisValue).
+module.exports = {
+ isNetworkError,
+ makeNetworkError,
+ makeResponse,
+ makeAppropriateNetworkError,
+ filterResponse,
+ Response,
+ cloneResponse,
+ fromInnerResponse
+}
- // 4. If object is a platform object, then perform a security
- // check, passing:
- // 5. If object is not a default iterator object for interface,
- // then throw a TypeError.
- if (Object.getPrototypeOf(this) !== i) {
- throw new TypeError(
- `'next' called on an object that does not implement interface ${name} Iterator.`
- )
- }
+/***/ }),
- // 6. Let index be object’s index.
- // 7. Let kind be object’s kind.
- // 8. Let values be object’s target's value pairs to iterate over.
- const { index, kind, target } = object
- const values = target()
+/***/ 3627:
+/***/ ((module) => {
- // 9. Let len be the length of values.
- const len = values.length
- // 10. If index is greater than or equal to len, then return
- // CreateIterResultObject(undefined, true).
- if (index >= len) {
- return { value: undefined, done: true }
- }
- // 11. Let pair be the entry in values at index index.
- const pair = values[index]
+module.exports = {
+ kUrl: Symbol('url'),
+ kHeaders: Symbol('headers'),
+ kSignal: Symbol('signal'),
+ kState: Symbol('state'),
+ kDispatcher: Symbol('dispatcher')
+}
- // 12. Set object’s index to index + 1.
- object.index = index + 1
- // 13. Return the iterator result for pair and kind.
- return iteratorResult(pair, kind)
- },
- // The class string of an iterator prototype object for a given interface is the
- // result of concatenating the identifier of the interface and the string " Iterator".
- [Symbol.toStringTag]: `${name} Iterator`
- }
-
- // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
- Object.setPrototypeOf(i, esIteratorPrototype)
- // esIteratorPrototype needs to be the prototype of i
- // which is the prototype of an empty object. Yes, it's confusing.
- return Object.setPrototypeOf({}, i)
-}
-
-// https://webidl.spec.whatwg.org/#iterator-result
-function iteratorResult (pair, kind) {
- let result
-
- // 1. Let result be a value determined by the value of kind:
- switch (kind) {
- case 'key': {
- // 1. Let idlKey be pair’s key.
- // 2. Let key be the result of converting idlKey to an
- // ECMAScript value.
- // 3. result is key.
- result = pair[0]
- break
- }
- case 'value': {
- // 1. Let idlValue be pair’s value.
- // 2. Let value be the result of converting idlValue to
- // an ECMAScript value.
- // 3. result is value.
- result = pair[1]
- break
- }
- case 'key+value': {
- // 1. Let idlKey be pair’s key.
- // 2. Let idlValue be pair’s value.
- // 3. Let key be the result of converting idlKey to an
- // ECMAScript value.
- // 4. Let value be the result of converting idlValue to
- // an ECMAScript value.
- // 5. Let array be ! ArrayCreate(2).
- // 6. Call ! CreateDataProperty(array, "0", key).
- // 7. Call ! CreateDataProperty(array, "1", value).
- // 8. result is array.
- result = pair
- break
- }
- }
+/***/ }),
- // 2. Return CreateIterResultObject(result, false).
- return { value: result, done: false }
-}
+/***/ 3168:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/**
- * @see https://fetch.spec.whatwg.org/#body-fully-read
- */
-async function fullyReadBody (body, processBody, processBodyError) {
- // 1. If taskDestination is null, then set taskDestination to
- // the result of starting a new parallel queue.
- // 2. Let successSteps given a byte sequence bytes be to queue a
- // fetch task to run processBody given bytes, with taskDestination.
- const successSteps = processBody
- // 3. Let errorSteps be to queue a fetch task to run processBodyError,
- // with taskDestination.
- const errorSteps = processBodyError
+const { Transform } = __nccwpck_require__(7075)
+const zlib = __nccwpck_require__(8522)
+const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(4495)
+const { getGlobalOrigin } = __nccwpck_require__(1059)
+const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(1900)
+const { performance } = __nccwpck_require__(643)
+const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3440)
+const assert = __nccwpck_require__(4589)
+const { isUint8Array } = __nccwpck_require__(3429)
+const { webidl } = __nccwpck_require__(5893)
- // 4. Let reader be the result of getting a reader for body’s stream.
- // If that threw an exception, then run errorSteps with that
- // exception and return.
- let reader
+let supportedHashes = []
- try {
- reader = body.stream.getReader()
- } catch (e) {
- errorSteps(e)
- return
- }
+// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
+/** @type {import('crypto')} */
+let crypto
+try {
+ crypto = __nccwpck_require__(7598)
+ const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
+ supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
+/* c8 ignore next 3 */
+} catch {
- // 5. Read all bytes from reader, given successSteps and errorSteps.
- try {
- const result = await readAllBytes(reader)
- successSteps(result)
- } catch (e) {
- errorSteps(e)
- }
}
-/** @type {ReadableStream} */
-let ReadableStream = globalThis.ReadableStream
+function responseURL (response) {
+ // https://fetch.spec.whatwg.org/#responses
+ // A response has an associated URL. It is a pointer to the last URL
+ // in response’s URL list and null if response’s URL list is empty.
+ const urlList = response.urlList
+ const length = urlList.length
+ return length === 0 ? null : urlList[length - 1].toString()
+}
-function isReadableStreamLike (stream) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
+// https://fetch.spec.whatwg.org/#concept-response-location-url
+function responseLocationURL (response, requestFragment) {
+ // 1. If response’s status is not a redirect status, then return null.
+ if (!redirectStatusSet.has(response.status)) {
+ return null
}
- return stream instanceof ReadableStream || (
- stream[Symbol.toStringTag] === 'ReadableStream' &&
- typeof stream.tee === 'function'
- )
-}
-
-const MAXIMUM_ARGUMENT_LENGTH = 65535
+ // 2. Let location be the result of extracting header list values given
+ // `Location` and response’s header list.
+ let location = response.headersList.get('location', true)
-/**
- * @see https://infra.spec.whatwg.org/#isomorphic-decode
- * @param {number[]|Uint8Array} input
- */
-function isomorphicDecode (input) {
- // 1. To isomorphic decode a byte sequence input, return a string whose code point
- // length is equal to input’s length and whose code points have the same values
- // as the values of input’s bytes, in the same order.
+ // 3. If location is a header value, then set location to the result of
+ // parsing location with response’s URL.
+ if (location !== null && isValidHeaderValue(location)) {
+ if (!isValidEncodedURL(location)) {
+ // Some websites respond location header in UTF-8 form without encoding them as ASCII
+ // and major browsers redirect them to correctly UTF-8 encoded addresses.
+ // Here, we handle that behavior in the same way.
+ location = normalizeBinaryStringToUtf8(location)
+ }
+ location = new URL(location, responseURL(response))
+ }
- if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
- return String.fromCharCode(...input)
+ // 4. If location is a URL whose fragment is null, then set location’s
+ // fragment to requestFragment.
+ if (location && !location.hash) {
+ location.hash = requestFragment
}
- return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
+ // 5. Return location.
+ return location
}
/**
- * @param {ReadableStreamController} controller
+ * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2
+ * @param {string} url
+ * @returns {boolean}
*/
-function readableStreamClose (controller) {
- try {
- controller.close()
- } catch (err) {
- // TODO: add comment explaining why this error occurs.
- if (!err.message.includes('Controller is already closed')) {
- throw err
+function isValidEncodedURL (url) {
+ for (let i = 0; i < url.length; ++i) {
+ const code = url.charCodeAt(i)
+
+ if (
+ code > 0x7E || // Non-US-ASCII + DEL
+ code < 0x20 // Control characters NUL - US
+ ) {
+ return false
}
}
+ return true
}
/**
- * @see https://infra.spec.whatwg.org/#isomorphic-encode
- * @param {string} input
+ * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.
+ * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.
+ * @param {string} value
+ * @returns {string}
*/
-function isomorphicEncode (input) {
- // 1. Assert: input contains no code points greater than U+00FF.
- for (let i = 0; i < input.length; i++) {
- assert(input.charCodeAt(i) <= 0xFF)
- }
-
- // 2. Return a byte sequence whose length is equal to input’s code
- // point length and whose bytes have the same values as the
- // values of input’s code points, in the same order
- return input
+function normalizeBinaryStringToUtf8 (value) {
+ return Buffer.from(value, 'binary').toString('utf8')
}
-/**
- * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
- * @see https://streams.spec.whatwg.org/#read-loop
- * @param {ReadableStreamDefaultReader} reader
- */
-async function readAllBytes (reader) {
- const bytes = []
- let byteLength = 0
+/** @returns {URL} */
+function requestCurrentURL (request) {
+ return request.urlList[request.urlList.length - 1]
+}
- while (true) {
- const { done, value: chunk } = await reader.read()
+function requestBadPort (request) {
+ // 1. Let url be request’s current URL.
+ const url = requestCurrentURL(request)
- if (done) {
- // 1. Call successSteps with bytes.
- return Buffer.concat(bytes, byteLength)
- }
+ // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
+ // then return blocked.
+ if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
+ return 'blocked'
+ }
- // 1. If chunk is not a Uint8Array object, call failureSteps
- // with a TypeError and abort these steps.
- if (!isUint8Array(chunk)) {
- throw new TypeError('Received non-Uint8Array chunk')
- }
+ // 3. Return allowed.
+ return 'allowed'
+}
- // 2. Append the bytes represented by chunk to bytes.
- bytes.push(chunk)
- byteLength += chunk.length
+function isErrorLike (object) {
+ return object instanceof Error || (
+ object?.constructor?.name === 'Error' ||
+ object?.constructor?.name === 'DOMException'
+ )
+}
- // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
+// Check whether |statusText| is a ByteString and
+// matches the Reason-Phrase token production.
+// RFC 2616: https://tools.ietf.org/html/rfc2616
+// RFC 7230: https://tools.ietf.org/html/rfc7230
+// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
+// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
+function isValidReasonPhrase (statusText) {
+ for (let i = 0; i < statusText.length; ++i) {
+ const c = statusText.charCodeAt(i)
+ if (
+ !(
+ (
+ c === 0x09 || // HTAB
+ (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
+ (c >= 0x80 && c <= 0xff)
+ ) // obs-text
+ )
+ ) {
+ return false
+ }
}
+ return true
}
/**
- * @see https://fetch.spec.whatwg.org/#is-local
- * @param {URL} url
+ * @see https://fetch.spec.whatwg.org/#header-name
+ * @param {string} potentialValue
*/
-function urlIsLocal (url) {
- assert('protocol' in url) // ensure it's a url object
-
- const protocol = url.protocol
-
- return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
-}
+const isValidHeaderName = isValidHTTPToken
/**
- * @param {string|URL} url
+ * @see https://fetch.spec.whatwg.org/#header-value
+ * @param {string} potentialValue
*/
-function urlHasHttpsScheme (url) {
- if (typeof url === 'string') {
- return url.startsWith('https:')
- }
-
- return url.protocol === 'https:'
+function isValidHeaderValue (potentialValue) {
+ // - Has no leading or trailing HTTP tab or space bytes.
+ // - Contains no 0x00 (NUL) or HTTP newline bytes.
+ return (
+ potentialValue[0] === '\t' ||
+ potentialValue[0] === ' ' ||
+ potentialValue[potentialValue.length - 1] === '\t' ||
+ potentialValue[potentialValue.length - 1] === ' ' ||
+ potentialValue.includes('\n') ||
+ potentialValue.includes('\r') ||
+ potentialValue.includes('\0')
+ ) === false
}
-/**
- * @see https://fetch.spec.whatwg.org/#http-scheme
- * @param {URL} url
- */
-function urlIsHttpHttpsScheme (url) {
- assert('protocol' in url) // ensure it's a url object
+// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
+function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
+ // Given a request request and a response actualResponse, this algorithm
+ // updates request’s referrer policy according to the Referrer-Policy
+ // header (if any) in actualResponse.
- const protocol = url.protocol
+ // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
+ // from a Referrer-Policy header on actualResponse.
- return protocol === 'http:' || protocol === 'https:'
+ // 8.1 Parse a referrer policy from a Referrer-Policy header
+ // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
+ const { headersList } = actualResponse
+ // 2. Let policy be the empty string.
+ // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.
+ // 4. Return policy.
+ const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')
+
+ // Note: As the referrer-policy can contain multiple policies
+ // separated by comma, we need to loop through all of them
+ // and pick the first valid one.
+ // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
+ let policy = ''
+ if (policyHeader.length > 0) {
+ // The right-most policy takes precedence.
+ // The left-most policy is the fallback.
+ for (let i = policyHeader.length; i !== 0; i--) {
+ const token = policyHeader[i - 1].trim()
+ if (referrerPolicyTokens.has(token)) {
+ policy = token
+ break
+ }
+ }
+ }
+
+ // 2. If policy is not the empty string, then set request’s referrer policy to policy.
+ if (policy !== '') {
+ request.referrerPolicy = policy
+ }
}
-/**
- * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
- */
-const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
+// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
+function crossOriginResourcePolicyCheck () {
+ // TODO
+ return 'allowed'
+}
-module.exports = {
- isAborted,
- isCancelled,
- createDeferredPromise,
- ReadableStreamFrom,
- toUSVString,
- tryUpgradeRequestToAPotentiallyTrustworthyURL,
- coarsenedSharedCurrentTime,
- determineRequestsReferrer,
- makePolicyContainer,
- clonePolicyContainer,
- appendFetchMetadata,
- appendRequestOriginHeader,
- TAOCheck,
- corsCheck,
- crossOriginResourcePolicyCheck,
- createOpaqueTimingInfo,
- setRequestReferrerPolicyOnRedirect,
- isValidHTTPToken,
- requestBadPort,
- requestCurrentURL,
- responseURL,
- responseLocationURL,
- isBlobLike,
- isURLPotentiallyTrustworthy,
- isValidReasonPhrase,
- sameOrigin,
- normalizeMethod,
- serializeJavascriptValueToJSONString,
- makeIterator,
- isValidHeaderName,
- isValidHeaderValue,
- hasOwn,
- isErrorLike,
- fullyReadBody,
- bytesMatch,
- isReadableStreamLike,
- readableStreamClose,
- isomorphicEncode,
- isomorphicDecode,
- urlIsLocal,
- urlHasHttpsScheme,
- urlIsHttpHttpsScheme,
- readAllBytes,
- normalizeMethodRecord,
- parseMetadata
+// https://fetch.spec.whatwg.org/#concept-cors-check
+function corsCheck () {
+ // TODO
+ return 'success'
+}
+
+// https://fetch.spec.whatwg.org/#concept-tao-check
+function TAOCheck () {
+ // TODO
+ return 'success'
}
+function appendFetchMetadata (httpRequest) {
+ // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
+ // TODO
-/***/ }),
+ // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
-/***/ 1744:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 1. Assert: r’s url is a potentially trustworthy URL.
+ // TODO
-"use strict";
+ // 2. Let header be a Structured Header whose value is a token.
+ let header = null
+ // 3. Set header’s value to r’s mode.
+ header = httpRequest.mode
-const { types } = __nccwpck_require__(3837)
-const { hasOwn, toUSVString } = __nccwpck_require__(2538)
+ // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
+ httpRequest.headersList.set('sec-fetch-mode', header, true)
-/** @type {import('../../types/webidl').Webidl} */
-const webidl = {}
-webidl.converters = {}
-webidl.util = {}
-webidl.errors = {}
+ // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
+ // TODO
-webidl.errors.exception = function (message) {
- return new TypeError(`${message.header}: ${message.message}`)
+ // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
+ // TODO
}
-webidl.errors.conversionFailed = function (context) {
- const plural = context.types.length === 1 ? '' : ' one of'
- const message =
- `${context.argument} could not be converted to` +
- `${plural}: ${context.types.join(', ')}.`
+// https://fetch.spec.whatwg.org/#append-a-request-origin-header
+function appendRequestOriginHeader (request) {
+ // 1. Let serializedOrigin be the result of byte-serializing a request origin
+ // with request.
+ // TODO: implement "byte-serializing a request origin"
+ let serializedOrigin = request.origin
- return webidl.errors.exception({
- header: context.prefix,
- message
- })
+ // - "'client' is changed to an origin during fetching."
+ // This doesn't happen in undici (in most cases) because undici, by default,
+ // has no concept of origin.
+ // - request.origin can also be set to request.client.origin (client being
+ // an environment settings object), which is undefined without using
+ // setGlobalOrigin.
+ if (serializedOrigin === 'client' || serializedOrigin === undefined) {
+ return
+ }
+
+ // 2. If request’s response tainting is "cors" or request’s mode is "websocket",
+ // then append (`Origin`, serializedOrigin) to request’s header list.
+ // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
+ if (request.responseTainting === 'cors' || request.mode === 'websocket') {
+ request.headersList.append('origin', serializedOrigin, true)
+ } else if (request.method !== 'GET' && request.method !== 'HEAD') {
+ // 1. Switch on request’s referrer policy:
+ switch (request.referrerPolicy) {
+ case 'no-referrer':
+ // Set serializedOrigin to `null`.
+ serializedOrigin = null
+ break
+ case 'no-referrer-when-downgrade':
+ case 'strict-origin':
+ case 'strict-origin-when-cross-origin':
+ // If request’s origin is a tuple origin, its scheme is "https", and
+ // request’s current URL’s scheme is not "https", then set
+ // serializedOrigin to `null`.
+ if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
+ serializedOrigin = null
+ }
+ break
+ case 'same-origin':
+ // If request’s origin is not same origin with request’s current URL’s
+ // origin, then set serializedOrigin to `null`.
+ if (!sameOrigin(request, requestCurrentURL(request))) {
+ serializedOrigin = null
+ }
+ break
+ default:
+ // Do nothing.
+ }
+
+ // 2. Append (`Origin`, serializedOrigin) to request’s header list.
+ request.headersList.append('origin', serializedOrigin, true)
+ }
}
-webidl.errors.invalidArgument = function (context) {
- return webidl.errors.exception({
- header: context.prefix,
- message: `"${context.value}" is an invalid ${context.type}.`
- })
+// https://w3c.github.io/hr-time/#dfn-coarsen-time
+function coarsenTime (timestamp, crossOriginIsolatedCapability) {
+ // TODO
+ return timestamp
}
-// https://webidl.spec.whatwg.org/#implements
-webidl.brandCheck = function (V, I, opts = undefined) {
- if (opts?.strict !== false && !(V instanceof I)) {
- throw new TypeError('Illegal invocation')
- } else {
- return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
+// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info
+function clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {
+ if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {
+ return {
+ domainLookupStartTime: defaultStartTime,
+ domainLookupEndTime: defaultStartTime,
+ connectionStartTime: defaultStartTime,
+ connectionEndTime: defaultStartTime,
+ secureConnectionStartTime: defaultStartTime,
+ ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol
+ }
}
-}
-webidl.argumentLengthCheck = function ({ length }, min, ctx) {
- if (length < min) {
- throw webidl.errors.exception({
- message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
- `but${length ? ' only' : ''} ${length} found.`,
- ...ctx
- })
+ return {
+ domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),
+ domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),
+ connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),
+ connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),
+ secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),
+ ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol
}
}
-webidl.illegalConstructor = function () {
- throw webidl.errors.exception({
- header: 'TypeError',
- message: 'Illegal constructor'
- })
+// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time
+function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
+ return coarsenTime(performance.now(), crossOriginIsolatedCapability)
}
-// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
-webidl.util.Type = function (V) {
- switch (typeof V) {
- case 'undefined': return 'Undefined'
- case 'boolean': return 'Boolean'
- case 'string': return 'String'
- case 'symbol': return 'Symbol'
- case 'number': return 'Number'
- case 'bigint': return 'BigInt'
- case 'function':
- case 'object': {
- if (V === null) {
- return 'Null'
- }
+// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
+function createOpaqueTimingInfo (timingInfo) {
+ return {
+ startTime: timingInfo.startTime ?? 0,
+ redirectStartTime: 0,
+ redirectEndTime: 0,
+ postRedirectStartTime: timingInfo.startTime ?? 0,
+ finalServiceWorkerStartTime: 0,
+ finalNetworkResponseStartTime: 0,
+ finalNetworkRequestStartTime: 0,
+ endTime: 0,
+ encodedBodySize: 0,
+ decodedBodySize: 0,
+ finalConnectionTimingInfo: null
+ }
+}
- return 'Object'
- }
+// https://html.spec.whatwg.org/multipage/origin.html#policy-container
+function makePolicyContainer () {
+ // Note: the fetch spec doesn't make use of embedder policy or CSP list
+ return {
+ referrerPolicy: 'strict-origin-when-cross-origin'
}
}
-// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
-webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
- let upperBound
- let lowerBound
+// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
+function clonePolicyContainer (policyContainer) {
+ return {
+ referrerPolicy: policyContainer.referrerPolicy
+ }
+}
- // 1. If bitLength is 64, then:
- if (bitLength === 64) {
- // 1. Let upperBound be 2^53 − 1.
- upperBound = Math.pow(2, 53) - 1
+// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
+function determineRequestsReferrer (request) {
+ // 1. Let policy be request's referrer policy.
+ const policy = request.referrerPolicy
- // 2. If signedness is "unsigned", then let lowerBound be 0.
- if (signedness === 'unsigned') {
- lowerBound = 0
- } else {
- // 3. Otherwise let lowerBound be −2^53 + 1.
- lowerBound = Math.pow(-2, 53) + 1
- }
- } else if (signedness === 'unsigned') {
- // 2. Otherwise, if signedness is "unsigned", then:
+ // Note: policy cannot (shouldn't) be null or an empty string.
+ assert(policy)
- // 1. Let lowerBound be 0.
- lowerBound = 0
+ // 2. Let environment be request’s client.
- // 2. Let upperBound be 2^bitLength − 1.
- upperBound = Math.pow(2, bitLength) - 1
- } else {
- // 3. Otherwise:
+ let referrerSource = null
- // 1. Let lowerBound be -2^bitLength − 1.
- lowerBound = Math.pow(-2, bitLength) - 1
+ // 3. Switch on request’s referrer:
+ if (request.referrer === 'client') {
+ // Note: node isn't a browser and doesn't implement document/iframes,
+ // so we bypass this step and replace it with our own.
- // 2. Let upperBound be 2^bitLength − 1 − 1.
- upperBound = Math.pow(2, bitLength - 1) - 1
- }
+ const globalOrigin = getGlobalOrigin()
- // 4. Let x be ? ToNumber(V).
- let x = Number(V)
+ if (!globalOrigin || globalOrigin.origin === 'null') {
+ return 'no-referrer'
+ }
- // 5. If x is −0, then set x to +0.
- if (x === 0) {
- x = 0
+ // note: we need to clone it as it's mutated
+ referrerSource = new URL(globalOrigin)
+ } else if (request.referrer instanceof URL) {
+ // Let referrerSource be request’s referrer.
+ referrerSource = request.referrer
}
- // 6. If the conversion is to an IDL type associated
- // with the [EnforceRange] extended attribute, then:
- if (opts.enforceRange === true) {
- // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
- if (
- Number.isNaN(x) ||
- x === Number.POSITIVE_INFINITY ||
- x === Number.NEGATIVE_INFINITY
- ) {
- throw webidl.errors.exception({
- header: 'Integer conversion',
- message: `Could not convert ${V} to an integer.`
- })
- }
-
- // 2. Set x to IntegerPart(x).
- x = webidl.util.IntegerPart(x)
+ // 4. Let request’s referrerURL be the result of stripping referrerSource for
+ // use as a referrer.
+ let referrerURL = stripURLForReferrer(referrerSource)
- // 3. If x < lowerBound or x > upperBound, then
- // throw a TypeError.
- if (x < lowerBound || x > upperBound) {
- throw webidl.errors.exception({
- header: 'Integer conversion',
- message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
- })
- }
+ // 5. Let referrerOrigin be the result of stripping referrerSource for use as
+ // a referrer, with the origin-only flag set to true.
+ const referrerOrigin = stripURLForReferrer(referrerSource, true)
- // 4. Return x.
- return x
+ // 6. If the result of serializing referrerURL is a string whose length is
+ // greater than 4096, set referrerURL to referrerOrigin.
+ if (referrerURL.toString().length > 4096) {
+ referrerURL = referrerOrigin
}
- // 7. If x is not NaN and the conversion is to an IDL
- // type associated with the [Clamp] extended
- // attribute, then:
- if (!Number.isNaN(x) && opts.clamp === true) {
- // 1. Set x to min(max(x, lowerBound), upperBound).
- x = Math.min(Math.max(x, lowerBound), upperBound)
+ const areSameOrigin = sameOrigin(request, referrerURL)
+ const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
+ !isURLPotentiallyTrustworthy(request.url)
- // 2. Round x to the nearest integer, choosing the
- // even integer if it lies halfway between two,
- // and choosing +0 rather than −0.
- if (Math.floor(x) % 2 === 0) {
- x = Math.floor(x)
- } else {
- x = Math.ceil(x)
+ // 8. Execute the switch statements corresponding to the value of policy:
+ switch (policy) {
+ case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
+ case 'unsafe-url': return referrerURL
+ case 'same-origin':
+ return areSameOrigin ? referrerOrigin : 'no-referrer'
+ case 'origin-when-cross-origin':
+ return areSameOrigin ? referrerURL : referrerOrigin
+ case 'strict-origin-when-cross-origin': {
+ const currentURL = requestCurrentURL(request)
+
+ // 1. If the origin of referrerURL and the origin of request’s current
+ // URL are the same, then return referrerURL.
+ if (sameOrigin(referrerURL, currentURL)) {
+ return referrerURL
+ }
+
+ // 2. If referrerURL is a potentially trustworthy URL and request’s
+ // current URL is not a potentially trustworthy URL, then return no
+ // referrer.
+ if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
+ return 'no-referrer'
+ }
+
+ // 3. Return referrerOrigin.
+ return referrerOrigin
}
+ case 'strict-origin': // eslint-disable-line
+ /**
+ * 1. If referrerURL is a potentially trustworthy URL and
+ * request’s current URL is not a potentially trustworthy URL,
+ * then return no referrer.
+ * 2. Return referrerOrigin
+ */
+ case 'no-referrer-when-downgrade': // eslint-disable-line
+ /**
+ * 1. If referrerURL is a potentially trustworthy URL and
+ * request’s current URL is not a potentially trustworthy URL,
+ * then return no referrer.
+ * 2. Return referrerOrigin
+ */
- // 3. Return x.
- return x
+ default: // eslint-disable-line
+ return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
}
+}
- // 8. If x is NaN, +0, +∞, or −∞, then return +0.
- if (
- Number.isNaN(x) ||
- (x === 0 && Object.is(0, x)) ||
- x === Number.POSITIVE_INFINITY ||
- x === Number.NEGATIVE_INFINITY
- ) {
- return 0
+/**
+ * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
+ * @param {URL} url
+ * @param {boolean|undefined} originOnly
+ */
+function stripURLForReferrer (url, originOnly) {
+ // 1. Assert: url is a URL.
+ assert(url instanceof URL)
+
+ url = new URL(url)
+
+ // 2. If url’s scheme is a local scheme, then return no referrer.
+ if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
+ return 'no-referrer'
}
- // 9. Set x to IntegerPart(x).
- x = webidl.util.IntegerPart(x)
+ // 3. Set url’s username to the empty string.
+ url.username = ''
- // 10. Set x to x modulo 2^bitLength.
- x = x % Math.pow(2, bitLength)
+ // 4. Set url’s password to the empty string.
+ url.password = ''
- // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
- // then return x − 2^bitLength.
- if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
- return x - Math.pow(2, bitLength)
+ // 5. Set url’s fragment to null.
+ url.hash = ''
+
+ // 6. If the origin-only flag is true, then:
+ if (originOnly) {
+ // 1. Set url’s path to « the empty string ».
+ url.pathname = ''
+
+ // 2. Set url’s query to null.
+ url.search = ''
}
- // 12. Otherwise, return x.
- return x
+ // 7. Return url.
+ return url
}
-// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
-webidl.util.IntegerPart = function (n) {
- // 1. Let r be floor(abs(n)).
- const r = Math.floor(Math.abs(n))
+function isURLPotentiallyTrustworthy (url) {
+ if (!(url instanceof URL)) {
+ return false
+ }
- // 2. If n < 0, then return -1 × r.
- if (n < 0) {
- return -1 * r
+ // If child of about, return true
+ if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
+ return true
}
- // 3. Otherwise, return r.
- return r
-}
+ // If scheme is data, return true
+ if (url.protocol === 'data:') return true
-// https://webidl.spec.whatwg.org/#es-sequence
-webidl.sequenceConverter = function (converter) {
- return (V) => {
- // 1. If Type(V) is not Object, throw a TypeError.
- if (webidl.util.Type(V) !== 'Object') {
- throw webidl.errors.exception({
- header: 'Sequence',
- message: `Value of type ${webidl.util.Type(V)} is not an Object.`
- })
- }
+ // If file, return true
+ if (url.protocol === 'file:') return true
- // 2. Let method be ? GetMethod(V, @@iterator).
- /** @type {Generator} */
- const method = V?.[Symbol.iterator]?.()
- const seq = []
+ return isOriginPotentiallyTrustworthy(url.origin)
- // 3. If method is undefined, throw a TypeError.
- if (
- method === undefined ||
- typeof method.next !== 'function'
- ) {
- throw webidl.errors.exception({
- header: 'Sequence',
- message: 'Object is not an iterator.'
- })
- }
+ function isOriginPotentiallyTrustworthy (origin) {
+ // If origin is explicitly null, return false
+ if (origin == null || origin === 'null') return false
- // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
- while (true) {
- const { done, value } = method.next()
+ const originAsURL = new URL(origin)
- if (done) {
- break
- }
+ // If secure, return true
+ if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
+ return true
+ }
- seq.push(converter(value))
+ // If localhost or variants, return true
+ if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
+ (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
+ (originAsURL.hostname.endsWith('.localhost'))) {
+ return true
}
- return seq
+ // If any other, return false
+ return false
}
}
-// https://webidl.spec.whatwg.org/#es-to-record
-webidl.recordConverter = function (keyConverter, valueConverter) {
- return (O) => {
- // 1. If Type(O) is not Object, throw a TypeError.
- if (webidl.util.Type(O) !== 'Object') {
- throw webidl.errors.exception({
- header: 'Record',
- message: `Value of type ${webidl.util.Type(O)} is not an Object.`
- })
- }
-
- // 2. Let result be a new empty instance of record.
- const result = {}
+/**
+ * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
+ * @param {Uint8Array} bytes
+ * @param {string} metadataList
+ */
+function bytesMatch (bytes, metadataList) {
+ // If node is not built with OpenSSL support, we cannot check
+ // a request's integrity, so allow it by default (the spec will
+ // allow requests if an invalid hash is given, as precedence).
+ /* istanbul ignore if: only if node is built with --without-ssl */
+ if (crypto === undefined) {
+ return true
+ }
- if (!types.isProxy(O)) {
- // Object.keys only returns enumerable properties
- const keys = Object.keys(O)
+ // 1. Let parsedMetadata be the result of parsing metadataList.
+ const parsedMetadata = parseMetadata(metadataList)
- for (const key of keys) {
- // 1. Let typedKey be key converted to an IDL value of type K.
- const typedKey = keyConverter(key)
+ // 2. If parsedMetadata is no metadata, return true.
+ if (parsedMetadata === 'no metadata') {
+ return true
+ }
- // 2. Let value be ? Get(O, key).
- // 3. Let typedValue be value converted to an IDL value of type V.
- const typedValue = valueConverter(O[key])
+ // 3. If response is not eligible for integrity validation, return false.
+ // TODO
- // 4. Set result[typedKey] to typedValue.
- result[typedKey] = typedValue
- }
+ // 4. If parsedMetadata is the empty set, return true.
+ if (parsedMetadata.length === 0) {
+ return true
+ }
- // 5. Return result.
- return result
- }
+ // 5. Let metadata be the result of getting the strongest
+ // metadata from parsedMetadata.
+ const strongest = getStrongestMetadata(parsedMetadata)
+ const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
- // 3. Let keys be ? O.[[OwnPropertyKeys]]().
- const keys = Reflect.ownKeys(O)
+ // 6. For each item in metadata:
+ for (const item of metadata) {
+ // 1. Let algorithm be the alg component of item.
+ const algorithm = item.algo
- // 4. For each key of keys.
- for (const key of keys) {
- // 1. Let desc be ? O.[[GetOwnProperty]](key).
- const desc = Reflect.getOwnPropertyDescriptor(O, key)
+ // 2. Let expectedValue be the val component of item.
+ const expectedValue = item.hash
- // 2. If desc is not undefined and desc.[[Enumerable]] is true:
- if (desc?.enumerable) {
- // 1. Let typedKey be key converted to an IDL value of type K.
- const typedKey = keyConverter(key)
+ // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
+ // "be liberal with padding". This is annoying, and it's not even in the spec.
- // 2. Let value be ? Get(O, key).
- // 3. Let typedValue be value converted to an IDL value of type V.
- const typedValue = valueConverter(O[key])
+ // 3. Let actualValue be the result of applying algorithm to bytes.
+ let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
- // 4. Set result[typedKey] to typedValue.
- result[typedKey] = typedValue
+ if (actualValue[actualValue.length - 1] === '=') {
+ if (actualValue[actualValue.length - 2] === '=') {
+ actualValue = actualValue.slice(0, -2)
+ } else {
+ actualValue = actualValue.slice(0, -1)
}
}
- // 5. Return result.
- return result
- }
-}
-
-webidl.interfaceConverter = function (i) {
- return (V, opts = {}) => {
- if (opts.strict !== false && !(V instanceof i)) {
- throw webidl.errors.exception({
- header: i.name,
- message: `Expected ${V} to be an instance of ${i.name}.`
- })
+ // 4. If actualValue is a case-sensitive match for expectedValue,
+ // return true.
+ if (compareBase64Mixed(actualValue, expectedValue)) {
+ return true
}
-
- return V
}
-}
-webidl.dictionaryConverter = function (converters) {
- return (dictionary) => {
- const type = webidl.util.Type(dictionary)
- const dict = {}
+ // 7. Return false.
+ return false
+}
- if (type === 'Null' || type === 'Undefined') {
- return dict
- } else if (type !== 'Object') {
- throw webidl.errors.exception({
- header: 'Dictionary',
- message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
- })
- }
+// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
+// https://www.w3.org/TR/CSP2/#source-list-syntax
+// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
+const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
- for (const options of converters) {
- const { key, defaultValue, required, converter } = options
+/**
+ * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
+ * @param {string} metadata
+ */
+function parseMetadata (metadata) {
+ // 1. Let result be the empty set.
+ /** @type {{ algo: string, hash: string }[]} */
+ const result = []
- if (required === true) {
- if (!hasOwn(dictionary, key)) {
- throw webidl.errors.exception({
- header: 'Dictionary',
- message: `Missing required key "${key}".`
- })
- }
- }
+ // 2. Let empty be equal to true.
+ let empty = true
- let value = dictionary[key]
- const hasDefault = hasOwn(options, 'defaultValue')
+ // 3. For each token returned by splitting metadata on spaces:
+ for (const token of metadata.split(' ')) {
+ // 1. Set empty to false.
+ empty = false
- // Only use defaultValue if value is undefined and
- // a defaultValue options was provided.
- if (hasDefault && value !== null) {
- value = value ?? defaultValue
- }
+ // 2. Parse token as a hash-with-options.
+ const parsedToken = parseHashWithOptions.exec(token)
- // A key can be optional and have no default value.
- // When this happens, do not perform a conversion,
- // and do not assign the key a value.
- if (required || hasDefault || value !== undefined) {
- value = converter(value)
+ // 3. If token does not parse, continue to the next token.
+ if (
+ parsedToken === null ||
+ parsedToken.groups === undefined ||
+ parsedToken.groups.algo === undefined
+ ) {
+ // Note: Chromium blocks the request at this point, but Firefox
+ // gives a warning that an invalid integrity was given. The
+ // correct behavior is to ignore these, and subsequently not
+ // check the integrity of the resource.
+ continue
+ }
- if (
- options.allowedValues &&
- !options.allowedValues.includes(value)
- ) {
- throw webidl.errors.exception({
- header: 'Dictionary',
- message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
- })
- }
+ // 4. Let algorithm be the hash-algo component of token.
+ const algorithm = parsedToken.groups.algo.toLowerCase()
- dict[key] = value
- }
+ // 5. If algorithm is a hash function recognized by the user
+ // agent, add the parsed token to result.
+ if (supportedHashes.includes(algorithm)) {
+ result.push(parsedToken.groups)
}
+ }
- return dict
+ // 4. Return no metadata if empty is true, otherwise return result.
+ if (empty === true) {
+ return 'no metadata'
}
+
+ return result
}
-webidl.nullableConverter = function (converter) {
- return (V) => {
- if (V === null) {
- return V
- }
+/**
+ * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
+ */
+function getStrongestMetadata (metadataList) {
+ // Let algorithm be the algo component of the first item in metadataList.
+ // Can be sha256
+ let algorithm = metadataList[0].algo
+ // If the algorithm is sha512, then it is the strongest
+ // and we can return immediately
+ if (algorithm[3] === '5') {
+ return algorithm
+ }
- return converter(V)
+ for (let i = 1; i < metadataList.length; ++i) {
+ const metadata = metadataList[i]
+ // If the algorithm is sha512, then it is the strongest
+ // and we can break the loop immediately
+ if (metadata.algo[3] === '5') {
+ algorithm = 'sha512'
+ break
+ // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
+ } else if (algorithm[3] === '3') {
+ continue
+ // algorithm is sha256, check if algorithm is sha384 and if so, set it as
+ // the strongest
+ } else if (metadata.algo[3] === '3') {
+ algorithm = 'sha384'
+ }
}
+ return algorithm
}
-// https://webidl.spec.whatwg.org/#es-DOMString
-webidl.converters.DOMString = function (V, opts = {}) {
- // 1. If V is null and the conversion is to an IDL type
- // associated with the [LegacyNullToEmptyString]
- // extended attribute, then return the DOMString value
- // that represents the empty string.
- if (V === null && opts.legacyNullToEmptyString) {
- return ''
+function filterMetadataListByAlgorithm (metadataList, algorithm) {
+ if (metadataList.length === 1) {
+ return metadataList
}
- // 2. Let x be ? ToString(V).
- if (typeof V === 'symbol') {
- throw new TypeError('Could not convert argument of type symbol to string.')
+ let pos = 0
+ for (let i = 0; i < metadataList.length; ++i) {
+ if (metadataList[i].algo === algorithm) {
+ metadataList[pos++] = metadataList[i]
+ }
}
- // 3. Return the IDL DOMString value that represents the
- // same sequence of code units as the one the
- // ECMAScript String value x represents.
- return String(V)
-}
+ metadataList.length = pos
-// https://webidl.spec.whatwg.org/#es-ByteString
-webidl.converters.ByteString = function (V) {
- // 1. Let x be ? ToString(V).
- // Note: DOMString converter perform ? ToString(V)
- const x = webidl.converters.DOMString(V)
+ return metadataList
+}
- // 2. If the value of any element of x is greater than
- // 255, then throw a TypeError.
- for (let index = 0; index < x.length; index++) {
- if (x.charCodeAt(index) > 255) {
- throw new TypeError(
- 'Cannot convert argument to a ByteString because the character at ' +
- `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
- )
+/**
+ * Compares two base64 strings, allowing for base64url
+ * in the second string.
+ *
+* @param {string} actualValue always base64
+ * @param {string} expectedValue base64 or base64url
+ * @returns {boolean}
+ */
+function compareBase64Mixed (actualValue, expectedValue) {
+ if (actualValue.length !== expectedValue.length) {
+ return false
+ }
+ for (let i = 0; i < actualValue.length; ++i) {
+ if (actualValue[i] !== expectedValue[i]) {
+ if (
+ (actualValue[i] === '+' && expectedValue[i] === '-') ||
+ (actualValue[i] === '/' && expectedValue[i] === '_')
+ ) {
+ continue
+ }
+ return false
}
}
- // 3. Return an IDL ByteString value whose length is the
- // length of x, and where the value of each element is
- // the value of the corresponding element of x.
- return x
+ return true
}
-// https://webidl.spec.whatwg.org/#es-USVString
-webidl.converters.USVString = toUSVString
+// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
+function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
+ // TODO
+}
-// https://webidl.spec.whatwg.org/#es-boolean
-webidl.converters.boolean = function (V) {
- // 1. Let x be the result of computing ToBoolean(V).
- const x = Boolean(V)
+/**
+ * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
+ * @param {URL} A
+ * @param {URL} B
+ */
+function sameOrigin (A, B) {
+ // 1. If A and B are the same opaque origin, then return true.
+ if (A.origin === B.origin && A.origin === 'null') {
+ return true
+ }
- // 2. Return the IDL boolean value that is the one that represents
- // the same truth value as the ECMAScript Boolean value x.
- return x
-}
+ // 2. If A and B are both tuple origins and their schemes,
+ // hosts, and port are identical, then return true.
+ if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
+ return true
+ }
-// https://webidl.spec.whatwg.org/#es-any
-webidl.converters.any = function (V) {
- return V
+ // 3. Return false.
+ return false
}
-// https://webidl.spec.whatwg.org/#es-long-long
-webidl.converters['long long'] = function (V) {
- // 1. Let x be ? ConvertToInt(V, 64, "signed").
- const x = webidl.util.ConvertToInt(V, 64, 'signed')
+function createDeferredPromise () {
+ let res
+ let rej
+ const promise = new Promise((resolve, reject) => {
+ res = resolve
+ rej = reject
+ })
- // 2. Return the IDL long long value that represents
- // the same numeric value as x.
- return x
+ return { promise, resolve: res, reject: rej }
}
-// https://webidl.spec.whatwg.org/#es-unsigned-long-long
-webidl.converters['unsigned long long'] = function (V) {
- // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
- const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
-
- // 2. Return the IDL unsigned long long value that
- // represents the same numeric value as x.
- return x
+function isAborted (fetchParams) {
+ return fetchParams.controller.state === 'aborted'
}
-// https://webidl.spec.whatwg.org/#es-unsigned-long
-webidl.converters['unsigned long'] = function (V) {
- // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
- const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
+function isCancelled (fetchParams) {
+ return fetchParams.controller.state === 'aborted' ||
+ fetchParams.controller.state === 'terminated'
+}
- // 2. Return the IDL unsigned long value that
- // represents the same numeric value as x.
- return x
+/**
+ * @see https://fetch.spec.whatwg.org/#concept-method-normalize
+ * @param {string} method
+ */
+function normalizeMethod (method) {
+ return normalizedMethodRecordsBase[method.toLowerCase()] ?? method
}
-// https://webidl.spec.whatwg.org/#es-unsigned-short
-webidl.converters['unsigned short'] = function (V, opts) {
- // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
- const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
+// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
+function serializeJavascriptValueToJSONString (value) {
+ // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
+ const result = JSON.stringify(value)
- // 2. Return the IDL unsigned short value that represents
- // the same numeric value as x.
- return x
+ // 2. If result is undefined, then throw a TypeError.
+ if (result === undefined) {
+ throw new TypeError('Value is not JSON serializable')
+ }
+
+ // 3. Assert: result is a string.
+ assert(typeof result === 'string')
+
+ // 4. Return result.
+ return result
}
-// https://webidl.spec.whatwg.org/#idl-ArrayBuffer
-webidl.converters.ArrayBuffer = function (V, opts = {}) {
- // 1. If Type(V) is not Object, or V does not have an
- // [[ArrayBufferData]] internal slot, then throw a
- // TypeError.
- // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
- // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
- if (
- webidl.util.Type(V) !== 'Object' ||
- !types.isAnyArrayBuffer(V)
- ) {
- throw webidl.errors.conversionFailed({
- prefix: `${V}`,
- argument: `${V}`,
- types: ['ArrayBuffer']
- })
- }
+// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
+const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
- // 2. If the conversion is not to an IDL type associated
- // with the [AllowShared] extended attribute, and
- // IsSharedArrayBuffer(V) is true, then throw a
- // TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
- throw webidl.errors.exception({
- header: 'ArrayBuffer',
- message: 'SharedArrayBuffer is not allowed.'
- })
- }
+/**
+ * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
+ * @param {string} name name of the instance
+ * @param {symbol} kInternalIterator
+ * @param {string | number} [keyIndex]
+ * @param {string | number} [valueIndex]
+ */
+function createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {
+ class FastIterableIterator {
+ /** @type {any} */
+ #target
+ /** @type {'key' | 'value' | 'key+value'} */
+ #kind
+ /** @type {number} */
+ #index
+
+ /**
+ * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object
+ * @param {unknown} target
+ * @param {'key' | 'value' | 'key+value'} kind
+ */
+ constructor (target, kind) {
+ this.#target = target
+ this.#kind = kind
+ this.#index = 0
+ }
+
+ next () {
+ // 1. Let interface be the interface for which the iterator prototype object exists.
+ // 2. Let thisValue be the this value.
+ // 3. Let object be ? ToObject(thisValue).
+ // 4. If object is a platform object, then perform a security
+ // check, passing:
+ // 5. If object is not a default iterator object for interface,
+ // then throw a TypeError.
+ if (typeof this !== 'object' || this === null || !(#target in this)) {
+ throw new TypeError(
+ `'next' called on an object that does not implement interface ${name} Iterator.`
+ )
+ }
+
+ // 6. Let index be object’s index.
+ // 7. Let kind be object’s kind.
+ // 8. Let values be object’s target's value pairs to iterate over.
+ const index = this.#index
+ const values = this.#target[kInternalIterator]
+
+ // 9. Let len be the length of values.
+ const len = values.length
+
+ // 10. If index is greater than or equal to len, then return
+ // CreateIterResultObject(undefined, true).
+ if (index >= len) {
+ return {
+ value: undefined,
+ done: true
+ }
+ }
- // 3. If the conversion is not to an IDL type associated
- // with the [AllowResizable] extended attribute, and
- // IsResizableArrayBuffer(V) is true, then throw a
- // TypeError.
- // Note: resizable ArrayBuffers are currently a proposal.
+ // 11. Let pair be the entry in values at index index.
+ const { [keyIndex]: key, [valueIndex]: value } = values[index]
- // 4. Return the IDL ArrayBuffer value that is a
- // reference to the same object as V.
- return V
-}
+ // 12. Set object’s index to index + 1.
+ this.#index = index + 1
-webidl.converters.TypedArray = function (V, T, opts = {}) {
- // 1. Let T be the IDL type V is being converted to.
+ // 13. Return the iterator result for pair and kind.
- // 2. If Type(V) is not Object, or V does not have a
- // [[TypedArrayName]] internal slot with a value
- // equal to T’s name, then throw a TypeError.
- if (
- webidl.util.Type(V) !== 'Object' ||
- !types.isTypedArray(V) ||
- V.constructor.name !== T.name
- ) {
- throw webidl.errors.conversionFailed({
- prefix: `${T.name}`,
- argument: `${V}`,
- types: [T.name]
- })
- }
+ // https://webidl.spec.whatwg.org/#iterator-result
+
+ // 1. Let result be a value determined by the value of kind:
+ let result
+ switch (this.#kind) {
+ case 'key':
+ // 1. Let idlKey be pair’s key.
+ // 2. Let key be the result of converting idlKey to an
+ // ECMAScript value.
+ // 3. result is key.
+ result = key
+ break
+ case 'value':
+ // 1. Let idlValue be pair’s value.
+ // 2. Let value be the result of converting idlValue to
+ // an ECMAScript value.
+ // 3. result is value.
+ result = value
+ break
+ case 'key+value':
+ // 1. Let idlKey be pair’s key.
+ // 2. Let idlValue be pair’s value.
+ // 3. Let key be the result of converting idlKey to an
+ // ECMAScript value.
+ // 4. Let value be the result of converting idlValue to
+ // an ECMAScript value.
+ // 5. Let array be ! ArrayCreate(2).
+ // 6. Call ! CreateDataProperty(array, "0", key).
+ // 7. Call ! CreateDataProperty(array, "1", value).
+ // 8. result is array.
+ result = [key, value]
+ break
+ }
- // 3. If the conversion is not to an IDL type associated
- // with the [AllowShared] extended attribute, and
- // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
- // true, then throw a TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
- throw webidl.errors.exception({
- header: 'ArrayBuffer',
- message: 'SharedArrayBuffer is not allowed.'
- })
+ // 2. Return CreateIterResultObject(result, false).
+ return {
+ value: result,
+ done: false
+ }
+ }
}
- // 4. If the conversion is not to an IDL type associated
- // with the [AllowResizable] extended attribute, and
- // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
- // true, then throw a TypeError.
- // Note: resizable array buffers are currently a proposal
+ // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
+ // @ts-ignore
+ delete FastIterableIterator.prototype.constructor
- // 5. Return the IDL value of type T that is a reference
- // to the same object as V.
- return V
-}
+ Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)
-webidl.converters.DataView = function (V, opts = {}) {
- // 1. If Type(V) is not Object, or V does not have a
- // [[DataView]] internal slot, then throw a TypeError.
- if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
- throw webidl.errors.exception({
- header: 'DataView',
- message: 'Object is not a DataView.'
- })
- }
+ Object.defineProperties(FastIterableIterator.prototype, {
+ [Symbol.toStringTag]: {
+ writable: false,
+ enumerable: false,
+ configurable: true,
+ value: `${name} Iterator`
+ },
+ next: { writable: true, enumerable: true, configurable: true }
+ })
- // 2. If the conversion is not to an IDL type associated
- // with the [AllowShared] extended attribute, and
- // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
- // then throw a TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
- throw webidl.errors.exception({
- header: 'ArrayBuffer',
- message: 'SharedArrayBuffer is not allowed.'
- })
+ /**
+ * @param {unknown} target
+ * @param {'key' | 'value' | 'key+value'} kind
+ * @returns {IterableIterator}
+ */
+ return function (target, kind) {
+ return new FastIterableIterator(target, kind)
}
+}
- // 3. If the conversion is not to an IDL type associated
- // with the [AllowResizable] extended attribute, and
- // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
- // true, then throw a TypeError.
- // Note: resizable ArrayBuffers are currently a proposal
+/**
+ * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
+ * @param {string} name name of the instance
+ * @param {any} object class
+ * @param {symbol} kInternalIterator
+ * @param {string | number} [keyIndex]
+ * @param {string | number} [valueIndex]
+ */
+function iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {
+ const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)
- // 4. Return the IDL DataView value that is a reference
- // to the same object as V.
- return V
+ const properties = {
+ keys: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function keys () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'key')
+ }
+ },
+ values: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function values () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'value')
+ }
+ },
+ entries: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function entries () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'key+value')
+ }
+ },
+ forEach: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function forEach (callbackfn, thisArg = globalThis) {
+ webidl.brandCheck(this, object)
+ webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)
+ if (typeof callbackfn !== 'function') {
+ throw new TypeError(
+ `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`
+ )
+ }
+ for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {
+ callbackfn.call(thisArg, value, key, this)
+ }
+ }
+ }
+ }
+
+ return Object.defineProperties(object.prototype, {
+ ...properties,
+ [Symbol.iterator]: {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ value: properties.entries.value
+ }
+ })
}
-// https://webidl.spec.whatwg.org/#BufferSource
-webidl.converters.BufferSource = function (V, opts = {}) {
- if (types.isAnyArrayBuffer(V)) {
- return webidl.converters.ArrayBuffer(V, opts)
- }
+/**
+ * @see https://fetch.spec.whatwg.org/#body-fully-read
+ */
+async function fullyReadBody (body, processBody, processBodyError) {
+ // 1. If taskDestination is null, then set taskDestination to
+ // the result of starting a new parallel queue.
- if (types.isTypedArray(V)) {
- return webidl.converters.TypedArray(V, V.constructor)
+ // 2. Let successSteps given a byte sequence bytes be to queue a
+ // fetch task to run processBody given bytes, with taskDestination.
+ const successSteps = processBody
+
+ // 3. Let errorSteps be to queue a fetch task to run processBodyError,
+ // with taskDestination.
+ const errorSteps = processBodyError
+
+ // 4. Let reader be the result of getting a reader for body’s stream.
+ // If that threw an exception, then run errorSteps with that
+ // exception and return.
+ let reader
+
+ try {
+ reader = body.stream.getReader()
+ } catch (e) {
+ errorSteps(e)
+ return
}
- if (types.isDataView(V)) {
- return webidl.converters.DataView(V, opts)
+ // 5. Read all bytes from reader, given successSteps and errorSteps.
+ try {
+ successSteps(await readAllBytes(reader))
+ } catch (e) {
+ errorSteps(e)
}
+}
- throw new TypeError(`Could not convert ${V} to a BufferSource.`)
+function isReadableStreamLike (stream) {
+ return stream instanceof ReadableStream || (
+ stream[Symbol.toStringTag] === 'ReadableStream' &&
+ typeof stream.tee === 'function'
+ )
}
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.ByteString
-)
+/**
+ * @param {ReadableStreamController} controller
+ */
+function readableStreamClose (controller) {
+ try {
+ controller.close()
+ controller.byobRequest?.respond(0)
+ } catch (err) {
+ // TODO: add comment explaining why this error occurs.
+ if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {
+ throw err
+ }
+ }
+}
-webidl.converters['sequence>'] = webidl.sequenceConverter(
- webidl.converters['sequence']
-)
+const invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/ // eslint-disable-line
-webidl.converters['record'] = webidl.recordConverter(
- webidl.converters.ByteString,
- webidl.converters.ByteString
-)
+/**
+ * @see https://infra.spec.whatwg.org/#isomorphic-encode
+ * @param {string} input
+ */
+function isomorphicEncode (input) {
+ // 1. Assert: input contains no code points greater than U+00FF.
+ assert(!invalidIsomorphicEncodeValueRegex.test(input))
-module.exports = {
- webidl
+ // 2. Return a byte sequence whose length is equal to input’s code
+ // point length and whose bytes have the same values as the
+ // values of input’s code points, in the same order
+ return input
}
+/**
+ * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
+ * @see https://streams.spec.whatwg.org/#read-loop
+ * @param {ReadableStreamDefaultReader} reader
+ */
+async function readAllBytes (reader) {
+ const bytes = []
+ let byteLength = 0
-/***/ }),
+ while (true) {
+ const { done, value: chunk } = await reader.read()
-/***/ 4854:
-/***/ ((module) => {
+ if (done) {
+ // 1. Call successSteps with bytes.
+ return Buffer.concat(bytes, byteLength)
+ }
+
+ // 1. If chunk is not a Uint8Array object, call failureSteps
+ // with a TypeError and abort these steps.
+ if (!isUint8Array(chunk)) {
+ throw new TypeError('Received non-Uint8Array chunk')
+ }
-"use strict";
+ // 2. Append the bytes represented by chunk to bytes.
+ bytes.push(chunk)
+ byteLength += chunk.length
+ // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
+ }
+}
/**
- * @see https://encoding.spec.whatwg.org/#concept-encoding-get
- * @param {string|undefined} label
+ * @see https://fetch.spec.whatwg.org/#is-local
+ * @param {URL} url
*/
-function getEncoding (label) {
- if (!label) {
- return 'failure'
- }
+function urlIsLocal (url) {
+ assert('protocol' in url) // ensure it's a url object
- // 1. Remove any leading and trailing ASCII whitespace from label.
- // 2. If label is an ASCII case-insensitive match for any of the
- // labels listed in the table below, then return the
- // corresponding encoding; otherwise return failure.
- switch (label.trim().toLowerCase()) {
- case 'unicode-1-1-utf-8':
- case 'unicode11utf8':
- case 'unicode20utf8':
- case 'utf-8':
- case 'utf8':
- case 'x-unicode20utf8':
- return 'UTF-8'
- case '866':
- case 'cp866':
- case 'csibm866':
- case 'ibm866':
- return 'IBM866'
- case 'csisolatin2':
- case 'iso-8859-2':
- case 'iso-ir-101':
- case 'iso8859-2':
- case 'iso88592':
- case 'iso_8859-2':
- case 'iso_8859-2:1987':
- case 'l2':
- case 'latin2':
- return 'ISO-8859-2'
- case 'csisolatin3':
- case 'iso-8859-3':
- case 'iso-ir-109':
- case 'iso8859-3':
- case 'iso88593':
- case 'iso_8859-3':
- case 'iso_8859-3:1988':
- case 'l3':
- case 'latin3':
- return 'ISO-8859-3'
- case 'csisolatin4':
- case 'iso-8859-4':
- case 'iso-ir-110':
- case 'iso8859-4':
- case 'iso88594':
- case 'iso_8859-4':
- case 'iso_8859-4:1988':
- case 'l4':
- case 'latin4':
- return 'ISO-8859-4'
- case 'csisolatincyrillic':
- case 'cyrillic':
- case 'iso-8859-5':
- case 'iso-ir-144':
- case 'iso8859-5':
- case 'iso88595':
- case 'iso_8859-5':
- case 'iso_8859-5:1988':
- return 'ISO-8859-5'
- case 'arabic':
- case 'asmo-708':
- case 'csiso88596e':
- case 'csiso88596i':
- case 'csisolatinarabic':
- case 'ecma-114':
- case 'iso-8859-6':
- case 'iso-8859-6-e':
- case 'iso-8859-6-i':
- case 'iso-ir-127':
- case 'iso8859-6':
- case 'iso88596':
- case 'iso_8859-6':
- case 'iso_8859-6:1987':
- return 'ISO-8859-6'
- case 'csisolatingreek':
- case 'ecma-118':
- case 'elot_928':
- case 'greek':
- case 'greek8':
- case 'iso-8859-7':
- case 'iso-ir-126':
- case 'iso8859-7':
- case 'iso88597':
- case 'iso_8859-7':
- case 'iso_8859-7:1987':
- case 'sun_eu_greek':
- return 'ISO-8859-7'
- case 'csiso88598e':
- case 'csisolatinhebrew':
- case 'hebrew':
- case 'iso-8859-8':
- case 'iso-8859-8-e':
- case 'iso-ir-138':
- case 'iso8859-8':
- case 'iso88598':
- case 'iso_8859-8':
- case 'iso_8859-8:1988':
- case 'visual':
- return 'ISO-8859-8'
- case 'csiso88598i':
- case 'iso-8859-8-i':
- case 'logical':
- return 'ISO-8859-8-I'
- case 'csisolatin6':
- case 'iso-8859-10':
- case 'iso-ir-157':
- case 'iso8859-10':
- case 'iso885910':
- case 'l6':
- case 'latin6':
- return 'ISO-8859-10'
- case 'iso-8859-13':
- case 'iso8859-13':
- case 'iso885913':
- return 'ISO-8859-13'
- case 'iso-8859-14':
- case 'iso8859-14':
- case 'iso885914':
- return 'ISO-8859-14'
- case 'csisolatin9':
- case 'iso-8859-15':
- case 'iso8859-15':
- case 'iso885915':
- case 'iso_8859-15':
- case 'l9':
- return 'ISO-8859-15'
- case 'iso-8859-16':
- return 'ISO-8859-16'
- case 'cskoi8r':
- case 'koi':
- case 'koi8':
- case 'koi8-r':
- case 'koi8_r':
- return 'KOI8-R'
- case 'koi8-ru':
- case 'koi8-u':
- return 'KOI8-U'
- case 'csmacintosh':
- case 'mac':
- case 'macintosh':
- case 'x-mac-roman':
- return 'macintosh'
- case 'iso-8859-11':
- case 'iso8859-11':
- case 'iso885911':
- case 'tis-620':
- case 'windows-874':
- return 'windows-874'
- case 'cp1250':
- case 'windows-1250':
- case 'x-cp1250':
- return 'windows-1250'
- case 'cp1251':
- case 'windows-1251':
- case 'x-cp1251':
- return 'windows-1251'
- case 'ansi_x3.4-1968':
- case 'ascii':
- case 'cp1252':
- case 'cp819':
- case 'csisolatin1':
- case 'ibm819':
- case 'iso-8859-1':
- case 'iso-ir-100':
- case 'iso8859-1':
- case 'iso88591':
- case 'iso_8859-1':
- case 'iso_8859-1:1987':
- case 'l1':
- case 'latin1':
- case 'us-ascii':
- case 'windows-1252':
- case 'x-cp1252':
- return 'windows-1252'
- case 'cp1253':
- case 'windows-1253':
- case 'x-cp1253':
- return 'windows-1253'
- case 'cp1254':
- case 'csisolatin5':
- case 'iso-8859-9':
- case 'iso-ir-148':
- case 'iso8859-9':
- case 'iso88599':
- case 'iso_8859-9':
- case 'iso_8859-9:1989':
- case 'l5':
- case 'latin5':
- case 'windows-1254':
- case 'x-cp1254':
- return 'windows-1254'
- case 'cp1255':
- case 'windows-1255':
- case 'x-cp1255':
- return 'windows-1255'
- case 'cp1256':
- case 'windows-1256':
- case 'x-cp1256':
- return 'windows-1256'
- case 'cp1257':
- case 'windows-1257':
- case 'x-cp1257':
- return 'windows-1257'
- case 'cp1258':
- case 'windows-1258':
- case 'x-cp1258':
- return 'windows-1258'
- case 'x-mac-cyrillic':
- case 'x-mac-ukrainian':
- return 'x-mac-cyrillic'
- case 'chinese':
- case 'csgb2312':
- case 'csiso58gb231280':
- case 'gb2312':
- case 'gb_2312':
- case 'gb_2312-80':
- case 'gbk':
- case 'iso-ir-58':
- case 'x-gbk':
- return 'GBK'
- case 'gb18030':
- return 'gb18030'
- case 'big5':
- case 'big5-hkscs':
- case 'cn-big5':
- case 'csbig5':
- case 'x-x-big5':
- return 'Big5'
- case 'cseucpkdfmtjapanese':
- case 'euc-jp':
- case 'x-euc-jp':
- return 'EUC-JP'
- case 'csiso2022jp':
- case 'iso-2022-jp':
- return 'ISO-2022-JP'
- case 'csshiftjis':
- case 'ms932':
- case 'ms_kanji':
- case 'shift-jis':
- case 'shift_jis':
- case 'sjis':
- case 'windows-31j':
- case 'x-sjis':
- return 'Shift_JIS'
- case 'cseuckr':
- case 'csksc56011987':
- case 'euc-kr':
- case 'iso-ir-149':
- case 'korean':
- case 'ks_c_5601-1987':
- case 'ks_c_5601-1989':
- case 'ksc5601':
- case 'ksc_5601':
- case 'windows-949':
- return 'EUC-KR'
- case 'csiso2022kr':
- case 'hz-gb-2312':
- case 'iso-2022-cn':
- case 'iso-2022-cn-ext':
- case 'iso-2022-kr':
- case 'replacement':
- return 'replacement'
- case 'unicodefffe':
- case 'utf-16be':
- return 'UTF-16BE'
- case 'csunicode':
- case 'iso-10646-ucs-2':
- case 'ucs-2':
- case 'unicode':
- case 'unicodefeff':
- case 'utf-16':
- case 'utf-16le':
- return 'UTF-16LE'
- case 'x-user-defined':
- return 'x-user-defined'
- default: return 'failure'
- }
+ const protocol = url.protocol
+
+ return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
}
-module.exports = {
- getEncoding
-}
+/**
+ * @param {string|URL} url
+ * @returns {boolean}
+ */
+function urlHasHttpsScheme (url) {
+ return (
+ (
+ typeof url === 'string' &&
+ url[5] === ':' &&
+ url[0] === 'h' &&
+ url[1] === 't' &&
+ url[2] === 't' &&
+ url[3] === 'p' &&
+ url[4] === 's'
+ ) ||
+ url.protocol === 'https:'
+ )
+}
+
+/**
+ * @see https://fetch.spec.whatwg.org/#http-scheme
+ * @param {URL} url
+ */
+function urlIsHttpHttpsScheme (url) {
+ assert('protocol' in url) // ensure it's a url object
+
+ const protocol = url.protocol
+ return protocol === 'http:' || protocol === 'https:'
+}
-/***/ }),
+/**
+ * @see https://fetch.spec.whatwg.org/#simple-range-header-value
+ * @param {string} value
+ * @param {boolean} allowWhitespace
+ */
+function simpleRangeHeaderValue (value, allowWhitespace) {
+ // 1. Let data be the isomorphic decoding of value.
+ // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,
+ // nothing more. We obviously don't need to do that if value is a string already.
+ const data = value
-/***/ 1446:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. If data does not start with "bytes", then return failure.
+ if (!data.startsWith('bytes')) {
+ return 'failure'
+ }
-"use strict";
+ // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.
+ const position = { position: 5 }
+ // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,
+ // from data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
+ }
-const {
- staticPropertyDescriptors,
- readOperation,
- fireAProgressEvent
-} = __nccwpck_require__(7530)
-const {
- kState,
- kError,
- kResult,
- kEvents,
- kAborted
-} = __nccwpck_require__(9054)
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+ // 5. If the code point at position within data is not U+003D (=), then return failure.
+ if (data.charCodeAt(position.position) !== 0x3D) {
+ return 'failure'
+ }
-class FileReader extends EventTarget {
- constructor () {
- super()
+ // 6. Advance position by 1.
+ position.position++
- this[kState] = 'empty'
- this[kResult] = null
- this[kError] = null
- this[kEvents] = {
- loadend: null,
- error: null,
- abort: null,
- load: null,
- progress: null,
- loadstart: null
- }
+ // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from
+ // data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
}
- /**
- * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
- * @param {import('buffer').Blob} blob
- */
- readAsArrayBuffer (blob) {
- webidl.brandCheck(this, FileReader)
+ // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,
+ // from data given position.
+ const rangeStart = collectASequenceOfCodePoints(
+ (char) => {
+ const code = char.charCodeAt(0)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
+ return code >= 0x30 && code <= 0x39
+ },
+ data,
+ position
+ )
- blob = webidl.converters.Blob(blob, { strict: false })
+ // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the
+ // empty string; otherwise null.
+ const rangeStartValue = rangeStart.length ? Number(rangeStart) : null
- // The readAsArrayBuffer(blob) method, when invoked,
- // must initiate a read operation for blob with ArrayBuffer.
- readOperation(this, blob, 'ArrayBuffer')
+ // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,
+ // from data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
}
- /**
- * @see https://w3c.github.io/FileAPI/#readAsBinaryString
- * @param {import('buffer').Blob} blob
- */
- readAsBinaryString (blob) {
- webidl.brandCheck(this, FileReader)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
+ // 11. If the code point at position within data is not U+002D (-), then return failure.
+ if (data.charCodeAt(position.position) !== 0x2D) {
+ return 'failure'
+ }
- blob = webidl.converters.Blob(blob, { strict: false })
+ // 12. Advance position by 1.
+ position.position++
- // The readAsBinaryString(blob) method, when invoked,
- // must initiate a read operation for blob with BinaryString.
- readOperation(this, blob, 'BinaryString')
+ // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab
+ // or space, from data given position.
+ // Note from Khafra: its the same step as in #8 again lol
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
}
- /**
- * @see https://w3c.github.io/FileAPI/#readAsDataText
- * @param {import('buffer').Blob} blob
- * @param {string?} encoding
- */
- readAsText (blob, encoding = undefined) {
- webidl.brandCheck(this, FileReader)
+ // 14. Let rangeEnd be the result of collecting a sequence of code points that are
+ // ASCII digits, from data given position.
+ // Note from Khafra: you wouldn't guess it, but this is also the same step as #8
+ const rangeEnd = collectASequenceOfCodePoints(
+ (char) => {
+ const code = char.charCodeAt(0)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
+ return code >= 0x30 && code <= 0x39
+ },
+ data,
+ position
+ )
- blob = webidl.converters.Blob(blob, { strict: false })
+ // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd
+ // is not the empty string; otherwise null.
+ // Note from Khafra: THE SAME STEP, AGAIN!!!
+ // Note: why interpret as a decimal if we only collect ascii digits?
+ const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null
- if (encoding !== undefined) {
- encoding = webidl.converters.DOMString(encoding)
- }
+ // 16. If position is not past the end of data, then return failure.
+ if (position.position < data.length) {
+ return 'failure'
+ }
- // The readAsText(blob, encoding) method, when invoked,
- // must initiate a read operation for blob with Text and encoding.
- readOperation(this, blob, 'Text', encoding)
+ // 17. If rangeEndValue and rangeStartValue are null, then return failure.
+ if (rangeEndValue === null && rangeStartValue === null) {
+ return 'failure'
}
- /**
- * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
- * @param {import('buffer').Blob} blob
- */
- readAsDataURL (blob) {
- webidl.brandCheck(this, FileReader)
+ // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is
+ // greater than rangeEndValue, then return failure.
+ // Note: ... when can they not be numbers?
+ if (rangeStartValue > rangeEndValue) {
+ return 'failure'
+ }
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
+ // 19. Return (rangeStartValue, rangeEndValue).
+ return { rangeStartValue, rangeEndValue }
+}
- blob = webidl.converters.Blob(blob, { strict: false })
+/**
+ * @see https://fetch.spec.whatwg.org/#build-a-content-range
+ * @param {number} rangeStart
+ * @param {number} rangeEnd
+ * @param {number} fullLength
+ */
+function buildContentRange (rangeStart, rangeEnd, fullLength) {
+ // 1. Let contentRange be `bytes `.
+ let contentRange = 'bytes '
- // The readAsDataURL(blob) method, when invoked, must
- // initiate a read operation for blob with DataURL.
- readOperation(this, blob, 'DataURL')
- }
+ // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.
+ contentRange += isomorphicEncode(`${rangeStart}`)
- /**
- * @see https://w3c.github.io/FileAPI/#dfn-abort
- */
- abort () {
- // 1. If this's state is "empty" or if this's state is
- // "done" set this's result to null and terminate
- // this algorithm.
- if (this[kState] === 'empty' || this[kState] === 'done') {
- this[kResult] = null
- return
- }
+ // 3. Append 0x2D (-) to contentRange.
+ contentRange += '-'
- // 2. If this's state is "loading" set this's state to
- // "done" and set this's result to null.
- if (this[kState] === 'loading') {
- this[kState] = 'done'
- this[kResult] = null
- }
+ // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.
+ contentRange += isomorphicEncode(`${rangeEnd}`)
- // 3. If there are any tasks from this on the file reading
- // task source in an affiliated task queue, then remove
- // those tasks from that task queue.
- this[kAborted] = true
+ // 5. Append 0x2F (/) to contentRange.
+ contentRange += '/'
- // 4. Terminate the algorithm for the read method being processed.
- // TODO
+ // 6. Append fullLength, serialized and isomorphic encoded to contentRange.
+ contentRange += isomorphicEncode(`${fullLength}`)
- // 5. Fire a progress event called abort at this.
- fireAProgressEvent('abort', this)
+ // 7. Return contentRange.
+ return contentRange
+}
- // 6. If this's state is not "loading", fire a progress
- // event called loadend at this.
- if (this[kState] !== 'loading') {
- fireAProgressEvent('loadend', this)
- }
+// A Stream, which pipes the response to zlib.createInflate() or
+// zlib.createInflateRaw() depending on the first byte of the Buffer.
+// If the lower byte of the first byte is 0x08, then the stream is
+// interpreted as a zlib stream, otherwise it's interpreted as a
+// raw deflate stream.
+class InflateStream extends Transform {
+ #zlibOptions
+
+ /** @param {zlib.ZlibOptions} [zlibOptions] */
+ constructor (zlibOptions) {
+ super()
+ this.#zlibOptions = zlibOptions
}
- /**
- * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
- */
- get readyState () {
- webidl.brandCheck(this, FileReader)
+ _transform (chunk, encoding, callback) {
+ if (!this._inflateStream) {
+ if (chunk.length === 0) {
+ callback()
+ return
+ }
+ this._inflateStream = (chunk[0] & 0x0F) === 0x08
+ ? zlib.createInflate(this.#zlibOptions)
+ : zlib.createInflateRaw(this.#zlibOptions)
- switch (this[kState]) {
- case 'empty': return this.EMPTY
- case 'loading': return this.LOADING
- case 'done': return this.DONE
+ this._inflateStream.on('data', this.push.bind(this))
+ this._inflateStream.on('end', () => this.push(null))
+ this._inflateStream.on('error', (err) => this.destroy(err))
}
- }
- /**
- * @see https://w3c.github.io/FileAPI/#dom-filereader-result
- */
- get result () {
- webidl.brandCheck(this, FileReader)
+ this._inflateStream.write(chunk, encoding, callback)
+ }
- // The result attribute’s getter, when invoked, must return
- // this's result.
- return this[kResult]
+ _final (callback) {
+ if (this._inflateStream) {
+ this._inflateStream.end()
+ this._inflateStream = null
+ }
+ callback()
}
+}
- /**
- * @see https://w3c.github.io/FileAPI/#dom-filereader-error
- */
- get error () {
- webidl.brandCheck(this, FileReader)
+/**
+ * @param {zlib.ZlibOptions} [zlibOptions]
+ * @returns {InflateStream}
+ */
+function createInflate (zlibOptions) {
+ return new InflateStream(zlibOptions)
+}
- // The error attribute’s getter, when invoked, must return
- // this's error.
- return this[kError]
- }
+/**
+ * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type
+ * @param {import('./headers').HeadersList} headers
+ */
+function extractMimeType (headers) {
+ // 1. Let charset be null.
+ let charset = null
- get onloadend () {
- webidl.brandCheck(this, FileReader)
+ // 2. Let essence be null.
+ let essence = null
- return this[kEvents].loadend
+ // 3. Let mimeType be null.
+ let mimeType = null
+
+ // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.
+ const values = getDecodeSplit('content-type', headers)
+
+ // 5. If values is null, then return failure.
+ if (values === null) {
+ return 'failure'
}
- set onloadend (fn) {
- webidl.brandCheck(this, FileReader)
+ // 6. For each value of values:
+ for (const value of values) {
+ // 6.1. Let temporaryMimeType be the result of parsing value.
+ const temporaryMimeType = parseMIMEType(value)
- if (this[kEvents].loadend) {
- this.removeEventListener('loadend', this[kEvents].loadend)
+ // 6.2. If temporaryMimeType is failure or its essence is "*/*", then continue.
+ if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {
+ continue
}
- if (typeof fn === 'function') {
- this[kEvents].loadend = fn
- this.addEventListener('loadend', fn)
- } else {
- this[kEvents].loadend = null
+ // 6.3. Set mimeType to temporaryMimeType.
+ mimeType = temporaryMimeType
+
+ // 6.4. If mimeType’s essence is not essence, then:
+ if (mimeType.essence !== essence) {
+ // 6.4.1. Set charset to null.
+ charset = null
+
+ // 6.4.2. If mimeType’s parameters["charset"] exists, then set charset to
+ // mimeType’s parameters["charset"].
+ if (mimeType.parameters.has('charset')) {
+ charset = mimeType.parameters.get('charset')
+ }
+
+ // 6.4.3. Set essence to mimeType’s essence.
+ essence = mimeType.essence
+ } else if (!mimeType.parameters.has('charset') && charset !== null) {
+ // 6.5. Otherwise, if mimeType’s parameters["charset"] does not exist, and
+ // charset is non-null, set mimeType’s parameters["charset"] to charset.
+ mimeType.parameters.set('charset', charset)
}
}
- get onerror () {
- webidl.brandCheck(this, FileReader)
-
- return this[kEvents].error
+ // 7. If mimeType is null, then return failure.
+ if (mimeType == null) {
+ return 'failure'
}
- set onerror (fn) {
- webidl.brandCheck(this, FileReader)
+ // 8. Return mimeType.
+ return mimeType
+}
- if (this[kEvents].error) {
- this.removeEventListener('error', this[kEvents].error)
- }
+/**
+ * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split
+ * @param {string|null} value
+ */
+function gettingDecodingSplitting (value) {
+ // 1. Let input be the result of isomorphic decoding value.
+ const input = value
- if (typeof fn === 'function') {
- this[kEvents].error = fn
- this.addEventListener('error', fn)
- } else {
- this[kEvents].error = null
- }
- }
+ // 2. Let position be a position variable for input, initially pointing at the start of input.
+ const position = { position: 0 }
- get onloadstart () {
- webidl.brandCheck(this, FileReader)
+ // 3. Let values be a list of strings, initially empty.
+ const values = []
- return this[kEvents].loadstart
- }
+ // 4. Let temporaryValue be the empty string.
+ let temporaryValue = ''
- set onloadstart (fn) {
- webidl.brandCheck(this, FileReader)
+ // 5. While position is not past the end of input:
+ while (position.position < input.length) {
+ // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (")
+ // or U+002C (,) from input, given position, to temporaryValue.
+ temporaryValue += collectASequenceOfCodePoints(
+ (char) => char !== '"' && char !== ',',
+ input,
+ position
+ )
- if (this[kEvents].loadstart) {
- this.removeEventListener('loadstart', this[kEvents].loadstart)
- }
+ // 5.2. If position is not past the end of input, then:
+ if (position.position < input.length) {
+ // 5.2.1. If the code point at position within input is U+0022 ("), then:
+ if (input.charCodeAt(position.position) === 0x22) {
+ // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.
+ temporaryValue += collectAnHTTPQuotedString(
+ input,
+ position
+ )
- if (typeof fn === 'function') {
- this[kEvents].loadstart = fn
- this.addEventListener('loadstart', fn)
- } else {
- this[kEvents].loadstart = null
+ // 5.2.1.2. If position is not past the end of input, then continue.
+ if (position.position < input.length) {
+ continue
+ }
+ } else {
+ // 5.2.2. Otherwise:
+
+ // 5.2.2.1. Assert: the code point at position within input is U+002C (,).
+ assert(input.charCodeAt(position.position) === 0x2C)
+
+ // 5.2.2.2. Advance position by 1.
+ position.position++
+ }
}
+
+ // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.
+ temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)
+
+ // 5.4. Append temporaryValue to values.
+ values.push(temporaryValue)
+
+ // 5.6. Set temporaryValue to the empty string.
+ temporaryValue = ''
}
- get onprogress () {
- webidl.brandCheck(this, FileReader)
+ // 6. Return values.
+ return values
+}
- return this[kEvents].progress
+/**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split
+ * @param {string} name lowercase header name
+ * @param {import('./headers').HeadersList} list
+ */
+function getDecodeSplit (name, list) {
+ // 1. Let value be the result of getting name from list.
+ const value = list.get(name, true)
+
+ // 2. If value is null, then return null.
+ if (value === null) {
+ return null
}
- set onprogress (fn) {
- webidl.brandCheck(this, FileReader)
+ // 3. Return the result of getting, decoding, and splitting value.
+ return gettingDecodingSplitting(value)
+}
- if (this[kEvents].progress) {
- this.removeEventListener('progress', this[kEvents].progress)
- }
+const textDecoder = new TextDecoder()
- if (typeof fn === 'function') {
- this[kEvents].progress = fn
- this.addEventListener('progress', fn)
- } else {
- this[kEvents].progress = null
- }
+/**
+ * @see https://encoding.spec.whatwg.org/#utf-8-decode
+ * @param {Buffer} buffer
+ */
+function utf8DecodeBytes (buffer) {
+ if (buffer.length === 0) {
+ return ''
}
- get onload () {
- webidl.brandCheck(this, FileReader)
+ // 1. Let buffer be the result of peeking three bytes from
+ // ioQueue, converted to a byte sequence.
- return this[kEvents].load
+ // 2. If buffer is 0xEF 0xBB 0xBF, then read three
+ // bytes from ioQueue. (Do nothing with those bytes.)
+ if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
+ buffer = buffer.subarray(3)
}
- set onload (fn) {
- webidl.brandCheck(this, FileReader)
+ // 3. Process a queue with an instance of UTF-8’s
+ // decoder, ioQueue, output, and "replacement".
+ const output = textDecoder.decode(buffer)
- if (this[kEvents].load) {
- this.removeEventListener('load', this[kEvents].load)
- }
+ // 4. Return output.
+ return output
+}
- if (typeof fn === 'function') {
- this[kEvents].load = fn
- this.addEventListener('load', fn)
- } else {
- this[kEvents].load = null
- }
+class EnvironmentSettingsObjectBase {
+ get baseUrl () {
+ return getGlobalOrigin()
}
- get onabort () {
- webidl.brandCheck(this, FileReader)
-
- return this[kEvents].abort
+ get origin () {
+ return this.baseUrl?.origin
}
- set onabort (fn) {
- webidl.brandCheck(this, FileReader)
+ policyContainer = makePolicyContainer()
+}
- if (this[kEvents].abort) {
- this.removeEventListener('abort', this[kEvents].abort)
- }
+class EnvironmentSettingsObject {
+ settingsObject = new EnvironmentSettingsObjectBase()
+}
- if (typeof fn === 'function') {
- this[kEvents].abort = fn
- this.addEventListener('abort', fn)
- } else {
- this[kEvents].abort = null
+const environmentSettingsObject = new EnvironmentSettingsObject()
+
+module.exports = {
+ isAborted,
+ isCancelled,
+ isValidEncodedURL,
+ createDeferredPromise,
+ ReadableStreamFrom,
+ tryUpgradeRequestToAPotentiallyTrustworthyURL,
+ clampAndCoarsenConnectionTimingInfo,
+ coarsenedSharedCurrentTime,
+ determineRequestsReferrer,
+ makePolicyContainer,
+ clonePolicyContainer,
+ appendFetchMetadata,
+ appendRequestOriginHeader,
+ TAOCheck,
+ corsCheck,
+ crossOriginResourcePolicyCheck,
+ createOpaqueTimingInfo,
+ setRequestReferrerPolicyOnRedirect,
+ isValidHTTPToken,
+ requestBadPort,
+ requestCurrentURL,
+ responseURL,
+ responseLocationURL,
+ isBlobLike,
+ isURLPotentiallyTrustworthy,
+ isValidReasonPhrase,
+ sameOrigin,
+ normalizeMethod,
+ serializeJavascriptValueToJSONString,
+ iteratorMixin,
+ createIterator,
+ isValidHeaderName,
+ isValidHeaderValue,
+ isErrorLike,
+ fullyReadBody,
+ bytesMatch,
+ isReadableStreamLike,
+ readableStreamClose,
+ isomorphicEncode,
+ urlIsLocal,
+ urlHasHttpsScheme,
+ urlIsHttpHttpsScheme,
+ readAllBytes,
+ simpleRangeHeaderValue,
+ buildContentRange,
+ parseMetadata,
+ createInflate,
+ extractMimeType,
+ getDecodeSplit,
+ utf8DecodeBytes,
+ environmentSettingsObject
+}
+
+
+/***/ }),
+
+/***/ 5893:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { types, inspect } = __nccwpck_require__(7975)
+const { markAsUncloneable } = __nccwpck_require__(5919)
+const { toUSVString } = __nccwpck_require__(3440)
+
+/** @type {import('../../../types/webidl').Webidl} */
+const webidl = {}
+webidl.converters = {}
+webidl.util = {}
+webidl.errors = {}
+
+webidl.errors.exception = function (message) {
+ return new TypeError(`${message.header}: ${message.message}`)
+}
+
+webidl.errors.conversionFailed = function (context) {
+ const plural = context.types.length === 1 ? '' : ' one of'
+ const message =
+ `${context.argument} could not be converted to` +
+ `${plural}: ${context.types.join(', ')}.`
+
+ return webidl.errors.exception({
+ header: context.prefix,
+ message
+ })
+}
+
+webidl.errors.invalidArgument = function (context) {
+ return webidl.errors.exception({
+ header: context.prefix,
+ message: `"${context.value}" is an invalid ${context.type}.`
+ })
+}
+
+// https://webidl.spec.whatwg.org/#implements
+webidl.brandCheck = function (V, I, opts) {
+ if (opts?.strict !== false) {
+ if (!(V instanceof I)) {
+ const err = new TypeError('Illegal invocation')
+ err.code = 'ERR_INVALID_THIS' // node compat.
+ throw err
+ }
+ } else {
+ if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {
+ const err = new TypeError('Illegal invocation')
+ err.code = 'ERR_INVALID_THIS' // node compat.
+ throw err
}
}
}
-// https://w3c.github.io/FileAPI/#dom-filereader-empty
-FileReader.EMPTY = FileReader.prototype.EMPTY = 0
-// https://w3c.github.io/FileAPI/#dom-filereader-loading
-FileReader.LOADING = FileReader.prototype.LOADING = 1
-// https://w3c.github.io/FileAPI/#dom-filereader-done
-FileReader.DONE = FileReader.prototype.DONE = 2
-
-Object.defineProperties(FileReader.prototype, {
- EMPTY: staticPropertyDescriptors,
- LOADING: staticPropertyDescriptors,
- DONE: staticPropertyDescriptors,
- readAsArrayBuffer: kEnumerableProperty,
- readAsBinaryString: kEnumerableProperty,
- readAsText: kEnumerableProperty,
- readAsDataURL: kEnumerableProperty,
- abort: kEnumerableProperty,
- readyState: kEnumerableProperty,
- result: kEnumerableProperty,
- error: kEnumerableProperty,
- onloadstart: kEnumerableProperty,
- onprogress: kEnumerableProperty,
- onload: kEnumerableProperty,
- onabort: kEnumerableProperty,
- onerror: kEnumerableProperty,
- onloadend: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'FileReader',
- writable: false,
- enumerable: false,
- configurable: true
+webidl.argumentLengthCheck = function ({ length }, min, ctx) {
+ if (length < min) {
+ throw webidl.errors.exception({
+ message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
+ `but${length ? ' only' : ''} ${length} found.`,
+ header: ctx
+ })
}
-})
+}
-Object.defineProperties(FileReader, {
- EMPTY: staticPropertyDescriptors,
- LOADING: staticPropertyDescriptors,
- DONE: staticPropertyDescriptors
-})
+webidl.illegalConstructor = function () {
+ throw webidl.errors.exception({
+ header: 'TypeError',
+ message: 'Illegal constructor'
+ })
+}
-module.exports = {
- FileReader
+// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
+webidl.util.Type = function (V) {
+ switch (typeof V) {
+ case 'undefined': return 'Undefined'
+ case 'boolean': return 'Boolean'
+ case 'string': return 'String'
+ case 'symbol': return 'Symbol'
+ case 'number': return 'Number'
+ case 'bigint': return 'BigInt'
+ case 'function':
+ case 'object': {
+ if (V === null) {
+ return 'Null'
+ }
+
+ return 'Object'
+ }
+ }
}
+webidl.util.markAsUncloneable = markAsUncloneable || (() => {})
+// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
+webidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {
+ let upperBound
+ let lowerBound
-/***/ }),
+ // 1. If bitLength is 64, then:
+ if (bitLength === 64) {
+ // 1. Let upperBound be 2^53 − 1.
+ upperBound = Math.pow(2, 53) - 1
-/***/ 5504:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. If signedness is "unsigned", then let lowerBound be 0.
+ if (signedness === 'unsigned') {
+ lowerBound = 0
+ } else {
+ // 3. Otherwise let lowerBound be −2^53 + 1.
+ lowerBound = Math.pow(-2, 53) + 1
+ }
+ } else if (signedness === 'unsigned') {
+ // 2. Otherwise, if signedness is "unsigned", then:
+
+ // 1. Let lowerBound be 0.
+ lowerBound = 0
+
+ // 2. Let upperBound be 2^bitLength − 1.
+ upperBound = Math.pow(2, bitLength) - 1
+ } else {
+ // 3. Otherwise:
-"use strict";
+ // 1. Let lowerBound be -2^bitLength − 1.
+ lowerBound = Math.pow(-2, bitLength) - 1
+ // 2. Let upperBound be 2^bitLength − 1 − 1.
+ upperBound = Math.pow(2, bitLength - 1) - 1
+ }
-const { webidl } = __nccwpck_require__(1744)
+ // 4. Let x be ? ToNumber(V).
+ let x = Number(V)
-const kState = Symbol('ProgressEvent state')
+ // 5. If x is −0, then set x to +0.
+ if (x === 0) {
+ x = 0
+ }
-/**
- * @see https://xhr.spec.whatwg.org/#progressevent
- */
-class ProgressEvent extends Event {
- constructor (type, eventInitDict = {}) {
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
+ // 6. If the conversion is to an IDL type associated
+ // with the [EnforceRange] extended attribute, then:
+ if (opts?.enforceRange === true) {
+ // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
+ if (
+ Number.isNaN(x) ||
+ x === Number.POSITIVE_INFINITY ||
+ x === Number.NEGATIVE_INFINITY
+ ) {
+ throw webidl.errors.exception({
+ header: 'Integer conversion',
+ message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`
+ })
+ }
- super(type, eventInitDict)
+ // 2. Set x to IntegerPart(x).
+ x = webidl.util.IntegerPart(x)
- this[kState] = {
- lengthComputable: eventInitDict.lengthComputable,
- loaded: eventInitDict.loaded,
- total: eventInitDict.total
+ // 3. If x < lowerBound or x > upperBound, then
+ // throw a TypeError.
+ if (x < lowerBound || x > upperBound) {
+ throw webidl.errors.exception({
+ header: 'Integer conversion',
+ message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
+ })
}
+
+ // 4. Return x.
+ return x
}
- get lengthComputable () {
- webidl.brandCheck(this, ProgressEvent)
+ // 7. If x is not NaN and the conversion is to an IDL
+ // type associated with the [Clamp] extended
+ // attribute, then:
+ if (!Number.isNaN(x) && opts?.clamp === true) {
+ // 1. Set x to min(max(x, lowerBound), upperBound).
+ x = Math.min(Math.max(x, lowerBound), upperBound)
- return this[kState].lengthComputable
- }
+ // 2. Round x to the nearest integer, choosing the
+ // even integer if it lies halfway between two,
+ // and choosing +0 rather than −0.
+ if (Math.floor(x) % 2 === 0) {
+ x = Math.floor(x)
+ } else {
+ x = Math.ceil(x)
+ }
- get loaded () {
- webidl.brandCheck(this, ProgressEvent)
+ // 3. Return x.
+ return x
+ }
- return this[kState].loaded
+ // 8. If x is NaN, +0, +∞, or −∞, then return +0.
+ if (
+ Number.isNaN(x) ||
+ (x === 0 && Object.is(0, x)) ||
+ x === Number.POSITIVE_INFINITY ||
+ x === Number.NEGATIVE_INFINITY
+ ) {
+ return 0
}
- get total () {
- webidl.brandCheck(this, ProgressEvent)
+ // 9. Set x to IntegerPart(x).
+ x = webidl.util.IntegerPart(x)
- return this[kState].total
- }
-}
+ // 10. Set x to x modulo 2^bitLength.
+ x = x % Math.pow(2, bitLength)
-webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
- {
- key: 'lengthComputable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'loaded',
- converter: webidl.converters['unsigned long long'],
- defaultValue: 0
- },
- {
- key: 'total',
- converter: webidl.converters['unsigned long long'],
- defaultValue: 0
- },
- {
- key: 'bubbles',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'cancelable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'composed',
- converter: webidl.converters.boolean,
- defaultValue: false
+ // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
+ // then return x − 2^bitLength.
+ if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
+ return x - Math.pow(2, bitLength)
}
-])
-module.exports = {
- ProgressEvent
+ // 12. Otherwise, return x.
+ return x
}
+// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
+webidl.util.IntegerPart = function (n) {
+ // 1. Let r be floor(abs(n)).
+ const r = Math.floor(Math.abs(n))
-/***/ }),
-
-/***/ 9054:
-/***/ ((module) => {
+ // 2. If n < 0, then return -1 × r.
+ if (n < 0) {
+ return -1 * r
+ }
-"use strict";
+ // 3. Otherwise, return r.
+ return r
+}
+webidl.util.Stringify = function (V) {
+ const type = webidl.util.Type(V)
-module.exports = {
- kState: Symbol('FileReader state'),
- kResult: Symbol('FileReader result'),
- kError: Symbol('FileReader error'),
- kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
- kEvents: Symbol('FileReader events'),
- kAborted: Symbol('FileReader aborted')
+ switch (type) {
+ case 'Symbol':
+ return `Symbol(${V.description})`
+ case 'Object':
+ return inspect(V)
+ case 'String':
+ return `"${V}"`
+ default:
+ return `${V}`
+ }
}
+// https://webidl.spec.whatwg.org/#es-sequence
+webidl.sequenceConverter = function (converter) {
+ return (V, prefix, argument, Iterable) => {
+ // 1. If Type(V) is not Object, throw a TypeError.
+ if (webidl.util.Type(V) !== 'Object') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`
+ })
+ }
-/***/ }),
-
-/***/ 7530:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. Let method be ? GetMethod(V, @@iterator).
+ /** @type {Generator} */
+ const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()
+ const seq = []
+ let index = 0
-"use strict";
+ // 3. If method is undefined, throw a TypeError.
+ if (
+ method === undefined ||
+ typeof method.next !== 'function'
+ ) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${argument} is not iterable.`
+ })
+ }
+ // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
+ while (true) {
+ const { done, value } = method.next()
-const {
- kState,
- kError,
- kResult,
- kAborted,
- kLastProgressEventFired
-} = __nccwpck_require__(9054)
-const { ProgressEvent } = __nccwpck_require__(5504)
-const { getEncoding } = __nccwpck_require__(4854)
-const { DOMException } = __nccwpck_require__(1037)
-const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
-const { types } = __nccwpck_require__(3837)
-const { StringDecoder } = __nccwpck_require__(1576)
-const { btoa } = __nccwpck_require__(4300)
+ if (done) {
+ break
+ }
-/** @type {PropertyDescriptor} */
-const staticPropertyDescriptors = {
- enumerable: true,
- writable: false,
- configurable: false
-}
+ seq.push(converter(value, prefix, `${argument}[${index++}]`))
+ }
-/**
- * @see https://w3c.github.io/FileAPI/#readOperation
- * @param {import('./filereader').FileReader} fr
- * @param {import('buffer').Blob} blob
- * @param {string} type
- * @param {string?} encodingName
- */
-function readOperation (fr, blob, type, encodingName) {
- // 1. If fr’s state is "loading", throw an InvalidStateError
- // DOMException.
- if (fr[kState] === 'loading') {
- throw new DOMException('Invalid state', 'InvalidStateError')
+ return seq
}
+}
- // 2. Set fr’s state to "loading".
- fr[kState] = 'loading'
-
- // 3. Set fr’s result to null.
- fr[kResult] = null
-
- // 4. Set fr’s error to null.
- fr[kError] = null
-
- // 5. Let stream be the result of calling get stream on blob.
- /** @type {import('stream/web').ReadableStream} */
- const stream = blob.stream()
-
- // 6. Let reader be the result of getting a reader from stream.
- const reader = stream.getReader()
+// https://webidl.spec.whatwg.org/#es-to-record
+webidl.recordConverter = function (keyConverter, valueConverter) {
+ return (O, prefix, argument) => {
+ // 1. If Type(O) is not Object, throw a TypeError.
+ if (webidl.util.Type(O) !== 'Object') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${argument} ("${webidl.util.Type(O)}") is not an Object.`
+ })
+ }
- // 7. Let bytes be an empty byte sequence.
- /** @type {Uint8Array[]} */
- const bytes = []
+ // 2. Let result be a new empty instance of record.
+ const result = {}
- // 8. Let chunkPromise be the result of reading a chunk from
- // stream with reader.
- let chunkPromise = reader.read()
+ if (!types.isProxy(O)) {
+ // 1. Let desc be ? O.[[GetOwnProperty]](key).
+ const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]
- // 9. Let isFirstChunk be true.
- let isFirstChunk = true
+ for (const key of keys) {
+ // 1. Let typedKey be key converted to an IDL value of type K.
+ const typedKey = keyConverter(key, prefix, argument)
- // 10. In parallel, while true:
- // Note: "In parallel" just means non-blocking
- // Note 2: readOperation itself cannot be async as double
- // reading the body would then reject the promise, instead
- // of throwing an error.
- ;(async () => {
- while (!fr[kAborted]) {
- // 1. Wait for chunkPromise to be fulfilled or rejected.
- try {
- const { done, value } = await chunkPromise
+ // 2. Let value be ? Get(O, key).
+ // 3. Let typedValue be value converted to an IDL value of type V.
+ const typedValue = valueConverter(O[key], prefix, argument)
- // 2. If chunkPromise is fulfilled, and isFirstChunk is
- // true, queue a task to fire a progress event called
- // loadstart at fr.
- if (isFirstChunk && !fr[kAborted]) {
- queueMicrotask(() => {
- fireAProgressEvent('loadstart', fr)
- })
- }
+ // 4. Set result[typedKey] to typedValue.
+ result[typedKey] = typedValue
+ }
- // 3. Set isFirstChunk to false.
- isFirstChunk = false
+ // 5. Return result.
+ return result
+ }
- // 4. If chunkPromise is fulfilled with an object whose
- // done property is false and whose value property is
- // a Uint8Array object, run these steps:
- if (!done && types.isUint8Array(value)) {
- // 1. Let bs be the byte sequence represented by the
- // Uint8Array object.
+ // 3. Let keys be ? O.[[OwnPropertyKeys]]().
+ const keys = Reflect.ownKeys(O)
- // 2. Append bs to bytes.
- bytes.push(value)
+ // 4. For each key of keys.
+ for (const key of keys) {
+ // 1. Let desc be ? O.[[GetOwnProperty]](key).
+ const desc = Reflect.getOwnPropertyDescriptor(O, key)
- // 3. If roughly 50ms have passed since these steps
- // were last invoked, queue a task to fire a
- // progress event called progress at fr.
- if (
- (
- fr[kLastProgressEventFired] === undefined ||
- Date.now() - fr[kLastProgressEventFired] >= 50
- ) &&
- !fr[kAborted]
- ) {
- fr[kLastProgressEventFired] = Date.now()
- queueMicrotask(() => {
- fireAProgressEvent('progress', fr)
- })
- }
+ // 2. If desc is not undefined and desc.[[Enumerable]] is true:
+ if (desc?.enumerable) {
+ // 1. Let typedKey be key converted to an IDL value of type K.
+ const typedKey = keyConverter(key, prefix, argument)
- // 4. Set chunkPromise to the result of reading a
- // chunk from stream with reader.
- chunkPromise = reader.read()
- } else if (done) {
- // 5. Otherwise, if chunkPromise is fulfilled with an
- // object whose done property is true, queue a task
- // to run the following steps and abort this algorithm:
- queueMicrotask(() => {
- // 1. Set fr’s state to "done".
- fr[kState] = 'done'
+ // 2. Let value be ? Get(O, key).
+ // 3. Let typedValue be value converted to an IDL value of type V.
+ const typedValue = valueConverter(O[key], prefix, argument)
- // 2. Let result be the result of package data given
- // bytes, type, blob’s type, and encodingName.
- try {
- const result = packageData(bytes, type, blob.type, encodingName)
+ // 4. Set result[typedKey] to typedValue.
+ result[typedKey] = typedValue
+ }
+ }
- // 4. Else:
+ // 5. Return result.
+ return result
+ }
+}
- if (fr[kAborted]) {
- return
- }
+webidl.interfaceConverter = function (i) {
+ return (V, prefix, argument, opts) => {
+ if (opts?.strict !== false && !(V instanceof i)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.`
+ })
+ }
- // 1. Set fr’s result to result.
- fr[kResult] = result
+ return V
+ }
+}
- // 2. Fire a progress event called load at the fr.
- fireAProgressEvent('load', fr)
- } catch (error) {
- // 3. If package data threw an exception error:
+webidl.dictionaryConverter = function (converters) {
+ return (dictionary, prefix, argument) => {
+ const type = webidl.util.Type(dictionary)
+ const dict = {}
- // 1. Set fr’s error to error.
- fr[kError] = error
+ if (type === 'Null' || type === 'Undefined') {
+ return dict
+ } else if (type !== 'Object') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
+ })
+ }
- // 2. Fire a progress event called error at fr.
- fireAProgressEvent('error', fr)
- }
+ for (const options of converters) {
+ const { key, defaultValue, required, converter } = options
- // 5. If fr’s state is not "loading", fire a progress
- // event called loadend at the fr.
- if (fr[kState] !== 'loading') {
- fireAProgressEvent('loadend', fr)
- }
+ if (required === true) {
+ if (!Object.hasOwn(dictionary, key)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `Missing required key "${key}".`
})
-
- break
- }
- } catch (error) {
- if (fr[kAborted]) {
- return
}
+ }
- // 6. Otherwise, if chunkPromise is rejected with an
- // error error, queue a task to run the following
- // steps and abort this algorithm:
- queueMicrotask(() => {
- // 1. Set fr’s state to "done".
- fr[kState] = 'done'
+ let value = dictionary[key]
+ const hasDefault = Object.hasOwn(options, 'defaultValue')
- // 2. Set fr’s error to error.
- fr[kError] = error
+ // Only use defaultValue if value is undefined and
+ // a defaultValue options was provided.
+ if (hasDefault && value !== null) {
+ value ??= defaultValue()
+ }
- // 3. Fire a progress event called error at fr.
- fireAProgressEvent('error', fr)
+ // A key can be optional and have no default value.
+ // When this happens, do not perform a conversion,
+ // and do not assign the key a value.
+ if (required || hasDefault || value !== undefined) {
+ value = converter(value, prefix, `${argument}.${key}`)
- // 4. If fr’s state is not "loading", fire a progress
- // event called loadend at fr.
- if (fr[kState] !== 'loading') {
- fireAProgressEvent('loadend', fr)
- }
- })
+ if (
+ options.allowedValues &&
+ !options.allowedValues.includes(value)
+ ) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
+ })
+ }
- break
+ dict[key] = value
}
}
- })()
+
+ return dict
+ }
}
-/**
- * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
- * @see https://dom.spec.whatwg.org/#concept-event-fire
- * @param {string} e The name of the event
- * @param {import('./filereader').FileReader} reader
- */
-function fireAProgressEvent (e, reader) {
- // The progress event e does not bubble. e.bubbles must be false
- // The progress event e is NOT cancelable. e.cancelable must be false
- const event = new ProgressEvent(e, {
- bubbles: false,
- cancelable: false
- })
+webidl.nullableConverter = function (converter) {
+ return (V, prefix, argument) => {
+ if (V === null) {
+ return V
+ }
- reader.dispatchEvent(event)
+ return converter(V, prefix, argument)
+ }
}
-/**
- * @see https://w3c.github.io/FileAPI/#blob-package-data
- * @param {Uint8Array[]} bytes
- * @param {string} type
- * @param {string?} mimeType
- * @param {string?} encodingName
- */
-function packageData (bytes, type, mimeType, encodingName) {
- // 1. A Blob has an associated package data algorithm, given
- // bytes, a type, a optional mimeType, and a optional
- // encodingName, which switches on type and runs the
- // associated steps:
+// https://webidl.spec.whatwg.org/#es-DOMString
+webidl.converters.DOMString = function (V, prefix, argument, opts) {
+ // 1. If V is null and the conversion is to an IDL type
+ // associated with the [LegacyNullToEmptyString]
+ // extended attribute, then return the DOMString value
+ // that represents the empty string.
+ if (V === null && opts?.legacyNullToEmptyString) {
+ return ''
+ }
- switch (type) {
- case 'DataURL': {
- // 1. Return bytes as a DataURL [RFC2397] subject to
- // the considerations below:
- // * Use mimeType as part of the Data URL if it is
- // available in keeping with the Data URL
- // specification [RFC2397].
- // * If mimeType is not available return a Data URL
- // without a media-type. [RFC2397].
+ // 2. Let x be ? ToString(V).
+ if (typeof V === 'symbol') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${argument} is a symbol, which cannot be converted to a DOMString.`
+ })
+ }
- // https://datatracker.ietf.org/doc/html/rfc2397#section-3
- // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
- // mediatype := [ type "/" subtype ] *( ";" parameter )
- // data := *urlchar
- // parameter := attribute "=" value
- let dataURL = 'data:'
+ // 3. Return the IDL DOMString value that represents the
+ // same sequence of code units as the one the
+ // ECMAScript String value x represents.
+ return String(V)
+}
- const parsed = parseMIMEType(mimeType || 'application/octet-stream')
+// https://webidl.spec.whatwg.org/#es-ByteString
+webidl.converters.ByteString = function (V, prefix, argument) {
+ // 1. Let x be ? ToString(V).
+ // Note: DOMString converter perform ? ToString(V)
+ const x = webidl.converters.DOMString(V, prefix, argument)
- if (parsed !== 'failure') {
- dataURL += serializeAMimeType(parsed)
- }
+ // 2. If the value of any element of x is greater than
+ // 255, then throw a TypeError.
+ for (let index = 0; index < x.length; index++) {
+ if (x.charCodeAt(index) > 255) {
+ throw new TypeError(
+ 'Cannot convert argument to a ByteString because the character at ' +
+ `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
+ )
+ }
+ }
- dataURL += ';base64,'
+ // 3. Return an IDL ByteString value whose length is the
+ // length of x, and where the value of each element is
+ // the value of the corresponding element of x.
+ return x
+}
- const decoder = new StringDecoder('latin1')
+// https://webidl.spec.whatwg.org/#es-USVString
+// TODO: rewrite this so we can control the errors thrown
+webidl.converters.USVString = toUSVString
- for (const chunk of bytes) {
- dataURL += btoa(decoder.write(chunk))
- }
+// https://webidl.spec.whatwg.org/#es-boolean
+webidl.converters.boolean = function (V) {
+ // 1. Let x be the result of computing ToBoolean(V).
+ const x = Boolean(V)
- dataURL += btoa(decoder.end())
+ // 2. Return the IDL boolean value that is the one that represents
+ // the same truth value as the ECMAScript Boolean value x.
+ return x
+}
+
+// https://webidl.spec.whatwg.org/#es-any
+webidl.converters.any = function (V) {
+ return V
+}
- return dataURL
- }
- case 'Text': {
- // 1. Let encoding be failure
- let encoding = 'failure'
+// https://webidl.spec.whatwg.org/#es-long-long
+webidl.converters['long long'] = function (V, prefix, argument) {
+ // 1. Let x be ? ConvertToInt(V, 64, "signed").
+ const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)
- // 2. If the encodingName is present, set encoding to the
- // result of getting an encoding from encodingName.
- if (encodingName) {
- encoding = getEncoding(encodingName)
- }
+ // 2. Return the IDL long long value that represents
+ // the same numeric value as x.
+ return x
+}
- // 3. If encoding is failure, and mimeType is present:
- if (encoding === 'failure' && mimeType) {
- // 1. Let type be the result of parse a MIME type
- // given mimeType.
- const type = parseMIMEType(mimeType)
+// https://webidl.spec.whatwg.org/#es-unsigned-long-long
+webidl.converters['unsigned long long'] = function (V, prefix, argument) {
+ // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
+ const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)
- // 2. If type is not failure, set encoding to the result
- // of getting an encoding from type’s parameters["charset"].
- if (type !== 'failure') {
- encoding = getEncoding(type.parameters.get('charset'))
- }
- }
+ // 2. Return the IDL unsigned long long value that
+ // represents the same numeric value as x.
+ return x
+}
- // 4. If encoding is failure, then set encoding to UTF-8.
- if (encoding === 'failure') {
- encoding = 'UTF-8'
- }
+// https://webidl.spec.whatwg.org/#es-unsigned-long
+webidl.converters['unsigned long'] = function (V, prefix, argument) {
+ // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
+ const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)
- // 5. Decode bytes using fallback encoding encoding, and
- // return the result.
- return decode(bytes, encoding)
- }
- case 'ArrayBuffer': {
- // Return a new ArrayBuffer whose contents are bytes.
- const sequence = combineByteSequences(bytes)
+ // 2. Return the IDL unsigned long value that
+ // represents the same numeric value as x.
+ return x
+}
- return sequence.buffer
- }
- case 'BinaryString': {
- // Return bytes as a binary string, in which every byte
- // is represented by a code unit of equal value [0..255].
- let binaryString = ''
+// https://webidl.spec.whatwg.org/#es-unsigned-short
+webidl.converters['unsigned short'] = function (V, prefix, argument, opts) {
+ // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
+ const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)
- const decoder = new StringDecoder('latin1')
+ // 2. Return the IDL unsigned short value that represents
+ // the same numeric value as x.
+ return x
+}
- for (const chunk of bytes) {
- binaryString += decoder.write(chunk)
- }
+// https://webidl.spec.whatwg.org/#idl-ArrayBuffer
+webidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {
+ // 1. If Type(V) is not Object, or V does not have an
+ // [[ArrayBufferData]] internal slot, then throw a
+ // TypeError.
+ // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
+ // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
+ if (
+ webidl.util.Type(V) !== 'Object' ||
+ !types.isAnyArrayBuffer(V)
+ ) {
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: `${argument} ("${webidl.util.Stringify(V)}")`,
+ types: ['ArrayBuffer']
+ })
+ }
- binaryString += decoder.end()
+ // 2. If the conversion is not to an IDL type associated
+ // with the [AllowShared] extended attribute, and
+ // IsSharedArrayBuffer(V) is true, then throw a
+ // TypeError.
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'SharedArrayBuffer is not allowed.'
+ })
+ }
- return binaryString
- }
+ // 3. If the conversion is not to an IDL type associated
+ // with the [AllowResizable] extended attribute, and
+ // IsResizableArrayBuffer(V) is true, then throw a
+ // TypeError.
+ if (V.resizable || V.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
}
+
+ // 4. Return the IDL ArrayBuffer value that is a
+ // reference to the same object as V.
+ return V
}
-/**
- * @see https://encoding.spec.whatwg.org/#decode
- * @param {Uint8Array[]} ioQueue
- * @param {string} encoding
- */
-function decode (ioQueue, encoding) {
- const bytes = combineByteSequences(ioQueue)
+webidl.converters.TypedArray = function (V, T, prefix, name, opts) {
+ // 1. Let T be the IDL type V is being converted to.
- // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
- const BOMEncoding = BOMSniffing(bytes)
+ // 2. If Type(V) is not Object, or V does not have a
+ // [[TypedArrayName]] internal slot with a value
+ // equal to T’s name, then throw a TypeError.
+ if (
+ webidl.util.Type(V) !== 'Object' ||
+ !types.isTypedArray(V) ||
+ V.constructor.name !== T.name
+ ) {
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: `${name} ("${webidl.util.Stringify(V)}")`,
+ types: [T.name]
+ })
+ }
- let slice = 0
+ // 3. If the conversion is not to an IDL type associated
+ // with the [AllowShared] extended attribute, and
+ // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
+ // true, then throw a TypeError.
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'SharedArrayBuffer is not allowed.'
+ })
+ }
- // 2. If BOMEncoding is non-null:
- if (BOMEncoding !== null) {
- // 1. Set encoding to BOMEncoding.
- encoding = BOMEncoding
+ // 4. If the conversion is not to an IDL type associated
+ // with the [AllowResizable] extended attribute, and
+ // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
+ // true, then throw a TypeError.
+ if (V.buffer.resizable || V.buffer.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
+ }
- // 2. Read three bytes from ioQueue, if BOMEncoding is
- // UTF-8; otherwise read two bytes.
- // (Do nothing with those bytes.)
- slice = BOMEncoding === 'UTF-8' ? 3 : 2
+ // 5. Return the IDL value of type T that is a reference
+ // to the same object as V.
+ return V
+}
+
+webidl.converters.DataView = function (V, prefix, name, opts) {
+ // 1. If Type(V) is not Object, or V does not have a
+ // [[DataView]] internal slot, then throw a TypeError.
+ if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${name} is not a DataView.`
+ })
}
- // 3. Process a queue with an instance of encoding’s
- // decoder, ioQueue, output, and "replacement".
+ // 2. If the conversion is not to an IDL type associated
+ // with the [AllowShared] extended attribute, and
+ // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
+ // then throw a TypeError.
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'SharedArrayBuffer is not allowed.'
+ })
+ }
- // 4. Return output.
+ // 3. If the conversion is not to an IDL type associated
+ // with the [AllowResizable] extended attribute, and
+ // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
+ // true, then throw a TypeError.
+ if (V.buffer.resizable || V.buffer.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
+ }
- const sliced = bytes.slice(slice)
- return new TextDecoder(encoding).decode(sliced)
+ // 4. Return the IDL DataView value that is a reference
+ // to the same object as V.
+ return V
}
-/**
- * @see https://encoding.spec.whatwg.org/#bom-sniff
- * @param {Uint8Array} ioQueue
- */
-function BOMSniffing (ioQueue) {
- // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
- // converted to a byte sequence.
- const [a, b, c] = ioQueue
+// https://webidl.spec.whatwg.org/#BufferSource
+webidl.converters.BufferSource = function (V, prefix, name, opts) {
+ if (types.isAnyArrayBuffer(V)) {
+ return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })
+ }
- // 2. For each of the rows in the table below, starting with
- // the first one and going down, if BOM starts with the
- // bytes given in the first column, then return the
- // encoding given in the cell in the second column of that
- // row. Otherwise, return null.
- if (a === 0xEF && b === 0xBB && c === 0xBF) {
- return 'UTF-8'
- } else if (a === 0xFE && b === 0xFF) {
- return 'UTF-16BE'
- } else if (a === 0xFF && b === 0xFE) {
- return 'UTF-16LE'
+ if (types.isTypedArray(V)) {
+ return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })
}
- return null
+ if (types.isDataView(V)) {
+ return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })
+ }
+
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: `${name} ("${webidl.util.Stringify(V)}")`,
+ types: ['BufferSource']
+ })
}
-/**
- * @param {Uint8Array[]} sequences
- */
-function combineByteSequences (sequences) {
- const size = sequences.reduce((a, b) => {
- return a + b.byteLength
- }, 0)
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.ByteString
+)
- let offset = 0
+webidl.converters['sequence>'] = webidl.sequenceConverter(
+ webidl.converters['sequence']
+)
- return sequences.reduce((a, b) => {
- a.set(b, offset)
- offset += b.byteLength
- return a
- }, new Uint8Array(size))
-}
+webidl.converters['record'] = webidl.recordConverter(
+ webidl.converters.ByteString,
+ webidl.converters.ByteString
+)
module.exports = {
- staticPropertyDescriptors,
- readOperation,
- fireAProgressEvent
+ webidl
}
/***/ }),
-/***/ 1892:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+/***/ 2607:
+/***/ ((module) => {
-// We include a version number for the Dispatcher API. In case of breaking changes,
-// this version number must be increased to avoid conflicts.
-const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const Agent = __nccwpck_require__(7890)
-if (getGlobalDispatcher() === undefined) {
- setGlobalDispatcher(new Agent())
-}
+/**
+ * @see https://encoding.spec.whatwg.org/#concept-encoding-get
+ * @param {string|undefined} label
+ */
+function getEncoding (label) {
+ if (!label) {
+ return 'failure'
+ }
-function setGlobalDispatcher (agent) {
- if (!agent || typeof agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument agent must implement Agent')
+ // 1. Remove any leading and trailing ASCII whitespace from label.
+ // 2. If label is an ASCII case-insensitive match for any of the
+ // labels listed in the table below, then return the
+ // corresponding encoding; otherwise return failure.
+ switch (label.trim().toLowerCase()) {
+ case 'unicode-1-1-utf-8':
+ case 'unicode11utf8':
+ case 'unicode20utf8':
+ case 'utf-8':
+ case 'utf8':
+ case 'x-unicode20utf8':
+ return 'UTF-8'
+ case '866':
+ case 'cp866':
+ case 'csibm866':
+ case 'ibm866':
+ return 'IBM866'
+ case 'csisolatin2':
+ case 'iso-8859-2':
+ case 'iso-ir-101':
+ case 'iso8859-2':
+ case 'iso88592':
+ case 'iso_8859-2':
+ case 'iso_8859-2:1987':
+ case 'l2':
+ case 'latin2':
+ return 'ISO-8859-2'
+ case 'csisolatin3':
+ case 'iso-8859-3':
+ case 'iso-ir-109':
+ case 'iso8859-3':
+ case 'iso88593':
+ case 'iso_8859-3':
+ case 'iso_8859-3:1988':
+ case 'l3':
+ case 'latin3':
+ return 'ISO-8859-3'
+ case 'csisolatin4':
+ case 'iso-8859-4':
+ case 'iso-ir-110':
+ case 'iso8859-4':
+ case 'iso88594':
+ case 'iso_8859-4':
+ case 'iso_8859-4:1988':
+ case 'l4':
+ case 'latin4':
+ return 'ISO-8859-4'
+ case 'csisolatincyrillic':
+ case 'cyrillic':
+ case 'iso-8859-5':
+ case 'iso-ir-144':
+ case 'iso8859-5':
+ case 'iso88595':
+ case 'iso_8859-5':
+ case 'iso_8859-5:1988':
+ return 'ISO-8859-5'
+ case 'arabic':
+ case 'asmo-708':
+ case 'csiso88596e':
+ case 'csiso88596i':
+ case 'csisolatinarabic':
+ case 'ecma-114':
+ case 'iso-8859-6':
+ case 'iso-8859-6-e':
+ case 'iso-8859-6-i':
+ case 'iso-ir-127':
+ case 'iso8859-6':
+ case 'iso88596':
+ case 'iso_8859-6':
+ case 'iso_8859-6:1987':
+ return 'ISO-8859-6'
+ case 'csisolatingreek':
+ case 'ecma-118':
+ case 'elot_928':
+ case 'greek':
+ case 'greek8':
+ case 'iso-8859-7':
+ case 'iso-ir-126':
+ case 'iso8859-7':
+ case 'iso88597':
+ case 'iso_8859-7':
+ case 'iso_8859-7:1987':
+ case 'sun_eu_greek':
+ return 'ISO-8859-7'
+ case 'csiso88598e':
+ case 'csisolatinhebrew':
+ case 'hebrew':
+ case 'iso-8859-8':
+ case 'iso-8859-8-e':
+ case 'iso-ir-138':
+ case 'iso8859-8':
+ case 'iso88598':
+ case 'iso_8859-8':
+ case 'iso_8859-8:1988':
+ case 'visual':
+ return 'ISO-8859-8'
+ case 'csiso88598i':
+ case 'iso-8859-8-i':
+ case 'logical':
+ return 'ISO-8859-8-I'
+ case 'csisolatin6':
+ case 'iso-8859-10':
+ case 'iso-ir-157':
+ case 'iso8859-10':
+ case 'iso885910':
+ case 'l6':
+ case 'latin6':
+ return 'ISO-8859-10'
+ case 'iso-8859-13':
+ case 'iso8859-13':
+ case 'iso885913':
+ return 'ISO-8859-13'
+ case 'iso-8859-14':
+ case 'iso8859-14':
+ case 'iso885914':
+ return 'ISO-8859-14'
+ case 'csisolatin9':
+ case 'iso-8859-15':
+ case 'iso8859-15':
+ case 'iso885915':
+ case 'iso_8859-15':
+ case 'l9':
+ return 'ISO-8859-15'
+ case 'iso-8859-16':
+ return 'ISO-8859-16'
+ case 'cskoi8r':
+ case 'koi':
+ case 'koi8':
+ case 'koi8-r':
+ case 'koi8_r':
+ return 'KOI8-R'
+ case 'koi8-ru':
+ case 'koi8-u':
+ return 'KOI8-U'
+ case 'csmacintosh':
+ case 'mac':
+ case 'macintosh':
+ case 'x-mac-roman':
+ return 'macintosh'
+ case 'iso-8859-11':
+ case 'iso8859-11':
+ case 'iso885911':
+ case 'tis-620':
+ case 'windows-874':
+ return 'windows-874'
+ case 'cp1250':
+ case 'windows-1250':
+ case 'x-cp1250':
+ return 'windows-1250'
+ case 'cp1251':
+ case 'windows-1251':
+ case 'x-cp1251':
+ return 'windows-1251'
+ case 'ansi_x3.4-1968':
+ case 'ascii':
+ case 'cp1252':
+ case 'cp819':
+ case 'csisolatin1':
+ case 'ibm819':
+ case 'iso-8859-1':
+ case 'iso-ir-100':
+ case 'iso8859-1':
+ case 'iso88591':
+ case 'iso_8859-1':
+ case 'iso_8859-1:1987':
+ case 'l1':
+ case 'latin1':
+ case 'us-ascii':
+ case 'windows-1252':
+ case 'x-cp1252':
+ return 'windows-1252'
+ case 'cp1253':
+ case 'windows-1253':
+ case 'x-cp1253':
+ return 'windows-1253'
+ case 'cp1254':
+ case 'csisolatin5':
+ case 'iso-8859-9':
+ case 'iso-ir-148':
+ case 'iso8859-9':
+ case 'iso88599':
+ case 'iso_8859-9':
+ case 'iso_8859-9:1989':
+ case 'l5':
+ case 'latin5':
+ case 'windows-1254':
+ case 'x-cp1254':
+ return 'windows-1254'
+ case 'cp1255':
+ case 'windows-1255':
+ case 'x-cp1255':
+ return 'windows-1255'
+ case 'cp1256':
+ case 'windows-1256':
+ case 'x-cp1256':
+ return 'windows-1256'
+ case 'cp1257':
+ case 'windows-1257':
+ case 'x-cp1257':
+ return 'windows-1257'
+ case 'cp1258':
+ case 'windows-1258':
+ case 'x-cp1258':
+ return 'windows-1258'
+ case 'x-mac-cyrillic':
+ case 'x-mac-ukrainian':
+ return 'x-mac-cyrillic'
+ case 'chinese':
+ case 'csgb2312':
+ case 'csiso58gb231280':
+ case 'gb2312':
+ case 'gb_2312':
+ case 'gb_2312-80':
+ case 'gbk':
+ case 'iso-ir-58':
+ case 'x-gbk':
+ return 'GBK'
+ case 'gb18030':
+ return 'gb18030'
+ case 'big5':
+ case 'big5-hkscs':
+ case 'cn-big5':
+ case 'csbig5':
+ case 'x-x-big5':
+ return 'Big5'
+ case 'cseucpkdfmtjapanese':
+ case 'euc-jp':
+ case 'x-euc-jp':
+ return 'EUC-JP'
+ case 'csiso2022jp':
+ case 'iso-2022-jp':
+ return 'ISO-2022-JP'
+ case 'csshiftjis':
+ case 'ms932':
+ case 'ms_kanji':
+ case 'shift-jis':
+ case 'shift_jis':
+ case 'sjis':
+ case 'windows-31j':
+ case 'x-sjis':
+ return 'Shift_JIS'
+ case 'cseuckr':
+ case 'csksc56011987':
+ case 'euc-kr':
+ case 'iso-ir-149':
+ case 'korean':
+ case 'ks_c_5601-1987':
+ case 'ks_c_5601-1989':
+ case 'ksc5601':
+ case 'ksc_5601':
+ case 'windows-949':
+ return 'EUC-KR'
+ case 'csiso2022kr':
+ case 'hz-gb-2312':
+ case 'iso-2022-cn':
+ case 'iso-2022-cn-ext':
+ case 'iso-2022-kr':
+ case 'replacement':
+ return 'replacement'
+ case 'unicodefffe':
+ case 'utf-16be':
+ return 'UTF-16BE'
+ case 'csunicode':
+ case 'iso-10646-ucs-2':
+ case 'ucs-2':
+ case 'unicode':
+ case 'unicodefeff':
+ case 'utf-16':
+ case 'utf-16le':
+ return 'UTF-16LE'
+ case 'x-user-defined':
+ return 'x-user-defined'
+ default: return 'failure'
}
- Object.defineProperty(globalThis, globalDispatcher, {
- value: agent,
- writable: true,
- enumerable: false,
- configurable: false
- })
-}
-
-function getGlobalDispatcher () {
- return globalThis[globalDispatcher]
}
module.exports = {
- setGlobalDispatcher,
- getGlobalDispatcher
-}
-
-
-/***/ }),
-
-/***/ 6930:
-/***/ ((module) => {
-
-"use strict";
-
-
-module.exports = class DecoratorHandler {
- constructor (handler) {
- this.handler = handler
- }
-
- onConnect (...args) {
- return this.handler.onConnect(...args)
- }
-
- onError (...args) {
- return this.handler.onError(...args)
- }
-
- onUpgrade (...args) {
- return this.handler.onUpgrade(...args)
- }
-
- onHeaders (...args) {
- return this.handler.onHeaders(...args)
- }
-
- onData (...args) {
- return this.handler.onData(...args)
- }
-
- onComplete (...args) {
- return this.handler.onComplete(...args)
- }
-
- onBodySent (...args) {
- return this.handler.onBodySent(...args)
- }
+ getEncoding
}
/***/ }),
-/***/ 2860:
+/***/ 8355:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const util = __nccwpck_require__(3983)
-const { kBodyUsed } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const EE = __nccwpck_require__(2361)
-
-const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
-
-const kBody = Symbol('body')
-
-class BodyAsyncIterable {
- constructor (body) {
- this[kBody] = body
- this[kBodyUsed] = false
- }
-
- async * [Symbol.asyncIterator] () {
- assert(!this[kBodyUsed], 'disturbed')
- this[kBodyUsed] = true
- yield * this[kBody]
- }
-}
-
-class RedirectHandler {
- constructor (dispatch, maxRedirections, opts, handler) {
- if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
- }
-
- util.validateHandler(handler, opts.method, opts.upgrade)
-
- this.dispatch = dispatch
- this.location = null
- this.abort = null
- this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
- this.maxRedirections = maxRedirections
- this.handler = handler
- this.history = []
-
- if (util.isStream(this.opts.body)) {
- // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
- // so that it can be dispatched again?
- // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
- if (util.bodyLength(this.opts.body) === 0) {
- this.opts.body
- .on('data', function () {
- assert(false)
- })
- }
-
- if (typeof this.opts.body.readableDidRead !== 'boolean') {
- this.opts.body[kBodyUsed] = false
- EE.prototype.on.call(this.opts.body, 'data', function () {
- this[kBodyUsed] = true
- })
- }
- } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
- // TODO (fix): We can't access ReadableStream internal state
- // to determine whether or not it has been disturbed. This is just
- // a workaround.
- this.opts.body = new BodyAsyncIterable(this.opts.body)
- } else if (
- this.opts.body &&
- typeof this.opts.body !== 'string' &&
- !ArrayBuffer.isView(this.opts.body) &&
- util.isIterable(this.opts.body)
- ) {
- // TODO: Should we allow re-using iterable if !this.opts.idempotent
- // or through some other flag?
- this.opts.body = new BodyAsyncIterable(this.opts.body)
- }
- }
-
- onConnect (abort) {
- this.abort = abort
- this.handler.onConnect(abort, { history: this.history })
- }
-
- onUpgrade (statusCode, headers, socket) {
- this.handler.onUpgrade(statusCode, headers, socket)
- }
-
- onError (error) {
- this.handler.onError(error)
- }
-
- onHeaders (statusCode, headers, resume, statusText) {
- this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
- ? null
- : parseLocation(statusCode, headers)
-
- if (this.opts.origin) {
- this.history.push(new URL(this.opts.path, this.opts.origin))
- }
-
- if (!this.location) {
- return this.handler.onHeaders(statusCode, headers, resume, statusText)
- }
-
- const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
- const path = search ? `${pathname}${search}` : pathname
-
- // Remove headers referring to the original URL.
- // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
- // https://tools.ietf.org/html/rfc7231#section-6.4
- this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
- this.opts.path = path
- this.opts.origin = origin
- this.opts.maxRedirections = 0
- this.opts.query = null
-
- // https://tools.ietf.org/html/rfc7231#section-6.4.4
- // In case of HTTP 303, always replace method to be either HEAD or GET
- if (statusCode === 303 && this.opts.method !== 'HEAD') {
- this.opts.method = 'GET'
- this.opts.body = null
- }
- }
-
- onData (chunk) {
- if (this.location) {
- /*
- https://tools.ietf.org/html/rfc7231#section-6.4
- TLDR: undici always ignores 3xx response bodies.
- Redirection is used to serve the requested resource from another URL, so it is assumes that
- no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
+const {
+ staticPropertyDescriptors,
+ readOperation,
+ fireAProgressEvent
+} = __nccwpck_require__(3610)
+const {
+ kState,
+ kError,
+ kResult,
+ kEvents,
+ kAborted
+} = __nccwpck_require__(961)
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
- For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
- (which means it's optional and not mandated) contain just an hyperlink to the value of
- the Location response header, so the body can be ignored safely.
+class FileReader extends EventTarget {
+ constructor () {
+ super()
- For status 300, which is "Multiple Choices", the spec mentions both generating a Location
- response header AND a response body with the other possible location to follow.
- Since the spec explicitily chooses not to specify a format for such body and leave it to
- servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
- */
- } else {
- return this.handler.onData(chunk)
+ this[kState] = 'empty'
+ this[kResult] = null
+ this[kError] = null
+ this[kEvents] = {
+ loadend: null,
+ error: null,
+ abort: null,
+ load: null,
+ progress: null,
+ loadstart: null
}
}
- onComplete (trailers) {
- if (this.location) {
- /*
- https://tools.ietf.org/html/rfc7231#section-6.4
-
- TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
- and neither are useful if present.
-
- See comment on onData method above for more detailed informations.
- */
+ /**
+ * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
+ * @param {import('buffer').Blob} blob
+ */
+ readAsArrayBuffer (blob) {
+ webidl.brandCheck(this, FileReader)
- this.location = null
- this.abort = null
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')
- this.dispatch(this.opts, this)
- } else {
- this.handler.onComplete(trailers)
- }
- }
+ blob = webidl.converters.Blob(blob, { strict: false })
- onBodySent (chunk) {
- if (this.handler.onBodySent) {
- this.handler.onBodySent(chunk)
- }
+ // The readAsArrayBuffer(blob) method, when invoked,
+ // must initiate a read operation for blob with ArrayBuffer.
+ readOperation(this, blob, 'ArrayBuffer')
}
-}
-function parseLocation (statusCode, headers) {
- if (redirectableStatusCodes.indexOf(statusCode) === -1) {
- return null
- }
+ /**
+ * @see https://w3c.github.io/FileAPI/#readAsBinaryString
+ * @param {import('buffer').Blob} blob
+ */
+ readAsBinaryString (blob) {
+ webidl.brandCheck(this, FileReader)
- for (let i = 0; i < headers.length; i += 2) {
- if (headers[i].toString().toLowerCase() === 'location') {
- return headers[i + 1]
- }
- }
-}
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')
-// https://tools.ietf.org/html/rfc7231#section-6.4.4
-function shouldRemoveHeader (header, removeContent, unknownOrigin) {
- if (header.length === 4) {
- return util.headerNameToString(header) === 'host'
- }
- if (removeContent && util.headerNameToString(header).startsWith('content-')) {
- return true
- }
- if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
- const name = util.headerNameToString(header)
- return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
- }
- return false
-}
+ blob = webidl.converters.Blob(blob, { strict: false })
-// https://tools.ietf.org/html/rfc7231#section-6.4
-function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
- const ret = []
- if (Array.isArray(headers)) {
- for (let i = 0; i < headers.length; i += 2) {
- if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
- ret.push(headers[i], headers[i + 1])
- }
- }
- } else if (headers && typeof headers === 'object') {
- for (const key of Object.keys(headers)) {
- if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
- ret.push(key, headers[key])
- }
- }
- } else {
- assert(headers == null, 'headers must be an object or an array')
+ // The readAsBinaryString(blob) method, when invoked,
+ // must initiate a read operation for blob with BinaryString.
+ readOperation(this, blob, 'BinaryString')
}
- return ret
-}
-
-module.exports = RedirectHandler
-
-
-/***/ }),
-
-/***/ 2286:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-const assert = __nccwpck_require__(9491)
-
-const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
-const { RequestRetryError } = __nccwpck_require__(8045)
-const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
-
-function calculateRetryAfterHeader (retryAfter) {
- const current = Date.now()
- const diff = new Date(retryAfter).getTime() - current
-
- return diff
-}
-
-class RetryHandler {
- constructor (opts, handlers) {
- const { retryOptions, ...dispatchOpts } = opts
- const {
- // Retry scoped
- retry: retryFn,
- maxRetries,
- maxTimeout,
- minTimeout,
- timeoutFactor,
- // Response scoped
- methods,
- errorCodes,
- retryAfter,
- statusCodes
- } = retryOptions ?? {}
-
- this.dispatch = handlers.dispatch
- this.handler = handlers.handler
- this.opts = dispatchOpts
- this.abort = null
- this.aborted = false
- this.retryOpts = {
- retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
- retryAfter: retryAfter ?? true,
- maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
- timeout: minTimeout ?? 500, // .5s
- timeoutFactor: timeoutFactor ?? 2,
- maxRetries: maxRetries ?? 5,
- // What errors we should retry
- methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
- // Indicates which errors to retry
- statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
- // List of errors to retry
- errorCodes: errorCodes ?? [
- 'ECONNRESET',
- 'ECONNREFUSED',
- 'ENOTFOUND',
- 'ENETDOWN',
- 'ENETUNREACH',
- 'EHOSTDOWN',
- 'EHOSTUNREACH',
- 'EPIPE'
- ]
- }
-
- this.retryCount = 0
- this.start = 0
- this.end = null
- this.etag = null
- this.resume = null
- // Handle possible onConnect duplication
- this.handler.onConnect(reason => {
- this.aborted = true
- if (this.abort) {
- this.abort(reason)
- } else {
- this.reason = reason
- }
- })
- }
+ /**
+ * @see https://w3c.github.io/FileAPI/#readAsDataText
+ * @param {import('buffer').Blob} blob
+ * @param {string?} encoding
+ */
+ readAsText (blob, encoding = undefined) {
+ webidl.brandCheck(this, FileReader)
- onRequestSent () {
- if (this.handler.onRequestSent) {
- this.handler.onRequestSent()
- }
- }
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')
- onUpgrade (statusCode, headers, socket) {
- if (this.handler.onUpgrade) {
- this.handler.onUpgrade(statusCode, headers, socket)
- }
- }
+ blob = webidl.converters.Blob(blob, { strict: false })
- onConnect (abort) {
- if (this.aborted) {
- abort(this.reason)
- } else {
- this.abort = abort
+ if (encoding !== undefined) {
+ encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')
}
- }
- onBodySent (chunk) {
- if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
+ // The readAsText(blob, encoding) method, when invoked,
+ // must initiate a read operation for blob with Text and encoding.
+ readOperation(this, blob, 'Text', encoding)
}
- static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
- const { statusCode, code, headers } = err
- const { method, retryOptions } = opts
- const {
- maxRetries,
- timeout,
- maxTimeout,
- timeoutFactor,
- statusCodes,
- errorCodes,
- methods
- } = retryOptions
- let { counter, currentTimeout } = state
-
- currentTimeout =
- currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
-
- // Any code that is not a Undici's originated and allowed to retry
- if (
- code &&
- code !== 'UND_ERR_REQ_RETRY' &&
- code !== 'UND_ERR_SOCKET' &&
- !errorCodes.includes(code)
- ) {
- cb(err)
- return
- }
-
- // If a set of method are provided and the current method is not in the list
- if (Array.isArray(methods) && !methods.includes(method)) {
- cb(err)
- return
- }
-
- // If a set of status code are provided and the current status code is not in the list
- if (
- statusCode != null &&
- Array.isArray(statusCodes) &&
- !statusCodes.includes(statusCode)
- ) {
- cb(err)
- return
- }
-
- // If we reached the max number of retries
- if (counter > maxRetries) {
- cb(err)
- return
- }
-
- let retryAfterHeader = headers != null && headers['retry-after']
- if (retryAfterHeader) {
- retryAfterHeader = Number(retryAfterHeader)
- retryAfterHeader = isNaN(retryAfterHeader)
- ? calculateRetryAfterHeader(retryAfterHeader)
- : retryAfterHeader * 1e3 // Retry-After is in seconds
- }
+ /**
+ * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
+ * @param {import('buffer').Blob} blob
+ */
+ readAsDataURL (blob) {
+ webidl.brandCheck(this, FileReader)
- const retryTimeout =
- retryAfterHeader > 0
- ? Math.min(retryAfterHeader, maxTimeout)
- : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')
- state.currentTimeout = retryTimeout
+ blob = webidl.converters.Blob(blob, { strict: false })
- setTimeout(() => cb(null), retryTimeout)
+ // The readAsDataURL(blob) method, when invoked, must
+ // initiate a read operation for blob with DataURL.
+ readOperation(this, blob, 'DataURL')
}
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const headers = parseHeaders(rawHeaders)
-
- this.retryCount += 1
-
- if (statusCode >= 300) {
- this.abort(
- new RequestRetryError('Request failed', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
-
- // Checkpoint for resume from where we left it
- if (this.resume != null) {
- this.resume = null
-
- if (statusCode !== 206) {
- return true
- }
-
- const contentRange = parseRangeHeader(headers['content-range'])
- // If no content range
- if (!contentRange) {
- this.abort(
- new RequestRetryError('Content-Range mismatch', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
+ /**
+ * @see https://w3c.github.io/FileAPI/#dfn-abort
+ */
+ abort () {
+ // 1. If this's state is "empty" or if this's state is
+ // "done" set this's result to null and terminate
+ // this algorithm.
+ if (this[kState] === 'empty' || this[kState] === 'done') {
+ this[kResult] = null
+ return
+ }
- // Let's start with a weak etag check
- if (this.etag != null && this.etag !== headers.etag) {
- this.abort(
- new RequestRetryError('ETag mismatch', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
+ // 2. If this's state is "loading" set this's state to
+ // "done" and set this's result to null.
+ if (this[kState] === 'loading') {
+ this[kState] = 'done'
+ this[kResult] = null
+ }
- const { start, size, end = size } = contentRange
+ // 3. If there are any tasks from this on the file reading
+ // task source in an affiliated task queue, then remove
+ // those tasks from that task queue.
+ this[kAborted] = true
- assert(this.start === start, 'content-range mismatch')
- assert(this.end == null || this.end === end, 'content-range mismatch')
+ // 4. Terminate the algorithm for the read method being processed.
+ // TODO
- this.resume = resume
- return true
+ // 5. Fire a progress event called abort at this.
+ fireAProgressEvent('abort', this)
+
+ // 6. If this's state is not "loading", fire a progress
+ // event called loadend at this.
+ if (this[kState] !== 'loading') {
+ fireAProgressEvent('loadend', this)
}
+ }
- if (this.end == null) {
- if (statusCode === 206) {
- // First time we receive 206
- const range = parseRangeHeader(headers['content-range'])
+ /**
+ * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
+ */
+ get readyState () {
+ webidl.brandCheck(this, FileReader)
- if (range == null) {
- return this.handler.onHeaders(
- statusCode,
- rawHeaders,
- resume,
- statusMessage
- )
- }
+ switch (this[kState]) {
+ case 'empty': return this.EMPTY
+ case 'loading': return this.LOADING
+ case 'done': return this.DONE
+ }
+ }
+
+ /**
+ * @see https://w3c.github.io/FileAPI/#dom-filereader-result
+ */
+ get result () {
+ webidl.brandCheck(this, FileReader)
- const { start, size, end = size } = range
+ // The result attribute’s getter, when invoked, must return
+ // this's result.
+ return this[kResult]
+ }
- assert(
- start != null && Number.isFinite(start) && this.start !== start,
- 'content-range mismatch'
- )
- assert(Number.isFinite(start))
- assert(
- end != null && Number.isFinite(end) && this.end !== end,
- 'invalid content-length'
- )
+ /**
+ * @see https://w3c.github.io/FileAPI/#dom-filereader-error
+ */
+ get error () {
+ webidl.brandCheck(this, FileReader)
- this.start = start
- this.end = end
- }
+ // The error attribute’s getter, when invoked, must return
+ // this's error.
+ return this[kError]
+ }
- // We make our best to checkpoint the body for further range headers
- if (this.end == null) {
- const contentLength = headers['content-length']
- this.end = contentLength != null ? Number(contentLength) : null
- }
+ get onloadend () {
+ webidl.brandCheck(this, FileReader)
- assert(Number.isFinite(this.start))
- assert(
- this.end == null || Number.isFinite(this.end),
- 'invalid content-length'
- )
+ return this[kEvents].loadend
+ }
- this.resume = resume
- this.etag = headers.etag != null ? headers.etag : null
+ set onloadend (fn) {
+ webidl.brandCheck(this, FileReader)
- return this.handler.onHeaders(
- statusCode,
- rawHeaders,
- resume,
- statusMessage
- )
+ if (this[kEvents].loadend) {
+ this.removeEventListener('loadend', this[kEvents].loadend)
}
- const err = new RequestRetryError('Request failed', statusCode, {
- headers,
- count: this.retryCount
- })
+ if (typeof fn === 'function') {
+ this[kEvents].loadend = fn
+ this.addEventListener('loadend', fn)
+ } else {
+ this[kEvents].loadend = null
+ }
+ }
- this.abort(err)
+ get onerror () {
+ webidl.brandCheck(this, FileReader)
- return false
+ return this[kEvents].error
}
- onData (chunk) {
- this.start += chunk.length
+ set onerror (fn) {
+ webidl.brandCheck(this, FileReader)
- return this.handler.onData(chunk)
- }
+ if (this[kEvents].error) {
+ this.removeEventListener('error', this[kEvents].error)
+ }
- onComplete (rawTrailers) {
- this.retryCount = 0
- return this.handler.onComplete(rawTrailers)
+ if (typeof fn === 'function') {
+ this[kEvents].error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this[kEvents].error = null
+ }
}
- onError (err) {
- if (this.aborted || isDisturbed(this.opts.body)) {
- return this.handler.onError(err)
- }
+ get onloadstart () {
+ webidl.brandCheck(this, FileReader)
- this.retryOpts.retry(
- err,
- {
- state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
- opts: { retryOptions: this.retryOpts, ...this.opts }
- },
- onRetry.bind(this)
- )
+ return this[kEvents].loadstart
+ }
- function onRetry (err) {
- if (err != null || this.aborted || isDisturbed(this.opts.body)) {
- return this.handler.onError(err)
- }
+ set onloadstart (fn) {
+ webidl.brandCheck(this, FileReader)
- if (this.start !== 0) {
- this.opts = {
- ...this.opts,
- headers: {
- ...this.opts.headers,
- range: `bytes=${this.start}-${this.end ?? ''}`
- }
- }
- }
+ if (this[kEvents].loadstart) {
+ this.removeEventListener('loadstart', this[kEvents].loadstart)
+ }
- try {
- this.dispatch(this.opts, this)
- } catch (err) {
- this.handler.onError(err)
- }
+ if (typeof fn === 'function') {
+ this[kEvents].loadstart = fn
+ this.addEventListener('loadstart', fn)
+ } else {
+ this[kEvents].loadstart = null
}
}
-}
-module.exports = RetryHandler
+ get onprogress () {
+ webidl.brandCheck(this, FileReader)
+ return this[kEvents].progress
+ }
-/***/ }),
+ set onprogress (fn) {
+ webidl.brandCheck(this, FileReader)
-/***/ 8861:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (this[kEvents].progress) {
+ this.removeEventListener('progress', this[kEvents].progress)
+ }
-"use strict";
+ if (typeof fn === 'function') {
+ this[kEvents].progress = fn
+ this.addEventListener('progress', fn)
+ } else {
+ this[kEvents].progress = null
+ }
+ }
+ get onload () {
+ webidl.brandCheck(this, FileReader)
-const RedirectHandler = __nccwpck_require__(2860)
+ return this[kEvents].load
+ }
-function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
- return (dispatch) => {
- return function Intercept (opts, handler) {
- const { maxRedirections = defaultMaxRedirections } = opts
+ set onload (fn) {
+ webidl.brandCheck(this, FileReader)
- if (!maxRedirections) {
- return dispatch(opts, handler)
- }
+ if (this[kEvents].load) {
+ this.removeEventListener('load', this[kEvents].load)
+ }
- const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
- opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
- return dispatch(opts, redirectHandler)
+ if (typeof fn === 'function') {
+ this[kEvents].load = fn
+ this.addEventListener('load', fn)
+ } else {
+ this[kEvents].load = null
}
}
-}
-
-module.exports = createRedirectInterceptor
+ get onabort () {
+ webidl.brandCheck(this, FileReader)
-/***/ }),
+ return this[kEvents].abort
+ }
-/***/ 953:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ set onabort (fn) {
+ webidl.brandCheck(this, FileReader)
-"use strict";
+ if (this[kEvents].abort) {
+ this.removeEventListener('abort', this[kEvents].abort)
+ }
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
-const utils_1 = __nccwpck_require__(1891);
-// C headers
-var ERROR;
-(function (ERROR) {
- ERROR[ERROR["OK"] = 0] = "OK";
- ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
- ERROR[ERROR["STRICT"] = 2] = "STRICT";
- ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
- ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
- ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
- ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
- ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
- ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
- ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
- ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
- ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
- ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
- ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
- ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
- ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
- ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
- ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
- ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
- ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
- ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
- ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
- ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
- ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
- ERROR[ERROR["USER"] = 24] = "USER";
-})(ERROR = exports.ERROR || (exports.ERROR = {}));
-var TYPE;
-(function (TYPE) {
- TYPE[TYPE["BOTH"] = 0] = "BOTH";
- TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
- TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
-})(TYPE = exports.TYPE || (exports.TYPE = {}));
-var FLAGS;
-(function (FLAGS) {
- FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
- FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
- FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
- FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
- FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
- FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
- FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
- FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
- // 1 << 8 is unused
- FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
-})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
-var LENIENT_FLAGS;
-(function (LENIENT_FLAGS) {
- LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
- LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
- LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
-})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
-var METHODS;
-(function (METHODS) {
- METHODS[METHODS["DELETE"] = 0] = "DELETE";
- METHODS[METHODS["GET"] = 1] = "GET";
- METHODS[METHODS["HEAD"] = 2] = "HEAD";
- METHODS[METHODS["POST"] = 3] = "POST";
- METHODS[METHODS["PUT"] = 4] = "PUT";
- /* pathological */
- METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
- METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
- METHODS[METHODS["TRACE"] = 7] = "TRACE";
- /* WebDAV */
- METHODS[METHODS["COPY"] = 8] = "COPY";
- METHODS[METHODS["LOCK"] = 9] = "LOCK";
- METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
- METHODS[METHODS["MOVE"] = 11] = "MOVE";
- METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
- METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
- METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
- METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
- METHODS[METHODS["BIND"] = 16] = "BIND";
- METHODS[METHODS["REBIND"] = 17] = "REBIND";
- METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
- METHODS[METHODS["ACL"] = 19] = "ACL";
- /* subversion */
- METHODS[METHODS["REPORT"] = 20] = "REPORT";
- METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
- METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
- METHODS[METHODS["MERGE"] = 23] = "MERGE";
- /* upnp */
- METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
- METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
- METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
- METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
- /* RFC-5789 */
- METHODS[METHODS["PATCH"] = 28] = "PATCH";
- METHODS[METHODS["PURGE"] = 29] = "PURGE";
- /* CalDAV */
- METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
- /* RFC-2068, section 19.6.1.2 */
- METHODS[METHODS["LINK"] = 31] = "LINK";
- METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
- /* icecast */
- METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
- /* RFC-7540, section 11.6 */
- METHODS[METHODS["PRI"] = 34] = "PRI";
- /* RFC-2326 RTSP */
- METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
- METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
- METHODS[METHODS["SETUP"] = 37] = "SETUP";
- METHODS[METHODS["PLAY"] = 38] = "PLAY";
- METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
- METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
- METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
- METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
- METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
- METHODS[METHODS["RECORD"] = 44] = "RECORD";
- /* RAOP */
- METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
-})(METHODS = exports.METHODS || (exports.METHODS = {}));
-exports.METHODS_HTTP = [
- METHODS.DELETE,
- METHODS.GET,
- METHODS.HEAD,
- METHODS.POST,
- METHODS.PUT,
- METHODS.CONNECT,
- METHODS.OPTIONS,
- METHODS.TRACE,
- METHODS.COPY,
- METHODS.LOCK,
- METHODS.MKCOL,
- METHODS.MOVE,
- METHODS.PROPFIND,
- METHODS.PROPPATCH,
- METHODS.SEARCH,
- METHODS.UNLOCK,
- METHODS.BIND,
- METHODS.REBIND,
- METHODS.UNBIND,
- METHODS.ACL,
- METHODS.REPORT,
- METHODS.MKACTIVITY,
- METHODS.CHECKOUT,
- METHODS.MERGE,
- METHODS['M-SEARCH'],
- METHODS.NOTIFY,
- METHODS.SUBSCRIBE,
- METHODS.UNSUBSCRIBE,
- METHODS.PATCH,
- METHODS.PURGE,
- METHODS.MKCALENDAR,
- METHODS.LINK,
- METHODS.UNLINK,
- METHODS.PRI,
- // TODO(indutny): should we allow it with HTTP?
- METHODS.SOURCE,
-];
-exports.METHODS_ICE = [
- METHODS.SOURCE,
-];
-exports.METHODS_RTSP = [
- METHODS.OPTIONS,
- METHODS.DESCRIBE,
- METHODS.ANNOUNCE,
- METHODS.SETUP,
- METHODS.PLAY,
- METHODS.PAUSE,
- METHODS.TEARDOWN,
- METHODS.GET_PARAMETER,
- METHODS.SET_PARAMETER,
- METHODS.REDIRECT,
- METHODS.RECORD,
- METHODS.FLUSH,
- // For AirPlay
- METHODS.GET,
- METHODS.POST,
-];
-exports.METHOD_MAP = utils_1.enumToMap(METHODS);
-exports.H_METHOD_MAP = {};
-Object.keys(exports.METHOD_MAP).forEach((key) => {
- if (/^H/.test(key)) {
- exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
+ if (typeof fn === 'function') {
+ this[kEvents].abort = fn
+ this.addEventListener('abort', fn)
+ } else {
+ this[kEvents].abort = null
}
-});
-var FINISH;
-(function (FINISH) {
- FINISH[FINISH["SAFE"] = 0] = "SAFE";
- FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
- FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
-})(FINISH = exports.FINISH || (exports.FINISH = {}));
-exports.ALPHA = [];
-for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
- // Upper case
- exports.ALPHA.push(String.fromCharCode(i));
- // Lower case
- exports.ALPHA.push(String.fromCharCode(i + 0x20));
+ }
}
-exports.NUM_MAP = {
- 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
- 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
-};
-exports.HEX_MAP = {
- 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
- 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
- A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
- a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
-};
-exports.NUM = [
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-];
-exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
-exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
-exports.USERINFO_CHARS = exports.ALPHANUM
- .concat(exports.MARK)
- .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
-// TODO(indutny): use RFC
-exports.STRICT_URL_CHAR = [
- '!', '"', '$', '%', '&', '\'',
- '(', ')', '*', '+', ',', '-', '.', '/',
- ':', ';', '<', '=', '>',
- '@', '[', '\\', ']', '^', '_',
- '`',
- '{', '|', '}', '~',
-].concat(exports.ALPHANUM);
-exports.URL_CHAR = exports.STRICT_URL_CHAR
- .concat(['\t', '\f']);
-// All characters with 0x80 bit set to 1
-for (let i = 0x80; i <= 0xff; i++) {
- exports.URL_CHAR.push(i);
+
+// https://w3c.github.io/FileAPI/#dom-filereader-empty
+FileReader.EMPTY = FileReader.prototype.EMPTY = 0
+// https://w3c.github.io/FileAPI/#dom-filereader-loading
+FileReader.LOADING = FileReader.prototype.LOADING = 1
+// https://w3c.github.io/FileAPI/#dom-filereader-done
+FileReader.DONE = FileReader.prototype.DONE = 2
+
+Object.defineProperties(FileReader.prototype, {
+ EMPTY: staticPropertyDescriptors,
+ LOADING: staticPropertyDescriptors,
+ DONE: staticPropertyDescriptors,
+ readAsArrayBuffer: kEnumerableProperty,
+ readAsBinaryString: kEnumerableProperty,
+ readAsText: kEnumerableProperty,
+ readAsDataURL: kEnumerableProperty,
+ abort: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ result: kEnumerableProperty,
+ error: kEnumerableProperty,
+ onloadstart: kEnumerableProperty,
+ onprogress: kEnumerableProperty,
+ onload: kEnumerableProperty,
+ onabort: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onloadend: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'FileReader',
+ writable: false,
+ enumerable: false,
+ configurable: true
+ }
+})
+
+Object.defineProperties(FileReader, {
+ EMPTY: staticPropertyDescriptors,
+ LOADING: staticPropertyDescriptors,
+ DONE: staticPropertyDescriptors
+})
+
+module.exports = {
+ FileReader
}
-exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
-/* Tokens as defined by rfc 2616. Also lowercases them.
- * token = 1*
- * separators = "(" | ")" | "<" | ">" | "@"
- * | "," | ";" | ":" | "\" | <">
- * | "/" | "[" | "]" | "?" | "="
- * | "{" | "}" | SP | HT
- */
-exports.STRICT_TOKEN = [
- '!', '#', '$', '%', '&', '\'',
- '*', '+', '-', '.',
- '^', '_', '`',
- '|', '~',
-].concat(exports.ALPHANUM);
-exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
-/*
- * Verify that a char is a valid visible (printable) US-ASCII
- * character or %x80-FF
+
+
+/***/ }),
+
+/***/ 8573:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { webidl } = __nccwpck_require__(5893)
+
+const kState = Symbol('ProgressEvent state')
+
+/**
+ * @see https://xhr.spec.whatwg.org/#progressevent
*/
-exports.HEADER_CHARS = ['\t'];
-for (let i = 32; i <= 255; i++) {
- if (i !== 127) {
- exports.HEADER_CHARS.push(i);
+class ProgressEvent extends Event {
+ constructor (type, eventInitDict = {}) {
+ type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')
+ eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
+
+ super(type, eventInitDict)
+
+ this[kState] = {
+ lengthComputable: eventInitDict.lengthComputable,
+ loaded: eventInitDict.loaded,
+ total: eventInitDict.total
}
-}
-// ',' = \x44
-exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
-exports.MAJOR = exports.NUM_MAP;
-exports.MINOR = exports.MAJOR;
-var HEADER_STATE;
-(function (HEADER_STATE) {
- HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
- HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
- HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
- HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
- HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
- HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
- HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
- HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
- HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
-})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
-exports.SPECIAL_HEADERS = {
- 'connection': HEADER_STATE.CONNECTION,
- 'content-length': HEADER_STATE.CONTENT_LENGTH,
- 'proxy-connection': HEADER_STATE.CONNECTION,
- 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
- 'upgrade': HEADER_STATE.UPGRADE,
-};
-//# sourceMappingURL=constants.js.map
+ }
-/***/ }),
+ get lengthComputable () {
+ webidl.brandCheck(this, ProgressEvent)
-/***/ 1145:
-/***/ ((module) => {
+ return this[kState].lengthComputable
+ }
-module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZF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c3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhY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BUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHt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yAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8='
+ get loaded () {
+ webidl.brandCheck(this, ProgressEvent)
+ return this[kState].loaded
+ }
-/***/ }),
+ get total () {
+ webidl.brandCheck(this, ProgressEvent)
-/***/ 5627:
-/***/ ((module) => {
+ return this[kState].total
+ }
+}
+
+webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
+ {
+ key: 'lengthComputable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'loaded',
+ converter: webidl.converters['unsigned long long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'total',
+ converter: webidl.converters['unsigned long long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'bubbles',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'cancelable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'composed',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ }
+])
-module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9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X3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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QAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAe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ABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
+module.exports = {
+ ProgressEvent
+}
/***/ }),
-/***/ 1891:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 961:
+/***/ ((module) => {
-"use strict";
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.enumToMap = void 0;
-function enumToMap(obj) {
- const res = {};
- Object.keys(obj).forEach((key) => {
- const value = obj[key];
- if (typeof value === 'number') {
- res[key] = value;
- }
- });
- return res;
+
+module.exports = {
+ kState: Symbol('FileReader state'),
+ kResult: Symbol('FileReader result'),
+ kError: Symbol('FileReader error'),
+ kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
+ kEvents: Symbol('FileReader events'),
+ kAborted: Symbol('FileReader aborted')
}
-exports.enumToMap = enumToMap;
-//# sourceMappingURL=utils.js.map
+
/***/ }),
-/***/ 6771:
+/***/ 3610:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { kClients } = __nccwpck_require__(2785)
-const Agent = __nccwpck_require__(7890)
const {
- kAgent,
- kMockAgentSet,
- kMockAgentGet,
- kDispatches,
- kIsMockActive,
- kNetConnect,
- kGetNetConnect,
- kOptions,
- kFactory
-} = __nccwpck_require__(4347)
-const MockClient = __nccwpck_require__(8687)
-const MockPool = __nccwpck_require__(6193)
-const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
-const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
-const Dispatcher = __nccwpck_require__(412)
-const Pluralizer = __nccwpck_require__(8891)
-const PendingInterceptorsFormatter = __nccwpck_require__(6823)
-
-class FakeWeakRef {
- constructor (value) {
- this.value = value
- }
+ kState,
+ kError,
+ kResult,
+ kAborted,
+ kLastProgressEventFired
+} = __nccwpck_require__(961)
+const { ProgressEvent } = __nccwpck_require__(8573)
+const { getEncoding } = __nccwpck_require__(2607)
+const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(1900)
+const { types } = __nccwpck_require__(7975)
+const { StringDecoder } = __nccwpck_require__(3193)
+const { btoa } = __nccwpck_require__(4573)
- deref () {
- return this.value
- }
+/** @type {PropertyDescriptor} */
+const staticPropertyDescriptors = {
+ enumerable: true,
+ writable: false,
+ configurable: false
}
-class MockAgent extends Dispatcher {
- constructor (opts) {
- super(opts)
+/**
+ * @see https://w3c.github.io/FileAPI/#readOperation
+ * @param {import('./filereader').FileReader} fr
+ * @param {import('buffer').Blob} blob
+ * @param {string} type
+ * @param {string?} encodingName
+ */
+function readOperation (fr, blob, type, encodingName) {
+ // 1. If fr’s state is "loading", throw an InvalidStateError
+ // DOMException.
+ if (fr[kState] === 'loading') {
+ throw new DOMException('Invalid state', 'InvalidStateError')
+ }
- this[kNetConnect] = true
- this[kIsMockActive] = true
+ // 2. Set fr’s state to "loading".
+ fr[kState] = 'loading'
- // Instantiate Agent and encapsulate
- if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
- }
- const agent = opts && opts.agent ? opts.agent : new Agent(opts)
- this[kAgent] = agent
+ // 3. Set fr’s result to null.
+ fr[kResult] = null
- this[kClients] = agent[kClients]
- this[kOptions] = buildMockOptions(opts)
- }
+ // 4. Set fr’s error to null.
+ fr[kError] = null
- get (origin) {
- let dispatcher = this[kMockAgentGet](origin)
+ // 5. Let stream be the result of calling get stream on blob.
+ /** @type {import('stream/web').ReadableStream} */
+ const stream = blob.stream()
- if (!dispatcher) {
- dispatcher = this[kFactory](origin)
- this[kMockAgentSet](origin, dispatcher)
+ // 6. Let reader be the result of getting a reader from stream.
+ const reader = stream.getReader()
+
+ // 7. Let bytes be an empty byte sequence.
+ /** @type {Uint8Array[]} */
+ const bytes = []
+
+ // 8. Let chunkPromise be the result of reading a chunk from
+ // stream with reader.
+ let chunkPromise = reader.read()
+
+ // 9. Let isFirstChunk be true.
+ let isFirstChunk = true
+
+ // 10. In parallel, while true:
+ // Note: "In parallel" just means non-blocking
+ // Note 2: readOperation itself cannot be async as double
+ // reading the body would then reject the promise, instead
+ // of throwing an error.
+ ;(async () => {
+ while (!fr[kAborted]) {
+ // 1. Wait for chunkPromise to be fulfilled or rejected.
+ try {
+ const { done, value } = await chunkPromise
+
+ // 2. If chunkPromise is fulfilled, and isFirstChunk is
+ // true, queue a task to fire a progress event called
+ // loadstart at fr.
+ if (isFirstChunk && !fr[kAborted]) {
+ queueMicrotask(() => {
+ fireAProgressEvent('loadstart', fr)
+ })
+ }
+
+ // 3. Set isFirstChunk to false.
+ isFirstChunk = false
+
+ // 4. If chunkPromise is fulfilled with an object whose
+ // done property is false and whose value property is
+ // a Uint8Array object, run these steps:
+ if (!done && types.isUint8Array(value)) {
+ // 1. Let bs be the byte sequence represented by the
+ // Uint8Array object.
+
+ // 2. Append bs to bytes.
+ bytes.push(value)
+
+ // 3. If roughly 50ms have passed since these steps
+ // were last invoked, queue a task to fire a
+ // progress event called progress at fr.
+ if (
+ (
+ fr[kLastProgressEventFired] === undefined ||
+ Date.now() - fr[kLastProgressEventFired] >= 50
+ ) &&
+ !fr[kAborted]
+ ) {
+ fr[kLastProgressEventFired] = Date.now()
+ queueMicrotask(() => {
+ fireAProgressEvent('progress', fr)
+ })
+ }
+
+ // 4. Set chunkPromise to the result of reading a
+ // chunk from stream with reader.
+ chunkPromise = reader.read()
+ } else if (done) {
+ // 5. Otherwise, if chunkPromise is fulfilled with an
+ // object whose done property is true, queue a task
+ // to run the following steps and abort this algorithm:
+ queueMicrotask(() => {
+ // 1. Set fr’s state to "done".
+ fr[kState] = 'done'
+
+ // 2. Let result be the result of package data given
+ // bytes, type, blob’s type, and encodingName.
+ try {
+ const result = packageData(bytes, type, blob.type, encodingName)
+
+ // 4. Else:
+
+ if (fr[kAborted]) {
+ return
+ }
+
+ // 1. Set fr’s result to result.
+ fr[kResult] = result
+
+ // 2. Fire a progress event called load at the fr.
+ fireAProgressEvent('load', fr)
+ } catch (error) {
+ // 3. If package data threw an exception error:
+
+ // 1. Set fr’s error to error.
+ fr[kError] = error
+
+ // 2. Fire a progress event called error at fr.
+ fireAProgressEvent('error', fr)
+ }
+
+ // 5. If fr’s state is not "loading", fire a progress
+ // event called loadend at the fr.
+ if (fr[kState] !== 'loading') {
+ fireAProgressEvent('loadend', fr)
+ }
+ })
+
+ break
+ }
+ } catch (error) {
+ if (fr[kAborted]) {
+ return
+ }
+
+ // 6. Otherwise, if chunkPromise is rejected with an
+ // error error, queue a task to run the following
+ // steps and abort this algorithm:
+ queueMicrotask(() => {
+ // 1. Set fr’s state to "done".
+ fr[kState] = 'done'
+
+ // 2. Set fr’s error to error.
+ fr[kError] = error
+
+ // 3. Fire a progress event called error at fr.
+ fireAProgressEvent('error', fr)
+
+ // 4. If fr’s state is not "loading", fire a progress
+ // event called loadend at fr.
+ if (fr[kState] !== 'loading') {
+ fireAProgressEvent('loadend', fr)
+ }
+ })
+
+ break
+ }
}
- return dispatcher
- }
+ })()
+}
- dispatch (opts, handler) {
- // Call MockAgent.get to perform additional setup before dispatching as normal
- this.get(opts.origin)
- return this[kAgent].dispatch(opts, handler)
- }
+/**
+ * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
+ * @see https://dom.spec.whatwg.org/#concept-event-fire
+ * @param {string} e The name of the event
+ * @param {import('./filereader').FileReader} reader
+ */
+function fireAProgressEvent (e, reader) {
+ // The progress event e does not bubble. e.bubbles must be false
+ // The progress event e is NOT cancelable. e.cancelable must be false
+ const event = new ProgressEvent(e, {
+ bubbles: false,
+ cancelable: false
+ })
- async close () {
- await this[kAgent].close()
- this[kClients].clear()
- }
+ reader.dispatchEvent(event)
+}
- deactivate () {
- this[kIsMockActive] = false
- }
+/**
+ * @see https://w3c.github.io/FileAPI/#blob-package-data
+ * @param {Uint8Array[]} bytes
+ * @param {string} type
+ * @param {string?} mimeType
+ * @param {string?} encodingName
+ */
+function packageData (bytes, type, mimeType, encodingName) {
+ // 1. A Blob has an associated package data algorithm, given
+ // bytes, a type, a optional mimeType, and a optional
+ // encodingName, which switches on type and runs the
+ // associated steps:
- activate () {
- this[kIsMockActive] = true
- }
+ switch (type) {
+ case 'DataURL': {
+ // 1. Return bytes as a DataURL [RFC2397] subject to
+ // the considerations below:
+ // * Use mimeType as part of the Data URL if it is
+ // available in keeping with the Data URL
+ // specification [RFC2397].
+ // * If mimeType is not available return a Data URL
+ // without a media-type. [RFC2397].
- enableNetConnect (matcher) {
- if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
- if (Array.isArray(this[kNetConnect])) {
- this[kNetConnect].push(matcher)
- } else {
- this[kNetConnect] = [matcher]
+ // https://datatracker.ietf.org/doc/html/rfc2397#section-3
+ // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
+ // mediatype := [ type "/" subtype ] *( ";" parameter )
+ // data := *urlchar
+ // parameter := attribute "=" value
+ let dataURL = 'data:'
+
+ const parsed = parseMIMEType(mimeType || 'application/octet-stream')
+
+ if (parsed !== 'failure') {
+ dataURL += serializeAMimeType(parsed)
}
- } else if (typeof matcher === 'undefined') {
- this[kNetConnect] = true
- } else {
- throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
+
+ dataURL += ';base64,'
+
+ const decoder = new StringDecoder('latin1')
+
+ for (const chunk of bytes) {
+ dataURL += btoa(decoder.write(chunk))
+ }
+
+ dataURL += btoa(decoder.end())
+
+ return dataURL
}
- }
+ case 'Text': {
+ // 1. Let encoding be failure
+ let encoding = 'failure'
- disableNetConnect () {
- this[kNetConnect] = false
- }
+ // 2. If the encodingName is present, set encoding to the
+ // result of getting an encoding from encodingName.
+ if (encodingName) {
+ encoding = getEncoding(encodingName)
+ }
- // This is required to bypass issues caused by using global symbols - see:
- // https://github.com/nodejs/undici/issues/1447
- get isMockActive () {
- return this[kIsMockActive]
- }
+ // 3. If encoding is failure, and mimeType is present:
+ if (encoding === 'failure' && mimeType) {
+ // 1. Let type be the result of parse a MIME type
+ // given mimeType.
+ const type = parseMIMEType(mimeType)
- [kMockAgentSet] (origin, dispatcher) {
- this[kClients].set(origin, new FakeWeakRef(dispatcher))
- }
+ // 2. If type is not failure, set encoding to the result
+ // of getting an encoding from type’s parameters["charset"].
+ if (type !== 'failure') {
+ encoding = getEncoding(type.parameters.get('charset'))
+ }
+ }
- [kFactory] (origin) {
- const mockOptions = Object.assign({ agent: this }, this[kOptions])
- return this[kOptions] && this[kOptions].connections === 1
- ? new MockClient(origin, mockOptions)
- : new MockPool(origin, mockOptions)
- }
+ // 4. If encoding is failure, then set encoding to UTF-8.
+ if (encoding === 'failure') {
+ encoding = 'UTF-8'
+ }
- [kMockAgentGet] (origin) {
- // First check if we can immediately find it
- const ref = this[kClients].get(origin)
- if (ref) {
- return ref.deref()
+ // 5. Decode bytes using fallback encoding encoding, and
+ // return the result.
+ return decode(bytes, encoding)
}
+ case 'ArrayBuffer': {
+ // Return a new ArrayBuffer whose contents are bytes.
+ const sequence = combineByteSequences(bytes)
- // If the origin is not a string create a dummy parent pool and return to user
- if (typeof origin !== 'string') {
- const dispatcher = this[kFactory]('http://localhost:9999')
- this[kMockAgentSet](origin, dispatcher)
- return dispatcher
+ return sequence.buffer
}
+ case 'BinaryString': {
+ // Return bytes as a binary string, in which every byte
+ // is represented by a code unit of equal value [0..255].
+ let binaryString = ''
- // If we match, create a pool and assign the same dispatches
- for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
- const nonExplicitDispatcher = nonExplicitRef.deref()
- if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
- const dispatcher = this[kFactory](origin)
- this[kMockAgentSet](origin, dispatcher)
- dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
- return dispatcher
+ const decoder = new StringDecoder('latin1')
+
+ for (const chunk of bytes) {
+ binaryString += decoder.write(chunk)
}
+
+ binaryString += decoder.end()
+
+ return binaryString
}
}
+}
+
+/**
+ * @see https://encoding.spec.whatwg.org/#decode
+ * @param {Uint8Array[]} ioQueue
+ * @param {string} encoding
+ */
+function decode (ioQueue, encoding) {
+ const bytes = combineByteSequences(ioQueue)
- [kGetNetConnect] () {
- return this[kNetConnect]
- }
+ // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
+ const BOMEncoding = BOMSniffing(bytes)
- pendingInterceptors () {
- const mockAgentClients = this[kClients]
+ let slice = 0
- return Array.from(mockAgentClients.entries())
- .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
- .filter(({ pending }) => pending)
+ // 2. If BOMEncoding is non-null:
+ if (BOMEncoding !== null) {
+ // 1. Set encoding to BOMEncoding.
+ encoding = BOMEncoding
+
+ // 2. Read three bytes from ioQueue, if BOMEncoding is
+ // UTF-8; otherwise read two bytes.
+ // (Do nothing with those bytes.)
+ slice = BOMEncoding === 'UTF-8' ? 3 : 2
}
- assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
- const pending = this.pendingInterceptors()
+ // 3. Process a queue with an instance of encoding’s
+ // decoder, ioQueue, output, and "replacement".
- if (pending.length === 0) {
- return
- }
+ // 4. Return output.
- const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
+ const sliced = bytes.slice(slice)
+ return new TextDecoder(encoding).decode(sliced)
+}
- throw new UndiciError(`
-${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
+/**
+ * @see https://encoding.spec.whatwg.org/#bom-sniff
+ * @param {Uint8Array} ioQueue
+ */
+function BOMSniffing (ioQueue) {
+ // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
+ // converted to a byte sequence.
+ const [a, b, c] = ioQueue
-${pendingInterceptorsFormatter.format(pending)}
-`.trim())
+ // 2. For each of the rows in the table below, starting with
+ // the first one and going down, if BOM starts with the
+ // bytes given in the first column, then return the
+ // encoding given in the cell in the second column of that
+ // row. Otherwise, return null.
+ if (a === 0xEF && b === 0xBB && c === 0xBF) {
+ return 'UTF-8'
+ } else if (a === 0xFE && b === 0xFF) {
+ return 'UTF-16BE'
+ } else if (a === 0xFF && b === 0xFE) {
+ return 'UTF-16LE'
}
+
+ return null
}
-module.exports = MockAgent
+/**
+ * @param {Uint8Array[]} sequences
+ */
+function combineByteSequences (sequences) {
+ const size = sequences.reduce((a, b) => {
+ return a + b.byteLength
+ }, 0)
+
+ let offset = 0
+
+ return sequences.reduce((a, b) => {
+ a.set(b, offset)
+ offset += b.byteLength
+ return a
+ }, new Uint8Array(size))
+}
+
+module.exports = {
+ staticPropertyDescriptors,
+ readOperation,
+ fireAProgressEvent
+}
/***/ }),
-/***/ 8687:
+/***/ 6897:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { promisify } = __nccwpck_require__(3837)
-const Client = __nccwpck_require__(3598)
-const { buildMockDispatch } = __nccwpck_require__(9323)
+const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(736)
const {
- kDispatches,
- kMockAgent,
- kClose,
- kOriginalClose,
- kOrigin,
- kOriginalDispatch,
- kConnected
-} = __nccwpck_require__(4347)
-const { MockInterceptor } = __nccwpck_require__(410)
-const Symbols = __nccwpck_require__(2785)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
+ kReadyState,
+ kSentClose,
+ kByteParser,
+ kReceivedClose,
+ kResponse
+} = __nccwpck_require__(1216)
+const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(8625)
+const { channels } = __nccwpck_require__(2414)
+const { CloseEvent } = __nccwpck_require__(5188)
+const { makeRequest } = __nccwpck_require__(9967)
+const { fetching } = __nccwpck_require__(4398)
+const { Headers, getHeadersList } = __nccwpck_require__(660)
+const { getDecodeSplit } = __nccwpck_require__(3168)
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+
+/** @type {import('crypto')} */
+let crypto
+try {
+ crypto = __nccwpck_require__(7598)
+/* c8 ignore next 3 */
+} catch {
+
+}
/**
- * MockClient provides an API that extends the Client to influence the mockDispatches.
+ * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
+ * @param {URL} url
+ * @param {string|string[]} protocols
+ * @param {import('./websocket').WebSocket} ws
+ * @param {(response: any, extensions: string[] | undefined) => void} onEstablish
+ * @param {Partial} options
*/
-class MockClient extends Client {
- constructor (origin, opts) {
- super(origin, opts)
+function establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {
+ // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
+ // scheme is "ws", and to "https" otherwise.
+ const requestURL = url
- if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
- }
+ requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
- this[kMockAgent] = opts.agent
- this[kOrigin] = origin
- this[kDispatches] = []
- this[kConnected] = 1
- this[kOriginalDispatch] = this.dispatch
- this[kOriginalClose] = this.close.bind(this)
+ // 2. Let request be a new request, whose URL is requestURL, client is client,
+ // service-workers mode is "none", referrer is "no-referrer", mode is
+ // "websocket", credentials mode is "include", cache mode is "no-store" ,
+ // and redirect mode is "error".
+ const request = makeRequest({
+ urlList: [requestURL],
+ client,
+ serviceWorkers: 'none',
+ referrer: 'no-referrer',
+ mode: 'websocket',
+ credentials: 'include',
+ cache: 'no-store',
+ redirect: 'error'
+ })
- this.dispatch = buildMockDispatch.call(this)
- this.close = this[kClose]
- }
+ // Note: undici extension, allow setting custom headers.
+ if (options.headers) {
+ const headersList = getHeadersList(new Headers(options.headers))
- get [Symbols.kConnected] () {
- return this[kConnected]
+ request.headersList = headersList
}
- /**
- * Sets up the base interceptor for mocking replies from undici.
- */
- intercept (opts) {
- return new MockInterceptor(opts, this[kDispatches])
- }
+ // 3. Append (`Upgrade`, `websocket`) to request’s header list.
+ // 4. Append (`Connection`, `Upgrade`) to request’s header list.
+ // Note: both of these are handled by undici currently.
+ // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
- async [kClose] () {
- await promisify(this[kOriginalClose])()
- this[kConnected] = 0
- this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ // 5. Let keyValue be a nonce consisting of a randomly selected
+ // 16-byte value that has been forgiving-base64-encoded and
+ // isomorphic encoded.
+ const keyValue = crypto.randomBytes(16).toString('base64')
+
+ // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
+ // header list.
+ request.headersList.append('sec-websocket-key', keyValue)
+
+ // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
+ // header list.
+ request.headersList.append('sec-websocket-version', '13')
+
+ // 8. For each protocol in protocols, combine
+ // (`Sec-WebSocket-Protocol`, protocol) in request’s header
+ // list.
+ for (const protocol of protocols) {
+ request.headersList.append('sec-websocket-protocol', protocol)
}
-}
-module.exports = MockClient
+ // 9. Let permessageDeflate be a user-agent defined
+ // "permessage-deflate" extension header value.
+ // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
+ const permessageDeflate = 'permessage-deflate; client_max_window_bits'
+ // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
+ // request’s header list.
+ request.headersList.append('sec-websocket-extensions', permessageDeflate)
-/***/ }),
+ // 11. Fetch request with useParallelQueue set to true, and
+ // processResponse given response being these steps:
+ const controller = fetching({
+ request,
+ useParallelQueue: true,
+ dispatcher: options.dispatcher,
+ processResponse (response) {
+ // 1. If response is a network error or its status is not 101,
+ // fail the WebSocket connection.
+ if (response.type === 'error' || response.status !== 101) {
+ failWebsocketConnection(ws, 'Received network error or non-101 status code.')
+ return
+ }
-/***/ 888:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. If protocols is not the empty list and extracting header
+ // list values given `Sec-WebSocket-Protocol` and response’s
+ // header list results in null, failure, or the empty byte
+ // sequence, then fail the WebSocket connection.
+ if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
+ failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
+ return
+ }
-"use strict";
+ // 3. Follow the requirements stated step 2 to step 6, inclusive,
+ // of the last set of steps in section 4.1 of The WebSocket
+ // Protocol to validate response. This either results in fail
+ // the WebSocket connection or the WebSocket connection is
+ // established.
+ // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
+ // header field contains a value that is not an ASCII case-
+ // insensitive match for the value "websocket", the client MUST
+ // _Fail the WebSocket Connection_.
+ if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
+ failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
+ return
+ }
-const { UndiciError } = __nccwpck_require__(8045)
+ // 3. If the response lacks a |Connection| header field or the
+ // |Connection| header field doesn't contain a token that is an
+ // ASCII case-insensitive match for the value "Upgrade", the client
+ // MUST _Fail the WebSocket Connection_.
+ if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
+ failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
+ return
+ }
-class MockNotMatchedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, MockNotMatchedError)
- this.name = 'MockNotMatchedError'
- this.message = message || 'The request does not match any registered mock dispatches'
- this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
- }
-}
+ // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
+ // the |Sec-WebSocket-Accept| contains a value other than the
+ // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
+ // Key| (as a string, not base64-decoded) with the string "258EAFA5-
+ // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
+ // trailing whitespace, the client MUST _Fail the WebSocket
+ // Connection_.
+ const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
+ const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
+ if (secWSAccept !== digest) {
+ failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
+ return
+ }
-module.exports = {
- MockNotMatchedError
-}
+ // 5. If the response includes a |Sec-WebSocket-Extensions| header
+ // field and this header field indicates the use of an extension
+ // that was not present in the client's handshake (the server has
+ // indicated an extension not requested by the client), the client
+ // MUST _Fail the WebSocket Connection_. (The parsing of this
+ // header field to determine which extensions are requested is
+ // discussed in Section 9.1.)
+ const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
+ let extensions
+ if (secExtension !== null) {
+ extensions = parseExtensions(secExtension)
-/***/ }),
+ if (!extensions.has('permessage-deflate')) {
+ failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')
+ return
+ }
+ }
-/***/ 410:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 6. If the response includes a |Sec-WebSocket-Protocol| header field
+ // and this header field indicates the use of a subprotocol that was
+ // not present in the client's handshake (the server has indicated a
+ // subprotocol not requested by the client), the client MUST _Fail
+ // the WebSocket Connection_.
+ const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
-"use strict";
+ if (secProtocol !== null) {
+ const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)
+ // The client can request that the server use a specific subprotocol by
+ // including the |Sec-WebSocket-Protocol| field in its handshake. If it
+ // is specified, the server needs to include the same field and one of
+ // the selected subprotocol values in its response for the connection to
+ // be established.
+ if (!requestProtocols.includes(secProtocol)) {
+ failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
+ return
+ }
+ }
-const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
-const {
- kDispatches,
- kDispatchKey,
- kDefaultHeaders,
- kDefaultTrailers,
- kContentLength,
- kMockDispatch
-} = __nccwpck_require__(4347)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { buildURL } = __nccwpck_require__(3983)
+ response.socket.on('data', onSocketData)
+ response.socket.on('close', onSocketClose)
+ response.socket.on('error', onSocketError)
-/**
- * Defines the scope API for an interceptor reply
- */
-class MockScope {
- constructor (mockDispatch) {
- this[kMockDispatch] = mockDispatch
- }
+ if (channels.open.hasSubscribers) {
+ channels.open.publish({
+ address: response.socket.address(),
+ protocol: secProtocol,
+ extensions: secExtension
+ })
+ }
- /**
- * Delay a reply by a set amount in ms.
- */
- delay (waitInMs) {
- if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
- throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
+ onEstablish(response, extensions)
}
+ })
- this[kMockDispatch].delay = waitInMs
- return this
- }
-
- /**
- * For a defined reply, never mark as consumed.
- */
- persist () {
- this[kMockDispatch].persist = true
- return this
- }
+ return controller
+}
- /**
- * Allow one to define a reply for a set amount of matching requests.
- */
- times (repeatTimes) {
- if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
- throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
+function closeWebSocketConnection (ws, code, reason, reasonByteLength) {
+ if (isClosing(ws) || isClosed(ws)) {
+ // If this's ready state is CLOSING (2) or CLOSED (3)
+ // Do nothing.
+ } else if (!isEstablished(ws)) {
+ // If the WebSocket connection is not yet established
+ // Fail the WebSocket connection and set this's ready state
+ // to CLOSING (2).
+ failWebsocketConnection(ws, 'Connection was closed before it was established.')
+ ws[kReadyState] = states.CLOSING
+ } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {
+ // If the WebSocket closing handshake has not yet been started
+ // Start the WebSocket closing handshake and set this's ready
+ // state to CLOSING (2).
+ // - If neither code nor reason is present, the WebSocket Close
+ // message must not have a body.
+ // - If code is present, then the status code to use in the
+ // WebSocket Close message must be the integer given by code.
+ // - If reason is also present, then reasonBytes must be
+ // provided in the Close message after the status code.
+
+ ws[kSentClose] = sentCloseFrameState.PROCESSING
+
+ const frame = new WebsocketFrameSend()
+
+ // If neither code nor reason is present, the WebSocket Close
+ // message must not have a body.
+
+ // If code is present, then the status code to use in the
+ // WebSocket Close message must be the integer given by code.
+ if (code !== undefined && reason === undefined) {
+ frame.frameData = Buffer.allocUnsafe(2)
+ frame.frameData.writeUInt16BE(code, 0)
+ } else if (code !== undefined && reason !== undefined) {
+ // If reason is also present, then reasonBytes must be
+ // provided in the Close message after the status code.
+ frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
+ frame.frameData.writeUInt16BE(code, 0)
+ // the body MAY contain UTF-8-encoded data with value /reason/
+ frame.frameData.write(reason, 2, 'utf-8')
+ } else {
+ frame.frameData = emptyBuffer
}
- this[kMockDispatch].times = repeatTimes
- return this
+ /** @type {import('stream').Duplex} */
+ const socket = ws[kResponse].socket
+
+ socket.write(frame.createFrame(opcodes.CLOSE))
+
+ ws[kSentClose] = sentCloseFrameState.SENT
+
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ ws[kReadyState] = states.CLOSING
+ } else {
+ // Otherwise
+ // Set this's ready state to CLOSING (2).
+ ws[kReadyState] = states.CLOSING
}
}
/**
- * Defines an interceptor for a Mock
+ * @param {Buffer} chunk
*/
-class MockInterceptor {
- constructor (opts, mockDispatches) {
- if (typeof opts !== 'object') {
- throw new InvalidArgumentError('opts must be an object')
- }
- if (typeof opts.path === 'undefined') {
- throw new InvalidArgumentError('opts.path must be defined')
- }
- if (typeof opts.method === 'undefined') {
- opts.method = 'GET'
- }
- // See https://github.com/nodejs/undici/issues/1245
- // As per RFC 3986, clients are not supposed to send URI
- // fragments to servers when they retrieve a document,
- if (typeof opts.path === 'string') {
- if (opts.query) {
- opts.path = buildURL(opts.path, opts.query)
- } else {
- // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
- const parsedURL = new URL(opts.path, 'data://')
- opts.path = parsedURL.pathname + parsedURL.search
- }
- }
- if (typeof opts.method === 'string') {
- opts.method = opts.method.toUpperCase()
- }
+function onSocketData (chunk) {
+ if (!this.ws[kByteParser].write(chunk)) {
+ this.pause()
+ }
+}
- this[kDispatchKey] = buildKey(opts)
- this[kDispatches] = mockDispatches
- this[kDefaultHeaders] = {}
- this[kDefaultTrailers] = {}
- this[kContentLength] = false
+/**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
+ */
+function onSocketClose () {
+ const { ws } = this
+ const { [kResponse]: response } = ws
+
+ response.socket.off('data', onSocketData)
+ response.socket.off('close', onSocketClose)
+ response.socket.off('error', onSocketError)
+
+ // If the TCP connection was closed after the
+ // WebSocket closing handshake was completed, the WebSocket connection
+ // is said to have been closed _cleanly_.
+ const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]
+
+ let code = 1005
+ let reason = ''
+
+ const result = ws[kByteParser].closingInfo
+
+ if (result && !result.error) {
+ code = result.code ?? 1005
+ reason = result.reason
+ } else if (!ws[kReceivedClose]) {
+ // If _The WebSocket
+ // Connection is Closed_ and no Close control frame was received by the
+ // endpoint (such as could occur if the underlying transport connection
+ // is lost), _The WebSocket Connection Close Code_ is considered to be
+ // 1006.
+ code = 1006
}
- createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
- const responseData = getResponseData(data)
- const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
- const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
- const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
+ // 1. Change the ready state to CLOSED (3).
+ ws[kReadyState] = states.CLOSED
- return { statusCode, data, headers, trailers }
+ // 2. If the user agent was required to fail the WebSocket
+ // connection, or if the WebSocket connection was closed
+ // after being flagged as full, fire an event named error
+ // at the WebSocket object.
+ // TODO
+
+ // 3. Fire an event named close at the WebSocket object,
+ // using CloseEvent, with the wasClean attribute
+ // initialized to true if the connection closed cleanly
+ // and false otherwise, the code attribute initialized to
+ // the WebSocket connection close code, and the reason
+ // attribute initialized to the result of applying UTF-8
+ // decode without BOM to the WebSocket connection close
+ // reason.
+ // TODO: process.nextTick
+ fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {
+ wasClean, code, reason
+ })
+
+ if (channels.close.hasSubscribers) {
+ channels.close.publish({
+ websocket: ws,
+ code,
+ reason
+ })
}
+}
- validateReplyParameters (statusCode, data, responseOptions) {
- if (typeof statusCode === 'undefined') {
- throw new InvalidArgumentError('statusCode must be defined')
- }
- if (typeof data === 'undefined') {
- throw new InvalidArgumentError('data must be defined')
- }
- if (typeof responseOptions !== 'object') {
- throw new InvalidArgumentError('responseOptions must be an object')
- }
+function onSocketError (error) {
+ const { ws } = this
+
+ ws[kReadyState] = states.CLOSING
+
+ if (channels.socketError.hasSubscribers) {
+ channels.socketError.publish(error)
}
- /**
- * Mock an undici request with a defined reply.
- */
- reply (replyData) {
- // Values of reply aren't available right now as they
- // can only be available when the reply callback is invoked.
- if (typeof replyData === 'function') {
- // We'll first wrap the provided callback in another function,
- // this function will properly resolve the data from the callback
- // when invoked.
- const wrappedDefaultsCallback = (opts) => {
- // Our reply options callback contains the parameter for statusCode, data and options.
- const resolvedData = replyData(opts)
+ this.destroy()
+}
- // Check if it is in the right format
- if (typeof resolvedData !== 'object') {
- throw new InvalidArgumentError('reply options callback must return an object')
- }
+module.exports = {
+ establishWebSocketConnection,
+ closeWebSocketConnection
+}
- const { statusCode, data = '', responseOptions = {} } = resolvedData
- this.validateReplyParameters(statusCode, data, responseOptions)
- // Since the values can be obtained immediately we return them
- // from this higher order function that will be resolved later.
- return {
- ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
- }
- }
- // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
- return new MockScope(newMockDispatch)
- }
+/***/ }),
- // We can have either one or three parameters, if we get here,
- // we should have 1-3 parameters. So we spread the arguments of
- // this function to obtain the parameters, since replyData will always
- // just be the statusCode.
- const [statusCode, data = '', responseOptions = {}] = [...arguments]
- this.validateReplyParameters(statusCode, data, responseOptions)
+/***/ 736:
+/***/ ((module) => {
- // Send in-already provided data like usual
- const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
- return new MockScope(newMockDispatch)
- }
- /**
- * Mock an undici request with a defined error.
- */
- replyWithError (error) {
- if (typeof error === 'undefined') {
- throw new InvalidArgumentError('error must be defined')
- }
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
- return new MockScope(newMockDispatch)
- }
+// This is a Globally Unique Identifier unique used
+// to validate that the endpoint accepts websocket
+// connections.
+// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
+const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
- /**
- * Set default reply headers on the interceptor for subsequent replies
- */
- defaultReplyHeaders (headers) {
- if (typeof headers === 'undefined') {
- throw new InvalidArgumentError('headers must be defined')
- }
+/** @type {PropertyDescriptor} */
+const staticPropertyDescriptors = {
+ enumerable: true,
+ writable: false,
+ configurable: false
+}
+
+const states = {
+ CONNECTING: 0,
+ OPEN: 1,
+ CLOSING: 2,
+ CLOSED: 3
+}
+
+const sentCloseFrameState = {
+ NOT_SENT: 0,
+ PROCESSING: 1,
+ SENT: 2
+}
+
+const opcodes = {
+ CONTINUATION: 0x0,
+ TEXT: 0x1,
+ BINARY: 0x2,
+ CLOSE: 0x8,
+ PING: 0x9,
+ PONG: 0xA
+}
- this[kDefaultHeaders] = headers
- return this
- }
+const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
- /**
- * Set default reply trailers on the interceptor for subsequent replies
- */
- defaultReplyTrailers (trailers) {
- if (typeof trailers === 'undefined') {
- throw new InvalidArgumentError('trailers must be defined')
- }
+const parserStates = {
+ INFO: 0,
+ PAYLOADLENGTH_16: 2,
+ PAYLOADLENGTH_64: 3,
+ READ_DATA: 4
+}
- this[kDefaultTrailers] = trailers
- return this
- }
+const emptyBuffer = Buffer.allocUnsafe(0)
- /**
- * Set reply content length header for replies on the interceptor
- */
- replyContentLength () {
- this[kContentLength] = true
- return this
- }
+const sendHints = {
+ string: 1,
+ typedArray: 2,
+ arrayBuffer: 3,
+ blob: 4
}
-module.exports.MockInterceptor = MockInterceptor
-module.exports.MockScope = MockScope
+module.exports = {
+ uid,
+ sentCloseFrameState,
+ staticPropertyDescriptors,
+ states,
+ opcodes,
+ maxUnsigned16Bit,
+ parserStates,
+ emptyBuffer,
+ sendHints
+}
/***/ }),
-/***/ 6193:
+/***/ 5188:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { promisify } = __nccwpck_require__(3837)
-const Pool = __nccwpck_require__(4634)
-const { buildMockDispatch } = __nccwpck_require__(9323)
-const {
- kDispatches,
- kMockAgent,
- kClose,
- kOriginalClose,
- kOrigin,
- kOriginalDispatch,
- kConnected
-} = __nccwpck_require__(4347)
-const { MockInterceptor } = __nccwpck_require__(410)
-const Symbols = __nccwpck_require__(2785)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { kConstruct } = __nccwpck_require__(6443)
+const { MessagePort } = __nccwpck_require__(5919)
/**
- * MockPool provides an API that extends the Pool to influence the mockDispatches.
+ * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
*/
-class MockPool extends Pool {
- constructor (origin, opts) {
- super(origin, opts)
+class MessageEvent extends Event {
+ #eventInit
- if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
+ constructor (type, eventInitDict = {}) {
+ if (type === kConstruct) {
+ super(arguments[1], arguments[2])
+ webidl.util.markAsUncloneable(this)
+ return
}
- this[kMockAgent] = opts.agent
- this[kOrigin] = origin
- this[kDispatches] = []
- this[kConnected] = 1
- this[kOriginalDispatch] = this.dispatch
- this[kOriginalClose] = this.close.bind(this)
+ const prefix = 'MessageEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- this.dispatch = buildMockDispatch.call(this)
- this.close = this[kClose]
- }
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')
- get [Symbols.kConnected] () {
- return this[kConnected]
- }
+ super(type, eventInitDict)
- /**
- * Sets up the base interceptor for mocking replies from undici.
- */
- intercept (opts) {
- return new MockInterceptor(opts, this[kDispatches])
+ this.#eventInit = eventInitDict
+ webidl.util.markAsUncloneable(this)
}
- async [kClose] () {
- await promisify(this[kOriginalClose])()
- this[kConnected] = 0
- this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
- }
-}
+ get data () {
+ webidl.brandCheck(this, MessageEvent)
-module.exports = MockPool
+ return this.#eventInit.data
+ }
+ get origin () {
+ webidl.brandCheck(this, MessageEvent)
-/***/ }),
+ return this.#eventInit.origin
+ }
-/***/ 4347:
-/***/ ((module) => {
+ get lastEventId () {
+ webidl.brandCheck(this, MessageEvent)
-"use strict";
+ return this.#eventInit.lastEventId
+ }
+ get source () {
+ webidl.brandCheck(this, MessageEvent)
-module.exports = {
- kAgent: Symbol('agent'),
- kOptions: Symbol('options'),
- kFactory: Symbol('factory'),
- kDispatches: Symbol('dispatches'),
- kDispatchKey: Symbol('dispatch key'),
- kDefaultHeaders: Symbol('default headers'),
- kDefaultTrailers: Symbol('default trailers'),
- kContentLength: Symbol('content length'),
- kMockAgent: Symbol('mock agent'),
- kMockAgentSet: Symbol('mock agent set'),
- kMockAgentGet: Symbol('mock agent get'),
- kMockDispatch: Symbol('mock dispatch'),
- kClose: Symbol('close'),
- kOriginalClose: Symbol('original agent close'),
- kOrigin: Symbol('origin'),
- kIsMockActive: Symbol('is mock active'),
- kNetConnect: Symbol('net connect'),
- kGetNetConnect: Symbol('get net connect'),
- kConnected: Symbol('connected')
-}
+ return this.#eventInit.source
+ }
+ get ports () {
+ webidl.brandCheck(this, MessageEvent)
-/***/ }),
+ if (!Object.isFrozen(this.#eventInit.ports)) {
+ Object.freeze(this.#eventInit.ports)
+ }
-/***/ 9323:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ return this.#eventInit.ports
+ }
-"use strict";
+ initMessageEvent (
+ type,
+ bubbles = false,
+ cancelable = false,
+ data = null,
+ origin = '',
+ lastEventId = '',
+ source = null,
+ ports = []
+ ) {
+ webidl.brandCheck(this, MessageEvent)
+ webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')
-const { MockNotMatchedError } = __nccwpck_require__(888)
-const {
- kDispatches,
- kMockAgent,
- kOriginalDispatch,
- kOrigin,
- kGetNetConnect
-} = __nccwpck_require__(4347)
-const { buildURL, nop } = __nccwpck_require__(3983)
-const { STATUS_CODES } = __nccwpck_require__(3685)
-const {
- types: {
- isPromise
+ return new MessageEvent(type, {
+ bubbles, cancelable, data, origin, lastEventId, source, ports
+ })
}
-} = __nccwpck_require__(3837)
-function matchValue (match, value) {
- if (typeof match === 'string') {
- return match === value
- }
- if (match instanceof RegExp) {
- return match.test(value)
+ static createFastMessageEvent (type, init) {
+ const messageEvent = new MessageEvent(kConstruct, type, init)
+ messageEvent.#eventInit = init
+ messageEvent.#eventInit.data ??= null
+ messageEvent.#eventInit.origin ??= ''
+ messageEvent.#eventInit.lastEventId ??= ''
+ messageEvent.#eventInit.source ??= null
+ messageEvent.#eventInit.ports ??= []
+ return messageEvent
}
- if (typeof match === 'function') {
- return match(value) === true
- }
- return false
}
-function lowerCaseEntries (headers) {
- return Object.fromEntries(
- Object.entries(headers).map(([headerName, headerValue]) => {
- return [headerName.toLocaleLowerCase(), headerValue]
- })
- )
-}
+const { createFastMessageEvent } = MessageEvent
+delete MessageEvent.createFastMessageEvent
/**
- * @param {import('../../index').Headers|string[]|Record} headers
- * @param {string} key
+ * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
*/
-function getHeaderByName (headers, key) {
- if (Array.isArray(headers)) {
- for (let i = 0; i < headers.length; i += 2) {
- if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
- return headers[i + 1]
- }
- }
+class CloseEvent extends Event {
+ #eventInit
- return undefined
- } else if (typeof headers.get === 'function') {
- return headers.get(key)
- } else {
- return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
+ constructor (type, eventInitDict = {}) {
+ const prefix = 'CloseEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
+
+ super(type, eventInitDict)
+
+ this.#eventInit = eventInitDict
+ webidl.util.markAsUncloneable(this)
}
-}
-/** @param {string[]} headers */
-function buildHeadersFromArray (headers) { // fetch HeadersList
- const clone = headers.slice()
- const entries = []
- for (let index = 0; index < clone.length; index += 2) {
- entries.push([clone[index], clone[index + 1]])
+ get wasClean () {
+ webidl.brandCheck(this, CloseEvent)
+
+ return this.#eventInit.wasClean
}
- return Object.fromEntries(entries)
-}
-function matchHeaders (mockDispatch, headers) {
- if (typeof mockDispatch.headers === 'function') {
- if (Array.isArray(headers)) { // fetch HeadersList
- headers = buildHeadersFromArray(headers)
- }
- return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
+ get code () {
+ webidl.brandCheck(this, CloseEvent)
+
+ return this.#eventInit.code
}
- if (typeof mockDispatch.headers === 'undefined') {
- return true
+
+ get reason () {
+ webidl.brandCheck(this, CloseEvent)
+
+ return this.#eventInit.reason
}
- if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
- return false
+}
+
+// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
+class ErrorEvent extends Event {
+ #eventInit
+
+ constructor (type, eventInitDict) {
+ const prefix = 'ErrorEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+
+ super(type, eventInitDict)
+ webidl.util.markAsUncloneable(this)
+
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
+
+ this.#eventInit = eventInitDict
}
- for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
- const headerValue = getHeaderByName(headers, matchHeaderName)
+ get message () {
+ webidl.brandCheck(this, ErrorEvent)
- if (!matchValue(matchHeaderValue, headerValue)) {
- return false
- }
+ return this.#eventInit.message
}
- return true
-}
-function safeUrl (path) {
- if (typeof path !== 'string') {
- return path
+ get filename () {
+ webidl.brandCheck(this, ErrorEvent)
+
+ return this.#eventInit.filename
}
- const pathSegments = path.split('?')
+ get lineno () {
+ webidl.brandCheck(this, ErrorEvent)
- if (pathSegments.length !== 2) {
- return path
+ return this.#eventInit.lineno
}
- const qp = new URLSearchParams(pathSegments.pop())
- qp.sort()
- return [...pathSegments, qp.toString()].join('?')
-}
+ get colno () {
+ webidl.brandCheck(this, ErrorEvent)
-function matchKey (mockDispatch, { path, method, body, headers }) {
- const pathMatch = matchValue(mockDispatch.path, path)
- const methodMatch = matchValue(mockDispatch.method, method)
- const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
- const headersMatch = matchHeaders(mockDispatch, headers)
- return pathMatch && methodMatch && bodyMatch && headersMatch
-}
+ return this.#eventInit.colno
+ }
-function getResponseData (data) {
- if (Buffer.isBuffer(data)) {
- return data
- } else if (typeof data === 'object') {
- return JSON.stringify(data)
- } else {
- return data.toString()
+ get error () {
+ webidl.brandCheck(this, ErrorEvent)
+
+ return this.#eventInit.error
}
}
-function getMockDispatch (mockDispatches, key) {
- const basePath = key.query ? buildURL(key.path, key.query) : key.path
- const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
+Object.defineProperties(MessageEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'MessageEvent',
+ configurable: true
+ },
+ data: kEnumerableProperty,
+ origin: kEnumerableProperty,
+ lastEventId: kEnumerableProperty,
+ source: kEnumerableProperty,
+ ports: kEnumerableProperty,
+ initMessageEvent: kEnumerableProperty
+})
- // Match path
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
+Object.defineProperties(CloseEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'CloseEvent',
+ configurable: true
+ },
+ reason: kEnumerableProperty,
+ code: kEnumerableProperty,
+ wasClean: kEnumerableProperty
+})
+
+Object.defineProperties(ErrorEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'ErrorEvent',
+ configurable: true
+ },
+ message: kEnumerableProperty,
+ filename: kEnumerableProperty,
+ lineno: kEnumerableProperty,
+ colno: kEnumerableProperty,
+ error: kEnumerableProperty
+})
+
+webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
+
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.MessagePort
+)
+
+const eventInit = [
+ {
+ key: 'bubbles',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'cancelable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'composed',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
}
+]
- // Match method
- matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
+webidl.converters.MessageEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'data',
+ converter: webidl.converters.any,
+ defaultValue: () => null
+ },
+ {
+ key: 'origin',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'lastEventId',
+ converter: webidl.converters.DOMString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'source',
+ // Node doesn't implement WindowProxy or ServiceWorker, so the only
+ // valid value for source is a MessagePort.
+ converter: webidl.nullableConverter(webidl.converters.MessagePort),
+ defaultValue: () => null
+ },
+ {
+ key: 'ports',
+ converter: webidl.converters['sequence'],
+ defaultValue: () => new Array(0)
}
+])
- // Match body
- matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
+webidl.converters.CloseEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'wasClean',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'code',
+ converter: webidl.converters['unsigned short'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'reason',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
}
+])
- // Match headers
- matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
+webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'message',
+ converter: webidl.converters.DOMString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'filename',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'lineno',
+ converter: webidl.converters['unsigned long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'colno',
+ converter: webidl.converters['unsigned long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'error',
+ converter: webidl.converters.any
}
+])
- return matchedMockDispatches[0]
+module.exports = {
+ MessageEvent,
+ CloseEvent,
+ ErrorEvent,
+ createFastMessageEvent
}
-function addMockDispatch (mockDispatches, key, data) {
- const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
- const replyData = typeof data === 'function' ? { callback: data } : { ...data }
- const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
- mockDispatches.push(newMockDispatch)
- return newMockDispatch
-}
-function deleteMockDispatch (mockDispatches, key) {
- const index = mockDispatches.findIndex(dispatch => {
- if (!dispatch.consumed) {
- return false
+/***/ }),
+
+/***/ 3264:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { maxUnsigned16Bit } = __nccwpck_require__(736)
+
+const BUFFER_SIZE = 16386
+
+/** @type {import('crypto')} */
+let crypto
+let buffer = null
+let bufIdx = BUFFER_SIZE
+
+try {
+ crypto = __nccwpck_require__(7598)
+/* c8 ignore next 3 */
+} catch {
+ crypto = {
+ // not full compatibility, but minimum.
+ randomFillSync: function randomFillSync (buffer, _offset, _size) {
+ for (let i = 0; i < buffer.length; ++i) {
+ buffer[i] = Math.random() * 255 | 0
+ }
+ return buffer
}
- return matchKey(dispatch, key)
- })
- if (index !== -1) {
- mockDispatches.splice(index, 1)
}
}
-function buildKey (opts) {
- const { path, method, body, headers, query } = opts
- return {
- path,
- method,
- body,
- headers,
- query
+function generateMask () {
+ if (bufIdx === BUFFER_SIZE) {
+ bufIdx = 0
+ crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)
}
+ return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]
}
-function generateKeyValues (data) {
- return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
- ...keyValuePairs,
- Buffer.from(`${key}`),
- Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
- ], [])
+class WebsocketFrameSend {
+ /**
+ * @param {Buffer|undefined} data
+ */
+ constructor (data) {
+ this.frameData = data
+ }
+
+ createFrame (opcode) {
+ const frameData = this.frameData
+ const maskKey = generateMask()
+ const bodyLength = frameData?.byteLength ?? 0
+
+ /** @type {number} */
+ let payloadLength = bodyLength // 0-125
+ let offset = 6
+
+ if (bodyLength > maxUnsigned16Bit) {
+ offset += 8 // payload length is next 8 bytes
+ payloadLength = 127
+ } else if (bodyLength > 125) {
+ offset += 2 // payload length is next 2 bytes
+ payloadLength = 126
+ }
+
+ const buffer = Buffer.allocUnsafe(bodyLength + offset)
+
+ // Clear first 2 bytes, everything else is overwritten
+ buffer[0] = buffer[1] = 0
+ buffer[0] |= 0x80 // FIN
+ buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
+
+ /*! ws. MIT License. Einar Otto Stangvik */
+ buffer[offset - 4] = maskKey[0]
+ buffer[offset - 3] = maskKey[1]
+ buffer[offset - 2] = maskKey[2]
+ buffer[offset - 1] = maskKey[3]
+
+ buffer[1] = payloadLength
+
+ if (payloadLength === 126) {
+ buffer.writeUInt16BE(bodyLength, 2)
+ } else if (payloadLength === 127) {
+ // Clear extended payload length
+ buffer[2] = buffer[3] = 0
+ buffer.writeUIntBE(bodyLength, 4, 6)
+ }
+
+ buffer[1] |= 0x80 // MASK
+
+ // mask body
+ for (let i = 0; i < bodyLength; ++i) {
+ buffer[offset + i] = frameData[i] ^ maskKey[i & 3]
+ }
+
+ return buffer
+ }
}
-/**
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
- * @param {number} statusCode
- */
-function getStatusText (statusCode) {
- return STATUS_CODES[statusCode] || 'unknown'
+module.exports = {
+ WebsocketFrameSend
}
-async function getResponse (body) {
- const buffers = []
- for await (const data of body) {
- buffers.push(data)
- }
- return Buffer.concat(buffers).toString('utf8')
-}
-/**
- * Mock dispatch function used to simulate undici dispatches
- */
-function mockDispatch (opts, handler) {
- // Get mock dispatch from built key
- const key = buildKey(opts)
- const mockDispatch = getMockDispatch(this[kDispatches], key)
+/***/ }),
- mockDispatch.timesInvoked++
+/***/ 9469:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // Here's where we resolve a callback if a callback is present for the dispatch data.
- if (mockDispatch.data.callback) {
- mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
- }
- // Parse mockDispatch data
- const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
- const { timesInvoked, times } = mockDispatch
- // If it's used up and not persistent, mark as consumed
- mockDispatch.consumed = !persist && timesInvoked >= times
- mockDispatch.pending = timesInvoked < times
+const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522)
+const { isValidClientWindowBits } = __nccwpck_require__(8625)
+const { MessageSizeExceededError } = __nccwpck_require__(8707)
- // If specified, trigger dispatch error
- if (error !== null) {
- deleteMockDispatch(this[kDispatches], key)
- handler.onError(error)
- return true
- }
+const tail = Buffer.from([0x00, 0x00, 0xff, 0xff])
+const kBuffer = Symbol('kBuffer')
+const kLength = Symbol('kLength')
- // Handle the request with a delay if necessary
- if (typeof delay === 'number' && delay > 0) {
- setTimeout(() => {
- handleReply(this[kDispatches])
- }, delay)
- } else {
- handleReply(this[kDispatches])
- }
+class PerMessageDeflate {
+ /** @type {import('node:zlib').InflateRaw} */
+ #inflate
- function handleReply (mockDispatches, _data = data) {
- // fetch's HeadersList is a 1D string array
- const optsHeaders = Array.isArray(opts.headers)
- ? buildHeadersFromArray(opts.headers)
- : opts.headers
- const body = typeof _data === 'function'
- ? _data({ ...opts, headers: optsHeaders })
- : _data
+ #options = {}
- // util.types.isPromise is likely needed for jest.
- if (isPromise(body)) {
- // If handleReply is asynchronous, throwing an error
- // in the callback will reject the promise, rather than
- // synchronously throw the error, which breaks some tests.
- // Rather, we wait for the callback to resolve if it is a
- // promise, and then re-run handleReply with the new body.
- body.then((newData) => handleReply(mockDispatches, newData))
- return
- }
+ #maxPayloadSize = 0
- const responseData = getResponseData(body)
- const responseHeaders = generateKeyValues(headers)
- const responseTrailers = generateKeyValues(trailers)
+ /**
+ * @param {Map} extensions
+ */
+ constructor (extensions, options) {
+ this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')
+ this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')
- handler.abort = nop
- handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
- handler.onData(Buffer.from(responseData))
- handler.onComplete(responseTrailers)
- deleteMockDispatch(mockDispatches, key)
+ this.#maxPayloadSize = options.maxPayloadSize
}
- function resume () {}
-
- return true
-}
+ /**
+ * Decompress a compressed payload.
+ * @param {Buffer} chunk Compressed data
+ * @param {boolean} fin Final fragment flag
+ * @param {Function} callback Callback function
+ */
+ decompress (chunk, fin, callback) {
+ // An endpoint uses the following algorithm to decompress a message.
+ // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the
+ // payload of the message.
+ // 2. Decompress the resulting data using DEFLATE.
+ if (!this.#inflate) {
+ let windowBits = Z_DEFAULT_WINDOWBITS
+
+ if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS
+ if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {
+ callback(new Error('Invalid server_max_window_bits'))
+ return
+ }
-function buildMockDispatch () {
- const agent = this[kMockAgent]
- const origin = this[kOrigin]
- const originalDispatch = this[kOriginalDispatch]
+ windowBits = Number.parseInt(this.#options.serverMaxWindowBits)
+ }
- return function dispatch (opts, handler) {
- if (agent.isMockActive) {
try {
- mockDispatch.call(this, opts, handler)
- } catch (error) {
- if (error instanceof MockNotMatchedError) {
- const netConnect = agent[kGetNetConnect]()
- if (netConnect === false) {
- throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
- }
- if (checkNetConnect(netConnect, origin)) {
- originalDispatch.call(this, opts, handler)
- } else {
- throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
- }
- } else {
- throw error
- }
+ this.#inflate = createInflateRaw({ windowBits })
+ } catch (err) {
+ callback(err)
+ return
}
- } else {
- originalDispatch.call(this, opts, handler)
+ this.#inflate[kBuffer] = []
+ this.#inflate[kLength] = 0
+
+ this.#inflate.on('data', (data) => {
+ this.#inflate[kLength] += data.length
+
+ if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
+ callback(new MessageSizeExceededError())
+ this.#inflate.removeAllListeners()
+ this.#inflate = null
+ return
+ }
+
+ this.#inflate[kBuffer].push(data)
+ })
+
+ this.#inflate.on('error', (err) => {
+ this.#inflate = null
+ callback(err)
+ })
}
- }
-}
-function checkNetConnect (netConnect, origin) {
- const url = new URL(origin)
- if (netConnect === true) {
- return true
- } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
- return true
- }
- return false
-}
+ this.#inflate.write(chunk)
+ if (fin) {
+ this.#inflate.write(tail)
+ }
-function buildMockOptions (opts) {
- if (opts) {
- const { agent, ...mockOptions } = opts
- return mockOptions
+ this.#inflate.flush(() => {
+ if (!this.#inflate) {
+ return
+ }
+
+ const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])
+
+ this.#inflate[kBuffer].length = 0
+ this.#inflate[kLength] = 0
+
+ callback(null, full)
+ })
}
}
-module.exports = {
- getResponseData,
- getMockDispatch,
- addMockDispatch,
- deleteMockDispatch,
- buildKey,
- generateKeyValues,
- matchValue,
- getResponse,
- getStatusText,
- mockDispatch,
- buildMockDispatch,
- checkNetConnect,
- buildMockOptions,
- getHeaderByName
-}
+module.exports = { PerMessageDeflate }
/***/ }),
-/***/ 6823:
+/***/ 1652:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { Transform } = __nccwpck_require__(2781)
-const { Console } = __nccwpck_require__(6206)
+const { Writable } = __nccwpck_require__(7075)
+const assert = __nccwpck_require__(4589)
+const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(736)
+const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(1216)
+const { channels } = __nccwpck_require__(2414)
+const {
+ isValidStatusCode,
+ isValidOpcode,
+ failWebsocketConnection,
+ websocketMessageReceived,
+ utf8Decode,
+ isControlFrame,
+ isTextBinaryFrame,
+ isContinuationFrame
+} = __nccwpck_require__(8625)
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+const { closeWebSocketConnection } = __nccwpck_require__(6897)
+const { PerMessageDeflate } = __nccwpck_require__(9469)
+const { MessageSizeExceededError } = __nccwpck_require__(8707)
+
+function failWebsocketConnectionWithCode (ws, code, reason) {
+ closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))
+ failWebsocketConnection(ws, reason)
+}
-/**
- * Gets the output of `console.table(…)` as a string.
- */
-module.exports = class PendingInterceptorsFormatter {
- constructor ({ disableColors } = {}) {
- this.transform = new Transform({
- transform (chunk, _enc, cb) {
- cb(null, chunk)
- }
- })
+// This code was influenced by ws released under the MIT license.
+// Copyright (c) 2011 Einar Otto Stangvik
+// Copyright (c) 2013 Arnout Kazemier and contributors
+// Copyright (c) 2016 Luigi Pinca and contributors
- this.logger = new Console({
- stdout: this.transform,
- inspectOptions: {
- colors: !disableColors && !process.env.CI
- }
- })
- }
+class ByteParser extends Writable {
+ #buffers = []
+ #fragmentsBytes = 0
+ #byteOffset = 0
+ #loop = false
- format (pendingInterceptors) {
- const withPrettyHeaders = pendingInterceptors.map(
- ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
- Method: method,
- Origin: origin,
- Path: path,
- 'Status code': statusCode,
- Persistent: persist ? '✅' : '❌',
- Invocations: timesInvoked,
- Remaining: persist ? Infinity : times - timesInvoked
- }))
+ #state = parserStates.INFO
- this.logger.table(withPrettyHeaders)
- return this.transform.read().toString()
- }
-}
+ #info = {}
+ #fragments = []
+ /** @type {Map} */
+ #extensions
-/***/ }),
+ /** @type {number} */
+ #maxFragments
-/***/ 8891:
-/***/ ((module) => {
+ /** @type {number} */
+ #maxPayloadSize
-"use strict";
+ /**
+ * @param {import('./websocket').WebSocket} ws
+ * @param {Map|null} extensions
+ * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]
+ */
+ constructor (ws, extensions, options = {}) {
+ super()
+ this.ws = ws
+ this.#extensions = extensions == null ? new Map() : extensions
+ this.#maxFragments = options.maxFragments ?? 0
+ this.#maxPayloadSize = options.maxPayloadSize ?? 0
-const singulars = {
- pronoun: 'it',
- is: 'is',
- was: 'was',
- this: 'this'
-}
+ if (this.#extensions.has('permessage-deflate')) {
+ this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))
+ }
+ }
-const plurals = {
- pronoun: 'they',
- is: 'are',
- was: 'were',
- this: 'these'
-}
+ /**
+ * @param {Buffer} chunk
+ * @param {() => void} callback
+ */
+ _write (chunk, _, callback) {
+ this.#buffers.push(chunk)
+ this.#byteOffset += chunk.length
+ this.#loop = true
-module.exports = class Pluralizer {
- constructor (singular, plural) {
- this.singular = singular
- this.plural = plural
+ this.run(callback)
}
- pluralize (count) {
- const one = count === 1
- const keys = one ? singulars : plurals
- const noun = one ? this.singular : this.plural
- return { ...keys, count, noun }
+ #validatePayloadLength () {
+ if (
+ this.#maxPayloadSize > 0 &&
+ !isControlFrame(this.#info.opcode) &&
+ this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize
+ ) {
+ failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')
+ return false
+ }
+
+ return true
}
-}
+ /**
+ * Runs whenever a new chunk is received.
+ * Callback is called whenever there are no more chunks buffering,
+ * or not enough bytes are buffered to parse.
+ */
+ run (callback) {
+ while (this.#loop) {
+ if (this.#state === parserStates.INFO) {
+ // If there aren't enough bytes to parse the payload length, etc.
+ if (this.#byteOffset < 2) {
+ return callback()
+ }
-/***/ }),
+ const buffer = this.consume(2)
+ const fin = (buffer[0] & 0x80) !== 0
+ const opcode = buffer[0] & 0x0F
+ const masked = (buffer[1] & 0x80) === 0x80
-/***/ 8266:
-/***/ ((module) => {
+ const fragmented = !fin && opcode !== opcodes.CONTINUATION
+ const payloadLength = buffer[1] & 0x7F
-"use strict";
-/* eslint-disable */
+ const rsv1 = buffer[0] & 0x40
+ const rsv2 = buffer[0] & 0x20
+ const rsv3 = buffer[0] & 0x10
+ if (!isValidOpcode(opcode)) {
+ failWebsocketConnection(this.ws, 'Invalid opcode received')
+ return callback()
+ }
+ if (masked) {
+ failWebsocketConnection(this.ws, 'Frame cannot be masked')
+ return callback()
+ }
-// Extracted from node/lib/internal/fixed_queue.js
+ // MUST be 0 unless an extension is negotiated that defines meanings
+ // for non-zero values. If a nonzero value is received and none of
+ // the negotiated extensions defines the meaning of such a nonzero
+ // value, the receiving endpoint MUST _Fail the WebSocket
+ // Connection_.
+ // This document allocates the RSV1 bit of the WebSocket header for
+ // PMCEs and calls the bit the "Per-Message Compressed" bit. On a
+ // WebSocket connection where a PMCE is in use, this bit indicates
+ // whether a message is compressed or not.
+ if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {
+ failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')
+ return
+ }
-// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
-const kSize = 2048;
-const kMask = kSize - 1;
+ if (rsv2 !== 0 || rsv3 !== 0) {
+ failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')
+ return
+ }
-// The FixedQueue is implemented as a singly-linked list of fixed-size
-// circular buffers. It looks something like this:
-//
-// head tail
-// | |
-// v v
-// +-----------+ <-----\ +-----------+ <------\ +-----------+
-// | [null] | \----- | next | \------- | next |
-// +-----------+ +-----------+ +-----------+
-// | item | <-- bottom | item | <-- bottom | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | bottom --> | item |
-// | item | | item | | item |
-// | ... | | ... | | ... |
-// | item | | item | | item |
-// | item | | item | | item |
-// | [empty] | <-- top | item | | item |
-// | [empty] | | item | | item |
-// | [empty] | | [empty] | <-- top top --> | [empty] |
-// +-----------+ +-----------+ +-----------+
-//
-// Or, if there is only one circular buffer, it looks something
-// like either of these:
-//
-// head tail head tail
-// | | | |
-// v v v v
-// +-----------+ +-----------+
-// | [null] | | [null] |
-// +-----------+ +-----------+
-// | [empty] | | item |
-// | [empty] | | item |
-// | item | <-- bottom top --> | [empty] |
-// | item | | [empty] |
-// | [empty] | <-- top bottom --> | item |
-// | [empty] | | item |
-// +-----------+ +-----------+
-//
-// Adding a value means moving `top` forward by one, removing means
-// moving `bottom` forward by one. After reaching the end, the queue
-// wraps around.
-//
-// When `top === bottom` the current queue is empty and when
-// `top + 1 === bottom` it's full. This wastes a single space of storage
-// but allows much quicker checks.
+ if (fragmented && !isTextBinaryFrame(opcode)) {
+ // Only text and binary frames can be fragmented
+ failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
+ return
+ }
-class FixedCircularBuffer {
- constructor() {
- this.bottom = 0;
- this.top = 0;
- this.list = new Array(kSize);
- this.next = null;
- }
+ // If we are already parsing a text/binary frame and do not receive either
+ // a continuation frame or close frame, fail the connection.
+ if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
+ failWebsocketConnection(this.ws, 'Expected continuation frame')
+ return
+ }
- isEmpty() {
- return this.top === this.bottom;
- }
+ if (this.#info.fragmented && fragmented) {
+ // A fragmented frame can't be fragmented itself
+ failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
+ return
+ }
- isFull() {
- return ((this.top + 1) & kMask) === this.bottom;
- }
+ // "All control frames MUST have a payload length of 125 bytes or less
+ // and MUST NOT be fragmented."
+ if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
+ failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')
+ return
+ }
- push(data) {
- this.list[this.top] = data;
- this.top = (this.top + 1) & kMask;
- }
+ if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
+ failWebsocketConnection(this.ws, 'Unexpected continuation frame')
+ return
+ }
- shift() {
- const nextItem = this.list[this.bottom];
- if (nextItem === undefined)
- return null;
- this.list[this.bottom] = undefined;
- this.bottom = (this.bottom + 1) & kMask;
- return nextItem;
- }
-}
+ if (payloadLength <= 125) {
+ this.#info.payloadLength = payloadLength
+ this.#state = parserStates.READ_DATA
-module.exports = class FixedQueue {
- constructor() {
- this.head = this.tail = new FixedCircularBuffer();
- }
+ if (!this.#validatePayloadLength()) {
+ return
+ }
+ } else if (payloadLength === 126) {
+ this.#state = parserStates.PAYLOADLENGTH_16
+ } else if (payloadLength === 127) {
+ this.#state = parserStates.PAYLOADLENGTH_64
+ }
- isEmpty() {
- return this.head.isEmpty();
- }
+ if (isTextBinaryFrame(opcode)) {
+ this.#info.binaryType = opcode
+ this.#info.compressed = rsv1 !== 0
+ }
- push(data) {
- if (this.head.isFull()) {
- // Head is full: Creates a new queue, sets the old queue's `.next` to it,
- // and sets it as the new main queue.
- this.head = this.head.next = new FixedCircularBuffer();
- }
- this.head.push(data);
- }
+ this.#info.opcode = opcode
+ this.#info.masked = masked
+ this.#info.fin = fin
+ this.#info.fragmented = fragmented
+ } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
+ if (this.#byteOffset < 2) {
+ return callback()
+ }
- shift() {
- const tail = this.tail;
- const next = tail.shift();
- if (tail.isEmpty() && tail.next !== null) {
- // If there is another queue, it forms the new tail.
- this.tail = tail.next;
- }
- return next;
- }
-};
+ const buffer = this.consume(2)
+ this.#info.payloadLength = buffer.readUInt16BE(0)
+ this.#state = parserStates.READ_DATA
-/***/ }),
+ if (!this.#validatePayloadLength()) {
+ return
+ }
+ } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
+ if (this.#byteOffset < 8) {
+ return callback()
+ }
-/***/ 3198:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const buffer = this.consume(8)
+ const upper = buffer.readUInt32BE(0)
+ const lower = buffer.readUInt32BE(4)
-"use strict";
+ // 2^31 is the maximum bytes an arraybuffer can contain
+ // on 32-bit systems. Although, on 64-bit systems, this is
+ // 2^53-1 bytes.
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
+ // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
+ // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
+ if (upper !== 0 || lower > 2 ** 31 - 1) {
+ failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
+ return
+ }
+ this.#info.payloadLength = lower
+ this.#state = parserStates.READ_DATA
-const DispatcherBase = __nccwpck_require__(4839)
-const FixedQueue = __nccwpck_require__(8266)
-const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
-const PoolStats = __nccwpck_require__(9689)
+ if (!this.#validatePayloadLength()) {
+ return
+ }
+ } else if (this.#state === parserStates.READ_DATA) {
+ if (this.#byteOffset < this.#info.payloadLength) {
+ return callback()
+ }
-const kClients = Symbol('clients')
-const kNeedDrain = Symbol('needDrain')
-const kQueue = Symbol('queue')
-const kClosedResolve = Symbol('closed resolve')
-const kOnDrain = Symbol('onDrain')
-const kOnConnect = Symbol('onConnect')
-const kOnDisconnect = Symbol('onDisconnect')
-const kOnConnectionError = Symbol('onConnectionError')
-const kGetDispatcher = Symbol('get dispatcher')
-const kAddClient = Symbol('add client')
-const kRemoveClient = Symbol('remove client')
-const kStats = Symbol('stats')
+ const body = this.consume(this.#info.payloadLength)
-class PoolBase extends DispatcherBase {
- constructor () {
- super()
+ if (isControlFrame(this.#info.opcode)) {
+ this.#loop = this.parseControlFrame(body)
+ this.#state = parserStates.INFO
+ } else {
+ if (!this.#info.compressed) {
+ if (!this.writeFragments(body)) {
+ return
+ }
- this[kQueue] = new FixedQueue()
- this[kClients] = []
- this[kQueued] = 0
+ if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
+ failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)
+ return
+ }
- const pool = this
+ // If the frame is not fragmented, a message has been received.
+ // If the frame is fragmented, it will terminate with a fin bit set
+ // and an opcode of 0 (continuation), therefore we handle that when
+ // parsing continuation frames, not here.
+ if (!this.#info.fragmented && this.#info.fin) {
+ websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())
+ }
- this[kOnDrain] = function onDrain (origin, targets) {
- const queue = pool[kQueue]
+ this.#state = parserStates.INFO
+ } else {
+ this.#extensions.get('permessage-deflate').decompress(
+ body,
+ this.#info.fin,
+ (error, data) => {
+ if (error) {
+ const code = error instanceof MessageSizeExceededError ? 1009 : 1007
+ failWebsocketConnectionWithCode(this.ws, code, error.message)
+ return
+ }
- let needDrain = false
+ if (!this.writeFragments(data)) {
+ return
+ }
- while (!needDrain) {
- const item = queue.shift()
- if (!item) {
- break
+ if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
+ failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)
+ return
+ }
+
+ if (!this.#info.fin) {
+ this.#state = parserStates.INFO
+ this.#loop = true
+ this.run(callback)
+ return
+ }
+
+ websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())
+
+ this.#loop = true
+ this.#state = parserStates.INFO
+ this.run(callback)
+ }
+ )
+
+ this.#loop = false
+ break
+ }
}
- pool[kQueued]--
- needDrain = !this.dispatch(item.opts, item.handler)
}
+ }
+ }
- this[kNeedDrain] = needDrain
+ /**
+ * Take n bytes from the buffered Buffers
+ * @param {number} n
+ * @returns {Buffer}
+ */
+ consume (n) {
+ if (n > this.#byteOffset) {
+ throw new Error('Called consume() before buffers satiated.')
+ } else if (n === 0) {
+ return emptyBuffer
+ }
- if (!this[kNeedDrain] && pool[kNeedDrain]) {
- pool[kNeedDrain] = false
- pool.emit('drain', origin, [pool, ...targets])
- }
+ if (this.#buffers[0].length === n) {
+ this.#byteOffset -= this.#buffers[0].length
+ return this.#buffers.shift()
+ }
- if (pool[kClosedResolve] && queue.isEmpty()) {
- Promise
- .all(pool[kClients].map(c => c.close()))
- .then(pool[kClosedResolve])
+ const buffer = Buffer.allocUnsafe(n)
+ let offset = 0
+
+ while (offset !== n) {
+ const next = this.#buffers[0]
+ const { length } = next
+
+ if (length + offset === n) {
+ buffer.set(this.#buffers.shift(), offset)
+ break
+ } else if (length + offset > n) {
+ buffer.set(next.subarray(0, n - offset), offset)
+ this.#buffers[0] = next.subarray(n - offset)
+ break
+ } else {
+ buffer.set(this.#buffers.shift(), offset)
+ offset += next.length
}
}
- this[kOnConnect] = (origin, targets) => {
- pool.emit('connect', origin, [pool, ...targets])
- }
+ this.#byteOffset -= n
- this[kOnDisconnect] = (origin, targets, err) => {
- pool.emit('disconnect', origin, [pool, ...targets], err)
- }
+ return buffer
+ }
- this[kOnConnectionError] = (origin, targets, err) => {
- pool.emit('connectionError', origin, [pool, ...targets], err)
+ writeFragments (fragment) {
+ if (
+ this.#maxFragments > 0 &&
+ this.#fragments.length === this.#maxFragments
+ ) {
+ failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')
+ return false
}
- this[kStats] = new PoolStats(this)
+ this.#fragmentsBytes += fragment.length
+ this.#fragments.push(fragment)
+ return true
}
- get [kBusy] () {
- return this[kNeedDrain]
- }
+ consumeFragments () {
+ const fragments = this.#fragments
- get [kConnected] () {
- return this[kClients].filter(client => client[kConnected]).length
- }
+ if (fragments.length === 1) {
+ this.#fragmentsBytes = 0
+ return fragments.shift()
+ }
- get [kFree] () {
- return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
- }
+ const output = Buffer.concat(fragments, this.#fragmentsBytes)
+ this.#fragments = []
+ this.#fragmentsBytes = 0
- get [kPending] () {
- let ret = this[kQueued]
- for (const { [kPending]: pending } of this[kClients]) {
- ret += pending
- }
- return ret
+ return output
}
- get [kRunning] () {
- let ret = 0
- for (const { [kRunning]: running } of this[kClients]) {
- ret += running
+ parseCloseBody (data) {
+ assert(data.length !== 1)
+
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
+ /** @type {number|undefined} */
+ let code
+
+ if (data.length >= 2) {
+ // _The WebSocket Connection Close Code_ is
+ // defined as the status code (Section 7.4) contained in the first Close
+ // control frame received by the application
+ code = data.readUInt16BE(0)
}
- return ret
- }
- get [kSize] () {
- let ret = this[kQueued]
- for (const { [kSize]: size } of this[kClients]) {
- ret += size
+ if (code !== undefined && !isValidStatusCode(code)) {
+ return { code: 1002, reason: 'Invalid status code', error: true }
}
- return ret
- }
- get stats () {
- return this[kStats]
- }
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
+ /** @type {Buffer} */
+ let reason = data.subarray(2)
- async [kClose] () {
- if (this[kQueue].isEmpty()) {
- return Promise.all(this[kClients].map(c => c.close()))
- } else {
- return new Promise((resolve) => {
- this[kClosedResolve] = resolve
- })
+ // Remove BOM
+ if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
+ reason = reason.subarray(3)
}
- }
- async [kDestroy] (err) {
- while (true) {
- const item = this[kQueue].shift()
- if (!item) {
- break
- }
- item.handler.onError(err)
+ try {
+ reason = utf8Decode(reason)
+ } catch {
+ return { code: 1007, reason: 'Invalid UTF-8', error: true }
}
- return Promise.all(this[kClients].map(c => c.destroy(err)))
+ return { code, reason, error: false }
}
- [kDispatch] (opts, handler) {
- const dispatcher = this[kGetDispatcher]()
+ /**
+ * Parses control frames.
+ * @param {Buffer} body
+ */
+ parseControlFrame (body) {
+ const { opcode, payloadLength } = this.#info
- if (!dispatcher) {
- this[kNeedDrain] = true
- this[kQueue].push({ opts, handler })
- this[kQueued]++
- } else if (!dispatcher.dispatch(opts, handler)) {
- dispatcher[kNeedDrain] = true
- this[kNeedDrain] = !this[kGetDispatcher]()
- }
+ if (opcode === opcodes.CLOSE) {
+ if (payloadLength === 1) {
+ failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
+ return false
+ }
- return !this[kNeedDrain]
- }
+ this.#info.closeInfo = this.parseCloseBody(body)
- [kAddClient] (client) {
- client
- .on('drain', this[kOnDrain])
- .on('connect', this[kOnConnect])
- .on('disconnect', this[kOnDisconnect])
- .on('connectionError', this[kOnConnectionError])
+ if (this.#info.closeInfo.error) {
+ const { code, reason } = this.#info.closeInfo
- this[kClients].push(client)
+ closeWebSocketConnection(this.ws, code, reason, reason.length)
+ failWebsocketConnection(this.ws, reason)
+ return false
+ }
- if (this[kNeedDrain]) {
- process.nextTick(() => {
- if (this[kNeedDrain]) {
- this[kOnDrain](client[kUrl], [this, client])
+ if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {
+ // If an endpoint receives a Close frame and did not previously send a
+ // Close frame, the endpoint MUST send a Close frame in response. (When
+ // sending a Close frame in response, the endpoint typically echos the
+ // status code it received.)
+ let body = emptyBuffer
+ if (this.#info.closeInfo.code) {
+ body = Buffer.allocUnsafe(2)
+ body.writeUInt16BE(this.#info.closeInfo.code, 0)
}
- })
- }
+ const closeFrame = new WebsocketFrameSend(body)
- return this
- }
+ this.ws[kResponse].socket.write(
+ closeFrame.createFrame(opcodes.CLOSE),
+ (err) => {
+ if (!err) {
+ this.ws[kSentClose] = sentCloseFrameState.SENT
+ }
+ }
+ )
+ }
- [kRemoveClient] (client) {
- client.close(() => {
- const idx = this[kClients].indexOf(client)
- if (idx !== -1) {
- this[kClients].splice(idx, 1)
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ this.ws[kReadyState] = states.CLOSING
+ this.ws[kReceivedClose] = true
+
+ return false
+ } else if (opcode === opcodes.PING) {
+ // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
+ // response, unless it already received a Close frame.
+ // A Pong frame sent in response to a Ping frame must have identical
+ // "Application data"
+
+ if (!this.ws[kReceivedClose]) {
+ const frame = new WebsocketFrameSend(body)
+
+ this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
+
+ if (channels.ping.hasSubscribers) {
+ channels.ping.publish({
+ payload: body
+ })
+ }
}
- })
+ } else if (opcode === opcodes.PONG) {
+ // A Pong frame MAY be sent unsolicited. This serves as a
+ // unidirectional heartbeat. A response to an unsolicited Pong frame is
+ // not expected.
- this[kNeedDrain] = this[kClients].some(dispatcher => (
- !dispatcher[kNeedDrain] &&
- dispatcher.closed !== true &&
- dispatcher.destroyed !== true
- ))
+ if (channels.pong.hasSubscribers) {
+ channels.pong.publish({
+ payload: body
+ })
+ }
+ }
+
+ return true
+ }
+
+ get closingInfo () {
+ return this.#info.closeInfo
}
}
module.exports = {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kRemoveClient,
- kGetDispatcher
+ ByteParser
}
/***/ }),
-/***/ 9689:
+/***/ 3900:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
-const kPool = Symbol('pool')
-class PoolStats {
- constructor (pool) {
- this[kPool] = pool
- }
- get connected () {
- return this[kPool][kConnected]
- }
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+const { opcodes, sendHints } = __nccwpck_require__(736)
+const FixedQueue = __nccwpck_require__(4660)
- get free () {
- return this[kPool][kFree]
- }
+/** @type {typeof Uint8Array} */
+const FastBuffer = Buffer[Symbol.species]
- get pending () {
- return this[kPool][kPending]
- }
+/**
+ * @typedef {object} SendQueueNode
+ * @property {Promise | null} promise
+ * @property {((...args: any[]) => any)} callback
+ * @property {Buffer | null} frame
+ */
- get queued () {
- return this[kPool][kQueued]
+class SendQueue {
+ /**
+ * @type {FixedQueue}
+ */
+ #queue = new FixedQueue()
+
+ /**
+ * @type {boolean}
+ */
+ #running = false
+
+ /** @type {import('node:net').Socket} */
+ #socket
+
+ constructor (socket) {
+ this.#socket = socket
}
- get running () {
- return this[kPool][kRunning]
+ add (item, cb, hint) {
+ if (hint !== sendHints.blob) {
+ const frame = createFrame(item, hint)
+ if (!this.#running) {
+ // fast-path
+ this.#socket.write(frame, cb)
+ } else {
+ /** @type {SendQueueNode} */
+ const node = {
+ promise: null,
+ callback: cb,
+ frame
+ }
+ this.#queue.push(node)
+ }
+ return
+ }
+
+ /** @type {SendQueueNode} */
+ const node = {
+ promise: item.arrayBuffer().then((ab) => {
+ node.promise = null
+ node.frame = createFrame(ab, hint)
+ }),
+ callback: cb,
+ frame: null
+ }
+
+ this.#queue.push(node)
+
+ if (!this.#running) {
+ this.#run()
+ }
}
- get size () {
- return this[kPool][kSize]
+ async #run () {
+ this.#running = true
+ const queue = this.#queue
+ while (!queue.isEmpty()) {
+ const node = queue.shift()
+ // wait pending promise
+ if (node.promise !== null) {
+ await node.promise
+ }
+ // write
+ this.#socket.write(node.frame, node.callback)
+ // cleanup
+ node.callback = node.frame = null
+ }
+ this.#running = false
}
}
-module.exports = PoolStats
+function createFrame (data, hint) {
+ return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)
+}
+function toBuffer (data, hint) {
+ switch (hint) {
+ case sendHints.string:
+ return Buffer.from(data)
+ case sendHints.arrayBuffer:
+ case sendHints.blob:
+ return new FastBuffer(data)
+ case sendHints.typedArray:
+ return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)
+ }
+}
-/***/ }),
+module.exports = { SendQueue }
-/***/ 4634:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+/***/ }),
+/***/ 1216:
+/***/ ((module) => {
-const {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kGetDispatcher
-} = __nccwpck_require__(3198)
-const Client = __nccwpck_require__(3598)
-const {
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { kUrl, kInterceptors } = __nccwpck_require__(2785)
-const buildConnector = __nccwpck_require__(2067)
-const kOptions = Symbol('options')
-const kConnections = Symbol('connections')
-const kFactory = Symbol('factory')
-function defaultFactory (origin, opts) {
- return new Client(origin, opts)
+module.exports = {
+ kWebSocketURL: Symbol('url'),
+ kReadyState: Symbol('ready state'),
+ kController: Symbol('controller'),
+ kResponse: Symbol('response'),
+ kBinaryType: Symbol('binary type'),
+ kSentClose: Symbol('sent close'),
+ kReceivedClose: Symbol('received close'),
+ kByteParser: Symbol('byte parser')
}
-class Pool extends PoolBase {
- constructor (origin, {
- connections,
- factory = defaultFactory,
- connect,
- connectTimeout,
- tls,
- maxCachedSessions,
- socketPath,
- autoSelectFamily,
- autoSelectFamilyAttemptTimeout,
- allowH2,
- ...options
- } = {}) {
- super()
- if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
- throw new InvalidArgumentError('invalid connections')
- }
+/***/ }),
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
- }
+/***/ 8625:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
- }
- if (typeof connect !== 'function') {
- connect = buildConnector({
- ...tls,
- maxCachedSessions,
- allowH2,
- socketPath,
- timeout: connectTimeout,
- ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
- ...connect
- })
- }
- this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
- ? options.interceptors.Pool
- : []
- this[kConnections] = connections || null
- this[kUrl] = util.parseOrigin(origin)
- this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
- this[kOptions].interceptors = options.interceptors
- ? { ...options.interceptors }
- : undefined
- this[kFactory] = factory
- }
+const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(1216)
+const { states, opcodes } = __nccwpck_require__(736)
+const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(5188)
+const { isUtf8 } = __nccwpck_require__(4573)
+const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(1900)
- [kGetDispatcher] () {
- let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
+/* globals Blob */
- if (dispatcher) {
- return dispatcher
- }
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isConnecting (ws) {
+ // If the WebSocket connection is not yet established, and the connection
+ // is not yet closed, then the WebSocket connection is in the CONNECTING state.
+ return ws[kReadyState] === states.CONNECTING
+}
- if (!this[kConnections] || this[kClients].length < this[kConnections]) {
- dispatcher = this[kFactory](this[kUrl], this[kOptions])
- this[kAddClient](dispatcher)
- }
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isEstablished (ws) {
+ // If the server's response is validated as provided for above, it is
+ // said that _The WebSocket Connection is Established_ and that the
+ // WebSocket Connection is in the OPEN state.
+ return ws[kReadyState] === states.OPEN
+}
- return dispatcher
- }
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isClosing (ws) {
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ return ws[kReadyState] === states.CLOSING
}
-module.exports = Pool
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isClosed (ws) {
+ return ws[kReadyState] === states.CLOSED
+}
+/**
+ * @see https://dom.spec.whatwg.org/#concept-event-fire
+ * @param {string} e
+ * @param {EventTarget} target
+ * @param {(...args: ConstructorParameters) => Event} eventFactory
+ * @param {EventInit | undefined} eventInitDict
+ */
+function fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {
+ // 1. If eventConstructor is not given, then let eventConstructor be Event.
-/***/ }),
+ // 2. Let event be the result of creating an event given eventConstructor,
+ // in the relevant realm of target.
+ // 3. Initialize event’s type attribute to e.
+ const event = eventFactory(e, eventInitDict)
-/***/ 7858:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 4. Initialize any other IDL attributes of event as described in the
+ // invocation of this algorithm.
-"use strict";
+ // 5. Return the result of dispatching event at target, with legacy target
+ // override flag set if set.
+ target.dispatchEvent(event)
+}
+/**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ * @param {import('./websocket').WebSocket} ws
+ * @param {number} type Opcode
+ * @param {Buffer} data application data
+ */
+function websocketMessageReceived (ws, type, data) {
+ // 1. If ready state is not OPEN (1), then return.
+ if (ws[kReadyState] !== states.OPEN) {
+ return
+ }
-const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
-const { URL } = __nccwpck_require__(7310)
-const Agent = __nccwpck_require__(7890)
-const Pool = __nccwpck_require__(4634)
-const DispatcherBase = __nccwpck_require__(4839)
-const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
-const buildConnector = __nccwpck_require__(2067)
+ // 2. Let dataForEvent be determined by switching on type and binary type:
+ let dataForEvent
-const kAgent = Symbol('proxy agent')
-const kClient = Symbol('proxy client')
-const kProxyHeaders = Symbol('proxy headers')
-const kRequestTls = Symbol('request tls settings')
-const kProxyTls = Symbol('proxy tls settings')
-const kConnectEndpoint = Symbol('connect endpoint function')
+ if (type === opcodes.TEXT) {
+ // -> type indicates that the data is Text
+ // a new DOMString containing data
+ try {
+ dataForEvent = utf8Decode(data)
+ } catch {
+ failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
+ return
+ }
+ } else if (type === opcodes.BINARY) {
+ if (ws[kBinaryType] === 'blob') {
+ // -> type indicates that the data is Binary and binary type is "blob"
+ // a new Blob object, created in the relevant Realm of the WebSocket
+ // object, that represents data as its raw data
+ dataForEvent = new Blob([data])
+ } else {
+ // -> type indicates that the data is Binary and binary type is "arraybuffer"
+ // a new ArrayBuffer object, created in the relevant Realm of the
+ // WebSocket object, whose contents are data
+ dataForEvent = toArrayBuffer(data)
+ }
+ }
-function defaultProtocolPort (protocol) {
- return protocol === 'https:' ? 443 : 80
+ // 3. Fire an event named message at the WebSocket object, using MessageEvent,
+ // with the origin attribute initialized to the serialization of the WebSocket
+ // object’s url's origin, and the data attribute initialized to dataForEvent.
+ fireEvent('message', ws, createFastMessageEvent, {
+ origin: ws[kWebSocketURL].origin,
+ data: dataForEvent
+ })
}
-function buildProxyOptions (opts) {
- if (typeof opts === 'string') {
- opts = { uri: opts }
+function toArrayBuffer (buffer) {
+ if (buffer.byteLength === buffer.buffer.byteLength) {
+ return buffer.buffer
}
+ return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)
+}
- if (!opts || !opts.uri) {
- throw new InvalidArgumentError('Proxy opts.uri is mandatory')
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455
+ * @see https://datatracker.ietf.org/doc/html/rfc2616
+ * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
+ * @param {string} protocol
+ */
+function isValidSubprotocol (protocol) {
+ // If present, this value indicates one
+ // or more comma-separated subprotocol the client wishes to speak,
+ // ordered by preference. The elements that comprise this value
+ // MUST be non-empty strings with characters in the range U+0021 to
+ // U+007E not including separator characters as defined in
+ // [RFC2616] and MUST all be unique strings.
+ if (protocol.length === 0) {
+ return false
}
- return {
- uri: opts.uri,
- protocol: opts.protocol || 'https'
+ for (let i = 0; i < protocol.length; ++i) {
+ const code = protocol.charCodeAt(i)
+
+ if (
+ code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)
+ code > 0x7E ||
+ code === 0x22 || // "
+ code === 0x28 || // (
+ code === 0x29 || // )
+ code === 0x2C || // ,
+ code === 0x2F || // /
+ code === 0x3A || // :
+ code === 0x3B || // ;
+ code === 0x3C || // <
+ code === 0x3D || // =
+ code === 0x3E || // >
+ code === 0x3F || // ?
+ code === 0x40 || // @
+ code === 0x5B || // [
+ code === 0x5C || // \
+ code === 0x5D || // ]
+ code === 0x7B || // {
+ code === 0x7D // }
+ ) {
+ return false
+ }
}
-}
-function defaultFactory (origin, opts) {
- return new Pool(origin, opts)
+ return true
}
-class ProxyAgent extends DispatcherBase {
- constructor (opts) {
- super(opts)
- this[kProxy] = buildProxyOptions(opts)
- this[kAgent] = new Agent(opts)
- this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
- ? opts.interceptors.ProxyAgent
- : []
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
+ * @param {number} code
+ */
+function isValidStatusCode (code) {
+ if (code >= 1000 && code < 1015) {
+ return (
+ code !== 1004 && // reserved
+ code !== 1005 && // "MUST NOT be set as a status code"
+ code !== 1006 // "MUST NOT be set as a status code"
+ )
+ }
- if (typeof opts === 'string') {
- opts = { uri: opts }
- }
+ return code >= 3000 && code <= 4999
+}
- if (!opts || !opts.uri) {
- throw new InvalidArgumentError('Proxy opts.uri is mandatory')
- }
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @param {string|undefined} reason
+ */
+function failWebsocketConnection (ws, reason) {
+ const { [kController]: controller, [kResponse]: response } = ws
- const { clientFactory = defaultFactory } = opts
+ controller.abort()
- if (typeof clientFactory !== 'function') {
- throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
- }
+ if (response?.socket && !response.socket.destroyed) {
+ response.socket.destroy()
+ }
- this[kRequestTls] = opts.requestTls
- this[kProxyTls] = opts.proxyTls
- this[kProxyHeaders] = opts.headers || {}
+ if (reason) {
+ // TODO: process.nextTick
+ fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {
+ error: new Error(reason),
+ message: reason
+ })
+ }
+}
- const resolvedUrl = new URL(opts.uri)
- const { origin, port, host, username, password } = resolvedUrl
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5
+ * @param {number} opcode
+ */
+function isControlFrame (opcode) {
+ return (
+ opcode === opcodes.CLOSE ||
+ opcode === opcodes.PING ||
+ opcode === opcodes.PONG
+ )
+}
- if (opts.auth && opts.token) {
- throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
- } else if (opts.auth) {
- /* @deprecated in favour of opts.token */
- this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
- } else if (opts.token) {
- this[kProxyHeaders]['proxy-authorization'] = opts.token
- } else if (username && password) {
- this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
- }
+function isContinuationFrame (opcode) {
+ return opcode === opcodes.CONTINUATION
+}
- const connect = buildConnector({ ...opts.proxyTls })
- this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
- this[kClient] = clientFactory(resolvedUrl, { connect })
- this[kAgent] = new Agent({
- ...opts,
- connect: async (opts, callback) => {
- let requestedHost = opts.host
- if (!opts.port) {
- requestedHost += `:${defaultProtocolPort(opts.protocol)}`
- }
- try {
- const { socket, statusCode } = await this[kClient].connect({
- origin,
- port,
- path: requestedHost,
- signal: opts.signal,
- headers: {
- ...this[kProxyHeaders],
- host
- }
- })
- if (statusCode !== 200) {
- socket.on('error', () => {}).destroy()
- callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
- }
- if (opts.protocol !== 'https:') {
- callback(null, socket)
- return
- }
- let servername
- if (this[kRequestTls]) {
- servername = this[kRequestTls].servername
- } else {
- servername = opts.servername
- }
- this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
- } catch (err) {
- callback(err)
- }
- }
- })
- }
+function isTextBinaryFrame (opcode) {
+ return opcode === opcodes.TEXT || opcode === opcodes.BINARY
+}
- dispatch (opts, handler) {
- const { host } = new URL(opts.origin)
- const headers = buildHeaders(opts.headers)
- throwIfProxyAuthIsSent(headers)
- return this[kAgent].dispatch(
- {
- ...opts,
- headers: {
- ...headers,
- host
- }
- },
- handler
+function isValidOpcode (opcode) {
+ return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)
+}
+
+/**
+ * Parses a Sec-WebSocket-Extensions header value.
+ * @param {string} extensions
+ * @returns {Map}
+ */
+// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
+function parseExtensions (extensions) {
+ const position = { position: 0 }
+ const extensionList = new Map()
+
+ while (position.position < extensions.length) {
+ const pair = collectASequenceOfCodePointsFast(';', extensions, position)
+ const [name, value = ''] = pair.split('=')
+
+ extensionList.set(
+ removeHTTPWhitespace(name, true, false),
+ removeHTTPWhitespace(value, false, true)
)
- }
- async [kClose] () {
- await this[kAgent].close()
- await this[kClient].close()
+ position.position++
}
- async [kDestroy] () {
- await this[kAgent].destroy()
- await this[kClient].destroy()
- }
+ return extensionList
}
/**
- * @param {string[] | Record} headers
- * @returns {Record}
+ * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2
+ * @description "client-max-window-bits = 1*DIGIT"
+ * @param {string} value
*/
-function buildHeaders (headers) {
- // When using undici.fetch, the headers list is stored
- // as an array.
- if (Array.isArray(headers)) {
- /** @type {Record} */
- const headersPair = {}
+function isValidClientWindowBits (value) {
+ // Must have at least one character
+ if (value.length === 0) {
+ return false
+ }
- for (let i = 0; i < headers.length; i += 2) {
- headersPair[headers[i]] = headers[i + 1]
- }
+ // Check all characters are ASCII digits
+ for (let i = 0; i < value.length; i++) {
+ const byte = value.charCodeAt(i)
- return headersPair
+ if (byte < 0x30 || byte > 0x39) {
+ return false
+ }
}
- return headers
+ // Check numeric range: zlib requires windowBits in range 8-15
+ const num = Number.parseInt(value, 10)
+ return num >= 8 && num <= 15
}
+// https://nodejs.org/api/intl.html#detecting-internationalization-support
+const hasIntl = typeof process.versions.icu === 'string'
+const fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined
+
/**
- * @param {Record} headers
- *
- * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
- * Nevertheless, it was changed and to avoid a security vulnerability by end users
- * this check was created.
- * It should be removed in the next major version for performance reasons
+ * Converts a Buffer to utf-8, even on platforms without icu.
+ * @param {Buffer} buffer
*/
-function throwIfProxyAuthIsSent (headers) {
- const existProxyAuth = headers && Object.keys(headers)
- .find((key) => key.toLowerCase() === 'proxy-authorization')
- if (existProxyAuth) {
- throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
+const utf8Decode = hasIntl
+ ? fatalDecoder.decode.bind(fatalDecoder)
+ : function (buffer) {
+ if (isUtf8(buffer)) {
+ return buffer.toString('utf-8')
+ }
+ throw new TypeError('Invalid utf-8 received.')
}
-}
-module.exports = ProxyAgent
+module.exports = {
+ isConnecting,
+ isEstablished,
+ isClosing,
+ isClosed,
+ fireEvent,
+ isValidSubprotocol,
+ isValidStatusCode,
+ failWebsocketConnection,
+ websocketMessageReceived,
+ utf8Decode,
+ isControlFrame,
+ isContinuationFrame,
+ isTextBinaryFrame,
+ isValidOpcode,
+ parseExtensions,
+ isValidClientWindowBits
+}
/***/ }),
-/***/ 9459:
-/***/ ((module) => {
+/***/ 3726:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-let fastNow = Date.now()
-let fastNowTimeout
+const { webidl } = __nccwpck_require__(5893)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { environmentSettingsObject } = __nccwpck_require__(3168)
+const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(736)
+const {
+ kWebSocketURL,
+ kReadyState,
+ kController,
+ kBinaryType,
+ kResponse,
+ kSentClose,
+ kByteParser
+} = __nccwpck_require__(1216)
+const {
+ isConnecting,
+ isEstablished,
+ isClosing,
+ isValidSubprotocol,
+ fireEvent
+} = __nccwpck_require__(8625)
+const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(6897)
+const { ByteParser } = __nccwpck_require__(1652)
+const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3440)
+const { getGlobalDispatcher } = __nccwpck_require__(2581)
+const { types } = __nccwpck_require__(7975)
+const { ErrorEvent, CloseEvent } = __nccwpck_require__(5188)
+const { SendQueue } = __nccwpck_require__(3900)
-const fastTimers = []
+// https://websockets.spec.whatwg.org/#interface-definition
+class WebSocket extends EventTarget {
+ #events = {
+ open: null,
+ error: null,
+ close: null,
+ message: null
+ }
-function onTimeout () {
- fastNow = Date.now()
+ #bufferedAmount = 0
+ #protocol = ''
+ #extensions = ''
- let len = fastTimers.length
- let idx = 0
- while (idx < len) {
- const timer = fastTimers[idx]
+ /** @type {SendQueue} */
+ #sendQueue
- if (timer.state === 0) {
- timer.state = fastNow + timer.delay
- } else if (timer.state > 0 && fastNow >= timer.state) {
- timer.state = -1
- timer.callback(timer.opaque)
- }
+ /**
+ * @param {string} url
+ * @param {string|string[]} protocols
+ */
+ constructor (url, protocols = []) {
+ super()
- if (timer.state === -1) {
- timer.state = -2
- if (idx !== len - 1) {
- fastTimers[idx] = fastTimers.pop()
- } else {
- fastTimers.pop()
- }
- len -= 1
- } else {
- idx += 1
- }
- }
+ webidl.util.markAsUncloneable(this)
- if (fastTimers.length > 0) {
- refreshTimeout()
- }
-}
+ const prefix = 'WebSocket constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-function refreshTimeout () {
- if (fastNowTimeout && fastNowTimeout.refresh) {
- fastNowTimeout.refresh()
- } else {
- clearTimeout(fastNowTimeout)
- fastNowTimeout = setTimeout(onTimeout, 1e3)
- if (fastNowTimeout.unref) {
- fastNowTimeout.unref()
- }
- }
-}
+ const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')
-class Timeout {
- constructor (callback, delay, opaque) {
- this.callback = callback
- this.delay = delay
- this.opaque = opaque
+ url = webidl.converters.USVString(url, prefix, 'url')
+ protocols = options.protocols
- // -2 not in timer list
- // -1 in timer list but inactive
- // 0 in timer list waiting for time
- // > 0 in timer list waiting for time to expire
- this.state = -2
+ // 1. Let baseURL be this's relevant settings object's API base URL.
+ const baseURL = environmentSettingsObject.settingsObject.baseUrl
- this.refresh()
- }
+ // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
+ let urlRecord
- refresh () {
- if (this.state === -2) {
- fastTimers.push(this)
- if (!fastNowTimeout || fastTimers.length === 1) {
- refreshTimeout()
- }
+ try {
+ urlRecord = new URL(url, baseURL)
+ } catch (e) {
+ // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
+ throw new DOMException(e, 'SyntaxError')
}
- this.state = 0
- }
-
- clear () {
- this.state = -1
- }
-}
+ // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
+ if (urlRecord.protocol === 'http:') {
+ urlRecord.protocol = 'ws:'
+ } else if (urlRecord.protocol === 'https:') {
+ // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
+ urlRecord.protocol = 'wss:'
+ }
-module.exports = {
- setTimeout (callback, delay, opaque) {
- return delay < 1e3
- ? setTimeout(callback, delay, opaque)
- : new Timeout(callback, delay, opaque)
- },
- clearTimeout (timeout) {
- if (timeout instanceof Timeout) {
- timeout.clear()
- } else {
- clearTimeout(timeout)
+ // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
+ if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
+ throw new DOMException(
+ `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
+ 'SyntaxError'
+ )
}
- }
-}
+ // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
+ // DOMException.
+ if (urlRecord.hash || urlRecord.href.endsWith('#')) {
+ throw new DOMException('Got fragment', 'SyntaxError')
+ }
-/***/ }),
+ // 8. If protocols is a string, set protocols to a sequence consisting
+ // of just that string.
+ if (typeof protocols === 'string') {
+ protocols = [protocols]
+ }
-/***/ 5354:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 9. If any of the values in protocols occur more than once or otherwise
+ // fail to match the requirements for elements that comprise the value
+ // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
+ // protocol, then throw a "SyntaxError" DOMException.
+ if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
+ throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ }
-"use strict";
+ if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
+ throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ }
+ // 10. Set this's url to urlRecord.
+ this[kWebSocketURL] = new URL(urlRecord.href)
-const diagnosticsChannel = __nccwpck_require__(7643)
-const { uid, states } = __nccwpck_require__(9188)
-const {
- kReadyState,
- kSentClose,
- kByteParser,
- kReceivedClose
-} = __nccwpck_require__(7578)
-const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
-const { CloseEvent } = __nccwpck_require__(2611)
-const { makeRequest } = __nccwpck_require__(8359)
-const { fetching } = __nccwpck_require__(4881)
-const { Headers } = __nccwpck_require__(554)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { kHeadersList } = __nccwpck_require__(2785)
-
-const channels = {}
-channels.open = diagnosticsChannel.channel('undici:websocket:open')
-channels.close = diagnosticsChannel.channel('undici:websocket:close')
-channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
+ // 11. Let client be this's relevant settings object.
+ const client = environmentSettingsObject.settingsObject
-/** @type {import('crypto')} */
-let crypto
-try {
- crypto = __nccwpck_require__(6113)
-} catch {
+ // 12. Run this step in parallel:
-}
+ // 1. Establish a WebSocket connection given urlRecord, protocols,
+ // and client.
+ this[kController] = establishWebSocketConnection(
+ urlRecord,
+ protocols,
+ client,
+ this,
+ (response, extensions) => this.#onConnectionEstablished(response, extensions),
+ options
+ )
-/**
- * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
- * @param {URL} url
- * @param {string|string[]} protocols
- * @param {import('./websocket').WebSocket} ws
- * @param {(response: any) => void} onEstablish
- * @param {Partial} options
- */
-function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
- // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
- // scheme is "ws", and to "https" otherwise.
- const requestURL = url
+ // Each WebSocket object has an associated ready state, which is a
+ // number representing the state of the connection. Initially it must
+ // be CONNECTING (0).
+ this[kReadyState] = WebSocket.CONNECTING
- requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
+ this[kSentClose] = sentCloseFrameState.NOT_SENT
- // 2. Let request be a new request, whose URL is requestURL, client is client,
- // service-workers mode is "none", referrer is "no-referrer", mode is
- // "websocket", credentials mode is "include", cache mode is "no-store" ,
- // and redirect mode is "error".
- const request = makeRequest({
- urlList: [requestURL],
- serviceWorkers: 'none',
- referrer: 'no-referrer',
- mode: 'websocket',
- credentials: 'include',
- cache: 'no-store',
- redirect: 'error'
- })
+ // The extensions attribute must initially return the empty string.
- // Note: undici extension, allow setting custom headers.
- if (options.headers) {
- const headersList = new Headers(options.headers)[kHeadersList]
+ // The protocol attribute must initially return the empty string.
- request.headersList = headersList
+ // Each WebSocket object has an associated binary type, which is a
+ // BinaryType. Initially it must be "blob".
+ this[kBinaryType] = 'blob'
}
- // 3. Append (`Upgrade`, `websocket`) to request’s header list.
- // 4. Append (`Connection`, `Upgrade`) to request’s header list.
- // Note: both of these are handled by undici currently.
- // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
+ /**
+ * @see https://websockets.spec.whatwg.org/#dom-websocket-close
+ * @param {number|undefined} code
+ * @param {string|undefined} reason
+ */
+ close (code = undefined, reason = undefined) {
+ webidl.brandCheck(this, WebSocket)
- // 5. Let keyValue be a nonce consisting of a randomly selected
- // 16-byte value that has been forgiving-base64-encoded and
- // isomorphic encoded.
- const keyValue = crypto.randomBytes(16).toString('base64')
+ const prefix = 'WebSocket.close'
- // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
- // header list.
- request.headersList.append('sec-websocket-key', keyValue)
+ if (code !== undefined) {
+ code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })
+ }
- // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
- // header list.
- request.headersList.append('sec-websocket-version', '13')
+ if (reason !== undefined) {
+ reason = webidl.converters.USVString(reason, prefix, 'reason')
+ }
- // 8. For each protocol in protocols, combine
- // (`Sec-WebSocket-Protocol`, protocol) in request’s header
- // list.
- for (const protocol of protocols) {
- request.headersList.append('sec-websocket-protocol', protocol)
- }
+ // 1. If code is present, but is neither an integer equal to 1000 nor an
+ // integer in the range 3000 to 4999, inclusive, throw an
+ // "InvalidAccessError" DOMException.
+ if (code !== undefined) {
+ if (code !== 1000 && (code < 3000 || code > 4999)) {
+ throw new DOMException('invalid code', 'InvalidAccessError')
+ }
+ }
- // 9. Let permessageDeflate be a user-agent defined
- // "permessage-deflate" extension header value.
- // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
- // TODO: enable once permessage-deflate is supported
- const permessageDeflate = '' // 'permessage-deflate; 15'
+ let reasonByteLength = 0
- // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
- // request’s header list.
- // request.headersList.append('sec-websocket-extensions', permessageDeflate)
+ // 2. If reason is present, then run these substeps:
+ if (reason !== undefined) {
+ // 1. Let reasonBytes be the result of encoding reason.
+ // 2. If reasonBytes is longer than 123 bytes, then throw a
+ // "SyntaxError" DOMException.
+ reasonByteLength = Buffer.byteLength(reason)
- // 11. Fetch request with useParallelQueue set to true, and
- // processResponse given response being these steps:
- const controller = fetching({
- request,
- useParallelQueue: true,
- dispatcher: options.dispatcher ?? getGlobalDispatcher(),
- processResponse (response) {
- // 1. If response is a network error or its status is not 101,
- // fail the WebSocket connection.
- if (response.type === 'error' || response.status !== 101) {
- failWebsocketConnection(ws, 'Received network error or non-101 status code.')
- return
+ if (reasonByteLength > 123) {
+ throw new DOMException(
+ `Reason must be less than 123 bytes; received ${reasonByteLength}`,
+ 'SyntaxError'
+ )
}
+ }
- // 2. If protocols is not the empty list and extracting header
- // list values given `Sec-WebSocket-Protocol` and response’s
- // header list results in null, failure, or the empty byte
- // sequence, then fail the WebSocket connection.
- if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
- failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
- return
- }
+ // 3. Run the first matching steps from the following list:
+ closeWebSocketConnection(this, code, reason, reasonByteLength)
+ }
- // 3. Follow the requirements stated step 2 to step 6, inclusive,
- // of the last set of steps in section 4.1 of The WebSocket
- // Protocol to validate response. This either results in fail
- // the WebSocket connection or the WebSocket connection is
- // established.
+ /**
+ * @see https://websockets.spec.whatwg.org/#dom-websocket-send
+ * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
+ */
+ send (data) {
+ webidl.brandCheck(this, WebSocket)
- // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
- // header field contains a value that is not an ASCII case-
- // insensitive match for the value "websocket", the client MUST
- // _Fail the WebSocket Connection_.
- if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
- failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
- return
- }
+ const prefix = 'WebSocket.send'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- // 3. If the response lacks a |Connection| header field or the
- // |Connection| header field doesn't contain a token that is an
- // ASCII case-insensitive match for the value "Upgrade", the client
- // MUST _Fail the WebSocket Connection_.
- if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
- failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
- return
- }
+ data = webidl.converters.WebSocketSendData(data, prefix, 'data')
- // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
- // the |Sec-WebSocket-Accept| contains a value other than the
- // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
- // Key| (as a string, not base64-decoded) with the string "258EAFA5-
- // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
- // trailing whitespace, the client MUST _Fail the WebSocket
- // Connection_.
- const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
- const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
- if (secWSAccept !== digest) {
- failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
- return
- }
+ // 1. If this's ready state is CONNECTING, then throw an
+ // "InvalidStateError" DOMException.
+ if (isConnecting(this)) {
+ throw new DOMException('Sent before connected.', 'InvalidStateError')
+ }
- // 5. If the response includes a |Sec-WebSocket-Extensions| header
- // field and this header field indicates the use of an extension
- // that was not present in the client's handshake (the server has
- // indicated an extension not requested by the client), the client
- // MUST _Fail the WebSocket Connection_. (The parsing of this
- // header field to determine which extensions are requested is
- // discussed in Section 9.1.)
- const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
+ // 2. Run the appropriate set of steps from the following list:
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
- if (secExtension !== null && secExtension !== permessageDeflate) {
- failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
- return
- }
+ if (!isEstablished(this) || isClosing(this)) {
+ return
+ }
- // 6. If the response includes a |Sec-WebSocket-Protocol| header field
- // and this header field indicates the use of a subprotocol that was
- // not present in the client's handshake (the server has indicated a
- // subprotocol not requested by the client), the client MUST _Fail
- // the WebSocket Connection_.
- const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
+ // If data is a string
+ if (typeof data === 'string') {
+ // If the WebSocket connection is established and the WebSocket
+ // closing handshake has not yet started, then the user agent
+ // must send a WebSocket Message comprised of the data argument
+ // using a text frame opcode; if the data cannot be sent, e.g.
+ // because it would need to be buffered but the buffer is full,
+ // the user agent must flag the WebSocket as full and then close
+ // the WebSocket connection. Any invocation of this method with a
+ // string argument that does not throw an exception must increase
+ // the bufferedAmount attribute by the number of bytes needed to
+ // express the argument as UTF-8.
- if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
- failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
- return
- }
+ const length = Buffer.byteLength(data)
- response.socket.on('data', onSocketData)
- response.socket.on('close', onSocketClose)
- response.socket.on('error', onSocketError)
+ this.#bufferedAmount += length
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= length
+ }, sendHints.string)
+ } else if (types.isArrayBuffer(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need
+ // to be buffered but the buffer is full, the user agent must flag
+ // the WebSocket as full and then close the WebSocket connection.
+ // The data to be sent is the data stored in the buffer described
+ // by the ArrayBuffer object. Any invocation of this method with an
+ // ArrayBuffer argument that does not throw an exception must
+ // increase the bufferedAmount attribute by the length of the
+ // ArrayBuffer in bytes.
- if (channels.open.hasSubscribers) {
- channels.open.publish({
- address: response.socket.address(),
- protocol: secProtocol,
- extensions: secExtension
- })
- }
+ this.#bufferedAmount += data.byteLength
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.byteLength
+ }, sendHints.arrayBuffer)
+ } else if (ArrayBuffer.isView(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need to
+ // be buffered but the buffer is full, the user agent must flag the
+ // WebSocket as full and then close the WebSocket connection. The
+ // data to be sent is the data stored in the section of the buffer
+ // described by the ArrayBuffer object that data references. Any
+ // invocation of this method with this kind of argument that does
+ // not throw an exception must increase the bufferedAmount attribute
+ // by the length of data’s buffer in bytes.
+
+ this.#bufferedAmount += data.byteLength
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.byteLength
+ }, sendHints.typedArray)
+ } else if (isBlobLike(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need to
+ // be buffered but the buffer is full, the user agent must flag the
+ // WebSocket as full and then close the WebSocket connection. The data
+ // to be sent is the raw data represented by the Blob object. Any
+ // invocation of this method with a Blob argument that does not throw
+ // an exception must increase the bufferedAmount attribute by the size
+ // of the Blob object’s raw data, in bytes.
- onEstablish(response)
+ this.#bufferedAmount += data.size
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.size
+ }, sendHints.blob)
}
- })
+ }
- return controller
-}
+ get readyState () {
+ webidl.brandCheck(this, WebSocket)
-/**
- * @param {Buffer} chunk
- */
-function onSocketData (chunk) {
- if (!this.ws[kByteParser].write(chunk)) {
- this.pause()
+ // The readyState getter steps are to return this's ready state.
+ return this[kReadyState]
}
-}
-/**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
- * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
- */
-function onSocketClose () {
- const { ws } = this
+ get bufferedAmount () {
+ webidl.brandCheck(this, WebSocket)
- // If the TCP connection was closed after the
- // WebSocket closing handshake was completed, the WebSocket connection
- // is said to have been closed _cleanly_.
- const wasClean = ws[kSentClose] && ws[kReceivedClose]
+ return this.#bufferedAmount
+ }
- let code = 1005
- let reason = ''
+ get url () {
+ webidl.brandCheck(this, WebSocket)
- const result = ws[kByteParser].closingInfo
+ // The url getter steps are to return this's url, serialized.
+ return URLSerializer(this[kWebSocketURL])
+ }
- if (result) {
- code = result.code ?? 1005
- reason = result.reason
- } else if (!ws[kSentClose]) {
- // If _The WebSocket
- // Connection is Closed_ and no Close control frame was received by the
- // endpoint (such as could occur if the underlying transport connection
- // is lost), _The WebSocket Connection Close Code_ is considered to be
- // 1006.
- code = 1006
+ get extensions () {
+ webidl.brandCheck(this, WebSocket)
+
+ return this.#extensions
}
- // 1. Change the ready state to CLOSED (3).
- ws[kReadyState] = states.CLOSED
+ get protocol () {
+ webidl.brandCheck(this, WebSocket)
- // 2. If the user agent was required to fail the WebSocket
- // connection, or if the WebSocket connection was closed
- // after being flagged as full, fire an event named error
- // at the WebSocket object.
- // TODO
+ return this.#protocol
+ }
+
+ get onopen () {
+ webidl.brandCheck(this, WebSocket)
+
+ return this.#events.open
+ }
+
+ set onopen (fn) {
+ webidl.brandCheck(this, WebSocket)
+
+ if (this.#events.open) {
+ this.removeEventListener('open', this.#events.open)
+ }
+
+ if (typeof fn === 'function') {
+ this.#events.open = fn
+ this.addEventListener('open', fn)
+ } else {
+ this.#events.open = null
+ }
+ }
- // 3. Fire an event named close at the WebSocket object,
- // using CloseEvent, with the wasClean attribute
- // initialized to true if the connection closed cleanly
- // and false otherwise, the code attribute initialized to
- // the WebSocket connection close code, and the reason
- // attribute initialized to the result of applying UTF-8
- // decode without BOM to the WebSocket connection close
- // reason.
- fireEvent('close', ws, CloseEvent, {
- wasClean, code, reason
- })
+ get onerror () {
+ webidl.brandCheck(this, WebSocket)
- if (channels.close.hasSubscribers) {
- channels.close.publish({
- websocket: ws,
- code,
- reason
- })
+ return this.#events.error
}
-}
-function onSocketError (error) {
- const { ws } = this
+ set onerror (fn) {
+ webidl.brandCheck(this, WebSocket)
- ws[kReadyState] = states.CLOSING
+ if (this.#events.error) {
+ this.removeEventListener('error', this.#events.error)
+ }
- if (channels.socketError.hasSubscribers) {
- channels.socketError.publish(error)
+ if (typeof fn === 'function') {
+ this.#events.error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this.#events.error = null
+ }
}
- this.destroy()
-}
-
-module.exports = {
- establishWebSocketConnection
-}
+ get onclose () {
+ webidl.brandCheck(this, WebSocket)
+ return this.#events.close
+ }
-/***/ }),
+ set onclose (fn) {
+ webidl.brandCheck(this, WebSocket)
-/***/ 9188:
-/***/ ((module) => {
+ if (this.#events.close) {
+ this.removeEventListener('close', this.#events.close)
+ }
-"use strict";
+ if (typeof fn === 'function') {
+ this.#events.close = fn
+ this.addEventListener('close', fn)
+ } else {
+ this.#events.close = null
+ }
+ }
+ get onmessage () {
+ webidl.brandCheck(this, WebSocket)
-// This is a Globally Unique Identifier unique used
-// to validate that the endpoint accepts websocket
-// connections.
-// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
-const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
+ return this.#events.message
+ }
-/** @type {PropertyDescriptor} */
-const staticPropertyDescriptors = {
- enumerable: true,
- writable: false,
- configurable: false
-}
+ set onmessage (fn) {
+ webidl.brandCheck(this, WebSocket)
-const states = {
- CONNECTING: 0,
- OPEN: 1,
- CLOSING: 2,
- CLOSED: 3
-}
+ if (this.#events.message) {
+ this.removeEventListener('message', this.#events.message)
+ }
-const opcodes = {
- CONTINUATION: 0x0,
- TEXT: 0x1,
- BINARY: 0x2,
- CLOSE: 0x8,
- PING: 0x9,
- PONG: 0xA
-}
+ if (typeof fn === 'function') {
+ this.#events.message = fn
+ this.addEventListener('message', fn)
+ } else {
+ this.#events.message = null
+ }
+ }
-const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
+ get binaryType () {
+ webidl.brandCheck(this, WebSocket)
-const parserStates = {
- INFO: 0,
- PAYLOADLENGTH_16: 2,
- PAYLOADLENGTH_64: 3,
- READ_DATA: 4
-}
+ return this[kBinaryType]
+ }
-const emptyBuffer = Buffer.allocUnsafe(0)
+ set binaryType (type) {
+ webidl.brandCheck(this, WebSocket)
-module.exports = {
- uid,
- staticPropertyDescriptors,
- states,
- opcodes,
- maxUnsigned16Bit,
- parserStates,
- emptyBuffer
-}
+ if (type !== 'blob' && type !== 'arraybuffer') {
+ this[kBinaryType] = 'blob'
+ } else {
+ this[kBinaryType] = type
+ }
+ }
+ /**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ */
+ #onConnectionEstablished (response, parsedExtensions) {
+ // processResponse is called when the "response's header list has been received and initialized."
+ // once this happens, the connection is open
+ this[kResponse] = response
-/***/ }),
+ const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions
+ const maxFragments = webSocketOptions?.maxFragments
+ const maxPayloadSize = webSocketOptions?.maxPayloadSize
-/***/ 2611:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const parser = new ByteParser(this, parsedExtensions, {
+ maxFragments,
+ maxPayloadSize
+ })
+ parser.on('drain', onParserDrain)
+ parser.on('error', onParserError.bind(this))
-"use strict";
+ response.socket.ws = this
+ this[kByteParser] = parser
+ this.#sendQueue = new SendQueue(response.socket)
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
-const { MessagePort } = __nccwpck_require__(1267)
+ // 1. Change the ready state to OPEN (1).
+ this[kReadyState] = states.OPEN
-/**
- * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
- */
-class MessageEvent extends Event {
- #eventInit
+ // 2. Change the extensions attribute’s value to the extensions in use, if
+ // it is not the null value.
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
+ const extensions = response.headersList.get('sec-websocket-extensions')
- constructor (type, eventInitDict = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
+ if (extensions !== null) {
+ this.#extensions = extensions
+ }
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
+ // 3. Change the protocol attribute’s value to the subprotocol in use, if
+ // it is not the null value.
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
+ const protocol = response.headersList.get('sec-websocket-protocol')
- super(type, eventInitDict)
+ if (protocol !== null) {
+ this.#protocol = protocol
+ }
- this.#eventInit = eventInitDict
+ // 4. Fire an event named open at the WebSocket object.
+ fireEvent('open', this)
}
+}
- get data () {
- webidl.brandCheck(this, MessageEvent)
+// https://websockets.spec.whatwg.org/#dom-websocket-connecting
+WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
+// https://websockets.spec.whatwg.org/#dom-websocket-open
+WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
+// https://websockets.spec.whatwg.org/#dom-websocket-closing
+WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
+// https://websockets.spec.whatwg.org/#dom-websocket-closed
+WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
- return this.#eventInit.data
+Object.defineProperties(WebSocket.prototype, {
+ CONNECTING: staticPropertyDescriptors,
+ OPEN: staticPropertyDescriptors,
+ CLOSING: staticPropertyDescriptors,
+ CLOSED: staticPropertyDescriptors,
+ url: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ bufferedAmount: kEnumerableProperty,
+ onopen: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onclose: kEnumerableProperty,
+ close: kEnumerableProperty,
+ onmessage: kEnumerableProperty,
+ binaryType: kEnumerableProperty,
+ send: kEnumerableProperty,
+ extensions: kEnumerableProperty,
+ protocol: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'WebSocket',
+ writable: false,
+ enumerable: false,
+ configurable: true
}
+})
- get origin () {
- webidl.brandCheck(this, MessageEvent)
+Object.defineProperties(WebSocket, {
+ CONNECTING: staticPropertyDescriptors,
+ OPEN: staticPropertyDescriptors,
+ CLOSING: staticPropertyDescriptors,
+ CLOSED: staticPropertyDescriptors
+})
- return this.#eventInit.origin
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.DOMString
+)
+
+webidl.converters['DOMString or sequence'] = function (V, prefix, argument) {
+ if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
+ return webidl.converters['sequence'](V)
}
- get lastEventId () {
- webidl.brandCheck(this, MessageEvent)
+ return webidl.converters.DOMString(V, prefix, argument)
+}
- return this.#eventInit.lastEventId
+// This implements the proposal made in https://github.com/whatwg/websockets/issues/42
+webidl.converters.WebSocketInit = webidl.dictionaryConverter([
+ {
+ key: 'protocols',
+ converter: webidl.converters['DOMString or sequence'],
+ defaultValue: () => new Array(0)
+ },
+ {
+ key: 'dispatcher',
+ converter: webidl.converters.any,
+ defaultValue: () => getGlobalDispatcher()
+ },
+ {
+ key: 'headers',
+ converter: webidl.nullableConverter(webidl.converters.HeadersInit)
}
+])
- get source () {
- webidl.brandCheck(this, MessageEvent)
-
- return this.#eventInit.source
+webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {
+ if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
+ return webidl.converters.WebSocketInit(V)
}
- get ports () {
- webidl.brandCheck(this, MessageEvent)
+ return { protocols: webidl.converters['DOMString or sequence'](V) }
+}
- if (!Object.isFrozen(this.#eventInit.ports)) {
- Object.freeze(this.#eventInit.ports)
+webidl.converters.WebSocketSendData = function (V) {
+ if (webidl.util.Type(V) === 'Object') {
+ if (isBlobLike(V)) {
+ return webidl.converters.Blob(V, { strict: false })
}
- return this.#eventInit.ports
+ if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {
+ return webidl.converters.BufferSource(V)
+ }
}
- initMessageEvent (
- type,
- bubbles = false,
- cancelable = false,
- data = null,
- origin = '',
- lastEventId = '',
- source = null,
- ports = []
- ) {
- webidl.brandCheck(this, MessageEvent)
+ return webidl.converters.USVString(V)
+}
- webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
+function onParserDrain () {
+ this.ws[kResponse].socket.resume()
+}
- return new MessageEvent(type, {
- bubbles, cancelable, data, origin, lastEventId, source, ports
- })
+function onParserError (err) {
+ let message
+ let code
+
+ if (err instanceof CloseEvent) {
+ message = err.reason
+ code = err.code
+ } else {
+ message = err.message
}
-}
-/**
- * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
- */
-class CloseEvent extends Event {
- #eventInit
+ fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))
- constructor (type, eventInitDict = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
+ closeWebSocketConnection(this, code)
+}
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
+module.exports = {
+ WebSocket
+}
- super(type, eventInitDict)
- this.#eventInit = eventInitDict
- }
+/***/ }),
- get wasClean () {
- webidl.brandCheck(this, CloseEvent)
+/***/ 2613:
+/***/ ((module) => {
- return this.#eventInit.wasClean
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert");
- get code () {
- webidl.brandCheck(this, CloseEvent)
+/***/ }),
- return this.#eventInit.code
- }
+/***/ 6982:
+/***/ ((module) => {
- get reason () {
- webidl.brandCheck(this, CloseEvent)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto");
- return this.#eventInit.reason
- }
-}
+/***/ }),
-// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
-class ErrorEvent extends Event {
- #eventInit
+/***/ 4434:
+/***/ ((module) => {
- constructor (type, eventInitDict) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events");
- super(type, eventInitDict)
+/***/ }),
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
+/***/ 9896:
+/***/ ((module) => {
- this.#eventInit = eventInitDict
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs");
- get message () {
- webidl.brandCheck(this, ErrorEvent)
+/***/ }),
- return this.#eventInit.message
- }
+/***/ 8611:
+/***/ ((module) => {
- get filename () {
- webidl.brandCheck(this, ErrorEvent)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http");
- return this.#eventInit.filename
- }
+/***/ }),
- get lineno () {
- webidl.brandCheck(this, ErrorEvent)
+/***/ 5675:
+/***/ ((module) => {
- return this.#eventInit.lineno
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2");
- get colno () {
- webidl.brandCheck(this, ErrorEvent)
+/***/ }),
- return this.#eventInit.colno
- }
+/***/ 5692:
+/***/ ((module) => {
- get error () {
- webidl.brandCheck(this, ErrorEvent)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https");
- return this.#eventInit.error
- }
-}
+/***/ }),
-Object.defineProperties(MessageEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'MessageEvent',
- configurable: true
- },
- data: kEnumerableProperty,
- origin: kEnumerableProperty,
- lastEventId: kEnumerableProperty,
- source: kEnumerableProperty,
- ports: kEnumerableProperty,
- initMessageEvent: kEnumerableProperty
-})
+/***/ 9278:
+/***/ ((module) => {
-Object.defineProperties(CloseEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'CloseEvent',
- configurable: true
- },
- reason: kEnumerableProperty,
- code: kEnumerableProperty,
- wasClean: kEnumerableProperty
-})
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net");
-Object.defineProperties(ErrorEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'ErrorEvent',
- configurable: true
- },
- message: kEnumerableProperty,
- filename: kEnumerableProperty,
- lineno: kEnumerableProperty,
- colno: kEnumerableProperty,
- error: kEnumerableProperty
-})
+/***/ }),
-webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
+/***/ 4589:
+/***/ ((module) => {
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.MessagePort
-)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:assert");
-const eventInit = [
- {
- key: 'bubbles',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'cancelable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'composed',
- converter: webidl.converters.boolean,
- defaultValue: false
- }
-]
+/***/ }),
-webidl.converters.MessageEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'data',
- converter: webidl.converters.any,
- defaultValue: null
- },
- {
- key: 'origin',
- converter: webidl.converters.USVString,
- defaultValue: ''
- },
- {
- key: 'lastEventId',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'source',
- // Node doesn't implement WindowProxy or ServiceWorker, so the only
- // valid value for source is a MessagePort.
- converter: webidl.nullableConverter(webidl.converters.MessagePort),
- defaultValue: null
- },
- {
- key: 'ports',
- converter: webidl.converters['sequence'],
- get defaultValue () {
- return []
- }
- }
-])
+/***/ 6698:
+/***/ ((module) => {
-webidl.converters.CloseEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'wasClean',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'code',
- converter: webidl.converters['unsigned short'],
- defaultValue: 0
- },
- {
- key: 'reason',
- converter: webidl.converters.USVString,
- defaultValue: ''
- }
-])
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:async_hooks");
-webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'message',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'filename',
- converter: webidl.converters.USVString,
- defaultValue: ''
- },
- {
- key: 'lineno',
- converter: webidl.converters['unsigned long'],
- defaultValue: 0
- },
- {
- key: 'colno',
- converter: webidl.converters['unsigned long'],
- defaultValue: 0
- },
- {
- key: 'error',
- converter: webidl.converters.any
- }
-])
+/***/ }),
-module.exports = {
- MessageEvent,
- CloseEvent,
- ErrorEvent
-}
+/***/ 4573:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer");
/***/ }),
-/***/ 5444:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 7540:
+/***/ ((module) => {
-"use strict";
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:console");
+/***/ }),
-const { maxUnsigned16Bit } = __nccwpck_require__(9188)
+/***/ 7598:
+/***/ ((module) => {
-/** @type {import('crypto')} */
-let crypto
-try {
- crypto = __nccwpck_require__(6113)
-} catch {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
-}
+/***/ }),
-class WebsocketFrameSend {
- /**
- * @param {Buffer|undefined} data
- */
- constructor (data) {
- this.frameData = data
- this.maskKey = crypto.randomBytes(4)
- }
+/***/ 3053:
+/***/ ((module) => {
- createFrame (opcode) {
- const bodyLength = this.frameData?.byteLength ?? 0
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:diagnostics_channel");
- /** @type {number} */
- let payloadLength = bodyLength // 0-125
- let offset = 6
+/***/ }),
- if (bodyLength > maxUnsigned16Bit) {
- offset += 8 // payload length is next 8 bytes
- payloadLength = 127
- } else if (bodyLength > 125) {
- offset += 2 // payload length is next 2 bytes
- payloadLength = 126
- }
+/***/ 610:
+/***/ ((module) => {
- const buffer = Buffer.allocUnsafe(bodyLength + offset)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns");
- // Clear first 2 bytes, everything else is overwritten
- buffer[0] = buffer[1] = 0
- buffer[0] |= 0x80 // FIN
- buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
+/***/ }),
- /*! ws. MIT License. Einar Otto Stangvik */
- buffer[offset - 4] = this.maskKey[0]
- buffer[offset - 3] = this.maskKey[1]
- buffer[offset - 2] = this.maskKey[2]
- buffer[offset - 1] = this.maskKey[3]
+/***/ 8474:
+/***/ ((module) => {
- buffer[1] = payloadLength
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events");
- if (payloadLength === 126) {
- buffer.writeUInt16BE(bodyLength, 2)
- } else if (payloadLength === 127) {
- // Clear extended payload length
- buffer[2] = buffer[3] = 0
- buffer.writeUIntBE(bodyLength, 4, 6)
- }
+/***/ }),
- buffer[1] |= 0x80 // MASK
+/***/ 3024:
+/***/ ((module) => {
- // mask body
- for (let i = 0; i < bodyLength; i++) {
- buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
- return buffer
- }
-}
+/***/ }),
-module.exports = {
- WebsocketFrameSend
-}
+/***/ 7067:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http");
/***/ }),
-/***/ 1688:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 2467:
+/***/ ((module) => {
-"use strict";
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http2");
+/***/ }),
-const { Writable } = __nccwpck_require__(2781)
-const diagnosticsChannel = __nccwpck_require__(7643)
-const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
-const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
-const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
-const { WebsocketFrameSend } = __nccwpck_require__(5444)
+/***/ 7030:
+/***/ ((module) => {
-// This code was influenced by ws released under the MIT license.
-// Copyright (c) 2011 Einar Otto Stangvik
-// Copyright (c) 2013 Arnout Kazemier and contributors
-// Copyright (c) 2016 Luigi Pinca and contributors
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net");
-const channels = {}
-channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
-channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
+/***/ }),
-class ByteParser extends Writable {
- #buffers = []
- #byteOffset = 0
+/***/ 8161:
+/***/ ((module) => {
- #state = parserStates.INFO
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
- #info = {}
- #fragments = []
+/***/ }),
- constructor (ws) {
- super()
+/***/ 6760:
+/***/ ((module) => {
- this.ws = ws
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
- /**
- * @param {Buffer} chunk
- * @param {() => void} callback
- */
- _write (chunk, _, callback) {
- this.#buffers.push(chunk)
- this.#byteOffset += chunk.length
+/***/ }),
- this.run(callback)
- }
+/***/ 643:
+/***/ ((module) => {
- /**
- * Runs whenever a new chunk is received.
- * Callback is called whenever there are no more chunks buffering,
- * or not enough bytes are buffered to parse.
- */
- run (callback) {
- while (true) {
- if (this.#state === parserStates.INFO) {
- // If there aren't enough bytes to parse the payload length, etc.
- if (this.#byteOffset < 2) {
- return callback()
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:perf_hooks");
- const buffer = this.consume(2)
+/***/ }),
- this.#info.fin = (buffer[0] & 0x80) !== 0
- this.#info.opcode = buffer[0] & 0x0F
+/***/ 1792:
+/***/ ((module) => {
- // If we receive a fragmented message, we use the type of the first
- // frame to parse the full message as binary/text, when it's terminated
- this.#info.originalOpcode ??= this.#info.opcode
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:querystring");
- this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
+/***/ }),
- if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
- // Only text and binary frames can be fragmented
- failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
- return
- }
+/***/ 7075:
+/***/ ((module) => {
- const payloadLength = buffer[1] & 0x7F
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream");
- if (payloadLength <= 125) {
- this.#info.payloadLength = payloadLength
- this.#state = parserStates.READ_DATA
- } else if (payloadLength === 126) {
- this.#state = parserStates.PAYLOADLENGTH_16
- } else if (payloadLength === 127) {
- this.#state = parserStates.PAYLOADLENGTH_64
- }
+/***/ }),
- if (this.#info.fragmented && payloadLength > 125) {
- // A fragmented frame can't be fragmented itself
- failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
- return
- } else if (
- (this.#info.opcode === opcodes.PING ||
- this.#info.opcode === opcodes.PONG ||
- this.#info.opcode === opcodes.CLOSE) &&
- payloadLength > 125
- ) {
- // Control frames can have a payload length of 125 bytes MAX
- failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
- return
- } else if (this.#info.opcode === opcodes.CLOSE) {
- if (payloadLength === 1) {
- failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
- return
- }
+/***/ 1692:
+/***/ ((module) => {
- const body = this.consume(payloadLength)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls");
- this.#info.closeInfo = this.parseCloseBody(false, body)
+/***/ }),
- if (!this.ws[kSentClose]) {
- // If an endpoint receives a Close frame and did not previously send a
- // Close frame, the endpoint MUST send a Close frame in response. (When
- // sending a Close frame in response, the endpoint typically echos the
- // status code it received.)
- const body = Buffer.allocUnsafe(2)
- body.writeUInt16BE(this.#info.closeInfo.code, 0)
- const closeFrame = new WebsocketFrameSend(body)
+/***/ 3136:
+/***/ ((module) => {
- this.ws[kResponse].socket.write(
- closeFrame.createFrame(opcodes.CLOSE),
- (err) => {
- if (!err) {
- this.ws[kSentClose] = true
- }
- }
- )
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url");
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- this.ws[kReadyState] = states.CLOSING
- this.ws[kReceivedClose] = true
+/***/ }),
- this.end()
+/***/ 7975:
+/***/ ((module) => {
- return
- } else if (this.#info.opcode === opcodes.PING) {
- // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
- // response, unless it already received a Close frame.
- // A Pong frame sent in response to a Ping frame must have identical
- // "Application data"
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util");
- const body = this.consume(payloadLength)
+/***/ }),
- if (!this.ws[kReceivedClose]) {
- const frame = new WebsocketFrameSend(body)
+/***/ 3429:
+/***/ ((module) => {
- this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util/types");
- if (channels.ping.hasSubscribers) {
- channels.ping.publish({
- payload: body
- })
- }
- }
+/***/ }),
- this.#state = parserStates.INFO
+/***/ 5919:
+/***/ ((module) => {
- if (this.#byteOffset > 0) {
- continue
- } else {
- callback()
- return
- }
- } else if (this.#info.opcode === opcodes.PONG) {
- // A Pong frame MAY be sent unsolicited. This serves as a
- // unidirectional heartbeat. A response to an unsolicited Pong frame is
- // not expected.
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:worker_threads");
- const body = this.consume(payloadLength)
+/***/ }),
- if (channels.pong.hasSubscribers) {
- channels.pong.publish({
- payload: body
- })
- }
+/***/ 8522:
+/***/ ((module) => {
- if (this.#byteOffset > 0) {
- continue
- } else {
- callback()
- return
- }
- }
- } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
- if (this.#byteOffset < 2) {
- return callback()
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");
- const buffer = this.consume(2)
+/***/ }),
- this.#info.payloadLength = buffer.readUInt16BE(0)
- this.#state = parserStates.READ_DATA
- } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
- if (this.#byteOffset < 8) {
- return callback()
- }
+/***/ 857:
+/***/ ((module) => {
- const buffer = this.consume(8)
- const upper = buffer.readUInt32BE(0)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os");
- // 2^31 is the maxinimum bytes an arraybuffer can contain
- // on 32-bit systems. Although, on 64-bit systems, this is
- // 2^53-1 bytes.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
- // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
- // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
- if (upper > 2 ** 31 - 1) {
- failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
- return
- }
+/***/ }),
- const lower = buffer.readUInt32BE(4)
+/***/ 6928:
+/***/ ((module) => {
- this.#info.payloadLength = (upper << 8) + lower
- this.#state = parserStates.READ_DATA
- } else if (this.#state === parserStates.READ_DATA) {
- if (this.#byteOffset < this.#info.payloadLength) {
- // If there is still more data in this chunk that needs to be read
- return callback()
- } else if (this.#byteOffset >= this.#info.payloadLength) {
- // If the server sent multiple frames in a single chunk
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path");
- const body = this.consume(this.#info.payloadLength)
+/***/ }),
- this.#fragments.push(body)
+/***/ 2203:
+/***/ ((module) => {
- // If the frame is unfragmented, or a fragmented frame was terminated,
- // a message was received
- if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
- const fullMessage = Buffer.concat(this.#fragments)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream");
- websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
+/***/ }),
- this.#info = {}
- this.#fragments.length = 0
- }
+/***/ 3193:
+/***/ ((module) => {
- this.#state = parserStates.INFO
- }
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder");
- if (this.#byteOffset > 0) {
- continue
- } else {
- callback()
- break
- }
- }
- }
+/***/ }),
- /**
- * Take n bytes from the buffered Buffers
- * @param {number} n
- * @returns {Buffer|null}
- */
- consume (n) {
- if (n > this.#byteOffset) {
- return null
- } else if (n === 0) {
- return emptyBuffer
- }
+/***/ 4756:
+/***/ ((module) => {
- if (this.#buffers[0].length === n) {
- this.#byteOffset -= this.#buffers[0].length
- return this.#buffers.shift()
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls");
- const buffer = Buffer.allocUnsafe(n)
- let offset = 0
+/***/ }),
- while (offset !== n) {
- const next = this.#buffers[0]
- const { length } = next
+/***/ 2018:
+/***/ ((module) => {
- if (length + offset === n) {
- buffer.set(this.#buffers.shift(), offset)
- break
- } else if (length + offset > n) {
- buffer.set(next.subarray(0, n - offset), offset)
- this.#buffers[0] = next.subarray(n - offset)
- break
- } else {
- buffer.set(this.#buffers.shift(), offset)
- offset += next.length
- }
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty");
- this.#byteOffset -= n
+/***/ }),
- return buffer
- }
+/***/ 7016:
+/***/ ((module) => {
- parseCloseBody (onlyCode, data) {
- // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
- /** @type {number|undefined} */
- let code
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
- if (data.length >= 2) {
- // _The WebSocket Connection Close Code_ is
- // defined as the status code (Section 7.4) contained in the first Close
- // control frame received by the application
- code = data.readUInt16BE(0)
- }
+/***/ }),
- if (onlyCode) {
- if (!isValidStatusCode(code)) {
- return null
- }
+/***/ 9023:
+/***/ ((module) => {
- return { code }
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util");
- // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
- /** @type {Buffer} */
- let reason = data.subarray(2)
+/***/ }),
- // Remove BOM
- if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
- reason = reason.subarray(3)
- }
+/***/ 3106:
+/***/ ((module) => {
- if (code !== undefined && !isValidStatusCode(code)) {
- return null
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib");
- try {
- // TODO: optimize this
- reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
- } catch {
- return null
- }
+/***/ }),
- return { code, reason }
- }
+/***/ 4649:
+/***/ ((__unused_webpack_module, exports) => {
- get closingInfo () {
- return this.#info.closeInfo
- }
-}
+var __webpack_unused_export__;
-module.exports = {
- ByteParser
+/*!
+ * content-type
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+__webpack_unused_export__ = ({ value: true });
+__webpack_unused_export__ = format;
+exports.qg = parse;
+const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;
+const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4
+ */
+const QUOTE_REGEXP = /[\\"]/g;
+/**
+ * RegExp to match type in RFC 9110 sec 8.3.1
+ *
+ * media-type = type "/" subtype
+ * type = token
+ * subtype = token
+ */
+const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
+/**
+ * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.
+ */
+const NullObject = /* @__PURE__ */ (() => {
+ const C = function () { };
+ C.prototype = Object.create(null);
+ return C;
+})();
+/**
+ * Format an object into a `Content-Type` header.
+ */
+function format(obj) {
+ const { type, parameters } = obj;
+ if (!type || !TYPE_REGEXP.test(type)) {
+ throw new TypeError(`Invalid type: ${type}`);
+ }
+ let result = type;
+ if (parameters) {
+ for (const param of Object.keys(parameters)) {
+ if (!TOKEN_REGEXP.test(param)) {
+ throw new TypeError(`Invalid parameter name: ${param}`);
+ }
+ result += `; ${param}=${qstring(parameters[param])}`;
+ }
+ }
+ return result;
}
-
+/**
+ * Parse a `Content-Type` header.
+ */
+function parse(header, options) {
+ const len = header.length;
+ let index = skipOWS(header, 0, len);
+ const valueStart = index;
+ index = skipValue(header, index, len);
+ const valueEnd = trailingOWS(header, valueStart, index);
+ const type = header.slice(valueStart, valueEnd).toLowerCase();
+ const parameters = options?.parameters === false
+ ? new NullObject()
+ : parseParameters(header, index, len);
+ return { type, parameters };
+}
+const SP = 32; // " "
+const HTAB = 9; // "\t"
+const SEMI = 59; // ";"
+const EQ = 61; // "="
+const DQUOTE = 34; // '"'
+const BSLASH = 92; // "\\"
+/**
+ * Parses the parameters of a `Content-Type` header starting at the given index.
+ */
+function parseParameters(header, index, len) {
+ const parameters = new NullObject();
+ parameter: while (index < len) {
+ index = skipOWS(header, index + 1 /* Skip over ; */, len);
+ const keyStart = index;
+ while (index < len) {
+ const code = header.charCodeAt(index);
+ if (code === SEMI)
+ continue parameter;
+ if (code === EQ) {
+ const keyEnd = trailingOWS(header, keyStart, index);
+ const key = header.slice(keyStart, keyEnd).toLowerCase();
+ index = skipOWS(header, index + 1, len);
+ if (index < len && header.charCodeAt(index) === DQUOTE) {
+ index++;
+ let value = "";
+ while (index < len) {
+ const code = header.charCodeAt(index++);
+ if (code === DQUOTE) {
+ index = skipValue(header, index, len);
+ if (parameters[key] === undefined)
+ parameters[key] = value;
+ break;
+ }
+ if (code === BSLASH && index < len) {
+ value += header[index++];
+ continue;
+ }
+ value += String.fromCharCode(code);
+ }
+ continue parameter;
+ }
+ const valueStart = index;
+ index = skipValue(header, index, len);
+ if (parameters[key] === undefined) {
+ const valueEnd = trailingOWS(header, valueStart, index);
+ parameters[key] = header.slice(valueStart, valueEnd);
+ }
+ continue parameter;
+ }
+ index++;
+ }
+ }
+ return parameters;
+}
+/**
+ * Skip over characters until a semicolon.
+ */
+function skipValue(str, index, len) {
+ while (index < len) {
+ const char = str.charCodeAt(index);
+ if (char === SEMI)
+ break;
+ index++;
+ }
+ return index;
+}
+/**
+ * Skip optional whitespace (OWS) in an HTTP header value.
+ *
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
+ */
+function skipOWS(header, index, len) {
+ while (index < len) {
+ const char = header.charCodeAt(index);
+ if (char !== SP && char !== HTAB)
+ break;
+ index++;
+ }
+ return index;
+}
+/**
+ * Trim optional whitespace (OWS) from the end of a substring.
+ *
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
+ */
+function trailingOWS(header, start, end) {
+ while (end > start) {
+ const char = header.charCodeAt(end - 1);
+ if (char !== SP && char !== HTAB)
+ break;
+ end--;
+ }
+ return end;
+}
+/**
+ * Serialize a parameter value.
+ */
+function qstring(str) {
+ if (TOKEN_REGEXP.test(str))
+ return str;
+ if (TEXT_REGEXP.test(str))
+ return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`;
+ throw new TypeError(`Invalid parameter value: ${str}`);
+}
+//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 7578:
-/***/ ((module) => {
+/***/ 7269:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */
-module.exports = {
- kWebSocketURL: Symbol('url'),
- kReadyState: Symbol('ready state'),
- kController: Symbol('controller'),
- kResponse: Symbol('response'),
- kBinaryType: Symbol('binary type'),
- kSentClose: Symbol('sent close'),
- kReceivedClose: Symbol('received close'),
- kByteParser: Symbol('byte parser')
+var FormData$1 = __nccwpck_require__(6454);
+var crypto = __nccwpck_require__(6982);
+var url = __nccwpck_require__(7016);
+var HttpsProxyAgent = __nccwpck_require__(3669);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var http2 = __nccwpck_require__(5675);
+var util = __nccwpck_require__(9023);
+var path = __nccwpck_require__(6928);
+var followRedirects = __nccwpck_require__(1573);
+var zlib = __nccwpck_require__(3106);
+var stream = __nccwpck_require__(2203);
+var events = __nccwpck_require__(4434);
+
+/**
+ * Create a bound version of a function with a specified `this` context
+ *
+ * @param {Function} fn - The function to bind
+ * @param {*} thisArg - The value to be passed as the `this` parameter
+ * @returns {Function} A new function that will call the original function with the specified `this` context
+ */
+function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
}
+// utils is a library of generic helper functions non-specific to axios
-/***/ }),
+const {
+ toString
+} = Object.prototype;
+const {
+ getPrototypeOf
+} = Object;
+const {
+ iterator,
+ toStringTag
+} = Symbol;
-/***/ 5515:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({
+ hasOwnProperty
+}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
-"use strict";
+/**
+ * Walk the prototype chain (excluding the shared Object.prototype) looking for
+ * an own `prop`. This distinguishes genuine own/inherited members — including
+ * class accessors and template prototypes — from members injected via
+ * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
+ * live on Object.prototype itself and are therefore never matched.
+ *
+ * @param {*} thing The value whose chain to inspect
+ * @param {string|symbol} prop The property key to look for
+ *
+ * @returns {boolean} True when `prop` is owned below Object.prototype
+ */
+const hasOwnInPrototypeChain = (thing, prop) => {
+ let obj = thing;
+ const seen = [];
+ while (obj != null && obj !== Object.prototype) {
+ if (seen.indexOf(obj) !== -1) {
+ return false;
+ }
+ seen.push(obj);
+ if (hasOwnProperty(obj, prop)) {
+ return true;
+ }
+ obj = getPrototypeOf(obj);
+ }
+ return false;
+};
+/**
+ * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
+ * properties and members inherited from a non-Object.prototype source (a class
+ * instance or template object) are honored; a value reachable only through a
+ * polluted Object.prototype is ignored and `undefined` is returned.
+ *
+ * @param {*} obj The source object
+ * @param {string|symbol} prop The property key to read
+ *
+ * @returns {*} The resolved value, or undefined when unsafe/absent
+ */
+const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+const kindOfTest = type => {
+ type = type.toLowerCase();
+ return thing => kindOf(thing) === type;
+};
+const typeOfTest = type => thing => typeof thing === type;
-const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
-const { states, opcodes } = __nccwpck_require__(9188)
-const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
+/**
+ * Determine if a value is a non-null object
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {
+ isArray
+} = Array;
-/* globals Blob */
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
/**
- * @param {import('./websocket').WebSocket} ws
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
*/
-function isEstablished (ws) {
- // If the server's response is validated as provided for above, it is
- // said that _The WebSocket Connection is Established_ and that the
- // WebSocket Connection is in the OPEN state.
- return ws[kReadyState] === states.OPEN
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
/**
- * @param {import('./websocket').WebSocket} ws
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
-function isClosing (ws) {
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- return ws[kReadyState] === states.CLOSING
-}
+const isArrayBuffer = kindOfTest('ArrayBuffer');
/**
- * @param {import('./websocket').WebSocket} ws
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
-function isClosed (ws) {
- return ws[kReadyState] === states.CLOSED
+function isArrayBufferView(val) {
+ let result;
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = val && val.buffer && isArrayBuffer(val.buffer);
+ }
+ return result;
}
/**
- * @see https://dom.spec.whatwg.org/#concept-event-fire
- * @param {string} e
- * @param {EventTarget} target
- * @param {EventInit | undefined} eventInitDict
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
*/
-function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
- // 1. If eventConstructor is not given, then let eventConstructor be Event.
+const isString = typeOfTest('string');
- // 2. Let event be the result of creating an event given eventConstructor,
- // in the relevant realm of target.
- // 3. Initialize event’s type attribute to e.
- const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction$1 = typeOfTest('function');
- // 4. Initialize any other IDL attributes of event as described in the
- // invocation of this algorithm.
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
- // 5. Return the result of dispatching event at target, with legacy target
- // override flag set if set.
- target.dispatchEvent(event)
-}
+/**
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
+ */
+const isObject = thing => thing !== null && typeof thing === 'object';
/**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
- * @param {import('./websocket').WebSocket} ws
- * @param {number} type Opcode
- * @param {Buffer} data application data
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
*/
-function websocketMessageReceived (ws, type, data) {
- // 1. If ready state is not OPEN (1), then return.
- if (ws[kReadyState] !== states.OPEN) {
- return
- }
+const isBoolean = thing => thing === true || thing === false;
- // 2. Let dataForEvent be determined by switching on type and binary type:
- let dataForEvent
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = val => {
+ if (!isObject(val)) {
+ return false;
+ }
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
+ // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
+ // than a plain object, while ignoring keys injected onto Object.prototype.
+ !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
+};
- if (type === opcodes.TEXT) {
- // -> type indicates that the data is Text
- // a new DOMString containing data
- try {
- dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
- } catch {
- failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
- return
- }
- } else if (type === opcodes.BINARY) {
- if (ws[kBinaryType] === 'blob') {
- // -> type indicates that the data is Binary and binary type is "blob"
- // a new Blob object, created in the relevant Realm of the WebSocket
- // object, that represents data as its raw data
- dataForEvent = new Blob([data])
- } else {
- // -> type indicates that the data is Binary and binary type is "arraybuffer"
- // a new ArrayBuffer object, created in the relevant Realm of the
- // WebSocket object, whose contents are data
- dataForEvent = new Uint8Array(data).buffer
- }
+/**
+ * Determine if a value is an empty object (safely handles Buffers)
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an empty object, otherwise false
+ */
+const isEmptyObject = val => {
+ // Early return for non-objects or Buffers to prevent RangeError
+ if (!isObject(val) || isBuffer(val)) {
+ return false;
+ }
+ try {
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
+ } catch (e) {
+ // Fallback for any other objects that might cause RangeError with Object.keys()
+ return false;
}
+};
- // 3. Fire an event named message at the WebSocket object, using MessageEvent,
- // with the origin attribute initialized to the serialization of the WebSocket
- // object’s url's origin, and the data attribute initialized to dataForEvent.
- fireEvent('message', ws, MessageEvent, {
- origin: ws[kWebSocketURL].origin,
- data: dataForEvent
- })
-}
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
/**
- * @see https://datatracker.ietf.org/doc/html/rfc6455
- * @see https://datatracker.ietf.org/doc/html/rfc2616
- * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
- * @param {string} protocol
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
*/
-function isValidSubprotocol (protocol) {
- // If present, this value indicates one
- // or more comma-separated subprotocol the client wishes to speak,
- // ordered by preference. The elements that comprise this value
- // MUST be non-empty strings with characters in the range U+0021 to
- // U+007E not including separator characters as defined in
- // [RFC2616] and MUST all be unique strings.
- if (protocol.length === 0) {
- return false
- }
+const isFile = kindOfTest('File');
- for (const char of protocol) {
- const code = char.charCodeAt(0)
+/**
+ * Determine if a value is a React Native Blob
+ * React Native "blob": an object with a `uri` attribute. Optionally, it can
+ * also have a `name` and `type` attribute to specify filename and content type
+ *
+ * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
+ *
+ * @param {*} value The value to test
+ *
+ * @returns {boolean} True if value is a React Native Blob, otherwise false
+ */
+const isReactNativeBlob = value => {
+ return !!(value && typeof value.uri !== 'undefined');
+};
- if (
- code < 0x21 ||
- code > 0x7E ||
- char === '(' ||
- char === ')' ||
- char === '<' ||
- char === '>' ||
- char === '@' ||
- char === ',' ||
- char === ';' ||
- char === ':' ||
- char === '\\' ||
- char === '"' ||
- char === '/' ||
- char === '[' ||
- char === ']' ||
- char === '?' ||
- char === '=' ||
- char === '{' ||
- char === '}' ||
- code === 32 || // SP
- code === 9 // HT
- ) {
- return false
- }
- }
+/**
+ * Determine if environment is React Native
+ * ReactNative `FormData` has a non-standard `getParts()` method
+ *
+ * @param {*} formData The formData to test
+ *
+ * @returns {boolean} True if environment is React Native, otherwise false
+ */
+const isReactNative = formData => formData && typeof formData.getParts !== 'undefined';
- return true
-}
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
/**
- * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
- * @param {number} code
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a FileList, otherwise false
*/
-function isValidStatusCode (code) {
- if (code >= 1000 && code < 1015) {
- return (
- code !== 1004 && // reserved
- code !== 1005 && // "MUST NOT be set as a status code"
- code !== 1006 // "MUST NOT be set as a status code"
- )
- }
+const isFileList = kindOfTest('FileList');
- return code >= 3000 && code <= 4999
-}
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = val => isObject(val) && isFunction$1(val.pipe);
/**
- * @param {import('./websocket').WebSocket} ws
- * @param {string|undefined} reason
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
*/
-function failWebsocketConnection (ws, reason) {
- const { [kController]: controller, [kResponse]: response } = ws
+function getGlobal() {
+ if (typeof globalThis !== 'undefined') return globalThis;
+ if (typeof self !== 'undefined') return self;
+ if (typeof window !== 'undefined') return window;
+ if (typeof global !== 'undefined') return global;
+ return {};
+}
+const G = getGlobal();
+const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
+const isFormData = thing => {
+ if (!thing) return false;
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
+ const proto = getPrototypeOf(thing);
+ if (!proto || proto === Object.prototype) return false;
+ if (!isFunction$1(thing.append)) return false;
+ const kind = kindOf(thing);
+ return kind === 'formdata' ||
+ // detect form-data instance
+ kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]';
+};
- controller.abort()
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
- if (response?.socket && !response.socket.destroyed) {
- response.socket.destroy()
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = str => {
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+};
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Object} [options]
+ * @param {Boolean} [options.allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {
+ allOwnKeys = false
+} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
}
+ let i;
+ let l;
- if (reason) {
- fireEvent('error', ws, ErrorEvent, {
- error: new Error(reason)
- })
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
}
-}
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
+ }
+ } else {
+ // Buffer check
+ if (isBuffer(obj)) {
+ return;
+ }
-module.exports = {
- isEstablished,
- isClosing,
- isClosed,
- fireEvent,
- isValidSubprotocol,
- isValidStatusCode,
- failWebsocketConnection,
- websocketMessageReceived
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
+ }
}
-
-/***/ }),
-
-/***/ 4284:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const { webidl } = __nccwpck_require__(1744)
-const { DOMException } = __nccwpck_require__(1037)
-const { URLSerializer } = __nccwpck_require__(685)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
-const {
- kWebSocketURL,
- kReadyState,
- kController,
- kBinaryType,
- kResponse,
- kSentClose,
- kByteParser
-} = __nccwpck_require__(7578)
-const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
-const { establishWebSocketConnection } = __nccwpck_require__(5354)
-const { WebsocketFrameSend } = __nccwpck_require__(5444)
-const { ByteParser } = __nccwpck_require__(1688)
-const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { types } = __nccwpck_require__(3837)
-
-let experimentalWarned = false
-
-// https://websockets.spec.whatwg.org/#interface-definition
-class WebSocket extends EventTarget {
- #events = {
- open: null,
- error: null,
- close: null,
- message: null
+/**
+ * Finds a key in an object, case-insensitive, returning the actual key name.
+ * Returns null if the object is a Buffer or if no match is found.
+ *
+ * @param {Object} obj - The object to search.
+ * @param {string} key - The key to find (case-insensitive).
+ * @returns {?string} The actual key name if found, otherwise null.
+ */
+function findKey(obj, key) {
+ if (isBuffer(obj)) {
+ return null;
}
-
- #bufferedAmount = 0
- #protocol = ''
- #extensions = ''
-
- /**
- * @param {string} url
- * @param {string|string[]} protocols
- */
- constructor (url, protocols = []) {
- super()
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
-
- if (!experimentalWarned) {
- experimentalWarned = true
- process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
- code: 'UNDICI-WS'
- })
- }
-
- const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols)
-
- url = webidl.converters.USVString(url)
- protocols = options.protocols
-
- // 1. Let baseURL be this's relevant settings object's API base URL.
- const baseURL = getGlobalOrigin()
-
- // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
- let urlRecord
-
- try {
- urlRecord = new URL(url, baseURL)
- } catch (e) {
- // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
- throw new DOMException(e, 'SyntaxError')
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
}
+ }
+ return null;
+}
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== 'undefined') return globalThis;
+ return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
+})();
+const isContextDefined = context => !isUndefined(context) && context !== _global;
- // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
- if (urlRecord.protocol === 'http:') {
- urlRecord.protocol = 'ws:'
- } else if (urlRecord.protocol === 'https:') {
- // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
- urlRecord.protocol = 'wss:'
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * const result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(...objs) {
+ const {
+ caseless,
+ skipUndefined
+ } = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ // Skip dangerous property names to prevent prototype pollution
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
+ return;
}
- // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
- if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
- throw new DOMException(
- `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
- 'SyntaxError'
- )
+ // findKey lowercases the key, so caseless lookup only applies to strings —
+ // symbol keys are identity-matched.
+ const targetKey = caseless && typeof key === 'string' && findKey(result, key) || key;
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
+ // chain, so a polluted Object.prototype value could surface here and get
+ // copied into the merged result.
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
+ if (isPlainObject(existing) && isPlainObject(val)) {
+ result[targetKey] = merge(existing, val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else if (!skipUndefined || !isUndefined(val)) {
+ result[targetKey] = val;
}
-
- // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
- // DOMException.
- if (urlRecord.hash || urlRecord.href.endsWith('#')) {
- throw new DOMException('Got fragment', 'SyntaxError')
+ };
+ for (let i = 0, l = objs.length; i < l; i++) {
+ const source = objs[i];
+ if (!source || isBuffer(source)) {
+ continue;
}
-
- // 8. If protocols is a string, set protocols to a sequence consisting
- // of just that string.
- if (typeof protocols === 'string') {
- protocols = [protocols]
+ forEach(source, assignValue);
+ if (typeof source !== 'object' || isArray(source)) {
+ continue;
}
-
- // 9. If any of the values in protocols occur more than once or otherwise
- // fail to match the requirements for elements that comprise the value
- // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
- // protocol, then throw a "SyntaxError" DOMException.
- if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
- throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ const symbols = Object.getOwnPropertySymbols(source);
+ for (let j = 0; j < symbols.length; j++) {
+ const symbol = symbols[j];
+ if (propertyIsEnumerable.call(source, symbol)) {
+ assignValue(source[symbol], symbol);
+ }
}
+ }
+ return result;
+}
- if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
- throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Object} [options]
+ * @param {Boolean} [options.allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {
+ allOwnKeys
+} = {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction$1(val)) {
+ Object.defineProperty(a, key, {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
+ // hijack defineProperty's accessor-vs-data resolution.
+ __proto__: null,
+ value: bind(val, thisArg),
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
+ } else {
+ Object.defineProperty(a, key, {
+ __proto__: null,
+ value: val,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
}
+ }, {
+ allOwnKeys
+ });
+ return a;
+};
- // 10. Set this's url to urlRecord.
- this[kWebSocketURL] = new URL(urlRecord.href)
-
- // 11. Let client be this's relevant settings object.
-
- // 12. Run this step in parallel:
-
- // 1. Establish a WebSocket connection given urlRecord, protocols,
- // and client.
- this[kController] = establishWebSocketConnection(
- urlRecord,
- protocols,
- this,
- (response) => this.#onConnectionEstablished(response),
- options
- )
-
- // Each WebSocket object has an associated ready state, which is a
- // number representing the state of the connection. Initially it must
- // be CONNECTING (0).
- this[kReadyState] = WebSocket.CONNECTING
-
- // The extensions attribute must initially return the empty string.
-
- // The protocol attribute must initially return the empty string.
-
- // Each WebSocket object has an associated binary type, which is a
- // BinaryType. Initially it must be "blob".
- this[kBinaryType] = 'blob'
+/**
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
+ */
+const stripBOM = content => {
+ if (content.charCodeAt(0) === 0xfeff) {
+ content = content.slice(1);
}
+ return content;
+};
- /**
- * @see https://websockets.spec.whatwg.org/#dom-websocket-close
- * @param {number|undefined} code
- * @param {string|undefined} reason
- */
- close (code = undefined, reason = undefined) {
- webidl.brandCheck(this, WebSocket)
-
- if (code !== undefined) {
- code = webidl.converters['unsigned short'](code, { clamp: true })
- }
-
- if (reason !== undefined) {
- reason = webidl.converters.USVString(reason)
- }
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ Object.defineProperty(constructor.prototype, 'constructor', {
+ __proto__: null,
+ value: constructor,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ Object.defineProperty(constructor, 'super', {
+ __proto__: null,
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+};
- // 1. If code is present, but is neither an integer equal to 1000 nor an
- // integer in the range 3000 to 4999, inclusive, throw an
- // "InvalidAccessError" DOMException.
- if (code !== undefined) {
- if (code !== 1000 && (code < 3000 || code > 4999)) {
- throw new DOMException('invalid code', 'InvalidAccessError')
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
}
}
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+ return destObj;
+};
- let reasonByteLength = 0
+/**
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
+ */
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
+ }
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+};
- // 2. If reason is present, then run these substeps:
- if (reason !== undefined) {
- // 1. Let reasonBytes be the result of encoding reason.
- // 2. If reasonBytes is longer than 123 bytes, then throw a
- // "SyntaxError" DOMException.
- reasonByteLength = Buffer.byteLength(reason)
+/**
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
+ */
+const toArray = thing => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
+ }
+ return arr;
+};
- if (reasonByteLength > 123) {
- throw new DOMException(
- `Reason must be less than 123 bytes; received ${reasonByteLength}`,
- 'SyntaxError'
- )
- }
- }
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
- // 3. Run the first matching steps from the following list:
- if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
- // If this's ready state is CLOSING (2) or CLOSED (3)
- // Do nothing.
- } else if (!isEstablished(this)) {
- // If the WebSocket connection is not yet established
- // Fail the WebSocket connection and set this's ready state
- // to CLOSING (2).
- failWebsocketConnection(this, 'Connection was closed before it was established.')
- this[kReadyState] = WebSocket.CLOSING
- } else if (!isClosing(this)) {
- // If the WebSocket closing handshake has not yet been started
- // Start the WebSocket closing handshake and set this's ready
- // state to CLOSING (2).
- // - If neither code nor reason is present, the WebSocket Close
- // message must not have a body.
- // - If code is present, then the status code to use in the
- // WebSocket Close message must be the integer given by code.
- // - If reason is also present, then reasonBytes must be
- // provided in the Close message after the status code.
-
- const frame = new WebsocketFrameSend()
-
- // If neither code nor reason is present, the WebSocket Close
- // message must not have a body.
-
- // If code is present, then the status code to use in the
- // WebSocket Close message must be the integer given by code.
- if (code !== undefined && reason === undefined) {
- frame.frameData = Buffer.allocUnsafe(2)
- frame.frameData.writeUInt16BE(code, 0)
- } else if (code !== undefined && reason !== undefined) {
- // If reason is also present, then reasonBytes must be
- // provided in the Close message after the status code.
- frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
- frame.frameData.writeUInt16BE(code, 0)
- // the body MAY contain UTF-8-encoded data with value /reason/
- frame.frameData.write(reason, 2, 'utf-8')
- } else {
- frame.frameData = emptyBuffer
- }
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[iterator];
+ const _iterator = generator.call(obj);
+ let result;
+ while ((result = _iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
+ }
+};
- /** @type {import('stream').Duplex} */
- const socket = this[kResponse].socket
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
+ }
+ return arr;
+};
- socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
- if (!err) {
- this[kSentClose] = true
- }
- })
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ });
+};
+const {
+ propertyIsEnumerable
+} = Object.prototype;
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- this[kReadyState] = states.CLOSING
- } else {
- // Otherwise
- // Set this's ready state to CLOSING (2).
- this[kReadyState] = WebSocket.CLOSING
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
}
- }
+ });
+ Object.defineProperties(obj, reducedDescriptors);
+};
- /**
- * @see https://websockets.spec.whatwg.org/#dom-websocket-send
- * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
- */
- send (data) {
- webidl.brandCheck(this, WebSocket)
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
- webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
+const freezeMethods = obj => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
+ return false;
+ }
+ const value = obj[name];
+ if (!isFunction$1(value)) return;
+ descriptor.enumerable = false;
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error("Can not rewrite read-only method '" + name + "'");
+ };
+ }
+ });
+};
- data = webidl.converters.WebSocketSendData(data)
+/**
+ * Converts an array or a delimited string into an object set with values as keys and true as values.
+ * Useful for fast membership checks.
+ *
+ * @param {Array|string} arrayOrString - The array or string to convert.
+ * @param {string} delimiter - The delimiter to use if input is a string.
+ * @returns {Object} An object with keys from the array or string, values set to true.
+ */
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+ const define = arr => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ };
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+ return obj;
+};
+const noop = () => {};
+const toFiniteNumber = (value, defaultValue) => {
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
+};
- // 1. If this's ready state is CONNECTING, then throw an
- // "InvalidStateError" DOMException.
- if (this[kReadyState] === WebSocket.CONNECTING) {
- throw new DOMException('Sent before connected.', 'InvalidStateError')
- }
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
+}
- // 2. Run the appropriate set of steps from the following list:
- // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
- // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
+/**
+ * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
+ *
+ * @param {Object} obj - The object to convert.
+ * @returns {Object} The JSON-compatible object.
+ */
+const toJSONObject = obj => {
+ const visited = new WeakSet();
+ const visit = source => {
+ if (isObject(source)) {
+ if (visited.has(source)) {
+ return;
+ }
- if (!isEstablished(this) || isClosing(this)) {
- return
+ //Buffer check
+ if (isBuffer(source)) {
+ return source;
+ }
+ if (!('toJSON' in source)) {
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
+ visited.add(source);
+ const target = isArray(source) ? [] : {};
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+ visited.delete(source);
+ return target;
+ }
}
+ return source;
+ };
+ return visit(obj);
+};
- /** @type {import('stream').Duplex} */
- const socket = this[kResponse].socket
-
- // If data is a string
- if (typeof data === 'string') {
- // If the WebSocket connection is established and the WebSocket
- // closing handshake has not yet started, then the user agent
- // must send a WebSocket Message comprised of the data argument
- // using a text frame opcode; if the data cannot be sent, e.g.
- // because it would need to be buffered but the buffer is full,
- // the user agent must flag the WebSocket as full and then close
- // the WebSocket connection. Any invocation of this method with a
- // string argument that does not throw an exception must increase
- // the bufferedAmount attribute by the number of bytes needed to
- // express the argument as UTF-8.
+/**
+ * Determines if a value is an async function.
+ *
+ * @param {*} thing - The value to test.
+ * @returns {boolean} True if value is an async function, otherwise false.
+ */
+const isAsyncFn = kindOfTest('AsyncFunction');
- const value = Buffer.from(data)
- const frame = new WebsocketFrameSend(value)
- const buffer = frame.createFrame(opcodes.TEXT)
+/**
+ * Determines if a value is thenable (has then and catch methods).
+ *
+ * @param {*} thing - The value to test.
+ * @returns {boolean} True if value is thenable, otherwise false.
+ */
+const isThenable = thing => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- } else if (types.isArrayBuffer(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need
- // to be buffered but the buffer is full, the user agent must flag
- // the WebSocket as full and then close the WebSocket connection.
- // The data to be sent is the data stored in the buffer described
- // by the ArrayBuffer object. Any invocation of this method with an
- // ArrayBuffer argument that does not throw an exception must
- // increase the bufferedAmount attribute by the length of the
- // ArrayBuffer in bytes.
+// original code
+// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
- const value = Buffer.from(data)
- const frame = new WebsocketFrameSend(value)
- const buffer = frame.createFrame(opcodes.BINARY)
+/**
+ * Provides a cross-platform setImmediate implementation.
+ * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
+ *
+ * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
+ * @param {boolean} postMessageSupported - Whether postMessage is supported.
+ * @returns {Function} A function to schedule a callback asynchronously.
+ */
+const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
+ if (setImmediateSupported) {
+ return setImmediate;
+ }
+ return postMessageSupported ? ((token, callbacks) => {
+ _global.addEventListener('message', ({
+ source,
+ data
+ }) => {
+ if (source === _global && data === token) {
+ callbacks.length && callbacks.shift()();
+ }
+ }, false);
+ return cb => {
+ callbacks.push(cb);
+ _global.postMessage(token, '*');
+ };
+ })(`axios@${Math.random()}`, []) : cb => setTimeout(cb);
+})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- } else if (ArrayBuffer.isView(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need to
- // be buffered but the buffer is full, the user agent must flag the
- // WebSocket as full and then close the WebSocket connection. The
- // data to be sent is the data stored in the section of the buffer
- // described by the ArrayBuffer object that data references. Any
- // invocation of this method with this kind of argument that does
- // not throw an exception must increase the bufferedAmount attribute
- // by the length of data’s buffer in bytes.
+/**
+ * Schedules a microtask or asynchronous callback as soon as possible.
+ * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
+ *
+ * @type {Function}
+ */
+const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
- const ab = Buffer.from(data, data.byteOffset, data.byteLength)
+// *********************
- const frame = new WebsocketFrameSend(ab)
- const buffer = frame.createFrame(opcodes.BINARY)
+const isIterable = thing => thing != null && isFunction$1(thing[iterator]);
- this.#bufferedAmount += ab.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= ab.byteLength
- })
- } else if (isBlobLike(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need to
- // be buffered but the buffer is full, the user agent must flag the
- // WebSocket as full and then close the WebSocket connection. The data
- // to be sent is the raw data represented by the Blob object. Any
- // invocation of this method with a Blob argument that does not throw
- // an exception must increase the bufferedAmount attribute by the size
- // of the Blob object’s raw data, in bytes.
+/**
+ * Determine if a value is iterable via an iterator that is NOT sourced solely
+ * from a polluted Object.prototype. Use this instead of `isIterable` whenever
+ * the iterable comes from untrusted input (e.g. user-supplied header sources),
+ * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
+ * into an attacker-controlled entries iterator.
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value has a non-polluted iterator
+ */
+const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
+var utils$1 = {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isEmptyObject,
+ isReadableStream,
+ isRequest,
+ isResponse,
+ isHeaders,
+ isUndefined,
+ isDate,
+ isFile,
+ isReactNativeBlob,
+ isReactNative,
+ isBlob,
+ isRegExp,
+ isFunction: isFunction$1,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty,
+ // an alias to avoid ESLint no-prototype-builtins detection
+ hasOwnInPrototypeChain,
+ getSafeProp,
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable,
+ setImmediate: _setImmediate,
+ asap,
+ isIterable,
+ isSafeIterable
+};
- const frame = new WebsocketFrameSend()
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
- data.arrayBuffer().then((ab) => {
- const value = Buffer.from(ab)
- frame.frameData = value
- const buffer = frame.createFrame(opcodes.BINARY)
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+var parseHeaders = rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+ return parsed;
+};
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- })
+function trimSPorHTAB(str) {
+ let start = 0;
+ let end = str.length;
+ while (start < end) {
+ const code = str.charCodeAt(start);
+ if (code !== 0x09 && code !== 0x20) {
+ break;
}
+ start += 1;
}
-
- get readyState () {
- webidl.brandCheck(this, WebSocket)
-
- // The readyState getter steps are to return this's ready state.
- return this[kReadyState]
+ while (end > start) {
+ const code = str.charCodeAt(end - 1);
+ if (code !== 0x09 && code !== 0x20) {
+ break;
+ }
+ end -= 1;
}
+ return start === 0 && end === str.length ? str : str.slice(start, end);
+}
- get bufferedAmount () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#bufferedAmount
+// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
+// eslint-disable-next-line no-control-regex
+const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
+// eslint-disable-next-line no-control-regex
+const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
+function sanitizeValue(value, invalidChars) {
+ if (utils$1.isArray(value)) {
+ return value.map(item => sanitizeValue(item, invalidChars));
}
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
+}
+const sanitizeHeaderValue = value => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
+const sanitizeByteStringHeaderValue = value => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
+function toByteStringHeaderObject(headers) {
+ const byteStringHeaders = Object.create(null);
+ utils$1.forEach(headers.toJSON(), (value, header) => {
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
+ });
+ return byteStringHeaders;
+}
- get url () {
- webidl.brandCheck(this, WebSocket)
-
- // The url getter steps are to return this's url, serialized.
- return URLSerializer(this[kWebSocketURL])
+const $internals = Symbol('internals');
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
}
-
- get extensions () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#extensions
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
+}
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+ while (match = tokensRE.exec(str)) {
+ tokens[match[1]] = match[2];
}
-
- get protocol () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#protocol
+ return tokens;
+}
+const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
}
-
- get onopen () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#events.open
+ if (isHeaderNameFilter) {
+ value = header;
}
-
- set onopen (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.open) {
- this.removeEventListener('open', this.#events.open)
+ if (!utils$1.isString(value)) return;
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+function formatHeader(header) {
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+function buildAccessors(obj, header) {
+ const accessorName = utils$1.toCamelCase(' ' + header);
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: function (arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+class AxiosHeaders {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+ if (!lHeader) {
+ return;
+ }
+ const key = utils$1.findKey(self, lHeader);
+ if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
+ self[key || _header] = normalizeValue(_value);
+ }
}
-
- if (typeof fn === 'function') {
- this.#events.open = fn
- this.addEventListener('open', fn)
+ const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
+ let obj = Object.create(null),
+ dest,
+ key;
+ for (const entry of header) {
+ if (!utils$1.isArray(entry)) {
+ throw new TypeError('Object iterator must return a key-value pair');
+ }
+ key = entry[0];
+ if (utils$1.hasOwnProp(obj, key)) {
+ dest = obj[key];
+ obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
+ } else {
+ obj[key] = entry[1];
+ }
+ }
+ setHeaders(obj, valueOrRewrite);
} else {
- this.#events.open = null
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+ return this;
+ }
+ get(header, parser) {
+ header = normalizeHeader(header);
+ if (header) {
+ const key = utils$1.findKey(this, header);
+ if (key) {
+ const value = this[key];
+ if (!parser) {
+ return value;
+ }
+ if (parser === true) {
+ return parseTokens(value);
+ }
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
}
}
-
- get onerror () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#events.error
+ has(header, matcher) {
+ header = normalizeHeader(header);
+ if (header) {
+ const key = utils$1.findKey(this, header);
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+ return false;
}
-
- set onerror (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.error) {
- this.removeEventListener('error', this.#events.error)
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+ if (_header) {
+ const key = utils$1.findKey(self, _header);
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+ deleted = true;
+ }
+ }
}
-
- if (typeof fn === 'function') {
- this.#events.error = fn
- this.addEventListener('error', fn)
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
} else {
- this.#events.error = null
+ deleteHeader(header);
+ }
+ return deleted;
+ }
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+ while (i--) {
+ const key = keys[i];
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+ return deleted;
+ }
+ normalize(format) {
+ const self = this;
+ const headers = {};
+ utils$1.forEach(this, (value, header) => {
+ const key = utils$1.findKey(headers, header);
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+ const normalized = format ? formatHeader(header) : String(header).trim();
+ if (normalized !== header) {
+ delete self[header];
+ }
+ self[normalized] = normalizeValue(value);
+ headers[normalized] = true;
+ });
+ return this;
+ }
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
+ }
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+ utils$1.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+ return obj;
+ }
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
+ }
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
+ }
+ getSetCookie() {
+ return this.get('set-cookie') || [];
+ }
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
+ }
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
+ }
+ static concat(first, ...targets) {
+ const computed = new this(first);
+ targets.forEach(target => computed.set(target));
+ return computed;
+ }
+ static accessor(header) {
+ const internals = this[$internals] = this[$internals] = {
+ accessors: {}
+ };
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
}
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+ return this;
}
+}
+AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
- get onclose () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#events.close
- }
-
- set onclose (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.close) {
- this.removeEventListener('close', this.#events.close)
- }
-
- if (typeof fn === 'function') {
- this.#events.close = fn
- this.addEventListener('close', fn)
- } else {
- this.#events.close = null
+// reserved names hotfix
+utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
+ value
+}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
}
- }
-
- get onmessage () {
- webidl.brandCheck(this, WebSocket)
+ };
+});
+utils$1.freezeMethods(AxiosHeaders);
- return this.#events.message
+const REDACTED = '[REDACTED ****]';
+function hasOwnOrPrototypeToJSON(source) {
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
+ return true;
}
-
- set onmessage (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.message) {
- this.removeEventListener('message', this.#events.message)
+ let prototype = Object.getPrototypeOf(source);
+ while (prototype && prototype !== Object.prototype) {
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
+ return true;
}
-
- if (typeof fn === 'function') {
- this.#events.message = fn
- this.addEventListener('message', fn)
+ prototype = Object.getPrototypeOf(prototype);
+ }
+ return false;
+}
+
+// Build a plain-object snapshot of `config` and replace the value of any key
+// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
+// and AxiosHeaders, and short-circuits on circular references.
+function redactConfig(config, redactKeys) {
+ const lowerKeys = new Set(redactKeys.map(k => String(k).toLowerCase()));
+ const seen = [];
+ const visit = source => {
+ if (source === null || typeof source !== 'object') return source;
+ if (utils$1.isBuffer(source)) return source;
+ if (seen.indexOf(source) !== -1) return undefined;
+ if (source instanceof AxiosHeaders) {
+ source = source.toJSON();
+ }
+ seen.push(source);
+ let result;
+ if (utils$1.isArray(source)) {
+ result = [];
+ source.forEach((v, i) => {
+ const reducedValue = visit(v);
+ if (!utils$1.isUndefined(reducedValue)) {
+ result[i] = reducedValue;
+ }
+ });
} else {
- this.#events.message = null
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
+ seen.pop();
+ return source;
+ }
+ result = Object.create(null);
+ for (const [key, value] of Object.entries(source)) {
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
+ if (!utils$1.isUndefined(reducedValue)) {
+ result[key] = reducedValue;
+ }
+ }
}
- }
-
- get binaryType () {
- webidl.brandCheck(this, WebSocket)
-
- return this[kBinaryType]
- }
-
- set binaryType (type) {
- webidl.brandCheck(this, WebSocket)
+ seen.pop();
+ return result;
+ };
+ return visit(config);
+}
+class AxiosError extends Error {
+ static from(error, code, config, request, response, customProps) {
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
+ // Match native `Error` `cause` semantics: non-enumerable. The wrapped
+ // error often carries circular internals (sockets, requests, agents), so
+ // an enumerable `cause` makes structured loggers (pino/winston) and any
+ // own-property walk throw "Converting circular structure to JSON".
+ // Regression from #6982; see #7205. `__proto__: null` mirrors the
+ // `message` descriptor below (prototype-pollution-safe descriptor).
+ Object.defineProperty(axiosError, 'cause', {
+ __proto__: null,
+ value: error,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ axiosError.name = error.name;
- if (type !== 'blob' && type !== 'arraybuffer') {
- this[kBinaryType] = 'blob'
- } else {
- this[kBinaryType] = type
+ // Preserve status from the original error if not already set from response
+ if (error.status != null && axiosError.status == null) {
+ axiosError.status = error.status;
}
+ customProps && Object.assign(axiosError, customProps);
+ return axiosError;
}
/**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
*/
- #onConnectionEstablished (response) {
- // processResponse is called when the "response’s header list has been received and initialized."
- // once this happens, the connection is open
- this[kResponse] = response
-
- const parser = new ByteParser(this)
- parser.on('drain', function onParserDrain () {
- this.ws[kResponse].socket.resume()
- })
+ constructor(message, code, config, request, response) {
+ super(message);
- response.socket.ws = this
- this[kByteParser] = parser
+ // Make message enumerable to maintain backward compatibility
+ // The native Error constructor sets message as non-enumerable,
+ // but axios < v1.13.3 had it as enumerable
+ Object.defineProperty(this, 'message', {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: message,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ this.name = 'AxiosError';
+ this.isAxiosError = true;
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ if (response) {
+ this.response = response;
+ this.status = response.status;
+ }
+ }
+ toJSON() {
+ // Opt-in redaction: when the request config carries a `redact` array, the
+ // value of any matching key (case-insensitive, at any depth) is replaced
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
+ // existing serialization behavior unchanged.
+ const config = this.config;
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
+ const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: serializedConfig,
+ code: this.code,
+ status: this.status
+ };
+ }
+}
- // 1. Change the ready state to OPEN (1).
- this[kReadyState] = states.OPEN
+// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
+AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
+AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
+AxiosError.ECONNABORTED = 'ECONNABORTED';
+AxiosError.ETIMEDOUT = 'ETIMEDOUT';
+AxiosError.ECONNREFUSED = 'ECONNREFUSED';
+AxiosError.ERR_NETWORK = 'ERR_NETWORK';
+AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
+AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
+AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
+AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
+AxiosError.ERR_CANCELED = 'ERR_CANCELED';
+AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
+AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
+AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
- // 2. Change the extensions attribute’s value to the extensions in use, if
- // it is not the null value.
- // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
- const extensions = response.headersList.get('sec-websocket-extensions')
+// Default nesting limit shared with the inverse transform (formDataToJSON) so
+// the FormData <-> JSON round-trip stays symmetric.
+const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
- if (extensions !== null) {
- this.#extensions = extensions
- }
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+}
- // 3. Change the protocol attribute’s value to the subprotocol in use, if
- // it is not the null value.
- // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
- const protocol = response.headersList.get('sec-websocket-protocol')
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
- if (protocol !== null) {
- this.#protocol = protocol
- }
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
- // 4. Fire an event named open at the WebSocket object.
- fireEvent('open', this)
- }
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
}
+const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
-// https://websockets.spec.whatwg.org/#dom-websocket-connecting
-WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
-// https://websockets.spec.whatwg.org/#dom-websocket-open
-WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
-// https://websockets.spec.whatwg.org/#dom-websocket-closing
-WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
-// https://websockets.spec.whatwg.org/#dom-websocket-closed
-WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
-Object.defineProperties(WebSocket.prototype, {
- CONNECTING: staticPropertyDescriptors,
- OPEN: staticPropertyDescriptors,
- CLOSING: staticPropertyDescriptors,
- CLOSED: staticPropertyDescriptors,
- url: kEnumerableProperty,
- readyState: kEnumerableProperty,
- bufferedAmount: kEnumerableProperty,
- onopen: kEnumerableProperty,
- onerror: kEnumerableProperty,
- onclose: kEnumerableProperty,
- close: kEnumerableProperty,
- onmessage: kEnumerableProperty,
- binaryType: kEnumerableProperty,
- send: kEnumerableProperty,
- extensions: kEnumerableProperty,
- protocol: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'WebSocket',
- writable: false,
- enumerable: false,
- configurable: true
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object} options
+ *
+ * @returns
+ */
+function toFormData(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
}
-})
-
-Object.defineProperties(WebSocket, {
- CONNECTING: staticPropertyDescriptors,
- OPEN: staticPropertyDescriptors,
- CLOSING: staticPropertyDescriptors,
- CLOSED: staticPropertyDescriptors
-})
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.DOMString
-)
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData$1 || FormData)();
-webidl.converters['DOMString or sequence'] = function (V) {
- if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
- return webidl.converters['sequence'](V)
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+ const stack = [];
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
}
-
- return webidl.converters.DOMString(V)
-}
-
-// This implements the propsal made in https://github.com/whatwg/websockets/issues/42
-webidl.converters.WebSocketInit = webidl.dictionaryConverter([
- {
- key: 'protocols',
- converter: webidl.converters['DOMString or sequence'],
- get defaultValue () {
- return []
+ function convertValue(value) {
+ if (value === null) return '';
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
}
- },
- {
- key: 'dispatcher',
- converter: (V) => V,
- get defaultValue () {
- return getGlobalDispatcher()
+ if (utils$1.isBoolean(value)) {
+ return value.toString();
}
- },
- {
- key: 'headers',
- converter: webidl.nullableConverter(webidl.converters.HeadersInit)
- }
-])
-
-webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {
- if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
- return webidl.converters.WebSocketInit(V)
- }
-
- return { protocols: webidl.converters['DOMString or sequence'](V) }
-}
-
-webidl.converters.WebSocketSendData = function (V) {
- if (webidl.util.Type(V) === 'Object') {
- if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
}
-
- if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
- return webidl.converters.BufferSource(V)
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ if (useBlob && typeof _Blob === 'function') {
+ return new _Blob([value]);
+ }
+ if (typeof Buffer !== 'undefined') {
+ return Buffer.from(value);
+ }
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
}
+ return value;
}
-
- return webidl.converters.USVString(V)
-}
-
-module.exports = {
- WebSocket
-}
-
-
-/***/ }),
-
-/***/ 5030:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-function getUserAgent() {
- if (typeof navigator === "object" && "userAgent" in navigator) {
- return navigator.userAgent;
+ function throwIfMaxDepthExceeded(depth) {
+ if (depth > maxDepth) {
+ throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
+ }
}
-
- if (typeof process === "object" && process.version !== undefined) {
- return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
+ function stringifyWithDepthLimit(value, depth) {
+ if (maxDepth === Infinity) {
+ return JSON.stringify(value);
+ }
+ const ancestors = [];
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
+ if (!utils$1.isObject(currentValue)) {
+ return currentValue;
+ }
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
+ ancestors.pop();
+ }
+ ancestors.push(currentValue);
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
+ return currentValue;
+ });
}
- return "";
-}
-
-exports.getUserAgent = getUserAgent;
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ 2940:
-/***/ ((module) => {
-
-// Returns a wrapper function that returns a wrapped callback
-// The wrapper function should do some stuff, and return a
-// presumably different callback function.
-// This makes sure that own properties are retained, so that
-// decorations and such are not lost along the way.
-module.exports = wrappy
-function wrappy (fn, cb) {
- if (fn && cb) return wrappy(fn)(cb)
-
- if (typeof fn !== 'function')
- throw new TypeError('need wrapper function')
-
- Object.keys(fn).forEach(function (k) {
- wrapper[k] = fn[k]
- })
-
- return wrapper
-
- function wrapper() {
- var args = new Array(arguments.length)
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i]
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
+ formData.append(renderKey(path, key, dots), convertValue(value));
+ return false;
}
- var ret = fn.apply(this, args)
- var cb = args[args.length-1]
- if (typeof ret === 'function' && ret !== cb) {
- Object.keys(cb).forEach(function (k) {
- ret[k] = cb[k]
- })
+ if (value && !path && typeof value === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = stringifyWithDepthLimit(value, 1);
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
+ });
+ return false;
+ }
}
- return ret
+ if (isVisitable(value)) {
+ return true;
+ }
+ formData.append(renderKey(path, key, dots), convertValue(value));
+ return false;
}
-}
-
-
-/***/ }),
-
-/***/ 9491:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("assert");
-
-/***/ }),
-
-/***/ 852:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("async_hooks");
-
-/***/ }),
-
-/***/ 4300:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("buffer");
-
-/***/ }),
-
-/***/ 6206:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("console");
-
-/***/ }),
-
-/***/ 6113:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("crypto");
-
-/***/ }),
-
-/***/ 7643:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("diagnostics_channel");
-
-/***/ }),
-
-/***/ 2361:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("events");
-
-/***/ }),
-
-/***/ 7147:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("fs");
-
-/***/ }),
-
-/***/ 3685:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("http");
-
-/***/ }),
-
-/***/ 5158:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("http2");
-
-/***/ }),
-
-/***/ 5687:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("https");
-
-/***/ }),
-
-/***/ 1808:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("net");
-
-/***/ }),
-
-/***/ 5673:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("node:events");
-
-/***/ }),
-
-/***/ 4492:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("node:stream");
-
-/***/ }),
-
-/***/ 7261:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("node:util");
-
-/***/ }),
-
-/***/ 2037:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("os");
-
-/***/ }),
-
-/***/ 1017:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("path");
-
-/***/ }),
-
-/***/ 4074:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("perf_hooks");
-
-/***/ }),
-
-/***/ 3477:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("querystring");
-
-/***/ }),
-
-/***/ 2781:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("stream");
-
-/***/ }),
-
-/***/ 5356:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("stream/web");
-
-/***/ }),
-
-/***/ 1576:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("string_decoder");
-
-/***/ }),
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+ function build(value, path, depth = 0) {
+ if (utils$1.isUndefined(value)) return;
+ throwIfMaxDepthExceeded(depth);
+ if (stack.indexOf(value) !== -1) {
+ throw new Error('Circular reference detected in ' + path.join('.'));
+ }
+ stack.push(value);
+ utils$1.forEach(value, function each(el, key) {
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key], depth + 1);
+ }
+ });
+ stack.pop();
+ }
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
+ }
+ build(obj);
+ return formData;
+}
-/***/ 4404:
-/***/ ((module) => {
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode$1(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
+ return charMap[match];
+ });
+}
-"use strict";
-module.exports = require("tls");
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object} params - The parameters to be converted to a FormData object.
+ * @param {Object} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+ params && toFormData(params, this, options);
+}
+const prototype = AxiosURLSearchParams.prototype;
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? value => encoder.call(this, value, encode$1) : encode$1;
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
-/***/ }),
+/**
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
+ * their plain counterparts (`:`, `$`, `,`, `+`).
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+');
+}
-/***/ 6224:
-/***/ ((module) => {
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?(object|Function)} options
+ *
+ * @returns {string} The formatted url
+ */
+function buildURL(url, params, options) {
+ if (!params) {
+ return url;
+ }
+ url = url || '';
+ const _options = utils$1.isFunction(options) ? {
+ serialize: options
+ } : options;
-"use strict";
-module.exports = require("tty");
+ // Read serializer options pollution-safely: own properties and methods on a
+ // class/template prototype are honored, but values injected onto a polluted
+ // Object.prototype are ignored.
+ const _encode = utils$1.getSafeProp(_options, 'encode') || encode;
+ const serializeFn = utils$1.getSafeProp(_options, 'serialize');
+ let serializedParams;
+ if (serializeFn) {
+ serializedParams = serializeFn(params, _options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
+ }
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+ return url;
+}
-/***/ }),
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
+ }
-/***/ 7310:
-/***/ ((module) => {
+ /**
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
+ *
+ * @return {Number} An ID used to remove interceptor later
+ */
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
+ }
-"use strict";
-module.exports = require("url");
+ /**
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {void}
+ */
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
-/***/ }),
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
-/***/ 3837:
-/***/ ((module) => {
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
-"use strict";
-module.exports = require("util");
+var transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false,
+ legacyInterceptorReqResOrdering: true,
+ advertiseZstdAcceptEncoding: false,
+ validateStatusUndefinedResolves: true
+};
-/***/ }),
+var URLSearchParams = url.URLSearchParams;
-/***/ 9830:
-/***/ ((module) => {
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+const DIGIT = '0123456789';
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+};
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {
+ length
+ } = alphabet;
+ const randomValues = new Uint32Array(size);
+ crypto.randomFillSync(randomValues);
+ for (let i = 0; i < size; i++) {
+ str += alphabet[randomValues[i] % length];
+ }
+ return str;
+};
+var platform$1 = {
+ isNode: true,
+ classes: {
+ URLSearchParams,
+ FormData: FormData$1,
+ Blob: typeof Blob !== 'undefined' && Blob || null
+ },
+ ALPHABET,
+ generateString,
+ protocols: ['http', 'https', 'file', 'data']
+};
-"use strict";
-module.exports = require("util/types");
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+const _navigator = typeof navigator === 'object' && navigator || undefined;
-/***/ }),
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
-/***/ 1267:
-/***/ ((module) => {
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
+})();
+const origin = hasBrowserEnv && window.location.href || 'http://localhost';
-"use strict";
-module.exports = require("worker_threads");
+var utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ navigator: _navigator,
+ origin: origin
+});
-/***/ }),
+var platform = {
+ ...utils,
+ ...platform$1
+};
-/***/ 9796:
-/***/ ((module) => {
+function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), {
+ visitor: function (value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+ return helpers.defaultVisitor.apply(this, arguments);
+ },
+ ...options
+ });
+}
-"use strict";
-module.exports = require("zlib");
+const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
+function throwIfDepthExceeded(index) {
+ if (index > MAX_DEPTH) {
+ throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
+ }
+}
-/***/ }),
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ const path = [];
+ const pattern = /\w+|\[(\w*)]/g;
+ let match;
+ while ((match = pattern.exec(name)) !== null) {
+ throwIfDepthExceeded(path.length);
+ path.push(match[0] === '[]' ? '' : match[1] || match[0]);
+ }
+ return path;
+}
-/***/ 2960:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
-"use strict";
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ throwIfDepthExceeded(index);
+ let name = path[index++];
+ if (name === '__proto__') return true;
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
+ } else {
+ target[name] = value;
+ }
+ return !isNumericKey;
+ }
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
+ target[name] = [];
+ }
+ const result = buildPath(path, value, target[name], index);
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
+ }
+ return !isNumericKey;
+ }
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ const obj = {};
+ utils$1.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+ return obj;
+ }
+ return null;
+}
+const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined;
-const WritableStream = (__nccwpck_require__(4492).Writable)
-const inherits = (__nccwpck_require__(7261).inherits)
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
+ }
+ }
+ }
+ return (encoder || JSON.stringify)(rawValue);
+}
+const defaults = {
+ transitional: transitionalDefaults,
+ adapter: ['xhr', 'http', 'fetch'],
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils$1.isObject(data);
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
+ }
+ const isFormData = utils$1.isFormData(data);
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+ if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+ let isFileList;
+ if (isObjectPayload) {
+ const formSerializer = own(this, 'formSerializer');
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, formSerializer).toString();
+ }
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const env = own(this, 'env');
+ const _FormData = env && env.FormData;
+ return toFormData(isFileList ? {
+ 'files[]': data
+ } : data, _FormData && new _FormData(), formSerializer);
+ }
+ }
+ if (isObjectPayload || hasJSONContentType) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
+ }
+ return data;
+ }],
+ transformResponse: [function transformResponse(data) {
+ const transitional = own(this, 'transitional') || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const responseType = own(this, 'responseType');
+ const JSONRequested = responseType === 'json';
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
+ return data;
+ }
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+ try {
+ return JSON.parse(data, own(this, 'parseReviver'));
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
+ }
+ throw e;
+ }
+ }
+ }
+ return data;
+ }],
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+ maxContentLength: -1,
+ maxBodyLength: -1,
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+ headers: {
+ common: {
+ Accept: 'application/json, text/plain, */*',
+ 'Content-Type': undefined
+ }
+ }
+};
+utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], method => {
+ defaults.headers[method] = {};
+});
-const StreamSearch = __nccwpck_require__(1142)
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+function transformData(fns, response) {
+ const config = this || defaults;
+ const context = response || config;
+ const headers = AxiosHeaders.from(context.headers);
+ let data = context.data;
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+ headers.normalize();
+ return data;
+}
-const PartStream = __nccwpck_require__(1620)
-const HeaderParser = __nccwpck_require__(2032)
+function isCancel(value) {
+ return !!(value && value.__CANCEL__);
+}
-const DASH = 45
-const B_ONEDASH = Buffer.from('-')
-const B_CRLF = Buffer.from('\r\n')
-const EMPTY_FN = function () {}
+class CanceledError extends AxiosError {
+ /**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+ constructor(message, config, request) {
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+ this.__CANCEL__ = true;
+ }
+}
-function Dicer (cfg) {
- if (!(this instanceof Dicer)) { return new Dicer(cfg) }
- WritableStream.call(this, cfg)
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError('Request failed with status code ' + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response));
+ }
+}
- if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ if (typeof url !== 'string') {
+ return false;
+ }
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
- if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+function combineURLs(baseURL, relativeURL) {
+ return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
+}
- this._headerFirst = cfg.headerFirst
+const malformedHttpProtocol = /^https?:(?!\/\/)/i;
+const httpProtocolControlCharacters = /[\t\n\r]/g;
+function stripLeadingC0ControlOrSpace(url) {
+ let i = 0;
+ while (i < url.length && url.charCodeAt(i) <= 0x20) {
+ i++;
+ }
+ return url.slice(i);
+}
+function normalizeURLForProtocolCheck(url) {
+ return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
+}
+function assertValidHttpProtocolURL(url, config) {
+ if (typeof url === 'string' && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
+ throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config);
+ }
+}
- this._dashes = 0
- this._parts = 0
- this._finished = false
- this._realFinish = false
- this._isPreamble = true
- this._justMatched = false
- this._firstWrite = true
- this._inHeader = true
- this._part = undefined
- this._cb = undefined
- this._ignoreData = false
- this._partOpts = { highWaterMark: cfg.partHwm }
- this._pause = false
+/**
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
+ */
+function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
+ assertValidHttpProtocolURL(requestedURL, config);
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
+ assertValidHttpProtocolURL(baseURL, config);
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
- const self = this
- this._hparser = new HeaderParser(cfg)
- this._hparser.on('header', function (header) {
- self._inHeader = false
- self._part.emit('header', header)
- })
+var DEFAULT_PORTS$1 = {
+ ftp: 21,
+ gopher: 70,
+ http: 80,
+ https: 443,
+ ws: 80,
+ wss: 443
+};
+function parseUrl(urlString) {
+ try {
+ return new URL(urlString);
+ } catch {
+ return null;
+ }
}
-inherits(Dicer, WritableStream)
-
-Dicer.prototype.emit = function (ev) {
- if (ev === 'finish' && !this._realFinish) {
- if (!this._finished) {
- const self = this
- process.nextTick(function () {
- self.emit('error', new Error('Unexpected end of multipart data'))
- if (self._part && !self._ignoreData) {
- const type = (self._isPreamble ? 'Preamble' : 'Part')
- self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
- self._part.push(null)
- process.nextTick(function () {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- })
- return
- }
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- })
- }
- } else { WritableStream.prototype.emit.apply(this, arguments) }
+
+/**
+ * @param {string|object|URL} url - The URL as a string or URL instance, or a
+ * compatible object (such as the result from legacy url.parse).
+ * @return {string} The URL of the proxy that should handle the request to the
+ * given URL. If no proxy is set, this will be an empty string.
+ */
+function getProxyForUrl(url) {
+ var parsedUrl = (typeof url === 'string' ? parseUrl(url) : url) || {};
+ var proto = parsedUrl.protocol;
+ var hostname = parsedUrl.host;
+ var port = parsedUrl.port;
+ if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
+ return ''; // Don't proxy URLs without a valid scheme or host.
+ }
+ proto = proto.split(':', 1)[0];
+ // Stripping ports in this way instead of using parsedUrl.hostname to make
+ // sure that the brackets around IPv6 addresses are kept.
+ hostname = hostname.replace(/:\d*$/, '');
+ port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
+ if (!shouldProxy(hostname, port)) {
+ return ''; // Don't proxy URLs that match NO_PROXY.
+ }
+ var proxy = getEnv(proto + '_proxy') || getEnv('all_proxy');
+ if (proxy && proxy.indexOf('://') === -1) {
+ // Missing scheme in proxy, default to the requested URL's scheme.
+ proxy = proto + '://' + proxy;
+ }
+ return proxy;
}
-Dicer.prototype._write = function (data, encoding, cb) {
- // ignore unexpected data (e.g. extra trailer data after finished)
- if (!this._hparser && !this._bparser) { return cb() }
-
- if (this._headerFirst && this._isPreamble) {
- if (!this._part) {
- this._part = new PartStream(this._partOpts)
- if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
- }
- const r = this._hparser.push(data)
- if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
+/**
+ * Determines whether a given URL should be proxied.
+ *
+ * @param {string} hostname - The host name of the URL.
+ * @param {number} port - The effective port of the URL.
+ * @returns {boolean} Whether the given URL should be proxied.
+ * @private
+ */
+function shouldProxy(hostname, port) {
+ var NO_PROXY = getEnv('no_proxy').toLowerCase();
+ if (!NO_PROXY) {
+ return true; // Always proxy if NO_PROXY is not set.
}
-
- // allows for "easier" testing
- if (this._firstWrite) {
- this._bparser.push(B_CRLF)
- this._firstWrite = false
+ if (NO_PROXY === '*') {
+ return false; // Never proxy if wildcard is set.
}
-
- this._bparser.push(data)
-
- if (this._pause) { this._cb = cb } else { cb() }
+ return NO_PROXY.split(/[,\s]/).every(function (proxy) {
+ if (!proxy) {
+ return true; // Skip zero-length hosts.
+ }
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
+ if (parsedProxyPort && parsedProxyPort !== port) {
+ return true; // Skip if ports don't match.
+ }
+ if (!/^[.*]/.test(parsedProxyHostname)) {
+ // No wildcards, so stop proxying if there is an exact match.
+ return hostname !== parsedProxyHostname;
+ }
+ if (parsedProxyHostname.charAt(0) === '*') {
+ // Remove leading wildcard.
+ parsedProxyHostname = parsedProxyHostname.slice(1);
+ }
+ // Stop proxying if the hostname ends with the no_proxy host.
+ return !hostname.endsWith(parsedProxyHostname);
+ });
}
-Dicer.prototype.reset = function () {
- this._part = undefined
- this._bparser = undefined
- this._hparser = undefined
+/**
+ * Get the value for an environment variable.
+ *
+ * @param {string} key - The name of the environment variable.
+ * @return {string} The value of the environment variable.
+ * @private
+ */
+function getEnv(key) {
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
}
-Dicer.prototype.setBoundary = function (boundary) {
- const self = this
- this._bparser = new StreamSearch('\r\n--' + boundary)
- this._bparser.on('info', function (isMatch, data, start, end) {
- self._oninfo(isMatch, data, start, end)
- })
-}
+const VERSION = "1.18.1";
-Dicer.prototype._ignore = function () {
- if (this._part && !this._ignoreData) {
- this._ignoreData = true
- this._part.on('error', EMPTY_FN)
- // we must perform some kind of read on the stream even though we are
- // ignoring the data, otherwise node's Readable stream will not emit 'end'
- // after pushing null to the stream
- this._part.resume()
- }
+function parseProtocol(url) {
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
+ return match && match[1] || '';
}
-Dicer.prototype._oninfo = function (isMatch, data, start, end) {
- let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
+// RFC 2397: data:[][;base64],
+// mediatype = type/subtype followed by optional ;name=value parameters
+const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
- if (!this._part && this._justMatched && data) {
- while (this._dashes < 2 && (start + i) < end) {
- if (data[start + i] === DASH) {
- ++i
- ++this._dashes
- } else {
- if (this._dashes) { buf = B_ONEDASH }
- this._dashes = 0
- break
- }
- }
- if (this._dashes === 2) {
- if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
- this.reset()
- this._finished = true
- // no more parts will be added
- if (self._parts === 0) {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- }
- }
- if (this._dashes) { return }
+/**
+ * Parse data uri to a Buffer or Blob
+ *
+ * @param {String} uri
+ * @param {?Boolean} asBlob
+ * @param {?Object} options
+ * @param {?Function} options.Blob
+ *
+ * @returns {Buffer|Blob}
+ */
+function fromDataURI(uri, asBlob, options) {
+ const _Blob = options && options.Blob || platform.classes.Blob;
+ const protocol = parseProtocol(uri);
+ if (asBlob === undefined && _Blob) {
+ asBlob = true;
}
- if (this._justMatched) { this._justMatched = false }
- if (!this._part) {
- this._part = new PartStream(this._partOpts)
- this._part._read = function (n) {
- self._unpause()
+ if (protocol === 'data') {
+ uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
+ const match = DATA_URL_PATTERN.exec(uri);
+ if (!match) {
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
}
- if (this._isPreamble && this.listenerCount('preamble') !== 0) {
- this.emit('preamble', this._part)
- } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
- this.emit('part', this._part)
- } else {
- this._ignore()
- }
- if (!this._isPreamble) { this._inHeader = true }
- }
- if (data && start < end && !this._ignoreData) {
- if (this._isPreamble || !this._inHeader) {
- if (buf) { shouldWriteMore = this._part.push(buf) }
- shouldWriteMore = this._part.push(data.slice(start, end))
- if (!shouldWriteMore) { this._pause = true }
- } else if (!this._isPreamble && this._inHeader) {
- if (buf) { this._hparser.push(buf) }
- r = this._hparser.push(data.slice(start, end))
- if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
- }
- }
- if (isMatch) {
- this._hparser.reset()
- if (this._isPreamble) { this._isPreamble = false } else {
- if (start !== end) {
- ++this._parts
- this._part.on('end', function () {
- if (--self._parts === 0) {
- if (self._finished) {
- self._realFinish = true
- self.emit('finish')
- self._realFinish = false
- } else {
- self._unpause()
- }
- }
- })
+ const type = match[1];
+ const params = match[2];
+ const encoding = match[3] ? 'base64' : 'utf8';
+ const body = match[4];
+
+ // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII
+ // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.
+ let mime = '';
+ if (type) {
+ mime = params ? type + params : type;
+ } else if (params) {
+ mime = 'text/plain' + params;
+ }
+ const buffer = encoding === 'base64' ? Buffer.from(body, 'base64') : Buffer.from(decodeURIComponent(body), encoding);
+ if (asBlob) {
+ if (!_Blob) {
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
}
+ return new _Blob([buffer], {
+ type: mime
+ });
}
- this._part.push(null)
- this._part = undefined
- this._ignoreData = false
- this._justMatched = true
- this._dashes = 0
+ return buffer;
}
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
}
-Dicer.prototype._unpause = function () {
- if (!this._pause) { return }
-
- this._pause = false
- if (this._cb) {
- const cb = this._cb
- this._cb = undefined
- cb()
+const kInternals = Symbol('internals');
+class AxiosTransformStream extends stream.Transform {
+ constructor(options) {
+ options = utils$1.toFlatObject(options, {
+ maxRate: 0,
+ chunkSize: 64 * 1024,
+ minChunkSize: 100,
+ timeWindow: 500,
+ ticksRate: 2,
+ samplesCount: 15
+ }, null, (prop, source) => {
+ return !utils$1.isUndefined(source[prop]);
+ });
+ super({
+ readableHighWaterMark: options.chunkSize
+ });
+ const internals = this[kInternals] = {
+ timeWindow: options.timeWindow,
+ chunkSize: options.chunkSize,
+ maxRate: options.maxRate,
+ minChunkSize: options.minChunkSize,
+ bytesSeen: 0,
+ isCaptured: false,
+ notifiedBytesLoaded: 0,
+ ts: Date.now(),
+ bytes: 0,
+ onReadCallback: null
+ };
+ this.on('newListener', event => {
+ if (event === 'progress') {
+ if (!internals.isCaptured) {
+ internals.isCaptured = true;
+ }
+ }
+ });
+ }
+ _read(size) {
+ const internals = this[kInternals];
+ if (internals.onReadCallback) {
+ internals.onReadCallback();
+ }
+ return super._read(size);
+ }
+ _transform(chunk, encoding, callback) {
+ const internals = this[kInternals];
+ const maxRate = internals.maxRate;
+ const readableHighWaterMark = this.readableHighWaterMark;
+ const timeWindow = internals.timeWindow;
+ const divider = 1000 / timeWindow;
+ const bytesThreshold = maxRate / divider;
+ const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+ const pushChunk = (_chunk, _callback) => {
+ const bytes = Buffer.byteLength(_chunk);
+ internals.bytesSeen += bytes;
+ internals.bytes += bytes;
+ internals.isCaptured && this.emit('progress', internals.bytesSeen);
+ if (this.push(_chunk)) {
+ process.nextTick(_callback);
+ } else {
+ internals.onReadCallback = () => {
+ internals.onReadCallback = null;
+ process.nextTick(_callback);
+ };
+ }
+ };
+ const transformChunk = (_chunk, _callback) => {
+ const chunkSize = Buffer.byteLength(_chunk);
+ let chunkRemainder = null;
+ let maxChunkSize = readableHighWaterMark;
+ let bytesLeft;
+ let passed = 0;
+ if (maxRate) {
+ const now = Date.now();
+ if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
+ internals.ts = now;
+ bytesLeft = bytesThreshold - internals.bytes;
+ internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
+ passed = 0;
+ }
+ bytesLeft = bytesThreshold - internals.bytes;
+ }
+ if (maxRate) {
+ if (bytesLeft <= 0) {
+ // next time window
+ return setTimeout(() => {
+ _callback(null, _chunk);
+ }, timeWindow - passed);
+ }
+ if (bytesLeft < maxChunkSize) {
+ maxChunkSize = bytesLeft;
+ }
+ }
+ if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
+ chunkRemainder = _chunk.subarray(maxChunkSize);
+ _chunk = _chunk.subarray(0, maxChunkSize);
+ }
+ pushChunk(_chunk, chunkRemainder ? () => {
+ process.nextTick(_callback, null, chunkRemainder);
+ } : _callback);
+ };
+ transformChunk(chunk, function transformNextChunk(err, _chunk) {
+ if (err) {
+ return callback(err);
+ }
+ if (_chunk) {
+ transformChunk(_chunk, transformNextChunk);
+ } else {
+ callback(null);
+ }
+ });
}
}
-module.exports = Dicer
-
-
-/***/ }),
-
-/***/ 2032:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
-const inherits = (__nccwpck_require__(7261).inherits)
-const getLimit = __nccwpck_require__(1467)
-
-const StreamSearch = __nccwpck_require__(1142)
-
-const B_DCRLF = Buffer.from('\r\n\r\n')
-const RE_CRLF = /\r\n/g
-const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
-
-function HeaderParser (cfg) {
- EventEmitter.call(this)
-
- cfg = cfg || {}
- const self = this
- this.nread = 0
- this.maxed = false
- this.npairs = 0
- this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
- this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
- this.buffer = ''
- this.header = {}
- this.finished = false
- this.ss = new StreamSearch(B_DCRLF)
- this.ss.on('info', function (isMatch, data, start, end) {
- if (data && !self.maxed) {
- if (self.nread + end - start >= self.maxHeaderSize) {
- end = self.maxHeaderSize - self.nread + start
- self.nread = self.maxHeaderSize
- self.maxed = true
- } else { self.nread += (end - start) }
+const {
+ asyncIterator
+} = Symbol;
+const readBlob = async function* (blob) {
+ if (blob.stream) {
+ yield* blob.stream();
+ } else if (blob.arrayBuffer) {
+ yield await blob.arrayBuffer();
+ } else if (blob[asyncIterator]) {
+ yield* blob[asyncIterator]();
+ } else {
+ yield blob;
+ }
+};
- self.buffer += data.toString('binary', start, end)
+const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
+const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
+const CRLF = '\r\n';
+const CRLF_BYTES = textEncoder.encode(CRLF);
+const CRLF_BYTES_COUNT = 2;
+class FormDataPart {
+ constructor(name, value) {
+ const {
+ escapeName
+ } = this.constructor;
+ const isStringValue = utils$1.isString(value);
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''}${CRLF}`;
+ if (isStringValue) {
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
+ } else {
+ const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
+ headers += `Content-Type: ${safeType}${CRLF}`;
}
- if (isMatch) { self._finish() }
- })
-}
-inherits(HeaderParser, EventEmitter)
-
-HeaderParser.prototype.push = function (data) {
- const r = this.ss.push(data)
- if (this.finished) { return r }
+ this.headers = textEncoder.encode(headers + CRLF);
+ this.contentLength = isStringValue ? value.byteLength : value.size;
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+ this.name = name;
+ this.value = value;
+ }
+ async *encode() {
+ yield this.headers;
+ const {
+ value
+ } = this;
+ if (utils$1.isTypedArray(value)) {
+ yield value;
+ } else {
+ yield* readBlob(value);
+ }
+ yield CRLF_BYTES;
+ }
+ static escapeName(name) {
+ return String(name).replace(/[\r\n"]/g, match => ({
+ '\r': '%0D',
+ '\n': '%0A',
+ '"': '%22'
+ })[match]);
+ }
}
+const formDataToStream = (form, headersHandler, options) => {
+ const {
+ tag = 'form-data-boundary',
+ size = 25,
+ boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
+ } = options || {};
+ if (!utils$1.isFormData(form)) {
+ throw new TypeError('FormData instance required');
+ }
+ if (boundary.length < 1 || boundary.length > 70) {
+ throw new Error('boundary must be 1-70 characters long');
+ }
+ const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
+ let contentLength = footerBytes.byteLength;
+ const parts = Array.from(form.entries()).map(([name, value]) => {
+ const part = new FormDataPart(name, value);
+ contentLength += part.size;
+ return part;
+ });
+ contentLength += boundaryBytes.byteLength * parts.length;
+ contentLength = utils$1.toFiniteNumber(contentLength);
+ const computedHeaders = {
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
+ };
+ if (Number.isFinite(contentLength)) {
+ computedHeaders['Content-Length'] = contentLength;
+ }
+ headersHandler && headersHandler(computedHeaders);
+ return stream.Readable.from(async function* () {
+ for (const part of parts) {
+ yield boundaryBytes;
+ yield* part.encode();
+ }
+ yield footerBytes;
+ }());
+};
-HeaderParser.prototype.reset = function () {
- this.finished = false
- this.buffer = ''
- this.header = {}
- this.ss.reset()
-}
+class ZlibHeaderTransformStream extends stream.Transform {
+ __transform(chunk, encoding, callback) {
+ this.push(chunk);
+ callback();
+ }
+ _transform(chunk, encoding, callback) {
+ if (chunk.length !== 0) {
+ this._transform = this.__transform;
-HeaderParser.prototype._finish = function () {
- if (this.buffer) { this._parseHeader() }
- this.ss.matches = this.ss.maxMatches
- const header = this.header
- this.header = {}
- this.buffer = ''
- this.finished = true
- this.nread = this.npairs = 0
- this.maxed = false
- this.emit('header', header)
+ // Add Default Compression headers if no zlib headers are present
+ if (chunk[0] !== 120) {
+ // Hex: 78
+ const header = Buffer.alloc(2);
+ header[0] = 120; // Hex: 78
+ header[1] = 156; // Hex: 9C
+ this.push(header, encoding);
+ }
+ }
+ this.__transform(chunk, encoding, callback);
+ }
}
-HeaderParser.prototype._parseHeader = function () {
- if (this.npairs === this.maxHeaderPairs) { return }
-
- const lines = this.buffer.split(RE_CRLF)
- const len = lines.length
- let m, h
-
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- if (lines[i].length === 0) { continue }
- if (lines[i][0] === '\t' || lines[i][0] === ' ') {
- // folded header content
- // RFC2822 says to just remove the CRLF and not the whitespace following
- // it, so we follow the RFC and include the leading whitespace ...
- if (h) {
- this.header[h][this.header[h].length - 1] += lines[i]
- continue
+class Http2Sessions {
+ constructor() {
+ this.sessions = Object.create(null);
+ }
+ getSession(authority, options) {
+ options = Object.assign({
+ sessionTimeout: 1000
+ }, options);
+ let authoritySessions = this.sessions[authority];
+ if (authoritySessions) {
+ let len = authoritySessions.length;
+ for (let i = 0; i < len; i++) {
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
+ return sessionHandle;
+ }
}
}
-
- const posColon = lines[i].indexOf(':')
- if (
- posColon === -1 ||
- posColon === 0
- ) {
- return
+ const session = http2.connect(authority, options);
+ let removed;
+ let timer;
+ const removeSession = () => {
+ if (removed) {
+ return;
+ }
+ removed = true;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ let entries = authoritySessions,
+ len = entries.length,
+ i = len;
+ while (i--) {
+ if (entries[i][0] === session) {
+ if (len === 1) {
+ delete this.sessions[authority];
+ } else {
+ entries.splice(i, 1);
+ }
+ if (!session.closed) {
+ session.close();
+ }
+ return;
+ }
+ }
+ };
+ const originalRequestFn = session.request;
+ const {
+ sessionTimeout
+ } = options;
+ if (sessionTimeout != null) {
+ let streamsCount = 0;
+ session.request = function () {
+ const stream = originalRequestFn.apply(this, arguments);
+ streamsCount++;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ stream.once('close', () => {
+ if (! --streamsCount) {
+ timer = setTimeout(() => {
+ timer = null;
+ removeSession();
+ }, sessionTimeout);
+ }
+ });
+ return stream;
+ };
}
- m = RE_HDR.exec(lines[i])
- h = m[1].toLowerCase()
- this.header[h] = this.header[h] || []
- this.header[h].push((m[2] || ''))
- if (++this.npairs === this.maxHeaderPairs) { break }
+ session.once('close', removeSession);
+ let entry = [session, options];
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
+ return session;
}
}
-module.exports = HeaderParser
-
-
-/***/ }),
-
-/***/ 1620:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const inherits = (__nccwpck_require__(7261).inherits)
-const ReadableStream = (__nccwpck_require__(4492).Readable)
-
-function PartStream (opts) {
- ReadableStream.call(this, opts)
-}
-inherits(PartStream, ReadableStream)
-
-PartStream.prototype._read = function (n) {}
-
-module.exports = PartStream
-
-
-/***/ }),
-
-/***/ 1142:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
+const callbackify = (fn, reducer) => {
+ return utils$1.isAsyncFn(fn) ? function (...args) {
+ const cb = args.pop();
+ fn.apply(this, args).then(value => {
+ try {
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
+ } catch (err) {
+ cb(err);
+ }
+ }, cb);
+ } : fn;
+};
-/**
- * Copyright Brian White. All rights reserved.
- *
- * @see https://github.com/mscdex/streamsearch
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
- * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
- */
-const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
-const inherits = (__nccwpck_require__(7261).inherits)
+const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
+const isIPv4Loopback = host => {
+ const parts = host.split('.');
+ if (parts.length !== 4) return false;
+ if (parts[0] !== '127') return false;
+ return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
+};
+const isIPv6ZeroGroup = group => /^0{1,4}$/.test(group);
+
+// The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host
+// for outbound connections, so treat it as loopback-equivalent for NO_PROXY
+// matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed
+// and full IPv6 all-zero forms so both families bypass symmetrically.
+const isIPv6Unspecified = host => {
+ if (host === '::') return true;
+ const compressionIndex = host.indexOf('::');
+ if (compressionIndex !== -1) {
+ if (compressionIndex !== host.lastIndexOf('::')) return false;
+ const left = host.slice(0, compressionIndex);
+ const right = host.slice(compressionIndex + 2);
+ const leftGroups = left ? left.split(':') : [];
+ const rightGroups = right ? right.split(':') : [];
+ const explicitGroups = leftGroups.length + rightGroups.length;
+ return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
+ }
+ const groups = host.split(':');
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
+};
+const isIPv6Loopback = host => {
+ // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1
+ // First, strip any leading "::" by normalising with Set lookup of common forms,
+ // then fall back to structural check.
+ if (host === '::1') return true;
+
+ // Check IPv4-mapped IPv6 loopback: ::ffff: or ::ffff:
+ // Node's URL parser normalises ::ffff:127.0.0.1 → ::ffff:7f00:1
+ const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
+ if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]);
+ const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
+ if (v4MappedHex) {
+ const high = parseInt(v4MappedHex[1], 16);
+ // High 16 bits must start with 127 (0x7f) — i.e. 0x7f00..0x7fff
+ return high >= 0x7f00 && high <= 0x7fff;
+ }
+
+ // Full-form ::1 variants: any number of zero groups followed by trailing 1
+ // e.g. 0:0:0:0:0:0:0:1, 0000:...:0001
+ const groups = host.split(':');
+ if (groups.length === 8) {
+ for (let i = 0; i < 7; i++) {
+ if (!/^0+$/.test(groups[i])) return false;
+ }
+ return /^0*1$/.test(groups[7]);
+ }
+ return false;
+};
+const isLoopback = host => {
+ if (!host) return false;
+ if (LOOPBACK_HOSTNAMES.has(host)) return true;
+ if (isIPv4Loopback(host)) return true;
+ if (isIPv6Unspecified(host)) return true;
+ return isIPv6Loopback(host);
+};
+const DEFAULT_PORTS = {
+ http: 80,
+ https: 443,
+ ws: 80,
+ wss: 443,
+ ftp: 21
+};
+const parseNoProxyEntry = entry => {
+ let entryHost = entry;
+ let entryPort = 0;
+ if (entryHost.charAt(0) === '[') {
+ const bracketIndex = entryHost.indexOf(']');
+ if (bracketIndex !== -1) {
+ const host = entryHost.slice(1, bracketIndex);
+ const rest = entryHost.slice(bracketIndex + 1);
+ if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) {
+ entryPort = Number.parseInt(rest.slice(1), 10);
+ }
+ return [host, entryPort];
+ }
+ }
+ const firstColon = entryHost.indexOf(':');
+ const lastColon = entryHost.lastIndexOf(':');
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
+ entryHost = entryHost.slice(0, lastColon);
+ }
+ return [entryHost, entryPort];
+};
-function SBMH (needle) {
- if (typeof needle === 'string') {
- needle = Buffer.from(needle)
+// Convert IPv4-mapped IPv6 (::ffff:0:0/96 prefix) to IPv4 dotted form so both
+// sides of a NO_PROXY comparison see the same canonical address. Without this,
+// `NO_PROXY=192.168.1.5` would not match a request to `http://[::ffff:192.168.1.5]/`
+// (Node's URL parser normalises that to `[::ffff:c0a8:105]`), and vice-versa,
+// allowing the proxy-bypass policy to be circumvented by using the alternate
+// representation. Returns the input unchanged when not IPv4-mapped.
+const IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i;
+const IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i;
+const unmapIPv4MappedIPv6 = host => {
+ if (typeof host !== 'string' || host.indexOf(':') === -1) return host;
+ const dotted = host.match(IPV4_MAPPED_DOTTED_RE);
+ if (dotted) return dotted[1];
+ const hex = host.match(IPV4_MAPPED_HEX_RE);
+ if (hex) {
+ const high = parseInt(hex[1], 16);
+ const low = parseInt(hex[2], 16);
+ return `${high >> 8}.${high & 0xff}.${low >> 8}.${low & 0xff}`;
+ }
+ return host;
+};
+const normalizeNoProxyHost = hostname => {
+ if (!hostname) {
+ return hostname;
}
-
- if (!Buffer.isBuffer(needle)) {
- throw new TypeError('The needle has to be a String or a Buffer.')
+ if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') {
+ hostname = hostname.slice(1, -1);
}
-
- const needleLength = needle.length
-
- if (needleLength === 0) {
- throw new Error('The needle cannot be an empty String/Buffer.')
+ return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ''));
+};
+function shouldBypassProxy(location) {
+ let parsed;
+ try {
+ parsed = new URL(location);
+ } catch (_err) {
+ return false;
}
-
- if (needleLength > 256) {
- throw new Error('The needle cannot have a length bigger than 256.')
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase();
+ if (!noProxy) {
+ return false;
}
-
- this.maxMatches = Infinity
- this.matches = 0
-
- this._occ = new Array(256)
- .fill(needleLength) // Initialize occurrence table.
- this._lookbehind_size = 0
- this._needle = needle
- this._bufpos = 0
-
- this._lookbehind = Buffer.alloc(needleLength)
-
- // Populate occurrence table with analysis of the needle,
- // ignoring last letter.
- for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
- this._occ[needle[i]] = needleLength - 1 - i
+ if (noProxy === '*') {
+ return true;
}
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;
+ const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
+ return noProxy.split(/[\s,]+/).some(entry => {
+ if (!entry) {
+ return false;
+ }
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
+ entryHost = normalizeNoProxyHost(entryHost);
+ if (!entryHost) {
+ return false;
+ }
+ if (entryPort && entryPort !== port) {
+ return false;
+ }
+ if (entryHost.charAt(0) === '*') {
+ entryHost = entryHost.slice(1);
+ }
+ if (entryHost.charAt(0) === '.') {
+ return hostname.endsWith(entryHost);
+ }
+ return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost);
+ });
}
-inherits(SBMH, EventEmitter)
-SBMH.prototype.reset = function () {
- this._lookbehind_size = 0
- this.matches = 0
- this._bufpos = 0
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+ min = min !== undefined ? min : 1000;
+ return function push(chunkLength) {
+ const now = Date.now();
+ const startedAt = timestamps[tail];
+ if (!firstSampleTS) {
+ firstSampleTS = now;
+ }
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+ let i = tail;
+ let bytesCount = 0;
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
+ }
+ head = (head + 1) % samplesCount;
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
+ }
+ if (now - firstSampleTS < min) {
+ return;
+ }
+ const passed = startedAt && now - startedAt;
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
}
-SBMH.prototype.push = function (chunk, pos) {
- if (!Buffer.isBuffer(chunk)) {
- chunk = Buffer.from(chunk, 'binary')
- }
- const chlen = chunk.length
- this._bufpos = pos || 0
- let r
- while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
- return r
+/**
+ * Throttle decorator
+ * @param {Function} fn
+ * @param {Number} freq
+ * @return {Function}
+ */
+function throttle(fn, freq) {
+ let timestamp = 0;
+ let threshold = 1000 / freq;
+ let lastArgs;
+ let timer;
+ const invoke = (args, now = Date.now()) => {
+ timestamp = now;
+ lastArgs = null;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ fn(...args);
+ };
+ const throttled = (...args) => {
+ const now = Date.now();
+ const passed = now - timestamp;
+ if (passed >= threshold) {
+ invoke(args, now);
+ } else {
+ lastArgs = args;
+ if (!timer) {
+ timer = setTimeout(() => {
+ timer = null;
+ invoke(lastArgs);
+ }, threshold - passed);
+ }
+ }
+ };
+ const flush = () => lastArgs && invoke(lastArgs);
+ return [throttled, flush];
}
-SBMH.prototype._sbmh_feed = function (data) {
- const len = data.length
- const needle = this._needle
- const needleLength = needle.length
- const lastNeedleChar = needle[needleLength - 1]
-
- // Positive: points to a position in `data`
- // pos == 3 points to data[3]
- // Negative: points to a position in the lookbehind buffer
- // pos == -2 points to lookbehind[lookbehind_size - 2]
- let pos = -this._lookbehind_size
- let ch
-
- if (pos < 0) {
- // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
- // search with character lookup code that considers both the
- // lookbehind buffer and the current round's haystack data.
- //
- // Loop until
- // there is a match.
- // or until
- // we've moved past the position that requires the
- // lookbehind buffer. In this case we switch to the
- // optimized loop.
- // or until
- // the character to look at lies outside the haystack.
- while (pos < 0 && pos <= len - needleLength) {
- ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
-
- if (
- ch === lastNeedleChar &&
- this._sbmh_memcmp(data, pos, needleLength - 1)
- ) {
- this._lookbehind_size = 0
- ++this.matches
- this.emit('info', true)
+const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+ return throttle(e => {
+ if (!e || typeof e.loaded !== 'number') {
+ return;
+ }
+ const rawLoaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
+ const progressBytes = Math.max(0, loaded - bytesNotified);
+ const rate = _speedometer(progressBytes);
+ bytesNotified = Math.max(bytesNotified, loaded);
+ const data = {
+ loaded,
+ total,
+ progress: total ? loaded / total : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total ? (total - loaded) / rate : undefined,
+ event: e,
+ lengthComputable: total != null,
+ [isDownloadStream ? 'download' : 'upload']: true
+ };
+ listener(data);
+ }, freq);
+};
+const progressEventDecorator = (total, throttled) => {
+ const lengthComputable = total != null;
+ return [loaded => throttled[0]({
+ lengthComputable,
+ total,
+ loaded
+ }), throttled[1]];
+};
+const asyncDecorator = fn => (...args) => utils$1.asap(() => fn(...args));
- return (this._bufpos = pos + needleLength)
+/**
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
+ * - For base64: compute exact decoded size using length and padding;
+ * handle %XX at the character-count level (no string allocation).
+ * - For non-base64: compute the exact percent-decoded UTF-8 byte length.
+ *
+ * @param {string} url
+ * @returns {number}
+ */
+const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
+const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
+function estimateDataURLDecodedBytes(url) {
+ if (!url || typeof url !== 'string') return 0;
+ if (!url.startsWith('data:')) return 0;
+ const comma = url.indexOf(',');
+ if (comma < 0) return 0;
+ const meta = url.slice(5, comma);
+ const body = url.slice(comma + 1);
+ const isBase64 = /;base64/i.test(meta);
+ if (isBase64) {
+ let effectiveLen = body.length;
+ const len = body.length; // cache length
+
+ for (let i = 0; i < len; i++) {
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
+ const a = body.charCodeAt(i + 1);
+ const b = body.charCodeAt(i + 2);
+ const isHex = isHexDigit(a) && isHexDigit(b);
+ if (isHex) {
+ effectiveLen -= 2;
+ i += 2;
+ }
}
- pos += this._occ[ch]
}
+ let pad = 0;
+ let idx = len - 1;
+ const tailIsPct3D = j => j >= 2 && body.charCodeAt(j - 2) === 37 &&
+ // '%'
+ body.charCodeAt(j - 1) === 51 && (
+ // '3'
+ body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
- // No match.
-
- if (pos < 0) {
- // There's too few data for Boyer-Moore-Horspool to run,
- // so let's use a different algorithm to skip as much as
- // we can.
- // Forward pos until
- // the trailing part of lookbehind + data
- // looks like the beginning of the needle
- // or until
- // pos == 0
- while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
+ if (idx >= 0) {
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
+ pad++;
+ idx--;
+ } else if (tailIsPct3D(idx)) {
+ pad++;
+ idx -= 3;
+ }
}
-
- if (pos >= 0) {
- // Discard lookbehind buffer.
- this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
- this._lookbehind_size = 0
- } else {
- // Cut off part of the lookbehind buffer that has
- // been processed and append the entire haystack
- // into it.
- const bytesToCutOff = this._lookbehind_size + pos
- if (bytesToCutOff > 0) {
- // The cut off data is guaranteed not to contain the needle.
- this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
+ if (pad === 1 && idx >= 0) {
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
+ pad++;
+ } else if (tailIsPct3D(idx)) {
+ pad++;
}
-
- this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
- this._lookbehind_size - bytesToCutOff)
- this._lookbehind_size -= bytesToCutOff
-
- data.copy(this._lookbehind, this._lookbehind_size)
- this._lookbehind_size += len
-
- this._bufpos = len
- return len
}
+ const groups = Math.floor(effectiveLen / 4);
+ const bytes = groups * 3 - (pad || 0);
+ return bytes > 0 ? bytes : 0;
}
- pos += (pos >= 0) * this._bufpos
-
- // Lookbehind buffer is now empty. We only need to check if the
- // needle is in the haystack.
- if (data.indexOf(needle, pos) !== -1) {
- pos = data.indexOf(needle, pos)
- ++this.matches
- if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
-
- return (this._bufpos = pos + needleLength)
- } else {
- pos = len - needleLength
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
+ // Valid %XX triplets count as one decoded byte; this matches the bytes that
+ // decodeURIComponent(body) would produce before Buffer re-encodes the string.
+ let bytes = 0;
+ for (let i = 0, len = body.length; i < len; i++) {
+ const c = body.charCodeAt(i);
+ if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
+ bytes += 1;
+ i += 2;
+ } else if (c < 0x80) {
+ bytes += 1;
+ } else if (c < 0x800) {
+ bytes += 2;
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
+ const next = body.charCodeAt(i + 1);
+ if (next >= 0xdc00 && next <= 0xdfff) {
+ bytes += 4;
+ i++;
+ } else {
+ bytes += 3;
+ }
+ } else {
+ bytes += 3;
+ }
}
+ return bytes;
+}
- // There was no match. If there's trailing haystack data that we cannot
- // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
- // data is less than the needle size) then match using a modified
- // algorithm that starts matching from the beginning instead of the end.
- // Whatever trailing data is left after running this algorithm is added to
- // the lookbehind buffer.
- while (
- pos < len &&
- (
- data[pos] !== needle[0] ||
- (
- (Buffer.compare(
- data.subarray(pos, pos + len - pos),
- needle.subarray(0, len - pos)
- ) !== 0)
- )
- )
- ) {
- ++pos
- }
- if (pos < len) {
- data.copy(this._lookbehind, 0, pos, pos + (len - pos))
- this._lookbehind_size = len - pos
+const zlibOptions = {
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+};
+const brotliOptions = {
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+};
+const zstdOptions = {
+ flush: zlib.constants.ZSTD_e_flush,
+ finishFlush: zlib.constants.ZSTD_e_flush
+};
+const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
+const isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
+const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : '');
+const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : '');
+const {
+ http: httpFollow,
+ https: httpsFollow
+} = followRedirects;
+const isHttps = /https:?/;
+const FORM_DATA_CONTENT_HEADERS$1 = ['content-type', 'content-length'];
+function setFormDataHeaders$1(headers, formHeaders, policy) {
+ if (policy !== 'content-only') {
+ headers.set(formHeaders);
+ return;
}
-
- // Everything until pos is guaranteed not to contain needle data.
- if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
-
- this._bufpos = len
- return len
+ Object.entries(formHeaders).forEach(([key, val]) => {
+ if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
+ headers.set(key, val);
+ }
+ });
}
-SBMH.prototype._sbmh_lookup_char = function (data, pos) {
- return (pos < 0)
- ? this._lookbehind[this._lookbehind_size + pos]
- : data[pos]
+// Symbols used to bind a single 'error' listener to a pooled socket and track
+// the request currently owning that socket across keep-alive reuse (issue #10780).
+const kAxiosSocketListener = Symbol('axios.http.socketListener');
+const kAxiosCurrentReq = Symbol('axios.http.currentReq');
+
+// Tags HttpsProxyAgent instances installed by setProxy() so the redirect path
+// can strip them without clobbering a user-supplied agent that happens to be
+// an HttpsProxyAgent.
+const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
+
+// Cache of CONNECT-tunneling agents keyed by proxy config so repeat requests
+// through the same proxy reuse a single agent (and its socket pool). The
+// keyspace is bounded by the set of distinct proxy configs the process uses,
+// so unbounded growth is not a concern in practice.
+const tunnelingAgentCache = new Map();
+const tunnelingAgentCacheUser = new WeakMap();
+// Minimum minor versions where Node's HTTP Agent supports native proxyEnv
+// handling. Checking the selected agent below also covers startup modes such
+// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.
+const NODE_NATIVE_ENV_PROXY_SUPPORT = {
+ 22: 21,
+ 24: 5
+};
+function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
+ if (!nodeVersion) {
+ return false;
+ }
+ const [major, minor] = nodeVersion.split('.').map(part => Number(part));
+ if (!Number.isInteger(major) || !Number.isInteger(minor)) {
+ return false;
+ }
+ if (major > 24) {
+ return true;
+ }
+ return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];
}
-
-SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
+function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
+ if (!isNodeNativeEnvProxySupported(nodeVersion)) {
+ return false;
}
- return true
+ const agentOptions = agent && agent.options;
+ return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null);
+}
+function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
+ return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;
+}
+function getTunnelingAgent(agentOptions, userHttpsAgent) {
+ const key = agentOptions.protocol + '//' + agentOptions.hostname + ':' + (agentOptions.port || '') + '#' + (agentOptions.auth || '');
+ const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent) : tunnelingAgentCache;
+ let agent = cache.get(key);
+ if (agent) return agent;
+ // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert,
+ // etc.) into the tunneling agent so they apply to the origin TLS upgrade
+ // performed after CONNECT. Our proxy fields take precedence on conflict.
+ const merged = userHttpsAgent && userHttpsAgent.options ? {
+ ...userHttpsAgent.options,
+ ...agentOptions
+ } : agentOptions;
+ agent = new HttpsProxyAgent(merged);
+ if (userHttpsAgent && userHttpsAgent.options) {
+ const originTLSOptions = {
+ ...userHttpsAgent.options
+ };
+ const callback = agent.callback;
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
+ // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
+ return callback.call(this, req, {
+ ...originTLSOptions,
+ ...opts
+ });
+ };
+ }
+ agent[kAxiosInstalledTunnel] = true;
+ cache.set(key, agent);
+ return agent;
}
+const supportedProtocols = platform.protocols.map(protocol => {
+ return protocol + ':';
+});
-module.exports = SBMH
-
-
-/***/ }),
-
-/***/ 727:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const WritableStream = (__nccwpck_require__(4492).Writable)
-const { inherits } = __nccwpck_require__(7261)
-const Dicer = __nccwpck_require__(2960)
-
-const MultipartParser = __nccwpck_require__(2183)
-const UrlencodedParser = __nccwpck_require__(8306)
-const parseParams = __nccwpck_require__(1854)
-
-function Busboy (opts) {
- if (!(this instanceof Busboy)) { return new Busboy(opts) }
+// Node's WHATWG URL parser returns `username` and `password` percent-encoded.
+// Decode before composing the `auth` option so credentials such as
+// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
+// original value for malformed input so a bad encoding never throws.
+const decodeURIComponentSafe$1 = value => {
+ if (!utils$1.isString(value)) {
+ return value;
+ }
+ try {
+ return decodeURIComponent(value);
+ } catch (error) {
+ return value;
+ }
+};
+const flushOnFinish = (stream, [throttled, flush]) => {
+ stream.on('end', flush).on('error', flush);
+ return throttled;
+};
+const http2Sessions = new Http2Sessions();
- if (typeof opts !== 'object') {
- throw new TypeError('Busboy expected an options-Object.')
+/**
+ * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined,
+ * call them with the options object.
+ *
+ * @param {Object} options - The options object that was passed to the request.
+ *
+ * @returns {Object}
+ */
+function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
+ if (options.beforeRedirects.proxy) {
+ options.beforeRedirects.proxy(options);
}
- if (typeof opts.headers !== 'object') {
- throw new TypeError('Busboy expected an options-Object with headers-attribute.')
+ if (options.beforeRedirects.auth) {
+ options.beforeRedirects.auth(options);
}
- if (typeof opts.headers['content-type'] !== 'string') {
- throw new TypeError('Missing Content-Type-header.')
+ if (options.beforeRedirects.sensitiveHeaders) {
+ options.beforeRedirects.sensitiveHeaders(options, requestDetails);
}
-
- const {
- headers,
- ...streamOptions
- } = opts
-
- this.opts = {
- autoDestroy: false,
- ...streamOptions
+ if (options.beforeRedirects.config) {
+ options.beforeRedirects.config(options, responseDetails, requestDetails);
}
- WritableStream.call(this, this.opts)
-
- this._done = false
- this._parser = this.getParserByHeaders(headers)
- this._finished = false
}
-inherits(Busboy, WritableStream)
-
-Busboy.prototype.emit = function (ev) {
- if (ev === 'finish') {
- if (!this._done) {
- this._parser?.end()
- return
- } else if (this._finished) {
- return
- }
- this._finished = true
+function stripMatchingHeaders(headers, sensitiveSet) {
+ if (!headers) {
+ return;
}
- WritableStream.prototype.emit.apply(this, arguments)
+ Object.keys(headers).forEach(header => {
+ if (sensitiveSet.has(header.toLowerCase())) {
+ delete headers[header];
+ }
+ });
}
-
-Busboy.prototype.getParserByHeaders = function (headers) {
- const parsed = parseParams(headers['content-type'])
-
- const cfg = {
- defCharset: this.opts.defCharset,
- fileHwm: this.opts.fileHwm,
- headers,
- highWaterMark: this.opts.highWaterMark,
- isPartAFile: this.opts.isPartAFile,
- limits: this.opts.limits,
- parsedConType: parsed,
- preservePath: this.opts.preservePath
- }
-
- if (MultipartParser.detect.test(parsed[0])) {
- return new MultipartParser(this, cfg)
+function isSameOriginRedirect(redirectOptions, requestDetails) {
+ if (!requestDetails) {
+ return false;
}
- if (UrlencodedParser.detect.test(parsed[0])) {
- return new UrlencodedParser(this, cfg)
+ try {
+ return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
+ } catch (e) {
+ // If origin comparison fails, treat the redirect as unsafe.
+ return false;
}
- throw new Error('Unsupported Content-Type.')
}
-Busboy.prototype._write = function (chunk, encoding, cb) {
- this._parser.write(chunk, cb)
-}
-
-module.exports = Busboy
-module.exports["default"] = Busboy
-module.exports.Busboy = Busboy
-
-module.exports.Dicer = Dicer
-
-
-/***/ }),
-
-/***/ 2183:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-// TODO:
-// * support 1 nested multipart level
-// (see second multipart example here:
-// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
-// * support limits.fieldNameSize
-// -- this will require modifications to utils.parseParams
-
-const { Readable } = __nccwpck_require__(4492)
-const { inherits } = __nccwpck_require__(7261)
-
-const Dicer = __nccwpck_require__(2960)
-
-const parseParams = __nccwpck_require__(1854)
-const decodeText = __nccwpck_require__(4619)
-const basename = __nccwpck_require__(8647)
-const getLimit = __nccwpck_require__(1467)
-
-const RE_BOUNDARY = /^boundary$/i
-const RE_FIELD = /^form-data$/i
-const RE_CHARSET = /^charset$/i
-const RE_FILENAME = /^filename$/i
-const RE_NAME = /^name$/i
-
-Multipart.detect = /^multipart\/form-data/i
-function Multipart (boy, cfg) {
- let i
- let len
- const self = this
- let boundary
- const limits = cfg.limits
- const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
- const parsedConType = cfg.parsedConType || []
- const defCharset = cfg.defCharset || 'utf8'
- const preservePath = cfg.preservePath
- const fileOpts = { highWaterMark: cfg.fileHwm }
-
- for (i = 0, len = parsedConType.length; i < len; ++i) {
- if (Array.isArray(parsedConType[i]) &&
- RE_BOUNDARY.test(parsedConType[i][0])) {
- boundary = parsedConType[i][1]
- break
+/**
+ * If the proxy or config afterRedirects functions are defined, call them with the options
+ *
+ * @param {http.ClientRequestArgs} options
+ * @param {AxiosProxyConfig} configProxy configuration from Axios options object
+ * @param {string} location
+ *
+ * @returns {http.ClientRequestArgs}
+ */
+function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
+ let proxy = configProxy;
+ const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
+ if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
+ const proxyUrl = getProxyForUrl(location);
+ if (proxyUrl) {
+ if (!shouldBypassProxy(location)) {
+ proxy = new URL(proxyUrl);
+ }
}
}
-
- function checkFinished () {
- if (nends === 0 && finished && !boy._done) {
- finished = false
- self.end()
+ // On redirect re-invocation, strip any stale Proxy-Authorization header carried
+ // over from the prior request (e.g. new target no longer uses a proxy, or uses
+ // a different proxy). Skip on the initial request so user-supplied headers are
+ // preserved. Header names are case-insensitive, so remove every case variant.
+ if (isRedirect && options.headers) {
+ for (const name of Object.keys(options.headers)) {
+ if (name.toLowerCase() === 'proxy-authorization') {
+ delete options.headers[name];
+ }
}
}
+ // Strip any tunneling agent we installed for the previous hop so a redirect
+ // that drops the proxy or crosses an HTTPS↔HTTP boundary doesn't reuse a
+ // stale one. Match on our Symbol marker so a user-supplied HttpsProxyAgent
+ // (which won't carry the marker) is left alone.
+ if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
+ options.agent = undefined;
+ }
+ if (proxy) {
+ // Read proxy fields without traversing the prototype chain. URL instances expose
+ // username/password/hostname/host/port/protocol via getters on URL.prototype (so
+ // direct reads are shielded), but plain object proxies — and the `auth` field
+ // (which URL does not expose) — must be guarded so a polluted Object.prototype
+ // (e.g. Object.prototype.auth = { username, password }) cannot inject
+ // attacker-controlled credentials into the Proxy-Authorization header or
+ // redirect proxying to an attacker-controlled host.
+ const isProxyURL = proxy instanceof URL;
+ const readProxyField = key => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : undefined;
+ const proxyUsername = readProxyField('username');
+ const proxyPassword = readProxyField('password');
+ let proxyAuth = utils$1.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined;
- if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
-
- const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
- const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
- const filesLimit = getLimit(limits, 'files', Infinity)
- const fieldsLimit = getLimit(limits, 'fields', Infinity)
- const partsLimit = getLimit(limits, 'parts', Infinity)
- const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
- const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
-
- let nfiles = 0
- let nfields = 0
- let nends = 0
- let curFile
- let curField
- let finished = false
-
- this._needDrain = false
- this._pause = false
- this._cb = undefined
- this._nparts = 0
- this._boy = boy
-
- const parserCfg = {
- boundary,
- maxHeaderPairs: headerPairsLimit,
- maxHeaderSize: headerSizeLimit,
- partHwm: fileOpts.highWaterMark,
- highWaterMark: cfg.highWaterMark
- }
-
- this.parser = new Dicer(parserCfg)
- this.parser.on('drain', function () {
- self._needDrain = false
- if (self._cb && !self._pause) {
- const cb = self._cb
- self._cb = undefined
- cb()
+ // Basic proxy authorization
+ if (proxyUsername) {
+ proxyAuth = (proxyUsername || '') + ':' + (proxyPassword || '');
+ }
+ if (proxyAuth) {
+ // Support proxy auth object form. Read sub-fields via own-prop checks so a
+ // plain object inheriting from polluted Object.prototype cannot leak creds.
+ const authIsObject = typeof proxyAuth === 'object';
+ const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined;
+ const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined;
+ const validProxyAuth = Boolean(authUsername || authPassword);
+ if (validProxyAuth) {
+ proxyAuth = (authUsername || '') + ':' + (authPassword || '');
+ } else if (authIsObject) {
+ throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, {
+ proxy
+ });
+ }
}
- }).on('part', function onPart (part) {
- if (++self._nparts > partsLimit) {
- self.parser.removeListener('part', onPart)
- self.parser.on('part', skipPart)
- boy.hitPartsLimit = true
- boy.emit('partsLimit')
- return skipPart(part)
- }
-
- // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
- // us emit 'end' early since we know the part has ended if we are already
- // seeing the next part
- if (curField) {
- const field = curField
- field.emit('end')
- field.removeAllListeners('end')
- }
-
- part.on('header', function (header) {
- let contype
- let fieldname
- let parsed
- let charset
- let encoding
- let filename
- let nsize = 0
-
- if (header['content-type']) {
- parsed = parseParams(header['content-type'][0])
- if (parsed[0]) {
- contype = parsed[0].toLowerCase()
- for (i = 0, len = parsed.length; i < len; ++i) {
- if (RE_CHARSET.test(parsed[i][0])) {
- charset = parsed[i][1].toLowerCase()
- break
- }
- }
+ const targetIsHttps = isHttps.test(options.protocol);
+ if (targetIsHttps) {
+ // CONNECT-tunneling path for HTTPS targets. Preserves end-to-end TLS to
+ // the origin so the proxy cannot inspect the URL, headers, or body — the
+ // behavior already promised by THREATMODEL.md (T-R9). HttpsProxyAgent
+ // sends Proxy-Authorization on the CONNECT request only, never on the
+ // wrapped TLS request, which is why we don't stamp it onto
+ // options.headers here. If the user already supplied an HttpsProxyAgent,
+ // they own tunneling end-to-end and we leave them alone; otherwise we
+ // install our own tunneling agent and forward their TLS options (if any)
+ // so a custom httpsAgent for cert pinning / rejectUnauthorized still
+ // applies to the origin TLS upgrade.
+ if (!(configHttpsAgent instanceof HttpsProxyAgent)) {
+ const proxyHost = readProxyField('hostname') || readProxyField('host');
+ const proxyPort = readProxyField('port');
+ const rawProxyProtocol = readProxyField('protocol');
+ const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(':') ? rawProxyProtocol : `${rawProxyProtocol}:` : 'http:';
+ // Bracket IPv6 literals for URL parsing; URL.hostname strips the
+ // brackets again on read so the agent receives the raw form.
+ const proxyHostForURL = proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[') ? `[${proxyHost}]` : proxyHost;
+ const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}`);
+ const agentOptions = {
+ protocol: proxyURL.protocol,
+ hostname: proxyURL.hostname.replace(/^\[|\]$/g, ''),
+ port: proxyURL.port,
+ auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined
+ };
+ if (proxyURL.protocol === 'https:') {
+ agentOptions.ALPNProtocols = ['http/1.1'];
+ }
+ const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent);
+ // Set both: `options.agent` is consumed by the native https.request path
+ // (maxRedirects === 0); `options.agents.https` is consumed by
+ // follow-redirects, which ignores `options.agent` when `options.agents`
+ // is present.
+ options.agent = tunnelingAgent;
+ if (options.agents) {
+ options.agents.https = tunnelingAgent;
}
}
-
- if (contype === undefined) { contype = 'text/plain' }
- if (charset === undefined) { charset = defCharset }
-
- if (header['content-disposition']) {
- parsed = parseParams(header['content-disposition'][0])
- if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
- for (i = 0, len = parsed.length; i < len; ++i) {
- if (RE_NAME.test(parsed[i][0])) {
- fieldname = parsed[i][1]
- } else if (RE_FILENAME.test(parsed[i][0])) {
- filename = parsed[i][1]
- if (!preservePath) { filename = basename(filename) }
- }
+ } else {
+ // Forward-proxy mode for plaintext HTTP targets. The request line carries
+ // the absolute URL and the proxy sees everything — acceptable for plain
+ // HTTP since the wire was already plaintext.
+ if (proxyAuth) {
+ const base64 = Buffer.from(proxyAuth, 'utf8').toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+
+ // Preserve a user-supplied Host header (case-insensitive) so callers can override
+ // the value forwarded to the proxy; otherwise default to the request URL's host.
+ let hasUserHostHeader = false;
+ for (const name of Object.keys(options.headers)) {
+ if (name.toLowerCase() === 'host') {
+ hasUserHostHeader = true;
+ break;
}
- } else { return skipPart(part) }
+ }
+ if (!hasUserHostHeader) {
+ options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
+ }
+ const proxyHost = readProxyField('hostname') || readProxyField('host');
+ options.hostname = proxyHost;
+ // Replace 'host' since options is not a URL object
+ options.host = proxyHost;
+ options.port = readProxyField('port');
+ options.path = location;
+ const proxyProtocol = readProxyField('protocol');
+ if (proxyProtocol) {
+ options.protocol = proxyProtocol.includes(':') ? proxyProtocol : `${proxyProtocol}:`;
+ }
+ }
+ }
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
+ // Configure proxy for redirected request, passing the original config proxy to apply
+ // the exact same logic as if the redirected request was performed by axios directly.
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
+ };
+}
+const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
- if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
+// temporary hotfix
- let onData,
- onEnd
+const wrapAsync = asyncExecutor => {
+ return new Promise((resolve, reject) => {
+ let onDone;
+ let isDone;
+ const done = (value, isRejected) => {
+ if (isDone) return;
+ isDone = true;
+ onDone && onDone(value, isRejected);
+ };
+ const _resolve = value => {
+ done(value);
+ resolve(value);
+ };
+ const _reject = reason => {
+ done(reason, true);
+ reject(reason);
+ };
+ asyncExecutor(_resolve, _reject, onDoneHandler => onDone = onDoneHandler).catch(_reject);
+ });
+};
+const resolveFamily = ({
+ address,
+ family
+}) => {
+ if (!utils$1.isString(address)) {
+ throw TypeError('address must be a string');
+ }
+ return {
+ address,
+ family: family || (address.indexOf('.') < 0 ? 6 : 4)
+ };
+};
+const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
+ address,
+ family
+});
+const http2Transport = {
+ request(options, cb) {
+ const authority = options.protocol + '//' + options.hostname + ':' + (options.port || (options.protocol === 'https:' ? 443 : 80));
+ const {
+ http2Options,
+ headers
+ } = options;
+ const session = http2Sessions.getSession(authority, http2Options);
+ const {
+ HTTP2_HEADER_SCHEME,
+ HTTP2_HEADER_METHOD,
+ HTTP2_HEADER_PATH,
+ HTTP2_HEADER_STATUS
+ } = http2.constants;
+ const http2Headers = {
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
+ [HTTP2_HEADER_METHOD]: options.method,
+ [HTTP2_HEADER_PATH]: options.path
+ };
+ utils$1.forEach(headers, (header, name) => {
+ name.charAt(0) !== ':' && (http2Headers[name] = header);
+ });
+ const req = session.request(http2Headers);
+ req.once('response', responseHeaders => {
+ const response = req; //duplex
+
+ responseHeaders = Object.assign({}, responseHeaders);
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
+ delete responseHeaders[HTTP2_HEADER_STATUS];
+ response.headers = responseHeaders;
+ response.statusCode = +status;
+ cb(response);
+ });
+ return req;
+ }
+};
- if (isPartAFile(fieldname, contype, filename)) {
- // file/binary field
- if (nfiles === filesLimit) {
- if (!boy.hitFilesLimit) {
- boy.hitFilesLimit = true
- boy.emit('filesLimit')
+/*eslint consistent-return:0*/
+var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
+ // Read config pollution-safely: own properties and members inherited from
+ // a non-Object.prototype source (e.g. an Object.create(defaults) template)
+ // are honored, but values injected onto a polluted Object.prototype are
+ // ignored. All behavior-affecting reads in this adapter go through own()
+ // so the protection boundary stays consistent.
+ const own = key => utils$1.getSafeProp(config, key);
+ const transitional = own('transitional') || transitionalDefaults;
+ let data = own('data');
+ let lookup = own('lookup');
+ let family = own('family');
+ let httpVersion = own('httpVersion');
+ if (httpVersion === undefined) httpVersion = 1;
+ let http2Options = own('http2Options');
+ const httpAgent = own('httpAgent');
+ const httpsAgent = own('httpsAgent');
+ const configProxy = own('proxy');
+ const responseType = own('responseType');
+ const responseEncoding = own('responseEncoding');
+ const socketPath = own('socketPath');
+ const method = own('method').toUpperCase();
+ const maxRedirects = own('maxRedirects');
+ const maxBodyLength = own('maxBodyLength');
+ const maxContentLength = own('maxContentLength');
+ const decompress = own('decompress');
+ let isDone;
+ let rejected = false;
+ let req;
+ let connectPhaseTimer;
+ httpVersion = +httpVersion;
+ if (Number.isNaN(httpVersion)) {
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
+ }
+ if (httpVersion !== 1 && httpVersion !== 2) {
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
+ }
+ const isHttp2 = httpVersion === 2;
+ if (lookup) {
+ const _lookup = callbackify(lookup, value => utils$1.isArray(value) ? value : [value]);
+ // hotfix to support opt.all option which is required for node 20.x
+ lookup = (hostname, opt, cb) => {
+ _lookup(hostname, opt, (err, arg0, arg1) => {
+ if (err) {
+ return cb(err);
}
- return skipPart(part)
+ const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
+ });
+ };
+ }
+ const abortEmitter = new events.EventEmitter();
+ function abort(reason) {
+ try {
+ abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
+ } catch (err) {
+ // ignore emit errors
+ }
+ }
+ function clearConnectPhaseTimer() {
+ if (connectPhaseTimer) {
+ clearTimeout(connectPhaseTimer);
+ connectPhaseTimer = null;
+ }
+ }
+ function createTimeoutError() {
+ const configTimeout = own('timeout');
+ let timeoutErrorMessage = configTimeout ? 'timeout of ' + configTimeout + 'ms exceeded' : 'timeout exceeded';
+ const configTimeoutErrorMessage = own('timeoutErrorMessage');
+ if (configTimeoutErrorMessage) {
+ timeoutErrorMessage = configTimeoutErrorMessage;
+ }
+ return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
+ }
+ abortEmitter.once('abort', reject);
+ const onFinished = () => {
+ clearConnectPhaseTimer();
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(abort);
+ }
+ if (config.signal) {
+ config.signal.removeEventListener('abort', abort);
+ }
+ abortEmitter.removeAllListeners();
+ };
+ if (config.cancelToken || config.signal) {
+ config.cancelToken && config.cancelToken.subscribe(abort);
+ if (config.signal) {
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+ }
+ }
+ onDone((response, isRejected) => {
+ isDone = true;
+ clearConnectPhaseTimer();
+ if (isRejected) {
+ rejected = true;
+ onFinished();
+ return;
+ }
+ const {
+ data
+ } = response;
+ if (data instanceof stream.Readable || data instanceof stream.Duplex) {
+ const offListeners = stream.finished(data, () => {
+ offListeners();
+ onFinished();
+ });
+ } else {
+ onFinished();
+ }
+ });
+
+ // Parse url
+ const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);
+ // Unix-socket requests (own socketPath) commonly pass a path-only url
+ // like '/foo'; supply a synthetic base so new URL() can still parse it.
+ // Use the own-property value (not config.socketPath) so a polluted
+ // prototype cannot influence URL base selection.
+ const urlBase = socketPath ? 'http://localhost' : platform.hasBrowserEnv ? platform.origin : undefined;
+ const parsed = new URL(fullPath, urlBase);
+ const protocol = parsed.protocol || supportedProtocols[0];
+ if (protocol === 'data:') {
+ // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
+ if (maxContentLength > -1) {
+ // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed.
+ const dataUrl = String(own('url') || fullPath || '');
+ const estimated = estimateDataURLDecodedBytes(dataUrl);
+ if (estimated > maxContentLength) {
+ return reject(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config));
+ }
+ }
+ let convertedData;
+ if (method !== 'GET') {
+ return settle(resolve, reject, {
+ status: 405,
+ statusText: 'method not allowed',
+ headers: {},
+ config
+ });
+ }
+ try {
+ convertedData = fromDataURI(own('url'), responseType === 'blob', {
+ Blob: config.env && config.env.Blob
+ });
+ } catch (err) {
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
+ }
+ if (responseType === 'text') {
+ convertedData = convertedData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ convertedData = utils$1.stripBOM(convertedData);
}
+ } else if (responseType === 'stream') {
+ convertedData = stream.Readable.from(convertedData);
+ }
+ return settle(resolve, reject, {
+ data: convertedData,
+ status: 200,
+ statusText: 'OK',
+ headers: new AxiosHeaders(),
+ config
+ });
+ }
+ if (supportedProtocols.indexOf(protocol) === -1) {
+ return reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config));
+ }
+ const headers = AxiosHeaders.from(config.headers).normalize();
- ++nfiles
+ // Set User-Agent (required by some servers)
+ // See https://github.com/axios/axios/issues/69
+ // User-Agent is specified; handle case where no UA header is desired
+ // Only set header if it hasn't been set in config
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+ const {
+ onUploadProgress,
+ onDownloadProgress
+ } = config;
+ const maxRate = config.maxRate;
+ let maxUploadRate = undefined;
+ let maxDownloadRate = undefined;
- if (boy.listenerCount('file') === 0) {
- self.parser._ignore()
- return
- }
+ // support for spec compliant FormData objects
+ if (utils$1.isSpecCompliantForm(data)) {
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
+ data = formDataToStream(data, formHeaders => {
+ headers.set(formHeaders);
+ }, {
+ tag: `axios-${VERSION}-boundary`,
+ boundary: userBoundary && userBoundary[1] || undefined
+ });
+ // support for https://www.npmjs.com/package/form-data api
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
+ setFormDataHeaders$1(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+ if (!headers.hasContentLength()) {
+ try {
+ const knownLength = await util.promisify(data.getLength).call(data);
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
+ /*eslint no-empty:0*/
+ } catch (e) {}
+ }
+ } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
+ data.size && headers.setContentType(data.type || 'application/octet-stream');
+ headers.setContentLength(data.size || 0);
+ data = stream.Readable.from(readBlob(data));
+ } else if (data && !utils$1.isStream(data)) {
+ if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils$1.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(new AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config));
+ }
- ++nends
- const file = new FileStream(fileOpts)
- curFile = file
- file.on('end', function () {
- --nends
- self._pause = false
- checkFinished()
- if (self._cb && !self._needDrain) {
- const cb = self._cb
- self._cb = undefined
- cb()
- }
- })
- file._read = function (n) {
- if (!self._pause) { return }
- self._pause = false
- if (self._cb && !self._needDrain) {
- const cb = self._cb
- self._cb = undefined
- cb()
- }
- }
- boy.emit('file', fieldname, file, filename, encoding, contype)
+ // Add Content-Length header if data exists
+ headers.setContentLength(data.length, false);
+ if (maxBodyLength > -1 && data.length > maxBodyLength) {
+ return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config));
+ }
+ }
+ const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
+ if (utils$1.isArray(maxRate)) {
+ maxUploadRate = maxRate[0];
+ maxDownloadRate = maxRate[1];
+ } else {
+ maxUploadRate = maxDownloadRate = maxRate;
+ }
+ if (data && (onUploadProgress || maxUploadRate)) {
+ if (!utils$1.isStream(data)) {
+ data = stream.Readable.from(data, {
+ objectMode: false
+ });
+ }
+ data = stream.pipeline([data, new AxiosTransformStream({
+ maxRate: utils$1.toFiniteNumber(maxUploadRate)
+ })], utils$1.noop);
+ onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
+ }
- onData = function (data) {
- if ((nsize += data.length) > fileSizeLimit) {
- const extralen = fileSizeLimit - nsize + data.length
- if (extralen > 0) { file.push(data.slice(0, extralen)) }
- file.truncated = true
- file.bytesRead = fileSizeLimit
- part.removeAllListeners('data')
- file.emit('limit')
- return
- } else if (!file.push(data)) { self._pause = true }
+ // HTTP basic authentication
+ let auth = undefined;
+ const configAuth = own('auth');
+ if (configAuth) {
+ const username = utils$1.getSafeProp(configAuth, 'username') || '';
+ const password = utils$1.getSafeProp(configAuth, 'password') || '';
+ auth = username + ':' + password;
+ }
+ if (!auth && (parsed.username || parsed.password)) {
+ const urlUsername = decodeURIComponentSafe$1(parsed.username);
+ const urlPassword = decodeURIComponentSafe$1(parsed.password);
+ auth = urlUsername + ':' + urlPassword;
+ }
+ auth && headers.delete('authorization');
+ let path$1;
+ try {
+ path$1 = buildURL(parsed.pathname + parsed.search, own('params'), own('paramsSerializer')).replace(/^\?/, '');
+ } catch (err) {
+ return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {
+ url: own('url'),
+ exists: true
+ }));
+ }
+ headers.set('Accept-Encoding', utils$1.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
- file.bytesRead = nsize
- }
+ // Null-prototype to block prototype pollution gadgets on properties read
+ // directly by Node's http.request (e.g. insecureHTTPParser, lookup).
+ const options = Object.assign(Object.create(null), {
+ path: path$1,
+ method: method,
+ headers: toByteStringHeaderObject(headers),
+ agents: {
+ http: httpAgent,
+ https: httpsAgent
+ },
+ auth,
+ protocol,
+ family,
+ beforeRedirect: dispatchBeforeRedirect,
+ beforeRedirects: Object.create(null),
+ http2Options
+ });
- onEnd = function () {
- curFile = undefined
- file.push(null)
+ // cacheable-lookup integration hotfix
+ !utils$1.isUndefined(lookup) && (options.lookup = lookup);
+ if (socketPath) {
+ if (typeof socketPath !== 'string') {
+ return reject(new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ const allowedSocketPaths = own('allowedSocketPaths');
+ if (allowedSocketPaths != null) {
+ const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths];
+ const resolvedSocket = path.resolve(socketPath);
+ const isAllowed = allowed.some(entry => typeof entry === 'string' && path.resolve(entry) === resolvedSocket);
+ if (!isAllowed) {
+ return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
}
+ }
+ options.socketPath = socketPath;
+ } else {
+ options.hostname = parsed.hostname.startsWith('[') ? parsed.hostname.slice(1, -1) : parsed.hostname;
+ options.port = parsed.port;
+ setProxy(options, configProxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent, httpAgent);
+ }
+ let transport;
+ let isNativeTransport = false;
+ // True only for the follow-redirects transport, which applies
+ // options.maxBodyLength itself. Every other transport (http2, native
+ // http/https, a user-supplied custom transport) needs the explicit
+ // byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
+ let transportEnforcesMaxBodyLength = false;
+ const isHttpsRequest = isHttps.test(options.protocol);
+ // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
+ // HTTPS target.
+ if (options.agent == null) {
+ options.agent = isHttpsRequest ? httpsAgent : httpAgent;
+ }
+ if (isHttp2) {
+ transport = http2Transport;
+ } else {
+ const configTransport = own('transport');
+ if (configTransport) {
+ transport = configTransport;
+ } else if (maxRedirects === 0) {
+ transport = isHttpsRequest ? https : http;
+ isNativeTransport = true;
} else {
- // non-file field
- if (nfields === fieldsLimit) {
- if (!boy.hitFieldsLimit) {
- boy.hitFieldsLimit = true
- boy.emit('fieldsLimit')
- }
- return skipPart(part)
+ transportEnforcesMaxBodyLength = true;
+ options.sensitiveHeaders = [];
+ if (maxRedirects) {
+ options.maxRedirects = maxRedirects;
}
-
- ++nfields
- ++nends
- let buffer = ''
- let truncated = false
- curField = part
-
- onData = function (data) {
- if ((nsize += data.length) > fieldSizeLimit) {
- const extralen = (fieldSizeLimit - (nsize - data.length))
- buffer += data.toString('binary', 0, extralen)
- truncated = true
- part.removeAllListeners('data')
- } else { buffer += data.toString('binary') }
+ const configBeforeRedirect = own('beforeRedirect');
+ if (configBeforeRedirect) {
+ options.beforeRedirects.config = configBeforeRedirect;
}
-
- onEnd = function () {
- curField = undefined
- if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
- boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
- --nends
- checkFinished()
+ if (auth) {
+ // Restore HTTP Basic credentials on same-origin redirects only.
+ // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929);
+ // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md
+ // and is preserved by deliberately not restoring on origin change.
+ const requestOrigin = parsed.origin;
+ const authToRestore = auth;
+ options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
+ try {
+ if (new URL(redirectOptions.href).origin === requestOrigin) {
+ redirectOptions.auth = authToRestore;
+ }
+ } catch (e) {
+ // ignore malformed URL: leaving auth stripped is fail-safe
+ }
+ };
+ }
+ const sensitiveHeaders = own('sensitiveHeaders');
+ if (sensitiveHeaders != null) {
+ if (!utils$1.isArray(sensitiveHeaders)) {
+ return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ const sensitiveSet = new Set();
+ for (const header of sensitiveHeaders) {
+ if (!utils$1.isString(header)) {
+ return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ sensitiveSet.add(header.toLowerCase());
+ }
+ if (sensitiveSet.size) {
+ options.sensitiveHeaders = Array.from(sensitiveSet);
+ options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
+ if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
+ stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
+ }
+ };
+ }
}
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
}
+ }
- /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
- broken. Streams2/streams3 is a huge black box of confusion, but
- somehow overriding the sync state seems to fix things again (and still
- seems to work for previous node versions).
- */
- part._readableState.sync = false
-
- part.on('data', onData)
- part.on('end', onEnd)
- }).on('error', function (err) {
- if (curFile) { curFile.emit('error', err) }
- })
- }).on('error', function (err) {
- boy.emit('error', err)
- }).on('finish', function () {
- finished = true
- checkFinished()
- })
-}
-
-Multipart.prototype.write = function (chunk, cb) {
- const r = this.parser.write(chunk)
- if (r && !this._pause) {
- cb()
- } else {
- this._needDrain = !r
- this._cb = cb
- }
-}
-
-Multipart.prototype.end = function () {
- const self = this
-
- if (self.parser.writable) {
- self.parser.end()
- } else if (!self._boy._done) {
- process.nextTick(function () {
- self._boy._done = true
- self._boy.emit('finish')
- })
- }
-}
-
-function skipPart (part) {
- part.resume()
-}
+ // Set an explicit maxBodyLength option for transports that inspect it.
+ // When maxBodyLength is -1 (default/unlimited), use Infinity so
+ // follow-redirects does not fall back to its own 10MB default.
+ if (maxBodyLength > -1) {
+ options.maxBodyLength = maxBodyLength;
+ } else {
+ options.maxBodyLength = Infinity;
+ }
-function FileStream (opts) {
- Readable.call(this, opts)
+ // Always set an explicit own value so a polluted
+ // Object.prototype.insecureHTTPParser cannot enable the lenient parser
+ // through Node's internal options copy
+ options.insecureHTTPParser = Boolean(own('insecureHTTPParser'));
- this.bytesRead = 0
+ // Create the request
+ req = transport.request(options, function handleResponse(res) {
+ clearConnectPhaseTimer();
+ if (req.destroyed) return;
+ const streams = [res];
+ const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
+ if (onDownloadProgress || maxDownloadRate) {
+ const transformStream = new AxiosTransformStream({
+ maxRate: utils$1.toFiniteNumber(maxDownloadRate)
+ });
+ onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
+ streams.push(transformStream);
+ }
- this.truncated = false
-}
+ // decompress the response body transparently if required
+ let responseStream = res;
-inherits(FileStream, Readable)
+ // return the last request in case of redirects
+ const lastRequest = res.req || req;
-FileStream.prototype._read = function (n) {}
+ // if decompress disabled we should not decompress
+ if (decompress !== false && res.headers['content-encoding']) {
+ // if no content, but headers still say that it is encoded,
+ // remove the header not confuse downstream operations
+ if (method === 'HEAD' || res.statusCode === 204) {
+ delete res.headers['content-encoding'];
+ }
+ switch ((res.headers['content-encoding'] || '').toLowerCase()) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'x-gzip':
+ case 'compress':
+ case 'x-compress':
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'deflate':
+ streams.push(new ZlibHeaderTransformStream());
-module.exports = Multipart
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'br':
+ if (isBrotliSupported) {
+ streams.push(zlib.createBrotliDecompress(brotliOptions));
+ delete res.headers['content-encoding'];
+ }
+ break;
+ case 'zstd':
+ if (isZstdSupported) {
+ streams.push(zlib.createZstdDecompress(zstdOptions));
+ delete res.headers['content-encoding'];
+ }
+ break;
+ }
+ }
+ responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
+ const response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: new AxiosHeaders(res.headers),
+ config,
+ request: lastRequest
+ };
+ if (responseType === 'stream') {
+ // Enforce maxContentLength on streamed responses; previously this
+ // was applied only to buffered responses.
+ if (maxContentLength > -1) {
+ const limit = maxContentLength;
+ const source = responseStream;
+ async function* enforceMaxContentLength() {
+ let totalResponseBytes = 0;
+ for await (const chunk of source) {
+ totalResponseBytes += chunk.length;
+ if (totalResponseBytes > limit) {
+ throw new AxiosError('maxContentLength size of ' + limit + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
+ }
+ yield chunk;
+ }
+ }
+ responseStream = stream.Readable.from(enforceMaxContentLength(), {
+ objectMode: false
+ });
+ }
+ response.data = responseStream;
+ settle(resolve, reject, response);
+ } else {
+ const responseBuffer = [];
+ let totalResponseBytes = 0;
+ responseStream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
+ totalResponseBytes += chunk.length;
-/***/ }),
+ // make sure the content length is not over the maxContentLength if specified
+ if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
+ // stream.destroy() emit aborted event before calling reject() on Node.js v16
+ rejected = true;
+ responseStream.destroy();
+ abort(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
+ }
+ });
+ responseStream.on('aborted', function handlerStreamAborted() {
+ if (rejected) {
+ return;
+ }
+ const err = new AxiosError('stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response);
+ responseStream.destroy(err);
+ reject(err);
+ });
+ responseStream.on('error', function handleStreamError(err) {
+ if (rejected) return;
+ reject(AxiosError.from(err, null, config, lastRequest, response));
+ });
+ responseStream.on('end', function handleStreamEnd() {
+ try {
+ let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+ if (responseType !== 'arraybuffer') {
+ responseData = responseData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ responseData = utils$1.stripBOM(responseData);
+ }
+ }
+ response.data = responseData;
+ } catch (err) {
+ return reject(AxiosError.from(err, null, config, response.request, response));
+ }
+ settle(resolve, reject, response);
+ });
+ }
+ abortEmitter.once('abort', err => {
+ if (!responseStream.destroyed) {
+ responseStream.emit('error', err);
+ responseStream.destroy();
+ }
+ });
+ });
+ abortEmitter.once('abort', err => {
+ if (req.close) {
+ req.close();
+ } else {
+ req.destroy(err);
+ }
+ });
-/***/ 8306:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ reject(AxiosError.from(err, null, config, req));
+ });
-"use strict";
+ // set tcp keep alive to prevent drop connection by peer
+ // Track every socket bound to this outer RedirectableRequest so a single
+ // 'close' listener can release ownership on all of them. follow-redirects
+ // re-emits the 'socket' event for each hop's native request onto the same
+ // outer request, so attaching per-request listeners inside this handler
+ // would accumulate across hops and trigger MaxListenersExceededWarning at
+ // >= 11 redirects. Clearing only the last-bound socket would leave stale
+ // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive
+ // pool, causing an idle-pool 'error' to be attributed to a closed req.
+ const boundSockets = new Set();
+ req.on('socket', function handleRequestSocket(socket) {
+ // default interval of sending ack packet is 1 minute
+ // proxy agents (e.g. agent-base) may return a generic Duplex stream
+ // that doesn't have setKeepAlive, so guard before calling
+ if (typeof socket.setKeepAlive === 'function') {
+ socket.setKeepAlive(true, 1000 * 60);
+ }
+
+ // Install a single 'error' listener per socket (not per request) to avoid
+ // accumulating listeners on pooled keep-alive sockets that get reassigned
+ // to new requests before the previous request's 'close' fires (issue #10780).
+ // The listener is bound to the socket's currently-active request via a
+ // symbol, which is swapped as the socket is reassigned.
+ if (!socket[kAxiosSocketListener]) {
+ socket.on('error', function handleSocketError(err) {
+ const current = socket[kAxiosCurrentReq];
+ if (current && !current.destroyed) {
+ current.destroy(err);
+ }
+ });
+ socket[kAxiosSocketListener] = true;
+ }
+ socket[kAxiosCurrentReq] = req;
+ boundSockets.add(socket);
+ });
+ req.once('close', function clearCurrentReq() {
+ clearConnectPhaseTimer();
+ for (const socket of boundSockets) {
+ if (socket[kAxiosCurrentReq] === req) {
+ socket[kAxiosCurrentReq] = null;
+ }
+ }
+ boundSockets.clear();
+ });
+ // Handle request timeout
+ if (own('timeout')) {
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+ const timeout = parseInt(own('timeout'), 10);
+ if (Number.isNaN(timeout)) {
+ abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
+ return;
+ }
+ const handleTimeout = function handleTimeout() {
+ if (isDone) return;
+ abort(createTimeoutError());
+ };
+ if (isNativeTransport && timeout > 0) {
+ // Native ClientRequest#setTimeout starts from the socket lifecycle and
+ // may not fire while TCP connect is still pending. Mirror the
+ // follow-redirects wall-clock timer for the maxRedirects === 0 path.
+ connectPhaseTimer = setTimeout(handleTimeout, timeout);
+ }
-const Decoder = __nccwpck_require__(7100)
-const decodeText = __nccwpck_require__(4619)
-const getLimit = __nccwpck_require__(1467)
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devouring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(timeout, handleTimeout);
+ } else {
+ // explicitly reset the socket timeout value for a possible `keep-alive` request
+ req.setTimeout(0);
+ }
-const RE_CHARSET = /^charset$/i
+ // Send the request
+ if (utils$1.isStream(data)) {
+ let ended = false;
+ let errored = false;
+ data.on('end', () => {
+ ended = true;
+ });
+ data.once('error', err => {
+ errored = true;
+ req.destroy(err);
+ });
+ data.on('close', () => {
+ if (!ended && !errored) {
+ abort(new CanceledError('Request stream has been aborted', config, req));
+ }
+ });
-UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
-function UrlEncoded (boy, cfg) {
- const limits = cfg.limits
- const parsedConType = cfg.parsedConType
- this.boy = boy
+ // Enforce maxBodyLength for streamed uploads on every transport that
+ // does not apply options.maxBodyLength itself (native http/https, http2,
+ // and user-supplied custom transports). The follow-redirects transport
+ // enforces it on the redirected HTTP/1 path.
+ let uploadStream = data;
+ if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
+ const limit = maxBodyLength;
+ let bytesSent = 0;
+ uploadStream = stream.pipeline([data, new stream.Transform({
+ transform(chunk, _enc, cb) {
+ bytesSent += chunk.length;
+ if (bytesSent > limit) {
+ return cb(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, req));
+ }
+ cb(null, chunk);
+ }
+ })], utils$1.noop);
+ uploadStream.on('error', err => {
+ if (!req.destroyed) req.destroy(err);
+ });
+ }
+ uploadStream.pipe(req);
+ } else {
+ data && req.write(data);
+ req.end();
+ }
+ });
+};
- this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
- this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
- this.fieldsLimit = getLimit(limits, 'fields', Infinity)
+var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => url => {
+ url = new URL(url, platform.origin);
+ return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
+})(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true;
- let charset
- for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
- if (Array.isArray(parsedConType[i]) &&
- RE_CHARSET.test(parsedConType[i][0])) {
- charset = parsedConType[i][1].toLowerCase()
- break
+var cookies = platform.hasStandardBrowserEnv ?
+// Standard browser envs support document.cookie
+{
+ write(name, value, expires, path, domain, secure, sameSite) {
+ if (typeof document === 'undefined') return;
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
+ if (utils$1.isNumber(expires)) {
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
+ }
+ if (utils$1.isString(path)) {
+ cookie.push(`path=${path}`);
+ }
+ if (utils$1.isString(domain)) {
+ cookie.push(`domain=${domain}`);
+ }
+ if (secure === true) {
+ cookie.push('secure');
+ }
+ if (utils$1.isString(sameSite)) {
+ cookie.push(`SameSite=${sameSite}`);
+ }
+ document.cookie = cookie.join('; ');
+ },
+ read(name) {
+ if (typeof document === 'undefined') return null;
+ // Match name=value by splitting on the semicolon separator instead of building a
+ // RegExp from `name` — interpolating an unescaped string into a RegExp would let
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
+ // "; ", so ignore optional whitespace before each cookie name.
+ const cookies = document.cookie.split(';');
+ for (let i = 0; i < cookies.length; i++) {
+ const cookie = cookies[i].replace(/^\s+/, '');
+ const eq = cookie.indexOf('=');
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
+ try {
+ return decodeURIComponent(cookie.slice(eq + 1));
+ } catch (e) {
+ return cookie.slice(eq + 1);
+ }
+ }
}
+ return null;
+ },
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000, '/');
}
+} :
+// Non-standard browser env (web workers, react-native) lack needed support.
+{
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+};
- if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
+const headersToObject = thing => thing instanceof AxiosHeaders ? {
+ ...thing
+} : thing;
- this.decoder = new Decoder()
- this.charset = charset
- this._fields = 0
- this._state = 'key'
- this._checkingBytes = true
- this._bytesKey = 0
- this._bytesVal = 0
- this._key = ''
- this._val = ''
- this._keyTrunc = false
- this._valTrunc = false
- this._hitLimit = false
-}
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config1 = config1 || {};
+ config2 = config2 || {};
-UrlEncoded.prototype.write = function (data, cb) {
- if (this._fields === this.fieldsLimit) {
- if (!this.boy.hitFieldsLimit) {
- this.boy.hitFieldsLimit = true
- this.boy.emit('fieldsLimit')
+ // Use a null-prototype object so that downstream reads such as `config.auth`
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
+ // ergonomics for user code that relies on it.
+ const config = Object.create(null);
+ Object.defineProperty(config, 'hasOwnProperty', {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: Object.prototype.hasOwnProperty,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ });
+ function getMergedValue(target, source, prop, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({
+ caseless
+ }, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
+ }
+ function mergeDeepProperties(a, b, prop, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, prop, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, prop, caseless);
}
- return cb()
}
- let idxeq; let idxamp; let i; let p = 0; const len = data.length
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ }
+ }
- while (p < len) {
- if (this._state === 'key') {
- idxeq = idxamp = undefined
- for (i = p; i < len; ++i) {
- if (!this._checkingBytes) { ++p }
- if (data[i] === 0x3D/* = */) {
- idxeq = i
- break
- } else if (data[i] === 0x26/* & */) {
- idxamp = i
- break
- }
- if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
- this._hitLimit = true
- break
- } else if (this._checkingBytes) { ++this._bytesKey }
- }
-
- if (idxeq !== undefined) {
- // key with assignment
- if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
- this._state = 'val'
-
- this._hitLimit = false
- this._checkingBytes = true
- this._val = ''
- this._bytesVal = 0
- this._valTrunc = false
- this.decoder.reset()
-
- p = idxeq + 1
- } else if (idxamp !== undefined) {
- // key with no assignment
- ++this._fields
- let key; const keyTrunc = this._keyTrunc
- if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
-
- this._hitLimit = false
- this._checkingBytes = true
- this._key = ''
- this._bytesKey = 0
- this._keyTrunc = false
- this.decoder.reset()
-
- if (key.length) {
- this.boy.emit('field', decodeText(key, 'binary', this.charset),
- '',
- keyTrunc,
- false)
- }
-
- p = idxamp + 1
- if (this._fields === this.fieldsLimit) { return cb() }
- } else if (this._hitLimit) {
- // we may not have hit the actual limit if there are encoded bytes...
- if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
- p = i
- if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
- // yep, we actually did hit the limit
- this._checkingBytes = false
- this._keyTrunc = true
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+ function getMergedTransitionalOption(prop) {
+ const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
+ if (!utils$1.isUndefined(transitional2)) {
+ if (utils$1.isPlainObject(transitional2)) {
+ if (utils$1.hasOwnProp(transitional2, prop)) {
+ return transitional2[prop];
}
} else {
- if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
- p = len
+ return undefined;
}
+ }
+ const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
+ if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
+ return transitional1[prop];
+ }
+ return undefined;
+ }
+
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (utils$1.hasOwnProp(config2, prop)) {
+ return getMergedValue(a, b);
+ } else if (utils$1.hasOwnProp(config1, prop)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ allowedSocketPaths: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
+ };
+ utils$1.forEach(Object.keys({
+ ...config1,
+ ...config2
+ }), function computeConfigValue(prop) {
+ if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
+ const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
+ const configValue = merge(a, b, prop);
+ utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
+ });
+ if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) {
+ if (utils$1.hasOwnProp(config1, 'validateStatus')) {
+ config.validateStatus = getMergedValue(undefined, config1.validateStatus);
} else {
- idxamp = undefined
- for (i = p; i < len; ++i) {
- if (!this._checkingBytes) { ++p }
- if (data[i] === 0x26/* & */) {
- idxamp = i
- break
- }
- if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
- this._hitLimit = true
- break
- } else if (this._checkingBytes) { ++this._bytesVal }
- }
-
- if (idxamp !== undefined) {
- ++this._fields
- if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- decodeText(this._val, 'binary', this.charset),
- this._keyTrunc,
- this._valTrunc)
- this._state = 'key'
-
- this._hitLimit = false
- this._checkingBytes = true
- this._key = ''
- this._bytesKey = 0
- this._keyTrunc = false
- this.decoder.reset()
-
- p = idxamp + 1
- if (this._fields === this.fieldsLimit) { return cb() }
- } else if (this._hitLimit) {
- // we may not have hit the actual limit if there are encoded bytes...
- if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
- p = i
- if ((this._val === '' && this.fieldSizeLimit === 0) ||
- (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
- // yep, we actually did hit the limit
- this._checkingBytes = false
- this._valTrunc = true
- }
- } else {
- if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
- p = len
- }
+ delete config.validateStatus;
}
}
- cb()
+ return config;
}
-UrlEncoded.prototype.end = function () {
- if (this.boy._done) { return }
-
- if (this._state === 'key' && this._key.length > 0) {
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- '',
- this._keyTrunc,
- false)
- } else if (this._state === 'val') {
- this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
- decodeText(this._val, 'binary', this.charset),
- this._keyTrunc,
- this._valTrunc)
+const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
+function setFormDataHeaders(headers, formHeaders, policy) {
+ if (policy !== 'content-only') {
+ headers.set(formHeaders);
+ return;
}
- this.boy._done = true
- this.boy.emit('finish')
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
+ headers.set(key, val);
+ }
+ });
}
-module.exports = UrlEncoded
-
-
-/***/ }),
-
-/***/ 7100:
-/***/ ((module) => {
+/**
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
+ *
+ * @param {string} str The string to encode
+ *
+ * @returns {string} UTF-8 bytes as a Latin-1 string
+ */
+const encodeUTF8$1 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+function resolveConfig(config) {
+ const newConfig = mergeConfig({}, config);
-"use strict";
+ // Read only own properties to prevent prototype pollution gadgets
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
+ const own = key => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
+ const data = own('data');
+ let withXSRFToken = own('withXSRFToken');
+ const xsrfHeaderName = own('xsrfHeaderName');
+ const xsrfCookieName = own('xsrfCookieName');
+ let headers = own('headers');
+ const auth = own('auth');
+ const baseURL = own('baseURL');
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
+ const url = own('url');
+ newConfig.headers = headers = AxiosHeaders.from(headers);
+ newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer'));
+ // HTTP basic authentication
+ if (auth) {
+ const username = utils$1.getSafeProp(auth, 'username') || '';
+ const password = utils$1.getSafeProp(auth, 'password') || '';
+ try {
+ headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));
+ } catch (e) {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
+ }
+ }
+ if (utils$1.isFormData(data)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
+ headers.setContentType(undefined); // browser/web worker/RN handles it
+ } else if (utils$1.isFunction(data.getHeaders)) {
+ // Node.js FormData (like form-data package)
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+ }
+ }
-const RE_PLUS = /\+/g
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
-const HEX = [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-]
+ if (platform.hasStandardBrowserEnv) {
+ if (utils$1.isFunction(withXSRFToken)) {
+ withXSRFToken = withXSRFToken(newConfig);
+ }
-function Decoder () {
- this.buffer = undefined
-}
-Decoder.prototype.write = function (str) {
- // Replace '+' with ' ' before decoding
- str = str.replace(RE_PLUS, ' ')
- let res = ''
- let i = 0; let p = 0; const len = str.length
- for (; i < len; ++i) {
- if (this.buffer !== undefined) {
- if (!HEX[str.charCodeAt(i)]) {
- res += '%' + this.buffer
- this.buffer = undefined
- --i // retry character
- } else {
- this.buffer += str[i]
- ++p
- if (this.buffer.length === 2) {
- res += String.fromCharCode(parseInt(this.buffer, 16))
- this.buffer = undefined
- }
- }
- } else if (str[i] === '%') {
- if (i > p) {
- res += str.substring(p, i)
- p = i
+ // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
+ // the XSRF token cross-origin.
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
+ if (shouldSendXSRF) {
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
+ if (xsrfValue) {
+ headers.set(xsrfHeaderName, xsrfValue);
}
- this.buffer = ''
- ++p
}
}
- if (p < len && this.buffer === undefined) { res += str.substring(p) }
- return res
-}
-Decoder.prototype.reset = function () {
- this.buffer = undefined
+ return newConfig;
}
-module.exports = Decoder
-
-
-/***/ }),
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+var xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ const _config = resolveConfig(config);
+ let requestData = _config.data;
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
+ let {
+ responseType,
+ onUploadProgress,
+ onDownloadProgress
+ } = _config;
+ let onCanceled;
+ let uploadThrottled, downloadThrottled;
+ let flushUpload, flushDownload;
+ function done() {
+ flushUpload && flushUpload(); // flush events
+ flushDownload && flushDownload(); // flush events
-/***/ 8647:
-/***/ ((module) => {
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
+ }
+ let request = new XMLHttpRequest();
+ request.open(_config.method.toUpperCase(), _config.url, true);
-"use strict";
+ // Set the request timeout in MS
+ request.timeout = _config.timeout;
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
+ // Clean up request
+ request = null;
+ }
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
-module.exports = function basename (path) {
- if (typeof path !== 'string') { return '' }
- for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
- switch (path.charCodeAt(i)) {
- case 0x2F: // '/'
- case 0x5C: // '\'
- path = path.slice(i + 1)
- return (path === '..' || path === '.' ? '' : path)
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith('file:'))) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
}
- }
- return (path === '..' || path === '.' ? '' : path)
-}
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+ done();
-/***/ }),
+ // Clean up request
+ request = null;
+ };
-/***/ 4619:
-/***/ (function(module) {
+ // Handle low level network errors
+ request.onerror = function handleError(event) {
+ // Browsers deliver a ProgressEvent in XHR onerror
+ // (message may be empty; when present, surface it)
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
+ const msg = event && event.message ? event.message : 'Network Error';
+ const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
+ // attach the underlying event for consumers who want details
+ err.event = event || null;
+ reject(err);
+ done();
+ request = null;
+ };
-"use strict";
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = _config.transitional || transitionalDefaults;
+ if (_config.timeoutErrorMessage) {
+ timeoutErrorMessage = _config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
+ done();
+ // Clean up request
+ request = null;
+ };
-// Node has always utf-8
-const utf8Decoder = new TextDecoder('utf-8')
-const textDecoders = new Map([
- ['utf-8', utf8Decoder],
- ['utf8', utf8Decoder]
-])
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
-function getDecoder (charset) {
- let lc
- while (true) {
- switch (charset) {
- case 'utf-8':
- case 'utf8':
- return decoders.utf8
- case 'latin1':
- case 'ascii': // TODO: Make these a separate, strict decoder?
- case 'us-ascii':
- case 'iso-8859-1':
- case 'iso8859-1':
- case 'iso88591':
- case 'iso_8859-1':
- case 'windows-1252':
- case 'iso_8859-1:1987':
- case 'cp1252':
- case 'x-cp1252':
- return decoders.latin1
- case 'utf16le':
- case 'utf-16le':
- case 'ucs2':
- case 'ucs-2':
- return decoders.utf16le
- case 'base64':
- return decoders.base64
- default:
- if (lc === undefined) {
- lc = true
- charset = charset.toLowerCase()
- continue
- }
- return decoders.other.bind(charset)
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
}
- }
-}
-const decoders = {
- utf8: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(_config.withCredentials)) {
+ request.withCredentials = !!_config.withCredentials;
}
- return data.utf8Slice(0, data.length)
- },
- latin1: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- return data
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = _config.responseType;
}
- return data.latin1Slice(0, data.length)
- },
- utf16le: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
- }
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
+ // Handle progress if needed
+ if (onDownloadProgress) {
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
+ request.addEventListener('progress', downloadThrottled);
}
- return data.ucs2Slice(0, data.length)
- },
- base64: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
+ // Not all browsers support upload events
+ if (onUploadProgress && request.upload) {
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
+ request.upload.addEventListener('progress', uploadThrottled);
+ request.upload.addEventListener('loadend', flushUpload);
}
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
+ if (_config.cancelToken || _config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ done();
+ request = null;
+ };
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
+ if (_config.signal) {
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+ const protocol = parseProtocol(_config.url);
+ if (protocol && !platform.protocols.includes(protocol)) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ done();
+ return;
}
- return data.base64Slice(0, data.length)
- },
- other: (data, sourceEncoding) => {
- if (data.length === 0) {
- return ''
+ // Send the request
+ request.send(requestData || null);
+ });
+};
+
+const composeSignals = (signals, timeout) => {
+ signals = signals ? signals.filter(Boolean) : [];
+ if (!timeout && !signals.length) {
+ return;
+ }
+ const controller = new AbortController();
+ let aborted = false;
+ const onabort = function (reason) {
+ if (!aborted) {
+ aborted = true;
+ unsubscribe();
+ const err = reason instanceof Error ? reason : this.reason;
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
}
- if (typeof data === 'string') {
- data = Buffer.from(data, sourceEncoding)
+ };
+ let timer = timeout && setTimeout(() => {
+ timer = null;
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
+ }, timeout);
+ const unsubscribe = () => {
+ if (!signals) {
+ return;
}
+ timer && clearTimeout(timer);
+ timer = null;
+ signals.forEach(signal => {
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
+ });
+ signals = null;
+ };
+ signals.forEach(signal => signal.addEventListener('abort', onabort, {
+ once: true
+ }));
+ const {
+ signal
+ } = controller;
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
+ return signal;
+};
- if (textDecoders.has(this.toString())) {
- try {
- return textDecoders.get(this).decode(data)
- } catch {}
- }
- return typeof data === 'string'
- ? data
- : data.toString()
+const streamChunk = function* (chunk, chunkSize) {
+ let len = chunk.byteLength;
+ if (len < chunkSize) {
+ yield chunk;
+ return;
}
-}
-
-function decodeText (text, sourceEncoding, destEncoding) {
- if (text) {
- return getDecoder(destEncoding)(text, sourceEncoding)
+ let pos = 0;
+ let end;
+ while (pos < len) {
+ end = pos + chunkSize;
+ yield chunk.slice(pos, end);
+ pos = end;
}
- return text
-}
-
-module.exports = decodeText
-
-
-/***/ }),
-
-/***/ 1467:
-/***/ ((module) => {
-
-"use strict";
-
-
-module.exports = function getLimit (limits, name, defaultLimit) {
- if (
- !limits ||
- limits[name] === undefined ||
- limits[name] === null
- ) { return defaultLimit }
-
- if (
- typeof limits[name] !== 'number' ||
- isNaN(limits[name])
- ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
-
- return limits[name]
-}
-
-
-/***/ }),
-
-/***/ 1854:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-/* eslint-disable object-property-newline */
-
-
-const decodeText = __nccwpck_require__(4619)
-
-const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
-
-const EncodedLookup = {
- '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
- '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
- '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
- '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
- '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
- '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
- '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
- '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
- '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
- '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
- '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
- '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
- '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
- '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
- '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
- '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
- '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
- '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
- '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
- '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
- '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
- '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
- '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
- '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
- '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
- '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
- '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
- '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
- '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
- '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
- '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
- '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
- '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
- '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
- '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
- '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
- '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
- '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
- '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
- '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
- '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
- '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
- '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
- '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
- '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
- '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
- '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
- '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
- '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
- '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
- '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
- '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
- '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
- '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
- '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
- '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
- '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
- '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
- '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
- '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
- '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
- '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
- '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
- '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
- '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
- '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
- '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
- '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
- '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
- '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
- '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
- '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
- '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
- '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
- '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
- '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
- '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
- '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
- '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
- '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
- '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
- '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
- '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
- '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
- '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
- '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
- '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
- '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
- '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
- '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
- '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
- '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
- '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
- '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
- '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
- '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
- '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
-}
-
-function encodedReplacer (match) {
- return EncodedLookup[match]
-}
-
-const STATE_KEY = 0
-const STATE_VALUE = 1
-const STATE_CHARSET = 2
-const STATE_LANG = 3
-
-function parseParams (str) {
- const res = []
- let state = STATE_KEY
- let charset = ''
- let inquote = false
- let escaping = false
- let p = 0
- let tmp = ''
- const len = str.length
-
- for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
- const char = str[i]
- if (char === '\\' && inquote) {
- if (escaping) { escaping = false } else {
- escaping = true
- continue
+};
+const readBytes = async function* (iterable, chunkSize) {
+ for await (const chunk of readStream(iterable)) {
+ yield* streamChunk(chunk, chunkSize);
+ }
+};
+const readStream = async function* (stream) {
+ if (stream[Symbol.asyncIterator]) {
+ yield* stream;
+ return;
+ }
+ const reader = stream.getReader();
+ try {
+ for (;;) {
+ const {
+ done,
+ value
+ } = await reader.read();
+ if (done) {
+ break;
}
- } else if (char === '"') {
- if (!escaping) {
- if (inquote) {
- inquote = false
- state = STATE_KEY
- } else { inquote = true }
- continue
- } else { escaping = false }
- } else {
- if (escaping && inquote) { tmp += '\\' }
- escaping = false
- if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
- if (state === STATE_CHARSET) {
- state = STATE_LANG
- charset = tmp.substring(1)
- } else { state = STATE_VALUE }
- tmp = ''
- continue
- } else if (state === STATE_KEY &&
- (char === '*' || char === '=') &&
- res.length) {
- state = char === '*'
- ? STATE_CHARSET
- : STATE_VALUE
- res[p] = [tmp, undefined]
- tmp = ''
- continue
- } else if (!inquote && char === ';') {
- state = STATE_KEY
- if (charset) {
- if (tmp.length) {
- tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
- 'binary',
- charset)
- }
- charset = ''
- } else if (tmp.length) {
- tmp = decodeText(tmp, 'binary', 'utf8')
- }
- if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
- tmp = ''
- ++p
- continue
- } else if (!inquote && (char === ' ' || char === '\t')) { continue }
+ yield value;
}
- tmp += char
- }
- if (charset && tmp.length) {
- tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
- 'binary',
- charset)
- } else if (tmp) {
- tmp = decodeText(tmp, 'binary', 'utf8')
+ } finally {
+ await reader.cancel();
}
-
- if (res[p] === undefined) {
- if (tmp) { res[p] = tmp }
- } else { res[p][1] = tmp }
-
- return res
-}
-
-module.exports = parseParams
-
-
-/***/ }),
-
-/***/ 8757:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Axios v1.7.2 Copyright (c) 2024 Matt Zabriskie and contributors
-
-
-const FormData$1 = __nccwpck_require__(4334);
-const url = __nccwpck_require__(7310);
-const proxyFromEnv = __nccwpck_require__(3329);
-const http = __nccwpck_require__(3685);
-const https = __nccwpck_require__(5687);
-const util = __nccwpck_require__(3837);
-const followRedirects = __nccwpck_require__(7707);
-const zlib = __nccwpck_require__(9796);
-const stream = __nccwpck_require__(2781);
-const events = __nccwpck_require__(2361);
-
-function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-
-const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
-const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
-const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
-const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
-const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
-const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
-const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
-const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
-
-function bind(fn, thisArg) {
- return function wrap() {
- return fn.apply(thisArg, arguments);
+};
+const trackStream = (stream, chunkSize, onProgress, onFinish) => {
+ const iterator = readBytes(stream, chunkSize);
+ let bytes = 0;
+ let done;
+ let _onFinish = e => {
+ if (!done) {
+ done = true;
+ onFinish && onFinish(e);
+ }
};
-}
-
-// utils is a library of generic helper functions non-specific to axios
-
-const {toString} = Object.prototype;
-const {getPrototypeOf} = Object;
-
-const kindOf = (cache => thing => {
- const str = toString.call(thing);
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
-})(Object.create(null));
-
-const kindOfTest = (type) => {
- type = type.toLowerCase();
- return (thing) => kindOf(thing) === type
+ return new ReadableStream({
+ async pull(controller) {
+ try {
+ const {
+ done,
+ value
+ } = await iterator.next();
+ if (done) {
+ _onFinish();
+ controller.close();
+ return;
+ }
+ let len = value.byteLength;
+ if (onProgress) {
+ let loadedBytes = bytes += len;
+ onProgress(loadedBytes);
+ }
+ controller.enqueue(new Uint8Array(value));
+ } catch (err) {
+ _onFinish(err);
+ throw err;
+ }
+ },
+ cancel(reason) {
+ _onFinish(reason);
+ return iterator.return();
+ }
+ }, {
+ highWaterMark: 2
+ });
};
-const typeOfTest = type => thing => typeof thing === type;
-
-/**
- * Determine if a value is an Array
- *
- * @param {Object} val The value to test
- *
- * @returns {boolean} True if value is an Array, otherwise false
- */
-const {isArray} = Array;
-
-/**
- * Determine if a value is undefined
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if the value is undefined, otherwise false
- */
-const isUndefined = typeOfTest('undefined');
-
-/**
- * Determine if a value is a Buffer
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a Buffer, otherwise false
- */
-function isBuffer(val) {
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
- && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
-}
-
-/**
- * Determine if a value is an ArrayBuffer
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
- */
-const isArrayBuffer = kindOfTest('ArrayBuffer');
-
-
-/**
- * Determine if a value is a view on an ArrayBuffer
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
- */
-function isArrayBufferView(val) {
- let result;
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
- result = ArrayBuffer.isView(val);
- } else {
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
- }
- return result;
-}
-
-/**
- * Determine if a value is a String
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a String, otherwise false
- */
-const isString = typeOfTest('string');
-
-/**
- * Determine if a value is a Function
- *
- * @param {*} val The value to test
- * @returns {boolean} True if value is a Function, otherwise false
- */
-const isFunction = typeOfTest('function');
-
-/**
- * Determine if a value is a Number
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a Number, otherwise false
- */
-const isNumber = typeOfTest('number');
-
-/**
- * Determine if a value is an Object
- *
- * @param {*} thing The value to test
- *
- * @returns {boolean} True if value is an Object, otherwise false
- */
-const isObject = (thing) => thing !== null && typeof thing === 'object';
-
-/**
- * Determine if a value is a Boolean
- *
- * @param {*} thing The value to test
- * @returns {boolean} True if value is a Boolean, otherwise false
- */
-const isBoolean = thing => thing === true || thing === false;
+const DEFAULT_CHUNK_SIZE = 64 * 1024;
+const {
+ isFunction
+} = utils$1;
/**
- * Determine if a value is a plain Object
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
*
- * @param {*} val The value to test
+ * @param {string} str The string to encode
*
- * @returns {boolean} True if value is a plain Object, otherwise false
+ * @returns {string} UTF-8 bytes as a Latin-1 string
*/
-const isPlainObject = (val) => {
- if (kindOf(val) !== 'object') {
+const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+
+// Node's WHATWG URL parser returns `username` and `password` percent-encoded.
+// Decode before composing the `auth` option so credentials such as
+// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
+// original value for malformed input so a bad encoding never throws.
+const decodeURIComponentSafe = value => {
+ if (!utils$1.isString(value)) {
+ return value;
+ }
+ try {
+ return decodeURIComponent(value);
+ } catch (error) {
+ return value;
+ }
+};
+const test = (fn, ...args) => {
+ try {
+ return !!fn(...args);
+ } catch (e) {
+ return false;
+ }
+};
+const maybeWithAuthCredentials = url => {
+ const protocolIndex = url.indexOf('://');
+ let urlToCheck = url;
+ if (protocolIndex !== -1) {
+ urlToCheck = urlToCheck.slice(protocolIndex + 3);
+ }
+ return urlToCheck.includes('@') || urlToCheck.includes(':');
+};
+const factory = env => {
+ const globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis;
+ const {
+ ReadableStream,
+ TextEncoder
+ } = globalObject;
+ env = utils$1.merge.call({
+ skipUndefined: true
+ }, {
+ Request: globalObject.Request,
+ Response: globalObject.Response
+ }, env);
+ const {
+ fetch: envFetch,
+ Request,
+ Response
+ } = env;
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
+ const isRequestSupported = isFunction(Request);
+ const isResponseSupported = isFunction(Response);
+ if (!isFetchSupported) {
return false;
}
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? (encoder => str => encoder.encode(str))(new TextEncoder()) : async str => new Uint8Array(await new Request(str).arrayBuffer()));
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
+ let duplexAccessed = false;
+ const request = new Request(platform.origin, {
+ body: new ReadableStream(),
+ method: 'POST',
+ get duplex() {
+ duplexAccessed = true;
+ return 'half';
+ }
+ });
+ const hasContentType = request.headers.has('Content-Type');
+ if (request.body != null) {
+ request.body.cancel();
+ }
+ return duplexAccessed && !hasContentType;
+ });
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response('').body));
+ const resolvers = {
+ stream: supportsResponseStream && (res => res.body)
+ };
+ isFetchSupported && (() => {
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
+ !resolvers[type] && (resolvers[type] = (res, config) => {
+ let method = res && res[type];
+ if (method) {
+ return method.call(res);
+ }
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
+ });
+ });
+ })();
+ const getBodyLength = async body => {
+ if (body == null) {
+ return 0;
+ }
+ if (utils$1.isBlob(body)) {
+ return body.size;
+ }
+ if (utils$1.isSpecCompliantForm(body)) {
+ const _request = new Request(platform.origin, {
+ method: 'POST',
+ body
+ });
+ return (await _request.arrayBuffer()).byteLength;
+ }
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
+ return body.byteLength;
+ }
+ if (utils$1.isURLSearchParams(body)) {
+ body = body + '';
+ }
+ if (utils$1.isString(body)) {
+ return (await encodeText(body)).byteLength;
+ }
+ };
+ const resolveBodyLength = async (headers, body) => {
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
+ return length == null ? getBodyLength(body) : length;
+ };
+ return async config => {
+ let {
+ url,
+ method,
+ data,
+ signal,
+ cancelToken,
+ timeout,
+ onDownloadProgress,
+ onUploadProgress,
+ responseType,
+ headers,
+ withCredentials = 'same-origin',
+ fetchOptions,
+ maxContentLength,
+ maxBodyLength
+ } = resolveConfig(config);
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
+ const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined;
+ let _fetch = envFetch || fetch;
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
+ let request = null;
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
+ composedSignal.unsubscribe();
+ });
+ let requestContentLength;
+
+ // AxiosError we raise while the request body is being streamed. Captured
+ // by identity so the catch block can surface it directly, regardless of
+ // how the runtime wraps the resulting fetch rejection (undici exposes it
+ // as `err.cause`; some browsers drop the original error entirely).
+ let pendingBodyError = null;
+ const maxBodyLengthError = () => new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request);
+ try {
+ // HTTP basic authentication
+ let auth = undefined;
+ const configAuth = own('auth');
+ if (configAuth) {
+ const username = utils$1.getSafeProp(configAuth, 'username') || '';
+ const password = utils$1.getSafeProp(configAuth, 'password') || '';
+ auth = {
+ username,
+ password
+ };
+ }
+ if (maybeWithAuthCredentials(url)) {
+ const parsedURL = new URL(url, platform.origin);
+ if (!auth && (parsedURL.username || parsedURL.password)) {
+ const urlUsername = decodeURIComponentSafe(parsedURL.username);
+ const urlPassword = decodeURIComponentSafe(parsedURL.password);
+ auth = {
+ username: urlUsername,
+ password: urlPassword
+ };
+ }
+ if (parsedURL.username || parsedURL.password) {
+ parsedURL.username = '';
+ parsedURL.password = '';
+ url = parsedURL.href;
+ }
+ }
+ if (auth) {
+ headers.delete('authorization');
+ headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))));
+ }
- const prototype = getPrototypeOf(val);
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
+ // "if (protocol === 'data:')" branch).
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
+ const estimated = estimateDataURLDecodedBytes(url);
+ if (estimated > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+
+ // Enforce maxBodyLength against known-size bodies before dispatch using
+ // the body's *actual* size — never a caller-declared Content-Length,
+ // which could under-report to slip an oversized body past the check.
+ // Unknown-size streams return undefined here and are counted per-chunk
+ // below as fetch consumes them.
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
+ const outboundLength = await getBodyLength(data);
+ if (typeof outboundLength === 'number' && isFinite(outboundLength)) {
+ requestContentLength = outboundLength;
+ if (outboundLength > maxBodyLength) {
+ throw maxBodyLengthError();
+ }
+ }
+ }
+
+ // A streamed body under maxBodyLength must be counted as fetch consumes
+ // it; its size is never trusted from a caller-declared Content-Length.
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
+ const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, loadedBytes => {
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
+ throw pendingBodyError = maxBodyLengthError();
+ }
+ onProgress && onProgress(loadedBytes);
+ }, flush);
+ if (supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody)) {
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
+
+ // A declared length of 0 is only trusted to skip the wrap when we are
+ // not enforcing a stream limit (which must not rely on that header).
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
+ let _request = new Request(url, {
+ method: 'POST',
+ body: data,
+ duplex: 'half'
+ });
+ let contentTypeHeader;
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
+ headers.setContentType(contentTypeHeader);
+ }
+ if (_request.body) {
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
+ data = trackRequestStream(_request.body, onProgress, flush);
+ }
+ }
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head') {
+ data = trackRequestStream(data);
+ } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head') {
+ throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request);
+ }
+ if (!utils$1.isString(withCredentials)) {
+ withCredentials = withCredentials ? 'include' : 'omit';
+ }
+
+ // Cloudflare Workers throws when credentials are defined
+ // see https://github.com/cloudflare/workerd/issues/902
+ const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
+
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
+ // delete it so fetch can set it correctly with the boundary
+ if (utils$1.isFormData(data)) {
+ const contentType = headers.getContentType();
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
+ headers.delete('content-type');
+ }
+ }
+
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+ const resolvedOptions = {
+ ...fetchOptions,
+ signal: composedSignal,
+ method: method.toUpperCase(),
+ headers: toByteStringHeaderObject(headers.normalize()),
+ body: data,
+ duplex: 'half',
+ credentials: isCredentialsSupported ? withCredentials : undefined
+ };
+ request = isRequestSupported && new Request(url, resolvedOptions);
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
+ const responseHeaders = AxiosHeaders.from(response.headers);
+
+ // Cheap pre-check: if the server honestly declares a content-length that
+ // already exceeds the cap, reject before we start streaming.
+ if (hasMaxContentLength) {
+ const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
+ if (declaredLength != null && declaredLength > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
+ if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
+ const options = {};
+ ['status', 'statusText', 'headers'].forEach(prop => {
+ options[prop] = response[prop];
+ });
+ const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
+ let bytesRead = 0;
+ const onChunkProgress = loadedBytes => {
+ if (hasMaxContentLength) {
+ bytesRead = loadedBytes;
+ if (bytesRead > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ onProgress && onProgress(loadedBytes);
+ };
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
+ flush && flush();
+ unsubscribe && unsubscribe();
+ }), options);
+ }
+ responseType = responseType || 'text';
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
+
+ // Fallback enforcement for environments without ReadableStream support
+ // (legacy runtimes). Detect materialized size from typed output; skip
+ // streams/Response passthrough since the user will read those themselves.
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
+ let materializedSize;
+ if (responseData != null) {
+ if (typeof responseData.byteLength === 'number') {
+ materializedSize = responseData.byteLength;
+ } else if (typeof responseData.size === 'number') {
+ materializedSize = responseData.size;
+ } else if (typeof responseData === 'string') {
+ materializedSize = typeof TextEncoder === 'function' ? new TextEncoder().encode(responseData).byteLength : responseData.length;
+ }
+ }
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ !isStreamResponse && unsubscribe && unsubscribe();
+ return await new Promise((resolve, reject) => {
+ settle(resolve, reject, {
+ data: responseData,
+ headers: AxiosHeaders.from(response.headers),
+ status: response.status,
+ statusText: response.statusText,
+ config,
+ request
+ });
+ });
+ } catch (err) {
+ unsubscribe && unsubscribe();
+
+ // Safari can surface fetch aborts as a DOMException-like object whose
+ // branded getters throw. Prefer our composed signal reason before reading
+ // the caught error, preserving timeout vs cancellation semantics.
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
+ const canceledError = composedSignal.reason;
+ canceledError.config = config;
+ request && (canceledError.request = request);
+ if (err !== canceledError) {
+ // Non-enumerable to match native Error `cause` semantics so loggers
+ // don't recurse into circular fetch internals (see #7205).
+ Object.defineProperty(canceledError, 'cause', {
+ __proto__: null,
+ value: err,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ }
+ throw canceledError;
+ }
+
+ // Surface a maxBodyLength violation we raised while the request body was
+ // being streamed. Matching by identity (rather than reading
+ // `err.cause.isAxiosError`) keeps the error deterministic across runtimes
+ // and avoids both prototype-pollution reads and mis-attributing a foreign
+ // AxiosError that merely happened to land in `err.cause`.
+ if (pendingBodyError) {
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
+ throw pendingBodyError;
+ }
+
+ // Re-throw AxiosErrors we raised synchronously (data: URL / content-length
+ // pre-checks, response size enforcement) without re-wrapping them.
+ if (err instanceof AxiosError) {
+ request && !err.request && (err.request = request);
+ throw err;
+ }
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
+ const networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response);
+ // Non-enumerable to match native Error `cause` semantics so loggers
+ // don't recurse into circular fetch internals (see #7205).
+ Object.defineProperty(networkError, 'cause', {
+ __proto__: null,
+ value: err.cause || err,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ throw networkError;
+ }
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
+ }
+ };
+};
+const seedCache = new Map();
+const getFetch = config => {
+ let env = config && config.env || {};
+ const {
+ fetch,
+ Request,
+ Response
+ } = env;
+ const seeds = [Request, Response, fetch];
+ let len = seeds.length,
+ i = len,
+ seed,
+ target,
+ map = seedCache;
+ while (i--) {
+ seed = seeds[i];
+ target = map.get(seed);
+ target === undefined && map.set(seed, target = i ? new Map() : factory(env));
+ map = target;
+ }
+ return target;
};
+getFetch();
/**
- * Determine if a value is a Date
- *
- * @param {*} val The value to test
+ * Known adapters mapping.
+ * Provides environment-specific adapters for Axios:
+ * - `http` for Node.js
+ * - `xhr` for browsers
+ * - `fetch` for fetch API-based requests
*
- * @returns {boolean} True if value is a Date, otherwise false
+ * @type {Object}
*/
-const isDate = kindOfTest('Date');
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter,
+ fetch: {
+ get: getFetch
+ }
+};
-/**
- * Determine if a value is a File
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a File, otherwise false
- */
-const isFile = kindOfTest('File');
+// Assign adapter names for easier debugging and identification
+utils$1.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
+ // these data descriptors into accessor descriptors on the way in.
+ Object.defineProperty(fn, 'name', {
+ __proto__: null,
+ value
+ });
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {
+ __proto__: null,
+ value
+ });
+ }
+});
/**
- * Determine if a value is a Blob
- *
- * @param {*} val The value to test
+ * Render a rejection reason string for unknown or unsupported adapters
*
- * @returns {boolean} True if value is a Blob, otherwise false
+ * @param {string} reason
+ * @returns {string}
*/
-const isBlob = kindOfTest('Blob');
+const renderReason = reason => `- ${reason}`;
/**
- * Determine if a value is a FileList
- *
- * @param {*} val The value to test
+ * Check if the adapter is resolved (function, null, or false)
*
- * @returns {boolean} True if value is a File, otherwise false
+ * @param {Function|null|false} adapter
+ * @returns {boolean}
*/
-const isFileList = kindOfTest('FileList');
+const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === null || adapter === false;
/**
- * Determine if a value is a Stream
- *
- * @param {*} val The value to test
+ * Get the first suitable adapter from the provided list.
+ * Tries each adapter in order until a supported one is found.
+ * Throws an AxiosError if no adapter is suitable.
*
- * @returns {boolean} True if value is a Stream, otherwise false
+ * @param {Array|string|Function} adapters - Adapter(s) by name or function.
+ * @param {Object} config - Axios request configuration
+ * @throws {AxiosError} If no suitable adapter is available
+ * @returns {Function} The resolved adapter function
*/
-const isStream = (val) => isObject(val) && isFunction(val.pipe);
+function getAdapter(adapters, config) {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+ const {
+ length
+ } = adapters;
+ let nameOrAdapter;
+ let adapter;
+ const rejectedReasons = {};
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+ adapter = nameOrAdapter;
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+ if (adapter === undefined) {
+ throw new AxiosError(`Unknown adapter '${id}'`);
+ }
+ }
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
+ break;
+ }
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+ if (!adapter) {
+ const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
+ let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT);
+ }
+ return adapter;
+}
/**
- * Determine if a value is a FormData
- *
- * @param {*} thing The value to test
- *
- * @returns {boolean} True if value is an FormData, otherwise false
+ * Exports Axios adapters and utility to resolve an adapter
*/
-const isFormData = (thing) => {
- let kind;
- return thing && (
- (typeof FormData === 'function' && thing instanceof FormData) || (
- isFunction(thing.append) && (
- (kind = kindOf(thing)) === 'formdata' ||
- // detect form-data instance
- (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
- )
- )
- )
+var adapters = {
+ /**
+ * Resolve an adapter from a list of adapter names or functions.
+ * @type {Function}
+ */
+ getAdapter,
+ /**
+ * Exposes all known adapters
+ * @type {Object}
+ */
+ adapters: knownAdapters
};
/**
- * Determine if a value is a URLSearchParams object
- *
- * @param {*} val The value to test
- *
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
- */
-const isURLSearchParams = kindOfTest('URLSearchParams');
-
-const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
-
-/**
- * Trim excess whitespace off the beginning and end of a string
+ * Throws a `CanceledError` if cancellation has been requested.
*
- * @param {String} str The String to trim
+ * @param {Object} config The config that is to be used for the request
*
- * @returns {String} The String freed of excess whitespace
+ * @returns {void}
*/
-const trim = (str) => str.trim ?
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+function throwIfCancellationRequested(config) {
+ if (config.cancelToken) {
+ config.cancelToken.throwIfRequested();
+ }
+ if (config.signal && config.signal.aborted) {
+ throw new CanceledError(null, config);
+ }
+}
/**
- * Iterate over an Array or an Object invoking a function for each item.
- *
- * If `obj` is an Array callback will be called passing
- * the value, index, and complete array for each item.
- *
- * If 'obj' is an Object callback will be called passing
- * the value, key, and complete object for each property.
+ * Dispatch a request to the server using the configured adapter.
*
- * @param {Object|Array} obj The object to iterate
- * @param {Function} fn The callback to invoke for each item
+ * @param {object} config The config that is to be used for the request
*
- * @param {Boolean} [allOwnKeys = false]
- * @returns {any}
+ * @returns {Promise} The Promise to be fulfilled
*/
-function forEach(obj, fn, {allOwnKeys = false} = {}) {
- // Don't bother if no value provided
- if (obj === null || typeof obj === 'undefined') {
- return;
- }
-
- let i;
- let l;
+function dispatchRequest(config) {
+ throwIfCancellationRequested(config);
+ config.headers = AxiosHeaders.from(config.headers);
- // Force an array if not already something iterable
- if (typeof obj !== 'object') {
- /*eslint no-param-reassign:0*/
- obj = [obj];
+ // Transform request data
+ config.data = transformData.call(config, config.transformRequest);
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
}
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
+ return adapter(config).then(function onAdapterResolution(response) {
+ throwIfCancellationRequested(config);
- if (isArray(obj)) {
- // Iterate over array values
- for (i = 0, l = obj.length; i < l; i++) {
- fn.call(null, obj[i], i, obj);
- }
- } else {
- // Iterate over object keys
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
- const len = keys.length;
- let key;
-
- for (i = 0; i < len; i++) {
- key = keys[i];
- fn.call(null, obj[key], key, obj);
+ // Expose the current response on config so that transformResponse can
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
+ // We clean it up afterwards to avoid polluting the config object.
+ config.response = response;
+ try {
+ response.data = transformData.call(config, config.transformResponse, response);
+ } finally {
+ delete config.response;
}
- }
-}
+ response.headers = AxiosHeaders.from(response.headers);
+ return response;
+ }, function onAdapterRejection(reason) {
+ if (!isCancel(reason)) {
+ throwIfCancellationRequested(config);
-function findKey(obj, key) {
- key = key.toLowerCase();
- const keys = Object.keys(obj);
- let i = keys.length;
- let _key;
- while (i-- > 0) {
- _key = keys[i];
- if (key === _key.toLowerCase()) {
- return _key;
+ // Transform response data
+ if (reason && reason.response) {
+ config.response = reason.response;
+ try {
+ reason.response.data = transformData.call(config, config.transformResponse, reason.response);
+ } finally {
+ delete config.response;
+ }
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
+ }
}
- }
- return null;
+ return Promise.reject(reason);
+ });
}
-const _global = (() => {
- /*eslint no-undef:0*/
- if (typeof globalThis !== "undefined") return globalThis;
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
-})();
+const validators$1 = {};
-const isContextDefined = (context) => !isUndefined(context) && context !== _global;
+// eslint-disable-next-line func-names
+['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
+ validators$1[type] = function validator(thing) {
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
+ };
+});
+const deprecatedWarnings = {};
/**
- * Accepts varargs expecting each argument to be an object, then
- * immutably merges the properties of each object and returns result.
- *
- * When multiple objects contain the same key the later object in
- * the arguments list will take precedence.
- *
- * Example:
- *
- * ```js
- * var result = merge({foo: 123}, {foo: 456});
- * console.log(result.foo); // outputs 456
- * ```
+ * Transitional option validator
*
- * @param {Object} obj1 Object to merge
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
+ * @param {string?} version - deprecated version / removed since version
+ * @param {string?} message - some message with additional info
*
- * @returns {Object} Result of all merge properties
+ * @returns {function}
*/
-function merge(/* obj1, obj2, obj3, ... */) {
- const {caseless} = isContextDefined(this) && this || {};
- const result = {};
- const assignValue = (val, key) => {
- const targetKey = caseless && findKey(result, key) || key;
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
- result[targetKey] = merge(result[targetKey], val);
- } else if (isPlainObject(val)) {
- result[targetKey] = merge({}, val);
- } else if (isArray(val)) {
- result[targetKey] = val.slice();
- } else {
- result[targetKey] = val;
- }
- };
-
- for (let i = 0, l = arguments.length; i < l; i++) {
- arguments[i] && forEach(arguments[i], assignValue);
+validators$1.transitional = function transitional(validator, version, message) {
+ function formatMessage(opt, desc) {
+ return '[Axios v' + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? '. ' + message : '');
}
- return result;
-}
-/**
- * Extends object a by mutably adding to it the properties of object b.
- *
- * @param {Object} a The object to be extended
- * @param {Object} b The object to copy properties from
- * @param {Object} thisArg The object to bind function to
- *
- * @param {Boolean} [allOwnKeys]
- * @returns {Object} The resulting value of object a
- */
-const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
- forEach(b, (val, key) => {
- if (thisArg && isFunction(val)) {
- a[key] = bind(val, thisArg);
- } else {
- a[key] = val;
+ // eslint-disable-next-line func-names
+ return (value, opt, opts) => {
+ if (validator === false) {
+ throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED);
}
- }, {allOwnKeys});
- return a;
+ if (version && !deprecatedWarnings[opt]) {
+ deprecatedWarnings[opt] = true;
+ // eslint-disable-next-line no-console
+ console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'));
+ }
+ return validator ? validator(value, opt, opts) : true;
+ };
};
-
-/**
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
- *
- * @param {string} content with BOM
- *
- * @returns {string} content value without BOM
- */
-const stripBOM = (content) => {
- if (content.charCodeAt(0) === 0xFEFF) {
- content = content.slice(1);
- }
- return content;
+validators$1.spelling = function spelling(correctSpelling) {
+ return (value, opt) => {
+ // eslint-disable-next-line no-console
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
+ return true;
+ };
};
/**
- * Inherit the prototype methods from one constructor into another
- * @param {function} constructor
- * @param {function} superConstructor
- * @param {object} [props]
- * @param {object} [descriptors]
+ * Assert object's properties type
*
- * @returns {void}
- */
-const inherits = (constructor, superConstructor, props, descriptors) => {
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
- constructor.prototype.constructor = constructor;
- Object.defineProperty(constructor, 'super', {
- value: superConstructor.prototype
- });
- props && Object.assign(constructor.prototype, props);
-};
-
-/**
- * Resolve object with deep prototype chain to a flat object
- * @param {Object} sourceObj source object
- * @param {Object} [destObj]
- * @param {Function|Boolean} [filter]
- * @param {Function} [propFilter]
+ * @param {object} options
+ * @param {object} schema
+ * @param {boolean?} allowUnknown
*
- * @returns {Object}
+ * @returns {object}
*/
-const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
- let props;
- let i;
- let prop;
- const merged = {};
-
- destObj = destObj || {};
- // eslint-disable-next-line no-eq-null,eqeqeq
- if (sourceObj == null) return destObj;
- do {
- props = Object.getOwnPropertyNames(sourceObj);
- i = props.length;
- while (i-- > 0) {
- prop = props[i];
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
- destObj[prop] = sourceObj[prop];
- merged[prop] = true;
+function assertOptions(options, schema, allowUnknown) {
+ if (typeof options !== 'object' || options === null) {
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
+ }
+ const keys = Object.keys(options);
+ let i = keys.length;
+ while (i-- > 0) {
+ const opt = keys[i];
+ // Use hasOwnProperty so a polluted Object.prototype. cannot supply
+ // a non-function validator and cause a TypeError.
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
+ if (validator) {
+ const value = options[opt];
+ const result = value === undefined || validator(value, opt, options);
+ if (result !== true) {
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
}
+ continue;
+ }
+ if (allowUnknown !== true) {
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
}
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
-
- return destObj;
-};
-
-/**
- * Determines whether a string ends with the characters of a specified string
- *
- * @param {String} str
- * @param {String} searchString
- * @param {Number} [position= 0]
- *
- * @returns {boolean}
- */
-const endsWith = (str, searchString, position) => {
- str = String(str);
- if (position === undefined || position > str.length) {
- position = str.length;
}
- position -= searchString.length;
- const lastIndex = str.indexOf(searchString, position);
- return lastIndex !== -1 && lastIndex === position;
+}
+var validator = {
+ assertOptions,
+ validators: validators$1
};
+const validators = validator.validators;
/**
- * Returns new array from array like object or null if failed
+ * Create a new instance of Axios
*
- * @param {*} [thing]
+ * @param {Object} instanceConfig The default config for the instance
*
- * @returns {?Array}
+ * @return {Axios} A new instance of Axios
*/
-const toArray = (thing) => {
- if (!thing) return null;
- if (isArray(thing)) return thing;
- let i = thing.length;
- if (!isNumber(i)) return null;
- const arr = new Array(i);
- while (i-- > 0) {
- arr[i] = thing[i];
+class Axios {
+ constructor(instanceConfig) {
+ this.defaults = instanceConfig || {};
+ this.interceptors = {
+ request: new InterceptorManager(),
+ response: new InterceptorManager()
+ };
}
- return arr;
-};
-/**
- * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
- * thing passed in is an instance of Uint8Array
- *
- * @param {TypedArray}
- *
- * @returns {Array}
- */
-// eslint-disable-next-line func-names
-const isTypedArray = (TypedArray => {
- // eslint-disable-next-line func-names
- return thing => {
- return TypedArray && thing instanceof TypedArray;
- };
-})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
+ /**
+ * Dispatch a request
+ *
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
+ * @param {?Object} config
+ *
+ * @returns {Promise} The Promise to be fulfilled
+ */
+ async request(configOrUrl, config) {
+ try {
+ return await this._request(configOrUrl, config);
+ } catch (err) {
+ if (err instanceof Error) {
+ let dummy = {};
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
+
+ // slice off the Error: ... line
+ const stack = (() => {
+ if (!dummy.stack) {
+ return '';
+ }
+ const firstNewlineIndex = dummy.stack.indexOf('\n');
+ return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
+ })();
+ try {
+ if (!err.stack) {
+ err.stack = stack;
+ // match without the 2 top stack lines
+ } else if (stack) {
+ const firstNewlineIndex = stack.indexOf('\n');
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
+ err.stack += '\n' + stack;
+ }
+ }
+ } catch (e) {
+ // ignore the case where "stack" is an un-writable property
+ }
+ }
+ throw err;
+ }
+ }
+ _request(configOrUrl, config) {
+ /*eslint no-param-reassign:0*/
+ // Allow for axios('example/url'[, config]) a la fetch API
+ if (typeof configOrUrl === 'string') {
+ config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
+ }
+ config = mergeConfig(this.defaults, config);
+ const {
+ transitional,
+ paramsSerializer,
+ headers
+ } = config;
+ if (transitional !== undefined) {
+ validator.assertOptions(transitional, {
+ silentJSONParsing: validators.transitional(validators.boolean),
+ forcedJSONParsing: validators.transitional(validators.boolean),
+ clarifyTimeoutError: validators.transitional(validators.boolean),
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
+ advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
+ validateStatusUndefinedResolves: validators.transitional(validators.boolean)
+ }, false);
+ }
+ if (paramsSerializer != null) {
+ if (utils$1.isFunction(paramsSerializer)) {
+ config.paramsSerializer = {
+ serialize: paramsSerializer
+ };
+ } else {
+ validator.assertOptions(paramsSerializer, {
+ encode: validators.function,
+ serialize: validators.function
+ }, true);
+ }
+ }
-/**
- * For each entry in the object, call the function with the key and value.
- *
- * @param {Object} obj - The object to iterate over.
- * @param {Function} fn - The function to call for each entry.
- *
- * @returns {void}
- */
-const forEachEntry = (obj, fn) => {
- const generator = obj && obj[Symbol.iterator];
+ // Set config.allowAbsoluteUrls
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
+ } else {
+ config.allowAbsoluteUrls = true;
+ }
+ validator.assertOptions(config, {
+ baseUrl: validators.spelling('baseURL'),
+ withXsrfToken: validators.spelling('withXSRFToken')
+ }, true);
- const iterator = generator.call(obj);
+ // Set config.method
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
- let result;
+ // Flatten headers
+ let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
+ headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], method => {
+ delete headers[method];
+ });
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
- while ((result = iterator.next()) && !result.done) {
- const pair = result.value;
- fn.call(obj, pair[0], pair[1]);
+ // filter out skipped interceptors
+ const requestInterceptorChain = [];
+ let synchronousRequestInterceptors = true;
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
+ return;
+ }
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
+ const transitional = config.transitional || transitionalDefaults;
+ const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
+ if (legacyInterceptorReqResOrdering) {
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
+ } else {
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ }
+ });
+ const responseInterceptorChain = [];
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
+ });
+ let promise;
+ let i = 0;
+ let len;
+ if (!synchronousRequestInterceptors) {
+ const chain = [dispatchRequest.bind(this), undefined];
+ chain.unshift(...requestInterceptorChain);
+ chain.push(...responseInterceptorChain);
+ len = chain.length;
+ promise = Promise.resolve(config);
+ while (i < len) {
+ promise = promise.then(chain[i++], chain[i++]);
+ }
+ return promise;
+ }
+ len = requestInterceptorChain.length;
+ let newConfig = config;
+ while (i < len) {
+ const onFulfilled = requestInterceptorChain[i++];
+ const onRejected = requestInterceptorChain[i++];
+ try {
+ newConfig = onFulfilled(newConfig);
+ } catch (error) {
+ onRejected.call(this, error);
+ break;
+ }
+ }
+ try {
+ promise = dispatchRequest.call(this, newConfig);
+ } catch (error) {
+ return Promise.reject(error);
+ }
+ i = 0;
+ len = responseInterceptorChain.length;
+ while (i < len) {
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
+ }
+ return promise;
}
-};
-
-/**
- * It takes a regular expression and a string, and returns an array of all the matches
- *
- * @param {string} regExp - The regular expression to match against.
- * @param {string} str - The string to search.
- *
- * @returns {Array}
- */
-const matchAll = (regExp, str) => {
- let matches;
- const arr = [];
-
- while ((matches = regExp.exec(str)) !== null) {
- arr.push(matches);
+ getUri(config) {
+ config = mergeConfig(this.defaults, config);
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
+ return buildURL(fullPath, config.params, config.paramsSerializer);
}
+}
- return arr;
-};
-
-/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
-const isHTMLForm = kindOfTest('HTMLFormElement');
-
-const toCamelCase = str => {
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
- function replacer(m, p1, p2) {
- return p1.toUpperCase() + p2;
- }
- );
-};
+// Provide aliases for supported request methods
+utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
+ /*eslint func-names:0*/
+ Axios.prototype[method] = function (url, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ url,
+ data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined
+ }));
+ };
+});
+utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
+ function generateHTTPMethod(isForm) {
+ return function httpMethod(url, data, config) {
+ return this.request(mergeConfig(config || {}, {
+ method,
+ headers: isForm ? {
+ 'Content-Type': 'multipart/form-data'
+ } : {},
+ url,
+ data
+ }));
+ };
+ }
+ Axios.prototype[method] = generateHTTPMethod();
-/* Creating a function that will check if an object has a property. */
-const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
+ // its semantics, so no queryForm shorthand is generated.
+ if (method !== 'query') {
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
+ }
+});
/**
- * Determine if a value is a RegExp object
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
*
- * @param {*} val The value to test
+ * @param {Function} executor The executor function.
*
- * @returns {boolean} True if value is a RegExp object, otherwise false
+ * @returns {CancelToken}
*/
-const isRegExp = kindOfTest('RegExp');
-
-const reduceDescriptors = (obj, reducer) => {
- const descriptors = Object.getOwnPropertyDescriptors(obj);
- const reducedDescriptors = {};
-
- forEach(descriptors, (descriptor, name) => {
- let ret;
- if ((ret = reducer(descriptor, name, obj)) !== false) {
- reducedDescriptors[name] = ret || descriptor;
+class CancelToken {
+ constructor(executor) {
+ if (typeof executor !== 'function') {
+ throw new TypeError('executor must be a function.');
}
- });
+ let resolvePromise;
+ this.promise = new Promise(function promiseExecutor(resolve) {
+ resolvePromise = resolve;
+ });
+ const token = this;
- Object.defineProperties(obj, reducedDescriptors);
-};
+ // eslint-disable-next-line func-names
+ this.promise.then(cancel => {
+ if (!token._listeners) return;
+ let i = token._listeners.length;
+ while (i-- > 0) {
+ token._listeners[i](cancel);
+ }
+ token._listeners = null;
+ });
-/**
- * Makes all methods read-only
- * @param {Object} obj
- */
+ // eslint-disable-next-line func-names
+ this.promise.then = onfulfilled => {
+ let _resolve;
+ // eslint-disable-next-line func-names
+ const promise = new Promise(resolve => {
+ token.subscribe(resolve);
+ _resolve = resolve;
+ }).then(onfulfilled);
+ promise.cancel = function reject() {
+ token.unsubscribe(_resolve);
+ };
+ return promise;
+ };
+ executor(function cancel(message, config, request) {
+ if (token.reason) {
+ // Cancellation has already been requested
+ return;
+ }
+ token.reason = new CanceledError(message, config, request);
+ resolvePromise(token.reason);
+ });
+ }
-const freezeMethods = (obj) => {
- reduceDescriptors(obj, (descriptor, name) => {
- // skip restricted props in strict mode
- if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
- return false;
+ /**
+ * Throws a `CanceledError` if cancellation has been requested.
+ */
+ throwIfRequested() {
+ if (this.reason) {
+ throw this.reason;
}
+ }
- const value = obj[name];
+ /**
+ * Subscribe to the cancel signal
+ */
- if (!isFunction(value)) return;
+ subscribe(listener) {
+ if (this.reason) {
+ listener(this.reason);
+ return;
+ }
+ if (this._listeners) {
+ this._listeners.push(listener);
+ } else {
+ this._listeners = [listener];
+ }
+ }
- descriptor.enumerable = false;
+ /**
+ * Unsubscribe from the cancel signal
+ */
- if ('writable' in descriptor) {
- descriptor.writable = false;
+ unsubscribe(listener) {
+ if (!this._listeners) {
return;
}
-
- if (!descriptor.set) {
- descriptor.set = () => {
- throw Error('Can not rewrite read-only method \'' + name + '\'');
- };
+ const index = this._listeners.indexOf(listener);
+ if (index !== -1) {
+ this._listeners.splice(index, 1);
}
- });
-};
-
-const toObjectSet = (arrayOrString, delimiter) => {
- const obj = {};
+ }
+ toAbortSignal() {
+ const controller = new AbortController();
+ const abort = err => {
+ controller.abort(err);
+ };
+ this.subscribe(abort);
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
+ return controller.signal;
+ }
- const define = (arr) => {
- arr.forEach(value => {
- obj[value] = true;
+ /**
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
+ * cancels the `CancelToken`.
+ */
+ static source() {
+ let cancel;
+ const token = new CancelToken(function executor(c) {
+ cancel = c;
});
- };
-
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
-
- return obj;
-};
-
-const noop = () => {};
-
-const toFiniteNumber = (value, defaultValue) => {
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
-};
-
-const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
-
-const DIGIT = '0123456789';
-
-const ALPHABET = {
- DIGIT,
- ALPHA,
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
-};
-
-const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
- let str = '';
- const {length} = alphabet;
- while (size--) {
- str += alphabet[Math.random() * length|0];
+ return {
+ token,
+ cancel
+ };
}
-
- return str;
-};
+}
/**
- * If the thing is a FormData object, return true, otherwise return false.
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
*
- * @param {unknown} thing - The thing to check.
+ * Common use case would be to use `Function.prototype.apply`.
*
- * @returns {boolean}
+ * ```js
+ * function f(x, y, z) {}
+ * const args = [1, 2, 3];
+ * f.apply(null, args);
+ * ```
+ *
+ * With `spread` this example can be re-written.
+ *
+ * ```js
+ * spread(function(x, y, z) {})([1, 2, 3]);
+ * ```
+ *
+ * @param {Function} callback
+ *
+ * @returns {Function}
*/
-function isSpecCompliantForm(thing) {
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
+function spread(callback) {
+ return function wrap(arr) {
+ return callback.apply(null, arr);
+ };
}
-const toJSONObject = (obj) => {
- const stack = new Array(10);
-
- const visit = (source, i) => {
-
- if (isObject(source)) {
- if (stack.indexOf(source) >= 0) {
- return;
- }
+/**
+ * Determines whether the payload is an error thrown by Axios
+ *
+ * @param {*} payload The value to test
+ *
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
+ */
+function isAxiosError(payload) {
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
+}
- if(!('toJSON' in source)) {
- stack[i] = source;
- const target = isArray(source) ? [] : {};
+const HttpStatusCode = {
+ Continue: 100,
+ SwitchingProtocols: 101,
+ Processing: 102,
+ EarlyHints: 103,
+ Ok: 200,
+ Created: 201,
+ Accepted: 202,
+ NonAuthoritativeInformation: 203,
+ NoContent: 204,
+ ResetContent: 205,
+ PartialContent: 206,
+ MultiStatus: 207,
+ AlreadyReported: 208,
+ ImUsed: 226,
+ MultipleChoices: 300,
+ MovedPermanently: 301,
+ Found: 302,
+ SeeOther: 303,
+ NotModified: 304,
+ UseProxy: 305,
+ Unused: 306,
+ TemporaryRedirect: 307,
+ PermanentRedirect: 308,
+ BadRequest: 400,
+ Unauthorized: 401,
+ PaymentRequired: 402,
+ Forbidden: 403,
+ NotFound: 404,
+ MethodNotAllowed: 405,
+ NotAcceptable: 406,
+ ProxyAuthenticationRequired: 407,
+ RequestTimeout: 408,
+ Conflict: 409,
+ Gone: 410,
+ LengthRequired: 411,
+ PreconditionFailed: 412,
+ PayloadTooLarge: 413,
+ UriTooLong: 414,
+ UnsupportedMediaType: 415,
+ RangeNotSatisfiable: 416,
+ ExpectationFailed: 417,
+ ImATeapot: 418,
+ MisdirectedRequest: 421,
+ UnprocessableEntity: 422,
+ Locked: 423,
+ FailedDependency: 424,
+ TooEarly: 425,
+ UpgradeRequired: 426,
+ PreconditionRequired: 428,
+ TooManyRequests: 429,
+ RequestHeaderFieldsTooLarge: 431,
+ UnavailableForLegalReasons: 451,
+ InternalServerError: 500,
+ NotImplemented: 501,
+ BadGateway: 502,
+ ServiceUnavailable: 503,
+ GatewayTimeout: 504,
+ HttpVersionNotSupported: 505,
+ VariantAlsoNegotiates: 506,
+ InsufficientStorage: 507,
+ LoopDetected: 508,
+ NotExtended: 510,
+ NetworkAuthenticationRequired: 511,
+ WebServerIsDown: 521,
+ ConnectionTimedOut: 522,
+ OriginIsUnreachable: 523,
+ TimeoutOccurred: 524,
+ SslHandshakeFailed: 525,
+ InvalidSslCertificate: 526
+};
+Object.entries(HttpStatusCode).forEach(([key, value]) => {
+ HttpStatusCode[value] = key;
+});
- forEach(source, (value, key) => {
- const reducedValue = visit(value, i + 1);
- !isUndefined(reducedValue) && (target[key] = reducedValue);
- });
+/**
+ * Create an instance of Axios
+ *
+ * @param {Object} defaultConfig The default config for the instance
+ *
+ * @returns {Axios} A new instance of Axios
+ */
+function createInstance(defaultConfig) {
+ const context = new Axios(defaultConfig);
+ const instance = bind(Axios.prototype.request, context);
- stack[i] = undefined;
+ // Copy axios.prototype to instance
+ utils$1.extend(instance, Axios.prototype, context, {
+ allOwnKeys: true
+ });
- return target;
- }
- }
+ // Copy context to instance
+ utils$1.extend(instance, context, null, {
+ allOwnKeys: true
+ });
- return source;
+ // Factory for creating new instances
+ instance.create = function create(instanceConfig) {
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
};
+ return instance;
+}
- return visit(obj, 0);
-};
+// Create the default instance to be exported
+const axios = createInstance(defaults);
-const isAsyncFn = kindOfTest('AsyncFunction');
+// Expose Axios class to allow class inheritance
+axios.Axios = Axios;
-const isThenable = (thing) =>
- thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
+// Expose Cancel & CancelToken
+axios.CanceledError = CanceledError;
+axios.CancelToken = CancelToken;
+axios.isCancel = isCancel;
+axios.VERSION = VERSION;
+axios.toFormData = toFormData;
-const utils$1 = {
- isArray,
- isArrayBuffer,
- isBuffer,
- isFormData,
- isArrayBufferView,
- isString,
- isNumber,
- isBoolean,
- isObject,
- isPlainObject,
- isReadableStream,
- isRequest,
- isResponse,
- isHeaders,
- isUndefined,
- isDate,
- isFile,
- isBlob,
- isRegExp,
- isFunction,
- isStream,
- isURLSearchParams,
- isTypedArray,
- isFileList,
- forEach,
- merge,
- extend,
- trim,
- stripBOM,
- inherits,
- toFlatObject,
- kindOf,
- kindOfTest,
- endsWith,
- toArray,
- forEachEntry,
- matchAll,
- isHTMLForm,
- hasOwnProperty,
- hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
- reduceDescriptors,
- freezeMethods,
- toObjectSet,
- toCamelCase,
- noop,
- toFiniteNumber,
- findKey,
- global: _global,
- isContextDefined,
- ALPHABET,
- generateString,
- isSpecCompliantForm,
- toJSONObject,
- isAsyncFn,
- isThenable
-};
+// Expose AxiosError class
+axios.AxiosError = AxiosError;
-/**
- * Create an Error with the specified message, config, error code, request and response.
- *
- * @param {string} message The error message.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [config] The config.
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- *
- * @returns {Error} The created error.
- */
-function AxiosError(message, code, config, request, response) {
- Error.call(this);
+// alias for CanceledError for backward compatibility
+axios.Cancel = axios.CanceledError;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- } else {
- this.stack = (new Error()).stack;
- }
+// Expose all/spread
+axios.all = function all(promises) {
+ return Promise.all(promises);
+};
+axios.spread = spread;
- this.message = message;
- this.name = 'AxiosError';
- code && (this.code = code);
- config && (this.config = config);
- request && (this.request = request);
- response && (this.response = response);
-}
+// Expose isAxiosError
+axios.isAxiosError = isAxiosError;
-utils$1.inherits(AxiosError, Error, {
- toJSON: function toJSON() {
- return {
- // Standard
- message: this.message,
- name: this.name,
- // Microsoft
- description: this.description,
- number: this.number,
- // Mozilla
- fileName: this.fileName,
- lineNumber: this.lineNumber,
- columnNumber: this.columnNumber,
- stack: this.stack,
- // Axios
- config: utils$1.toJSONObject(this.config),
- code: this.code,
- status: this.response && this.response.status ? this.response.status : null
- };
- }
-});
+// Expose mergeConfig
+axios.mergeConfig = mergeConfig;
+axios.AxiosHeaders = AxiosHeaders;
+axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+axios.getAdapter = adapters.getAdapter;
+axios.HttpStatusCode = HttpStatusCode;
+axios.default = axios;
-const prototype$1 = AxiosError.prototype;
-const descriptors = {};
+module.exports = axios;
+//# sourceMappingURL=axios.cjs.map
-[
- 'ERR_BAD_OPTION_VALUE',
- 'ERR_BAD_OPTION',
- 'ECONNABORTED',
- 'ETIMEDOUT',
- 'ERR_NETWORK',
- 'ERR_FR_TOO_MANY_REDIRECTS',
- 'ERR_DEPRECATED',
- 'ERR_BAD_RESPONSE',
- 'ERR_BAD_REQUEST',
- 'ERR_CANCELED',
- 'ERR_NOT_SUPPORT',
- 'ERR_INVALID_URL'
-// eslint-disable-next-line func-names
-].forEach(code => {
- descriptors[code] = {value: code};
-});
-Object.defineProperties(AxiosError, descriptors);
-Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
+/***/ }),
-// eslint-disable-next-line func-names
-AxiosError.from = (error, code, config, request, response, customProps) => {
- const axiosError = Object.create(prototype$1);
+/***/ 6734:
+/***/ ((module) => {
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
- return obj !== Error.prototype;
- }, prop => {
- return prop !== 'isAxiosError';
- });
+module.exports = /*#__PURE__*/JSON.parse('{"name":"@slack/web-api","version":"7.13.0","description":"Official library for using the Slack Platform\'s Web API","author":"Slack Technologies, LLC","license":"MIT","keywords":["slack","web-api","bot","client","http","api","proxy","rate-limiting","pagination"],"main":"dist/index.js","types":"./dist/index.d.ts","files":["dist/**/*"],"engines":{"node":">= 18","npm":">= 8.6.0"},"repository":"slackapi/node-slack-sdk","homepage":"https://docs.slack.dev/tools/node-slack-sdk/web-api/","publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/slackapi/node-slack-sdk/issues"},"scripts":{"prepare":"npm run build","build":"npm run build:clean && tsc","build:clean":"shx rm -rf ./dist ./coverage","docs":"npx typedoc --plugin typedoc-plugin-markdown","lint":"npx @biomejs/biome check .","lint:fix":"npx @biomejs/biome check --write .","mocha":"mocha --config ./test/.mocharc.json \\"./src/**/*.spec.ts\\"","test":"npm run lint && npm run test:types && npm run test:integration && npm run test:unit","test:integration":"npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs && npm run test:integration:ts","test:integration:ts":"cd test/integration/ts-4.7-project && npm i && npm run build","test:unit":"npm run build && c8 --config ./test/.c8rc.json npm run mocha","test:types":"tsd","watch":"npx nodemon --watch \'src\' --ext \'ts\' --exec npm run build"},"dependencies":{"@slack/logger":"^4.0.0","@slack/types":"^2.18.0","@types/node":">=18.0.0","@types/retry":"0.12.0","axios":"^1.11.0","eventemitter3":"^5.0.1","form-data":"^4.0.4","is-electron":"2.2.2","is-stream":"^2","p-queue":"^6","p-retry":"^4","retry":"^0.13.1"},"devDependencies":{"@biomejs/biome":"^2.0.5","@tsconfig/recommended":"^1","@types/busboy":"^1.5.4","@types/chai":"^4","@types/mocha":"^10","@types/sinon":"^21","busboy":"^1","c8":"^10.1.2","chai":"^4","mocha":"^11","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","nock":"^14","shx":"^0.4.0","sinon":"^21","source-map-support":"^0.5.21","ts-node":"^10","tsd":"^0.33.0","typedoc":"^0.28.7","typedoc-plugin-markdown":"^4.7.1","typescript":"5.9.3"},"tsd":{"directory":"test/types"}}');
+
+/***/ }),
- AxiosError.call(axiosError, error.message, code, config, request, response);
+/***/ 1813:
+/***/ ((module) => {
- axiosError.cause = error;
+module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}');
- axiosError.name = error.name;
+/***/ })
- customProps && Object.assign(axiosError, customProps);
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __nccwpck_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ var threw = true;
+/******/ try {
+/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
+/******/ threw = false;
+/******/ } finally {
+/******/ if(threw) delete __webpack_module_cache__[moduleId];
+/******/ }
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __nccwpck_require__.d = (exports, definition) => {
+/******/ for(var key in definition) {
+/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
+/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
+/******/ }
+/******/ }
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/hasOwnProperty shorthand */
+/******/ (() => {
+/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat */
+/******/
+/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
- return axiosError;
-};
+// EXPORTS
+__nccwpck_require__.d(__webpack_exports__, {
+ e: () => (/* binding */ run)
+});
+// EXTERNAL MODULE: external "os"
+var external_os_ = __nccwpck_require__(857);
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/utils.js
+// We use any as a valid input type
+/* eslint-disable @typescript-eslint/no-explicit-any */
/**
- * Determines if the given thing is a array or js object.
- *
- * @param {string} thing - The object or array to be visited.
- *
- * @returns {boolean}
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
+ * @param input input to sanitize into a string
*/
-function isVisitable(thing) {
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+function utils_toCommandValue(input) {
+ if (input === null || input === undefined) {
+ return '';
+ }
+ else if (typeof input === 'string' || input instanceof String) {
+ return input;
+ }
+ return JSON.stringify(input);
}
-
/**
- * It removes the brackets from the end of a string
- *
- * @param {string} key - The key of the parameter.
*
- * @returns {string} the key without the brackets.
+ * @param annotationProperties
+ * @returns The command properties to send with the actual annotation command
+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
*/
-function removeBrackets(key) {
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+function utils_toCommandProperties(annotationProperties) {
+ if (!Object.keys(annotationProperties).length) {
+ return {};
+ }
+ return {
+ title: annotationProperties.title,
+ file: annotationProperties.file,
+ line: annotationProperties.startLine,
+ endLine: annotationProperties.endLine,
+ col: annotationProperties.startColumn,
+ endColumn: annotationProperties.endColumn
+ };
}
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/command.js
+
/**
- * It takes a path, a key, and a boolean, and returns a string
+ * Issues a command to the GitHub Actions runner
*
- * @param {string} path - The path to the current key.
- * @param {string} key - The key of the current object being iterated over.
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ * @param command - The command name to issue
+ * @param properties - Additional properties for the command (key-value pairs)
+ * @param message - The message to include with the command
+ * @remarks
+ * This function outputs a specially formatted string to stdout that the Actions
+ * runner interprets as a command. These commands can control workflow behavior,
+ * set outputs, create annotations, mask values, and more.
*
- * @returns {string} The path to the current key.
- */
-function renderKey(path, key, dots) {
- if (!path) return key;
- return path.concat(key).map(function each(token, i) {
- // eslint-disable-next-line no-param-reassign
- token = removeBrackets(token);
- return !dots && i ? '[' + token + ']' : token;
- }).join(dots ? '.' : '');
-}
-
-/**
- * If the array is an array and none of its elements are visitable, then it's a flat array.
+ * Command Format:
+ * ::name key=value,key=value::message
*
- * @param {Array} arr - The array to check
+ * @example
+ * ```typescript
+ * // Issue a warning annotation
+ * issueCommand('warning', {}, 'This is a warning message');
+ * // Output: ::warning::This is a warning message
*
- * @returns {boolean}
+ * // Set an environment variable
+ * issueCommand('set-env', { name: 'MY_VAR' }, 'some value');
+ * // Output: ::set-env name=MY_VAR::some value
+ *
+ * // Add a secret mask
+ * issueCommand('add-mask', {}, 'secretValue123');
+ * // Output: ::add-mask::secretValue123
+ * ```
+ *
+ * @internal
+ * This is an internal utility function that powers the public API functions
+ * such as setSecret, warning, error, and exportVariable.
*/
-function isFlatArray(arr) {
- return utils$1.isArray(arr) && !arr.some(isVisitable);
+function command_issueCommand(command, properties, message) {
+ const cmd = new Command(command, properties, message);
+ process.stdout.write(cmd.toString() + external_os_.EOL);
+}
+function command_issue(name, message = '') {
+ command_issueCommand(name, {}, message);
+}
+const CMD_STRING = '::';
+class Command {
+ constructor(command, properties, message) {
+ if (!command) {
+ command = 'missing.command';
+ }
+ this.command = command;
+ this.properties = properties;
+ this.message = message;
+ }
+ toString() {
+ let cmdStr = CMD_STRING + this.command;
+ if (this.properties && Object.keys(this.properties).length > 0) {
+ cmdStr += ' ';
+ let first = true;
+ for (const key in this.properties) {
+ if (this.properties.hasOwnProperty(key)) {
+ const val = this.properties[key];
+ if (val) {
+ if (first) {
+ first = false;
+ }
+ else {
+ cmdStr += ',';
+ }
+ cmdStr += `${key}=${escapeProperty(val)}`;
+ }
+ }
+ }
+ }
+ cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
+ return cmdStr;
+ }
}
+function escapeData(s) {
+ return utils_toCommandValue(s)
+ .replace(/%/g, '%25')
+ .replace(/\r/g, '%0D')
+ .replace(/\n/g, '%0A');
+}
+function escapeProperty(s) {
+ return utils_toCommandValue(s)
+ .replace(/%/g, '%25')
+ .replace(/\r/g, '%0D')
+ .replace(/\n/g, '%0A')
+ .replace(/:/g, '%3A')
+ .replace(/,/g, '%2C');
+}
+//# sourceMappingURL=command.js.map
+// EXTERNAL MODULE: external "crypto"
+var external_crypto_ = __nccwpck_require__(6982);
+// EXTERNAL MODULE: external "fs"
+var external_fs_ = __nccwpck_require__(9896);
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/file-command.js
+// For internal use, subject to change.
+// We use any as a valid input type
+/* eslint-disable @typescript-eslint/no-explicit-any */
-const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
- return /^is[A-Z]/.test(prop);
-});
-/**
- * Convert a data object to FormData
- *
- * @param {Object} obj
- * @param {?Object} [formData]
- * @param {?Object} [options]
- * @param {Function} [options.visitor]
- * @param {Boolean} [options.metaTokens = true]
- * @param {Boolean} [options.dots = false]
- * @param {?Boolean} [options.indexes = false]
- *
- * @returns {Object}
- **/
-/**
- * It converts an object into a FormData object
- *
- * @param {Object} obj - The object to convert to form data.
- * @param {string} formData - The FormData object to append to.
- * @param {Object} options
- *
- * @returns
- */
-function toFormData(obj, formData, options) {
- if (!utils$1.isObject(obj)) {
- throw new TypeError('target must be an object');
- }
- // eslint-disable-next-line no-param-reassign
- formData = formData || new (FormData__default["default"] || FormData)();
+function file_command_issueFileCommand(command, message) {
+ const filePath = process.env[`GITHUB_${command}`];
+ if (!filePath) {
+ throw new Error(`Unable to find environment variable for file command ${command}`);
+ }
+ if (!external_fs_.existsSync(filePath)) {
+ throw new Error(`Missing file at path: ${filePath}`);
+ }
+ external_fs_.appendFileSync(filePath, `${utils_toCommandValue(message)}${external_os_.EOL}`, {
+ encoding: 'utf8'
+ });
+}
+function file_command_prepareKeyValueMessage(key, value) {
+ const delimiter = `ghadelimiter_${external_crypto_.randomUUID()}`;
+ const convertedValue = utils_toCommandValue(value);
+ // These should realistically never happen, but just in case someone finds a
+ // way to exploit uuid generation let's not allow keys or values that contain
+ // the delimiter.
+ if (key.includes(delimiter)) {
+ throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
+ }
+ if (convertedValue.includes(delimiter)) {
+ throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
+ }
+ return `${key}<<${delimiter}${external_os_.EOL}${convertedValue}${external_os_.EOL}${delimiter}`;
+}
+//# sourceMappingURL=file-command.js.map
+// EXTERNAL MODULE: external "path"
+var external_path_ = __nccwpck_require__(6928);
+// EXTERNAL MODULE: external "http"
+var external_http_ = __nccwpck_require__(8611);
+// EXTERNAL MODULE: external "https"
+var external_https_ = __nccwpck_require__(5692);
+;// CONCATENATED MODULE: ./node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js
+function getProxyUrl(reqUrl) {
+ const usingSsl = reqUrl.protocol === 'https:';
+ if (checkBypass(reqUrl)) {
+ return undefined;
+ }
+ const proxyVar = (() => {
+ if (usingSsl) {
+ return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
+ }
+ else {
+ return process.env['http_proxy'] || process.env['HTTP_PROXY'];
+ }
+ })();
+ if (proxyVar) {
+ try {
+ return new DecodedURL(proxyVar);
+ }
+ catch (_a) {
+ if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
+ return new DecodedURL(`http://${proxyVar}`);
+ }
+ }
+ else {
+ return undefined;
+ }
+}
+function checkBypass(reqUrl) {
+ if (!reqUrl.hostname) {
+ return false;
+ }
+ const reqHost = reqUrl.hostname;
+ if (isLoopbackAddress(reqHost)) {
+ return true;
+ }
+ const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
+ if (!noProxy) {
+ return false;
+ }
+ // Determine the request port
+ let reqPort;
+ if (reqUrl.port) {
+ reqPort = Number(reqUrl.port);
+ }
+ else if (reqUrl.protocol === 'http:') {
+ reqPort = 80;
+ }
+ else if (reqUrl.protocol === 'https:') {
+ reqPort = 443;
+ }
+ // Format the request hostname and hostname with port
+ const upperReqHosts = [reqUrl.hostname.toUpperCase()];
+ if (typeof reqPort === 'number') {
+ upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
+ }
+ // Compare request host against noproxy
+ for (const upperNoProxyItem of noProxy
+ .split(',')
+ .map(x => x.trim().toUpperCase())
+ .filter(x => x)) {
+ if (upperNoProxyItem === '*' ||
+ upperReqHosts.some(x => x === upperNoProxyItem ||
+ x.endsWith(`.${upperNoProxyItem}`) ||
+ (upperNoProxyItem.startsWith('.') &&
+ x.endsWith(`${upperNoProxyItem}`)))) {
+ return true;
+ }
+ }
+ return false;
+}
+function isLoopbackAddress(host) {
+ const hostLower = host.toLowerCase();
+ return (hostLower === 'localhost' ||
+ hostLower.startsWith('127.') ||
+ hostLower.startsWith('[::1]') ||
+ hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
+}
+class DecodedURL extends URL {
+ constructor(url, base) {
+ super(url, base);
+ this._decodedUsername = decodeURIComponent(super.username);
+ this._decodedPassword = decodeURIComponent(super.password);
+ }
+ get username() {
+ return this._decodedUsername;
+ }
+ get password() {
+ return this._decodedPassword;
+ }
+}
+//# sourceMappingURL=proxy.js.map
+// EXTERNAL MODULE: ./node_modules/tunnel/index.js
+var node_modules_tunnel = __nccwpck_require__(770);
+// EXTERNAL MODULE: ./node_modules/undici/index.js
+var undici = __nccwpck_require__(6752);
+;// CONCATENATED MODULE: ./node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js
+/* eslint-disable @typescript-eslint/no-explicit-any */
+var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
- // eslint-disable-next-line no-param-reassign
- options = utils$1.toFlatObject(options, {
- metaTokens: true,
- dots: false,
- indexes: false
- }, false, function defined(option, source) {
- // eslint-disable-next-line no-eq-null,eqeqeq
- return !utils$1.isUndefined(source[option]);
- });
- const metaTokens = options.metaTokens;
- // eslint-disable-next-line no-use-before-define
- const visitor = options.visitor || defaultVisitor;
- const dots = options.dots;
- const indexes = options.indexes;
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
- if (!utils$1.isFunction(visitor)) {
- throw new TypeError('visitor must be a function');
- }
- function convertValue(value) {
- if (value === null) return '';
- if (utils$1.isDate(value)) {
- return value.toISOString();
+var HttpCodes;
+(function (HttpCodes) {
+ HttpCodes[HttpCodes["OK"] = 200] = "OK";
+ HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
+ HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
+ HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
+ HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
+ HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
+ HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
+ HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
+ HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
+ HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
+ HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
+ HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
+ HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
+ HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
+ HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
+ HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
+ HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
+ HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
+ HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
+ HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
+ HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
+ HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
+ HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
+ HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
+ HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
+ HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
+ HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
+})(HttpCodes || (HttpCodes = {}));
+var Headers;
+(function (Headers) {
+ Headers["Accept"] = "accept";
+ Headers["ContentType"] = "content-type";
+})(Headers || (Headers = {}));
+var MediaTypes;
+(function (MediaTypes) {
+ MediaTypes["ApplicationJson"] = "application/json";
+})(MediaTypes || (MediaTypes = {}));
+/**
+ * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
+ * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
+ */
+function lib_getProxyUrl(serverUrl) {
+ const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
+ return proxyUrl ? proxyUrl.href : '';
+}
+const HttpRedirectCodes = [
+ HttpCodes.MovedPermanently,
+ HttpCodes.ResourceMoved,
+ HttpCodes.SeeOther,
+ HttpCodes.TemporaryRedirect,
+ HttpCodes.PermanentRedirect
+];
+const HttpResponseRetryCodes = [
+ HttpCodes.BadGateway,
+ HttpCodes.ServiceUnavailable,
+ HttpCodes.GatewayTimeout
+];
+const RetryableHttpVerbs = (/* unused pure expression or super */ null && (['OPTIONS', 'GET', 'DELETE', 'HEAD']));
+const ExponentialBackoffCeiling = 10;
+const ExponentialBackoffTimeSlice = 5;
+class HttpClientError extends Error {
+ constructor(message, statusCode) {
+ super(message);
+ this.name = 'HttpClientError';
+ this.statusCode = statusCode;
+ Object.setPrototypeOf(this, HttpClientError.prototype);
+ }
+}
+class HttpClientResponse {
+ constructor(message) {
+ this.message = message;
+ }
+ readBody() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ let output = Buffer.alloc(0);
+ this.message.on('data', (chunk) => {
+ output = Buffer.concat([output, chunk]);
+ });
+ this.message.on('end', () => {
+ resolve(output.toString());
+ });
+ }));
+ });
+ }
+ readBodyBuffer() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ const chunks = [];
+ this.message.on('data', (chunk) => {
+ chunks.push(chunk);
+ });
+ this.message.on('end', () => {
+ resolve(Buffer.concat(chunks));
+ });
+ }));
+ });
+ }
+}
+function isHttps(requestUrl) {
+ const parsedUrl = new URL(requestUrl);
+ return parsedUrl.protocol === 'https:';
+}
+class lib_HttpClient {
+ constructor(userAgent, handlers, requestOptions) {
+ this._ignoreSslError = false;
+ this._allowRedirects = true;
+ this._allowRedirectDowngrade = false;
+ this._maxRedirects = 50;
+ this._allowRetries = false;
+ this._maxRetries = 1;
+ this._keepAlive = false;
+ this._disposed = false;
+ this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
+ this.handlers = handlers || [];
+ this.requestOptions = requestOptions;
+ if (requestOptions) {
+ if (requestOptions.ignoreSslError != null) {
+ this._ignoreSslError = requestOptions.ignoreSslError;
+ }
+ this._socketTimeout = requestOptions.socketTimeout;
+ if (requestOptions.allowRedirects != null) {
+ this._allowRedirects = requestOptions.allowRedirects;
+ }
+ if (requestOptions.allowRedirectDowngrade != null) {
+ this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
+ }
+ if (requestOptions.maxRedirects != null) {
+ this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
+ }
+ if (requestOptions.keepAlive != null) {
+ this._keepAlive = requestOptions.keepAlive;
+ }
+ if (requestOptions.allowRetries != null) {
+ this._allowRetries = requestOptions.allowRetries;
+ }
+ if (requestOptions.maxRetries != null) {
+ this._maxRetries = requestOptions.maxRetries;
+ }
+ }
+ }
+ options(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
+ });
+ }
+ get(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('GET', requestUrl, null, additionalHeaders || {});
+ });
+ }
+ del(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('DELETE', requestUrl, null, additionalHeaders || {});
+ });
+ }
+ post(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('POST', requestUrl, data, additionalHeaders || {});
+ });
+ }
+ patch(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('PATCH', requestUrl, data, additionalHeaders || {});
+ });
+ }
+ put(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('PUT', requestUrl, data, additionalHeaders || {});
+ });
+ }
+ head(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('HEAD', requestUrl, null, additionalHeaders || {});
+ });
+ }
+ sendStream(verb, requestUrl, stream, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request(verb, requestUrl, stream, additionalHeaders);
+ });
+ }
+ /**
+ * Gets a typed object from an endpoint
+ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
+ */
+ getJson(requestUrl_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ const res = yield this.get(requestUrl, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
+ }
+ postJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.post(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
+ }
+ putJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.put(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
+ }
+ patchJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.patch(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
+ }
+ /**
+ * Makes a raw http request.
+ * All other methods such as get, post, patch, and request ultimately call this.
+ * Prefer get, del, post and patch
+ */
+ request(verb, requestUrl, data, headers) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this._disposed) {
+ throw new Error('Client has already been disposed.');
+ }
+ const parsedUrl = new URL(requestUrl);
+ let info = this._prepareRequest(verb, parsedUrl, headers);
+ // Only perform retries on reads since writes may not be idempotent.
+ const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
+ ? this._maxRetries + 1
+ : 1;
+ let numTries = 0;
+ let response;
+ do {
+ response = yield this.requestRaw(info, data);
+ // Check if it's an authentication challenge
+ if (response &&
+ response.message &&
+ response.message.statusCode === HttpCodes.Unauthorized) {
+ let authenticationHandler;
+ for (const handler of this.handlers) {
+ if (handler.canHandleAuthentication(response)) {
+ authenticationHandler = handler;
+ break;
+ }
+ }
+ if (authenticationHandler) {
+ return authenticationHandler.handleAuthentication(this, info, data);
+ }
+ else {
+ // We have received an unauthorized response but have no handlers to handle it.
+ // Let the response return to the caller.
+ return response;
+ }
+ }
+ let redirectsRemaining = this._maxRedirects;
+ while (response.message.statusCode &&
+ HttpRedirectCodes.includes(response.message.statusCode) &&
+ this._allowRedirects &&
+ redirectsRemaining > 0) {
+ const redirectUrl = response.message.headers['location'];
+ if (!redirectUrl) {
+ // if there's no location to redirect to, we won't
+ break;
+ }
+ const parsedRedirectUrl = new URL(redirectUrl);
+ if (parsedUrl.protocol === 'https:' &&
+ parsedUrl.protocol !== parsedRedirectUrl.protocol &&
+ !this._allowRedirectDowngrade) {
+ throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
+ }
+ // we need to finish reading the response before reassigning response
+ // which will leak the open socket.
+ yield response.readBody();
+ // strip authorization header if redirected to a different hostname
+ if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
+ for (const header in headers) {
+ // header names are case insensitive
+ if (header.toLowerCase() === 'authorization') {
+ delete headers[header];
+ }
+ }
+ }
+ // let's make the request with the new redirectUrl
+ info = this._prepareRequest(verb, parsedRedirectUrl, headers);
+ response = yield this.requestRaw(info, data);
+ redirectsRemaining--;
+ }
+ if (!response.message.statusCode ||
+ !HttpResponseRetryCodes.includes(response.message.statusCode)) {
+ // If not a retry code, return immediately instead of retrying
+ return response;
+ }
+ numTries += 1;
+ if (numTries < maxTries) {
+ yield response.readBody();
+ yield this._performExponentialBackoff(numTries);
+ }
+ } while (numTries < maxTries);
+ return response;
+ });
}
-
- if (!useBlob && utils$1.isBlob(value)) {
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ /**
+ * Needs to be called if keepAlive is set to true in request options.
+ */
+ dispose() {
+ if (this._agent) {
+ this._agent.destroy();
+ }
+ this._disposed = true;
}
-
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
+ /**
+ * Raw request.
+ * @param info
+ * @param data
+ */
+ requestRaw(info, data) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve, reject) => {
+ function callbackForResult(err, res) {
+ if (err) {
+ reject(err);
+ }
+ else if (!res) {
+ // If `err` is not passed, then `res` must be passed.
+ reject(new Error('Unknown error'));
+ }
+ else {
+ resolve(res);
+ }
+ }
+ this.requestRawWithCallback(info, data, callbackForResult);
+ });
+ });
}
-
- return value;
- }
-
- /**
- * Default visitor.
- *
- * @param {*} value
- * @param {String|Number} key
- * @param {Array} path
- * @this {FormData}
- *
- * @returns {boolean} return true to visit the each prop of the value recursively
- */
- function defaultVisitor(value, key, path) {
- let arr = value;
-
- if (value && !path && typeof value === 'object') {
- if (utils$1.endsWith(key, '{}')) {
- // eslint-disable-next-line no-param-reassign
- key = metaTokens ? key : key.slice(0, -2);
- // eslint-disable-next-line no-param-reassign
- value = JSON.stringify(value);
- } else if (
- (utils$1.isArray(value) && isFlatArray(value)) ||
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
- )) {
- // eslint-disable-next-line no-param-reassign
- key = removeBrackets(key);
-
- arr.forEach(function each(el, index) {
- !(utils$1.isUndefined(el) || el === null) && formData.append(
- // eslint-disable-next-line no-nested-ternary
- indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
- convertValue(el)
- );
+ /**
+ * Raw request with callback.
+ * @param info
+ * @param data
+ * @param onResult
+ */
+ requestRawWithCallback(info, data, onResult) {
+ if (typeof data === 'string') {
+ if (!info.options.headers) {
+ info.options.headers = {};
+ }
+ info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
+ }
+ let callbackCalled = false;
+ function handleResult(err, res) {
+ if (!callbackCalled) {
+ callbackCalled = true;
+ onResult(err, res);
+ }
+ }
+ const req = info.httpModule.request(info.options, (msg) => {
+ const res = new HttpClientResponse(msg);
+ handleResult(undefined, res);
});
- return false;
- }
+ let socket;
+ req.on('socket', sock => {
+ socket = sock;
+ });
+ // If we ever get disconnected, we want the socket to timeout eventually
+ req.setTimeout(this._socketTimeout || 3 * 60000, () => {
+ if (socket) {
+ socket.end();
+ }
+ handleResult(new Error(`Request timeout: ${info.options.path}`));
+ });
+ req.on('error', function (err) {
+ // err has statusCode property
+ // res should have headers
+ handleResult(err);
+ });
+ if (data && typeof data === 'string') {
+ req.write(data, 'utf8');
+ }
+ if (data && typeof data !== 'string') {
+ data.on('close', function () {
+ req.end();
+ });
+ data.pipe(req);
+ }
+ else {
+ req.end();
+ }
}
-
- if (isVisitable(value)) {
- return true;
+ /**
+ * Gets an http agent. This function is useful when you need an http agent that handles
+ * routing through a proxy server - depending upon the url and proxy environment variables.
+ * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
+ */
+ getAgent(serverUrl) {
+ const parsedUrl = new URL(serverUrl);
+ return this._getAgent(parsedUrl);
}
-
- formData.append(renderKey(path, key, dots), convertValue(value));
-
- return false;
- }
-
- const stack = [];
-
- const exposedHelpers = Object.assign(predicates, {
- defaultVisitor,
- convertValue,
- isVisitable
- });
-
- function build(value, path) {
- if (utils$1.isUndefined(value)) return;
-
- if (stack.indexOf(value) !== -1) {
- throw Error('Circular reference detected in ' + path.join('.'));
+ getAgentDispatcher(serverUrl) {
+ const parsedUrl = new URL(serverUrl);
+ const proxyUrl = pm.getProxyUrl(parsedUrl);
+ const useProxy = proxyUrl && proxyUrl.hostname;
+ if (!useProxy) {
+ return;
+ }
+ return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
}
-
- stack.push(value);
-
- utils$1.forEach(value, function each(el, key) {
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
- );
-
- if (result === true) {
- build(el, path ? path.concat(key) : [key]);
- }
- });
-
- stack.pop();
- }
-
- if (!utils$1.isObject(obj)) {
- throw new TypeError('data must be an object');
- }
-
- build(obj);
-
- return formData;
-}
-
-/**
- * It encodes a string by replacing all characters that are not in the unreserved set with
- * their percent-encoded equivalents
- *
- * @param {string} str - The string to encode.
- *
- * @returns {string} The encoded string.
- */
-function encode$1(str) {
- const charMap = {
- '!': '%21',
- "'": '%27',
- '(': '%28',
- ')': '%29',
- '~': '%7E',
- '%20': '+',
- '%00': '\x00'
- };
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
- return charMap[match];
- });
-}
-
-/**
- * It takes a params object and converts it to a FormData object
- *
- * @param {Object} params - The parameters to be converted to a FormData object.
- * @param {Object} options - The options object passed to the Axios constructor.
- *
- * @returns {void}
- */
-function AxiosURLSearchParams(params, options) {
- this._pairs = [];
-
- params && toFormData(params, this, options);
-}
-
-const prototype = AxiosURLSearchParams.prototype;
-
-prototype.append = function append(name, value) {
- this._pairs.push([name, value]);
-};
-
-prototype.toString = function toString(encoder) {
- const _encode = encoder ? function(value) {
- return encoder.call(this, value, encode$1);
- } : encode$1;
-
- return this._pairs.map(function each(pair) {
- return _encode(pair[0]) + '=' + _encode(pair[1]);
- }, '').join('&');
-};
-
-/**
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
- * URI encoded counterparts
- *
- * @param {string} val The value to be encoded.
- *
- * @returns {string} The encoded value.
- */
-function encode(val) {
- return encodeURIComponent(val).
- replace(/%3A/gi, ':').
- replace(/%24/g, '$').
- replace(/%2C/gi, ',').
- replace(/%20/g, '+').
- replace(/%5B/gi, '[').
- replace(/%5D/gi, ']');
-}
-
-/**
- * Build a URL by appending params to the end
- *
- * @param {string} url The base of the url (e.g., http://www.google.com)
- * @param {object} [params] The params to be appended
- * @param {?object} options
- *
- * @returns {string} The formatted url
- */
-function buildURL(url, params, options) {
- /*eslint no-param-reassign:0*/
- if (!params) {
- return url;
- }
-
- const _encode = options && options.encode || encode;
-
- const serializeFn = options && options.serialize;
-
- let serializedParams;
-
- if (serializeFn) {
- serializedParams = serializeFn(params, options);
- } else {
- serializedParams = utils$1.isURLSearchParams(params) ?
- params.toString() :
- new AxiosURLSearchParams(params, options).toString(_encode);
- }
-
- if (serializedParams) {
- const hashmarkIndex = url.indexOf("#");
-
- if (hashmarkIndex !== -1) {
- url = url.slice(0, hashmarkIndex);
+ _prepareRequest(method, requestUrl, headers) {
+ const info = {};
+ info.parsedUrl = requestUrl;
+ const usingSsl = info.parsedUrl.protocol === 'https:';
+ info.httpModule = usingSsl ? https : http;
+ const defaultPort = usingSsl ? 443 : 80;
+ info.options = {};
+ info.options.host = info.parsedUrl.hostname;
+ info.options.port = info.parsedUrl.port
+ ? parseInt(info.parsedUrl.port)
+ : defaultPort;
+ info.options.path =
+ (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
+ info.options.method = method;
+ info.options.headers = this._mergeHeaders(headers);
+ if (this.userAgent != null) {
+ info.options.headers['user-agent'] = this.userAgent;
+ }
+ info.options.agent = this._getAgent(info.parsedUrl);
+ // gives handlers an opportunity to participate
+ if (this.handlers) {
+ for (const handler of this.handlers) {
+ handler.prepareRequest(info.options);
+ }
+ }
+ return info;
+ }
+ _mergeHeaders(headers) {
+ if (this.requestOptions && this.requestOptions.headers) {
+ return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
+ }
+ return lowercaseKeys(headers || {});
+ }
+ /**
+ * Gets an existing header value or returns a default.
+ * Handles converting number header values to strings since HTTP headers must be strings.
+ * Note: This returns string | string[] since some headers can have multiple values.
+ * For headers that must always be a single string (like Content-Type), use the
+ * specialized _getExistingOrDefaultContentTypeHeader method instead.
+ */
+ _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
+ let clientHeader;
+ if (this.requestOptions && this.requestOptions.headers) {
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[header];
+ if (headerValue) {
+ clientHeader =
+ typeof headerValue === 'number' ? headerValue.toString() : headerValue;
+ }
+ }
+ const additionalValue = additionalHeaders[header];
+ if (additionalValue !== undefined) {
+ return typeof additionalValue === 'number'
+ ? additionalValue.toString()
+ : additionalValue;
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
+ }
+ return _default;
+ }
+ /**
+ * Specialized version of _getExistingOrDefaultHeader for Content-Type header.
+ * Always returns a single string (not an array) since Content-Type should be a single value.
+ * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
+ * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
+ * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
+ */
+ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {
+ let clientHeader;
+ if (this.requestOptions && this.requestOptions.headers) {
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];
+ if (headerValue) {
+ if (typeof headerValue === 'number') {
+ clientHeader = String(headerValue);
+ }
+ else if (Array.isArray(headerValue)) {
+ clientHeader = headerValue.join(', ');
+ }
+ else {
+ clientHeader = headerValue;
+ }
+ }
+ }
+ const additionalValue = additionalHeaders[Headers.ContentType];
+ // Return the first non-undefined value, converting numbers or arrays to strings if necessary
+ if (additionalValue !== undefined) {
+ if (typeof additionalValue === 'number') {
+ return String(additionalValue);
+ }
+ else if (Array.isArray(additionalValue)) {
+ return additionalValue.join(', ');
+ }
+ else {
+ return additionalValue;
+ }
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
+ }
+ return _default;
+ }
+ _getAgent(parsedUrl) {
+ let agent;
+ const proxyUrl = pm.getProxyUrl(parsedUrl);
+ const useProxy = proxyUrl && proxyUrl.hostname;
+ if (this._keepAlive && useProxy) {
+ agent = this._proxyAgent;
+ }
+ if (!useProxy) {
+ agent = this._agent;
+ }
+ // if agent is already assigned use that agent.
+ if (agent) {
+ return agent;
+ }
+ const usingSsl = parsedUrl.protocol === 'https:';
+ let maxSockets = 100;
+ if (this.requestOptions) {
+ maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
+ }
+ // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
+ if (proxyUrl && proxyUrl.hostname) {
+ const agentOptions = {
+ maxSockets,
+ keepAlive: this._keepAlive,
+ proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
+ proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
+ })), { host: proxyUrl.hostname, port: proxyUrl.port })
+ };
+ let tunnelAgent;
+ const overHttps = proxyUrl.protocol === 'https:';
+ if (usingSsl) {
+ tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
+ }
+ else {
+ tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
+ }
+ agent = tunnelAgent(agentOptions);
+ this._proxyAgent = agent;
+ }
+ // if tunneling agent isn't assigned create a new agent
+ if (!agent) {
+ const options = { keepAlive: this._keepAlive, maxSockets };
+ agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
+ this._agent = agent;
+ }
+ if (usingSsl && this._ignoreSslError) {
+ // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
+ // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
+ // we have to cast it to any and change it directly
+ agent.options = Object.assign(agent.options || {}, {
+ rejectUnauthorized: false
+ });
+ }
+ return agent;
+ }
+ _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
+ let proxyAgent;
+ if (this._keepAlive) {
+ proxyAgent = this._proxyAgentDispatcher;
+ }
+ // if agent is already assigned use that agent.
+ if (proxyAgent) {
+ return proxyAgent;
+ }
+ const usingSsl = parsedUrl.protocol === 'https:';
+ proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
+ token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
+ })));
+ this._proxyAgentDispatcher = proxyAgent;
+ if (usingSsl && this._ignoreSslError) {
+ // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
+ // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
+ // we have to cast it to any and change it directly
+ proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
+ rejectUnauthorized: false
+ });
+ }
+ return proxyAgent;
+ }
+ _getUserAgentWithOrchestrationId(userAgent) {
+ const baseUserAgent = userAgent || 'actions/http-client';
+ const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
+ if (orchId) {
+ // Sanitize the orchestration ID to ensure it contains only valid characters
+ // Valid characters: 0-9, a-z, _, -, .
+ const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
+ return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
+ }
+ return baseUserAgent;
+ }
+ _performExponentialBackoff(retryNumber) {
+ return __awaiter(this, void 0, void 0, function* () {
+ retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
+ const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
+ return new Promise(resolve => setTimeout(() => resolve(), ms));
+ });
+ }
+ _processResponse(res, options) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
+ const statusCode = res.message.statusCode || 0;
+ const response = {
+ statusCode,
+ result: null,
+ headers: {}
+ };
+ // not found leads to null obj returned
+ if (statusCode === HttpCodes.NotFound) {
+ resolve(response);
+ }
+ // get the result from the body
+ function dateTimeDeserializer(key, value) {
+ if (typeof value === 'string') {
+ const a = new Date(value);
+ if (!isNaN(a.valueOf())) {
+ return a;
+ }
+ }
+ return value;
+ }
+ let obj;
+ let contents;
+ try {
+ contents = yield res.readBody();
+ if (contents && contents.length > 0) {
+ if (options && options.deserializeDates) {
+ obj = JSON.parse(contents, dateTimeDeserializer);
+ }
+ else {
+ obj = JSON.parse(contents);
+ }
+ response.result = obj;
+ }
+ response.headers = res.message.headers;
+ }
+ catch (err) {
+ // Invalid resource (contents not json); leaving result obj null
+ }
+ // note that 3xx redirects are handled by the http layer.
+ if (statusCode > 299) {
+ let msg;
+ // if exception/error in body, attempt to get better error
+ if (obj && obj.message) {
+ msg = obj.message;
+ }
+ else if (contents && contents.length > 0) {
+ // it may be the case that the exception is in the body message as string
+ msg = contents;
+ }
+ else {
+ msg = `Failed request: (${statusCode})`;
+ }
+ const err = new HttpClientError(msg, statusCode);
+ err.result = response.result;
+ reject(err);
+ }
+ else {
+ resolve(response);
+ }
+ }));
+ });
}
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
- }
-
- return url;
}
-
-class InterceptorManager {
- constructor() {
- this.handlers = [];
- }
-
- /**
- * Add a new interceptor to the stack
- *
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
- * @param {Function} rejected The function to handle `reject` for a `Promise`
- *
- * @return {Number} An ID used to remove interceptor later
- */
- use(fulfilled, rejected, options) {
- this.handlers.push({
- fulfilled,
- rejected,
- synchronous: options ? options.synchronous : false,
- runWhen: options ? options.runWhen : null
+const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js
+var auth_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
});
- return this.handlers.length - 1;
- }
-
- /**
- * Remove an interceptor from the stack
- *
- * @param {Number} id The ID that was returned by `use`
- *
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
- */
- eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
+};
+class BasicCredentialHandler {
+ constructor(username, password) {
+ this.username = username;
+ this.password = password;
}
- }
-
- /**
- * Clear all interceptors from the stack
- *
- * @returns {void}
- */
- clear() {
- if (this.handlers) {
- this.handlers = [];
+ prepareRequest(options) {
+ if (!options.headers) {
+ throw Error('The request has no headers');
+ }
+ options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
}
- }
-
- /**
- * Iterate over all the registered interceptors
- *
- * This method is particularly useful for skipping over any
- * interceptors that may have become `null` calling `eject`.
- *
- * @param {Function} fn The function to call for each interceptor
- *
- * @returns {void}
- */
- forEach(fn) {
- utils$1.forEach(this.handlers, function forEachHandler(h) {
- if (h !== null) {
- fn(h);
- }
- });
- }
-}
-
-const InterceptorManager$1 = InterceptorManager;
-
-const transitionalDefaults = {
- silentJSONParsing: true,
- forcedJSONParsing: true,
- clarifyTimeoutError: false
-};
-
-const URLSearchParams = url__default["default"].URLSearchParams;
-
-const platform$1 = {
- isNode: true,
- classes: {
- URLSearchParams,
- FormData: FormData__default["default"],
- Blob: typeof Blob !== 'undefined' && Blob || null
- },
- protocols: [ 'http', 'https', 'file', 'data' ]
-};
-
-const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
-
-/**
- * Determine if we're running in a standard browser environment
- *
- * This allows axios to run in a web worker, and react-native.
- * Both environments support XMLHttpRequest, but not fully standard globals.
- *
- * web workers:
- * typeof window -> undefined
- * typeof document -> undefined
- *
- * react-native:
- * navigator.product -> 'ReactNative'
- * nativescript
- * navigator.product -> 'NativeScript' or 'NS'
- *
- * @returns {boolean}
- */
-const hasStandardBrowserEnv = (
- (product) => {
- return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
- })(typeof navigator !== 'undefined' && navigator.product);
-
-/**
- * Determine if we're running in a standard browser webWorker environment
- *
- * Although the `isStandardBrowserEnv` method indicates that
- * `allows axios to run in a web worker`, the WebWorker will still be
- * filtered out due to its judgment standard
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
- * This leads to a problem when axios post `FormData` in webWorker
- */
-const hasStandardBrowserWebWorkerEnv = (() => {
- return (
- typeof WorkerGlobalScope !== 'undefined' &&
- // eslint-disable-next-line no-undef
- self instanceof WorkerGlobalScope &&
- typeof self.importScripts === 'function'
- );
-})();
-
-const origin = hasBrowserEnv && window.location.href || 'http://localhost';
-
-const utils = /*#__PURE__*/Object.freeze({
- __proto__: null,
- hasBrowserEnv: hasBrowserEnv,
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
- hasStandardBrowserEnv: hasStandardBrowserEnv,
- origin: origin
-});
-
-const platform = {
- ...utils,
- ...platform$1
-};
-
-function toURLEncodedForm(data, options) {
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
- visitor: function(value, key, path, helpers) {
- if (platform.isNode && utils$1.isBuffer(value)) {
- this.append(key, value.toString('base64'));
+ // This handler cannot handle 401
+ canHandleAuthentication() {
return false;
- }
-
- return helpers.defaultVisitor.apply(this, arguments);
}
- }, options));
-}
-
-/**
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
- *
- * @param {string} name - The name of the property to get.
- *
- * @returns An array of strings.
- */
-function parsePropPath(name) {
- // foo[x][y][z]
- // foo.x.y.z
- // foo-x-y-z
- // foo x y z
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
- return match[0] === '[]' ? '' : match[1] || match[0];
- });
+ handleAuthentication() {
+ return auth_awaiter(this, void 0, void 0, function* () {
+ throw new Error('not implemented');
+ });
+ }
}
-
-/**
- * Convert an array to an object.
- *
- * @param {Array} arr - The array to convert to an object.
- *
- * @returns An object with the same keys and values as the array.
- */
-function arrayToObject(arr) {
- const obj = {};
- const keys = Object.keys(arr);
- let i;
- const len = keys.length;
- let key;
- for (i = 0; i < len; i++) {
- key = keys[i];
- obj[key] = arr[key];
- }
- return obj;
+class auth_BearerCredentialHandler {
+ constructor(token) {
+ this.token = token;
+ }
+ // currently implements pre-authorization
+ // TODO: support preAuth = false where it hooks on 401
+ prepareRequest(options) {
+ if (!options.headers) {
+ throw Error('The request has no headers');
+ }
+ options.headers['Authorization'] = `Bearer ${this.token}`;
+ }
+ // This handler cannot handle 401
+ canHandleAuthentication() {
+ return false;
+ }
+ handleAuthentication() {
+ return auth_awaiter(this, void 0, void 0, function* () {
+ throw new Error('not implemented');
+ });
+ }
}
-
-/**
- * It takes a FormData object and returns a JavaScript object
- *
- * @param {string} formData The FormData object to convert to JSON.
- *
- * @returns {Object | null} The converted object.
- */
-function formDataToJSON(formData) {
- function buildPath(path, value, target, index) {
- let name = path[index++];
-
- if (name === '__proto__') return true;
-
- const isNumericKey = Number.isFinite(+name);
- const isLast = index >= path.length;
- name = !name && utils$1.isArray(target) ? target.length : name;
-
- if (isLast) {
- if (utils$1.hasOwnProp(target, name)) {
- target[name] = [target[name], value];
- } else {
- target[name] = value;
- }
-
- return !isNumericKey;
+class PersonalAccessTokenCredentialHandler {
+ constructor(token) {
+ this.token = token;
}
-
- if (!target[name] || !utils$1.isObject(target[name])) {
- target[name] = [];
+ // currently implements pre-authorization
+ // TODO: support preAuth = false where it hooks on 401
+ prepareRequest(options) {
+ if (!options.headers) {
+ throw Error('The request has no headers');
+ }
+ options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
}
-
- const result = buildPath(path, value, target[name], index);
-
- if (result && utils$1.isArray(target[name])) {
- target[name] = arrayToObject(target[name]);
+ // This handler cannot handle 401
+ canHandleAuthentication() {
+ return false;
}
-
- return !isNumericKey;
- }
-
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
- const obj = {};
-
- utils$1.forEachEntry(formData, (name, value) => {
- buildPath(parsePropPath(name), value, obj, 0);
+ handleAuthentication() {
+ return auth_awaiter(this, void 0, void 0, function* () {
+ throw new Error('not implemented');
+ });
+ }
+}
+//# sourceMappingURL=auth.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/oidc-utils.js
+var oidc_utils_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
});
+};
- return obj;
- }
- return null;
-}
-/**
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
- * of the input
- *
- * @param {any} rawValue - The value to be stringified.
- * @param {Function} parser - A function that parses a string into a JavaScript object.
- * @param {Function} encoder - A function that takes a value and returns a string.
- *
- * @returns {string} A stringified version of the rawValue.
- */
-function stringifySafely(rawValue, parser, encoder) {
- if (utils$1.isString(rawValue)) {
- try {
- (parser || JSON.parse)(rawValue);
- return utils$1.trim(rawValue);
- } catch (e) {
- if (e.name !== 'SyntaxError') {
- throw e;
- }
+class oidc_utils_OidcClient {
+ static createHttpClient(allowRetry = true, maxRetry = 10) {
+ const requestOptions = {
+ allowRetries: allowRetry,
+ maxRetries: maxRetry
+ };
+ return new HttpClient('actions/oidc-client', [new BearerCredentialHandler(oidc_utils_OidcClient.getRequestToken())], requestOptions);
+ }
+ static getRequestToken() {
+ const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
+ if (!token) {
+ throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
+ }
+ return token;
+ }
+ static getIDTokenUrl() {
+ const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
+ if (!runtimeUrl) {
+ throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
+ }
+ return runtimeUrl;
+ }
+ static getCall(id_token_url) {
+ return oidc_utils_awaiter(this, void 0, void 0, function* () {
+ var _a;
+ const httpclient = oidc_utils_OidcClient.createHttpClient();
+ const res = yield httpclient
+ .getJson(id_token_url)
+ .catch(error => {
+ throw new Error(`Failed to get ID Token. \n
+ Error Code : ${error.statusCode}\n
+ Error Message: ${error.message}`);
+ });
+ const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
+ if (!id_token) {
+ throw new Error('Response json body do not have ID Token field');
+ }
+ return id_token;
+ });
+ }
+ static getIDToken(audience) {
+ return oidc_utils_awaiter(this, void 0, void 0, function* () {
+ try {
+ // New ID Token is requested from action service
+ let id_token_url = oidc_utils_OidcClient.getIDTokenUrl();
+ if (audience) {
+ const encodedAudience = encodeURIComponent(audience);
+ id_token_url = `${id_token_url}&audience=${encodedAudience}`;
+ }
+ debug(`ID token url is ${id_token_url}`);
+ const id_token = yield oidc_utils_OidcClient.getCall(id_token_url);
+ setSecret(id_token);
+ return id_token;
+ }
+ catch (error) {
+ throw new Error(`Error message: ${error.message}`);
+ }
+ });
}
- }
-
- return (encoder || JSON.stringify)(rawValue);
}
+//# sourceMappingURL=oidc-utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/summary.js
+var summary_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
-const defaults = {
-
- transitional: transitionalDefaults,
-
- adapter: ['xhr', 'http', 'fetch'],
-
- transformRequest: [function transformRequest(data, headers) {
- const contentType = headers.getContentType() || '';
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
- const isObjectPayload = utils$1.isObject(data);
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
- data = new FormData(data);
+const { access, appendFile, writeFile } = external_fs_.promises;
+const SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
+const SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
+class Summary {
+ constructor() {
+ this._buffer = '';
}
-
- const isFormData = utils$1.isFormData(data);
-
- if (isFormData) {
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ /**
+ * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
+ * Also checks r/w permissions.
+ *
+ * @returns step summary file path
+ */
+ filePath() {
+ return summary_awaiter(this, void 0, void 0, function* () {
+ if (this._filePath) {
+ return this._filePath;
+ }
+ const pathFromEnv = process.env[SUMMARY_ENV_VAR];
+ if (!pathFromEnv) {
+ throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
+ }
+ try {
+ yield access(pathFromEnv, external_fs_.constants.R_OK | external_fs_.constants.W_OK);
+ }
+ catch (_a) {
+ throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
+ }
+ this._filePath = pathFromEnv;
+ return this._filePath;
+ });
}
-
- if (utils$1.isArrayBuffer(data) ||
- utils$1.isBuffer(data) ||
- utils$1.isStream(data) ||
- utils$1.isFile(data) ||
- utils$1.isBlob(data) ||
- utils$1.isReadableStream(data)
- ) {
- return data;
+ /**
+ * Wraps content in an HTML tag, adding any HTML attributes
+ *
+ * @param {string} tag HTML tag to wrap
+ * @param {string | null} content content within the tag
+ * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
+ *
+ * @returns {string} content wrapped in HTML element
+ */
+ wrap(tag, content, attrs = {}) {
+ const htmlAttrs = Object.entries(attrs)
+ .map(([key, value]) => ` ${key}="${value}"`)
+ .join('');
+ if (!content) {
+ return `<${tag}${htmlAttrs}>`;
+ }
+ return `<${tag}${htmlAttrs}>${content}${tag}>`;
}
- if (utils$1.isArrayBufferView(data)) {
- return data.buffer;
+ /**
+ * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
+ *
+ * @param {SummaryWriteOptions} [options] (optional) options for write operation
+ *
+ * @returns {Promise} summary instance
+ */
+ write(options) {
+ return summary_awaiter(this, void 0, void 0, function* () {
+ const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
+ const filePath = yield this.filePath();
+ const writeFunc = overwrite ? writeFile : appendFile;
+ yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
+ return this.emptyBuffer();
+ });
}
- if (utils$1.isURLSearchParams(data)) {
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
- return data.toString();
+ /**
+ * Clears the summary buffer and wipes the summary file
+ *
+ * @returns {Summary} summary instance
+ */
+ clear() {
+ return summary_awaiter(this, void 0, void 0, function* () {
+ return this.emptyBuffer().write({ overwrite: true });
+ });
}
-
- let isFileList;
-
- if (isObjectPayload) {
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
- return toURLEncodedForm(data, this.formSerializer).toString();
- }
-
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
- const _FormData = this.env && this.env.FormData;
-
- return toFormData(
- isFileList ? {'files[]': data} : data,
- _FormData && new _FormData(),
- this.formSerializer
- );
- }
+ /**
+ * Returns the current summary buffer as a string
+ *
+ * @returns {string} string of summary buffer
+ */
+ stringify() {
+ return this._buffer;
}
-
- if (isObjectPayload || hasJSONContentType ) {
- headers.setContentType('application/json', false);
- return stringifySafely(data);
+ /**
+ * If the summary buffer is empty
+ *
+ * @returns {boolen} true if the buffer is empty
+ */
+ isEmptyBuffer() {
+ return this._buffer.length === 0;
}
-
- return data;
- }],
-
- transformResponse: [function transformResponse(data) {
- const transitional = this.transitional || defaults.transitional;
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
- const JSONRequested = this.responseType === 'json';
-
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
- return data;
+ /**
+ * Resets the summary buffer without writing to summary file
+ *
+ * @returns {Summary} summary instance
+ */
+ emptyBuffer() {
+ this._buffer = '';
+ return this;
}
-
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
-
- try {
- return JSON.parse(data);
- } catch (e) {
- if (strictJSONParsing) {
- if (e.name === 'SyntaxError') {
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
- }
- throw e;
- }
- }
+ /**
+ * Adds raw text to the summary buffer
+ *
+ * @param {string} text content to add
+ * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
+ *
+ * @returns {Summary} summary instance
+ */
+ addRaw(text, addEOL = false) {
+ this._buffer += text;
+ return addEOL ? this.addEOL() : this;
+ }
+ /**
+ * Adds the operating system-specific end-of-line marker to the buffer
+ *
+ * @returns {Summary} summary instance
+ */
+ addEOL() {
+ return this.addRaw(external_os_.EOL);
+ }
+ /**
+ * Adds an HTML codeblock to the summary buffer
+ *
+ * @param {string} code content to render within fenced code block
+ * @param {string} lang (optional) language to syntax highlight code
+ *
+ * @returns {Summary} summary instance
+ */
+ addCodeBlock(code, lang) {
+ const attrs = Object.assign({}, (lang && { lang }));
+ const element = this.wrap('pre', this.wrap('code', code), attrs);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML list to the summary buffer
+ *
+ * @param {string[]} items list of items to render
+ * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
+ *
+ * @returns {Summary} summary instance
+ */
+ addList(items, ordered = false) {
+ const tag = ordered ? 'ol' : 'ul';
+ const listItems = items.map(item => this.wrap('li', item)).join('');
+ const element = this.wrap(tag, listItems);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML table to the summary buffer
+ *
+ * @param {SummaryTableCell[]} rows table rows
+ *
+ * @returns {Summary} summary instance
+ */
+ addTable(rows) {
+ const tableBody = rows
+ .map(row => {
+ const cells = row
+ .map(cell => {
+ if (typeof cell === 'string') {
+ return this.wrap('td', cell);
+ }
+ const { header, data, colspan, rowspan } = cell;
+ const tag = header ? 'th' : 'td';
+ const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
+ return this.wrap(tag, data, attrs);
+ })
+ .join('');
+ return this.wrap('tr', cells);
+ })
+ .join('');
+ const element = this.wrap('table', tableBody);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds a collapsable HTML details element to the summary buffer
+ *
+ * @param {string} label text for the closed state
+ * @param {string} content collapsable content
+ *
+ * @returns {Summary} summary instance
+ */
+ addDetails(label, content) {
+ const element = this.wrap('details', this.wrap('summary', label) + content);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML image tag to the summary buffer
+ *
+ * @param {string} src path to the image you to embed
+ * @param {string} alt text description of the image
+ * @param {SummaryImageOptions} options (optional) addition image attributes
+ *
+ * @returns {Summary} summary instance
+ */
+ addImage(src, alt, options) {
+ const { width, height } = options || {};
+ const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
+ const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML section heading element
+ *
+ * @param {string} text heading text
+ * @param {number | string} [level=1] (optional) the heading level, default: 1
+ *
+ * @returns {Summary} summary instance
+ */
+ addHeading(text, level) {
+ const tag = `h${level}`;
+ const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
+ ? tag
+ : 'h1';
+ const element = this.wrap(allowedTag, text);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML thematic break (
) to the summary buffer
+ *
+ * @returns {Summary} summary instance
+ */
+ addSeparator() {
+ const element = this.wrap('hr', null);
+ return this.addRaw(element).addEOL();
+ }
+ /**
+ * Adds an HTML line break (
) to the summary buffer
+ *
+ * @returns {Summary} summary instance
+ */
+ addBreak() {
+ const element = this.wrap('br', null);
+ return this.addRaw(element).addEOL();
}
-
- return data;
- }],
-
- /**
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
- * timeout is not created.
- */
- timeout: 0,
-
- xsrfCookieName: 'XSRF-TOKEN',
- xsrfHeaderName: 'X-XSRF-TOKEN',
-
- maxContentLength: -1,
- maxBodyLength: -1,
-
- env: {
- FormData: platform.classes.FormData,
- Blob: platform.classes.Blob
- },
-
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- },
-
- headers: {
- common: {
- 'Accept': 'application/json, text/plain, */*',
- 'Content-Type': undefined
+ /**
+ * Adds an HTML blockquote to the summary buffer
+ *
+ * @param {string} text quote text
+ * @param {string} cite (optional) citation url
+ *
+ * @returns {Summary} summary instance
+ */
+ addQuote(text, cite) {
+ const attrs = Object.assign({}, (cite && { cite }));
+ const element = this.wrap('blockquote', text, attrs);
+ return this.addRaw(element).addEOL();
}
- }
-};
-
-utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
- defaults.headers[method] = {};
-});
-
-const defaults$1 = defaults;
-
-// RawAxiosHeaders whose duplicates are ignored by node
-// c.f. https://nodejs.org/api/http.html#http_message_headers
-const ignoreDuplicateOf = utils$1.toObjectSet([
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
- 'referer', 'retry-after', 'user-agent'
-]);
+ /**
+ * Adds an HTML anchor tag to the summary buffer
+ *
+ * @param {string} text link text/content
+ * @param {string} href hyperlink
+ *
+ * @returns {Summary} summary instance
+ */
+ addLink(text, href) {
+ const element = this.wrap('a', text, { href });
+ return this.addRaw(element).addEOL();
+ }
+}
+const _summary = new Summary();
+/**
+ * @deprecated use `core.summary`
+ */
+const markdownSummary = (/* unused pure expression or super */ null && (_summary));
+const summary = (/* unused pure expression or super */ null && (_summary));
+//# sourceMappingURL=summary.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/path-utils.js
/**
- * Parse headers into an object
- *
- * ```
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
- * Content-Type: application/json
- * Connection: keep-alive
- * Transfer-Encoding: chunked
- * ```
+ * toPosixPath converts the given path to the posix form. On Windows, \\ will be
+ * replaced with /.
*
- * @param {String} rawHeaders Headers needing to be parsed
+ * @param pth. Path to transform.
+ * @return string Posix path.
+ */
+function toPosixPath(pth) {
+ return pth.replace(/[\\]/g, '/');
+}
+/**
+ * toWin32Path converts the given path to the win32 form. On Linux, / will be
+ * replaced with \\.
*
- * @returns {Object} Headers parsed into an object
+ * @param pth. Path to transform.
+ * @return string Win32 path.
*/
-const parseHeaders = rawHeaders => {
- const parsed = {};
- let key;
- let val;
- let i;
+function toWin32Path(pth) {
+ return pth.replace(/[/]/g, '\\');
+}
+/**
+ * toPlatformPath converts the given path to a platform-specific path. It does
+ * this by replacing instances of / and \ with the platform-specific path
+ * separator.
+ *
+ * @param pth The path to platformize.
+ * @return string The platform-specific path.
+ */
+function toPlatformPath(pth) {
+ return pth.replace(/[/\\]/g, path.sep);
+}
+//# sourceMappingURL=path-utils.js.map
+// EXTERNAL MODULE: external "string_decoder"
+var external_string_decoder_ = __nccwpck_require__(3193);
+// EXTERNAL MODULE: external "events"
+var external_events_ = __nccwpck_require__(4434);
+;// CONCATENATED MODULE: external "child_process"
+const external_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process");
+// EXTERNAL MODULE: external "assert"
+var external_assert_ = __nccwpck_require__(2613);
+;// CONCATENATED MODULE: ./node_modules/@actions/io/lib/io-util.js
+var io_util_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
- i = line.indexOf(':');
- key = line.substring(0, i).trim().toLowerCase();
- val = line.substring(i + 1).trim();
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
- return;
+const { chmod, copyFile, lstat, mkdir, open: io_util_open, readdir, rename, rm, rmdir, stat, symlink, unlink } = external_fs_.promises;
+// export const {open} = 'fs'
+const IS_WINDOWS = process.platform === 'win32';
+/**
+ * Custom implementation of readlink to ensure Windows junctions
+ * maintain trailing backslash for backward compatibility with Node.js < 24
+ *
+ * In Node.js 20, Windows junctions (directory symlinks) always returned paths
+ * with trailing backslashes. Node.js 24 removed this behavior, which breaks
+ * code that relied on this format for path operations.
+ *
+ * This implementation restores the Node 20 behavior by adding a trailing
+ * backslash to all junction results on Windows.
+ */
+function readlink(fsPath) {
+ return io_util_awaiter(this, void 0, void 0, function* () {
+ const result = yield fs.promises.readlink(fsPath);
+ // On Windows, restore Node 20 behavior: add trailing backslash to all results
+ // since junctions on Windows are always directory links
+ if (IS_WINDOWS && !result.endsWith('\\')) {
+ return `${result}\\`;
+ }
+ return result;
+ });
+}
+// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
+const UV_FS_O_EXLOCK = 0x10000000;
+const READONLY = external_fs_.constants.O_RDONLY;
+function exists(fsPath) {
+ return io_util_awaiter(this, void 0, void 0, function* () {
+ try {
+ yield stat(fsPath);
+ }
+ catch (err) {
+ if (err.code === 'ENOENT') {
+ return false;
+ }
+ throw err;
+ }
+ return true;
+ });
+}
+function isDirectory(fsPath_1) {
+ return io_util_awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {
+ const stats = useStat ? yield stat(fsPath) : yield lstat(fsPath);
+ return stats.isDirectory();
+ });
+}
+/**
+ * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
+ * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
+ */
+function isRooted(p) {
+ p = normalizeSeparators(p);
+ if (!p) {
+ throw new Error('isRooted() parameter "p" cannot be empty');
}
-
- if (key === 'set-cookie') {
- if (parsed[key]) {
- parsed[key].push(val);
- } else {
- parsed[key] = [val];
- }
- } else {
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ if (IS_WINDOWS) {
+ return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
+ ); // e.g. C: or C:\hello
}
- });
-
- return parsed;
-};
-
-const $internals = Symbol('internals');
-
-function normalizeHeader(header) {
- return header && String(header).trim().toLowerCase();
+ return p.startsWith('/');
}
-
-function normalizeValue(value) {
- if (value === false || value == null) {
- return value;
- }
-
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
+/**
+ * Best effort attempt to determine whether a file exists and is executable.
+ * @param filePath file path to check
+ * @param extensions additional file extensions to try
+ * @return if file exists and is executable, returns the file path. otherwise empty string.
+ */
+function tryGetExecutablePath(filePath, extensions) {
+ return io_util_awaiter(this, void 0, void 0, function* () {
+ let stats = undefined;
+ try {
+ // test file exists
+ stats = yield stat(filePath);
+ }
+ catch (err) {
+ if (err.code !== 'ENOENT') {
+ // eslint-disable-next-line no-console
+ console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
+ }
+ }
+ if (stats && stats.isFile()) {
+ if (IS_WINDOWS) {
+ // on Windows, test for valid extension
+ const upperExt = external_path_.extname(filePath).toUpperCase();
+ if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
+ return filePath;
+ }
+ }
+ else {
+ if (isUnixExecutable(stats)) {
+ return filePath;
+ }
+ }
+ }
+ // try each extension
+ const originalFilePath = filePath;
+ for (const extension of extensions) {
+ filePath = originalFilePath + extension;
+ stats = undefined;
+ try {
+ stats = yield stat(filePath);
+ }
+ catch (err) {
+ if (err.code !== 'ENOENT') {
+ // eslint-disable-next-line no-console
+ console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
+ }
+ }
+ if (stats && stats.isFile()) {
+ if (IS_WINDOWS) {
+ // preserve the case of the actual file (since an extension was appended)
+ try {
+ const directory = external_path_.dirname(filePath);
+ const upperName = external_path_.basename(filePath).toUpperCase();
+ for (const actualName of yield readdir(directory)) {
+ if (upperName === actualName.toUpperCase()) {
+ filePath = external_path_.join(directory, actualName);
+ break;
+ }
+ }
+ }
+ catch (err) {
+ // eslint-disable-next-line no-console
+ console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
+ }
+ return filePath;
+ }
+ else {
+ if (isUnixExecutable(stats)) {
+ return filePath;
+ }
+ }
+ }
+ }
+ return '';
+ });
}
-
-function parseTokens(str) {
- const tokens = Object.create(null);
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
- let match;
-
- while ((match = tokensRE.exec(str))) {
- tokens[match[1]] = match[2];
- }
-
- return tokens;
+function normalizeSeparators(p) {
+ p = p || '';
+ if (IS_WINDOWS) {
+ // convert slashes on Windows
+ p = p.replace(/\//g, '\\');
+ // remove redundant slashes
+ return p.replace(/\\\\+/g, '\\');
+ }
+ // remove redundant slashes
+ return p.replace(/\/\/+/g, '/');
+}
+// on Mac/Linux, test the execute bit
+// R W X R W X R W X
+// 256 128 64 32 16 8 4 2 1
+function isUnixExecutable(stats) {
+ return ((stats.mode & 1) > 0 ||
+ ((stats.mode & 8) > 0 &&
+ process.getgid !== undefined &&
+ stats.gid === process.getgid()) ||
+ ((stats.mode & 64) > 0 &&
+ process.getuid !== undefined &&
+ stats.uid === process.getuid()));
+}
+// Get the path of cmd.exe in windows
+function getCmdPath() {
+ var _a;
+ return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
}
+//# sourceMappingURL=io-util.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/io/lib/io.js
+var io_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
-const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
-
-function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
- if (utils$1.isFunction(filter)) {
- return filter.call(this, value, header);
- }
-
- if (isHeaderNameFilter) {
- value = header;
- }
-
- if (!utils$1.isString(value)) return;
- if (utils$1.isString(filter)) {
- return value.indexOf(filter) !== -1;
- }
- if (utils$1.isRegExp(filter)) {
- return filter.test(value);
- }
+/**
+ * Copies a file or folder.
+ * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
+ *
+ * @param source source path
+ * @param dest destination path
+ * @param options optional. See CopyOptions.
+ */
+function cp(source_1, dest_1) {
+ return io_awaiter(this, arguments, void 0, function* (source, dest, options = {}) {
+ const { force, recursive, copySourceDirectory } = readCopyOptions(options);
+ const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
+ // Dest is an existing file, but not forcing
+ if (destStat && destStat.isFile() && !force) {
+ return;
+ }
+ // If dest is an existing directory, should copy inside.
+ const newDest = destStat && destStat.isDirectory() && copySourceDirectory
+ ? path.join(dest, path.basename(source))
+ : dest;
+ if (!(yield ioUtil.exists(source))) {
+ throw new Error(`no such file or directory: ${source}`);
+ }
+ const sourceStat = yield ioUtil.stat(source);
+ if (sourceStat.isDirectory()) {
+ if (!recursive) {
+ throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
+ }
+ else {
+ yield cpDirRecursive(source, newDest, 0, force);
+ }
+ }
+ else {
+ if (path.relative(source, newDest) === '') {
+ // a file cannot be copied to itself
+ throw new Error(`'${newDest}' and '${source}' are the same file`);
+ }
+ yield io_copyFile(source, newDest, force);
+ }
+ });
}
-
-function formatHeader(header) {
- return header.trim()
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
- return char.toUpperCase() + str;
+/**
+ * Moves a path.
+ *
+ * @param source source path
+ * @param dest destination path
+ * @param options optional. See MoveOptions.
+ */
+function mv(source_1, dest_1) {
+ return io_awaiter(this, arguments, void 0, function* (source, dest, options = {}) {
+ if (yield ioUtil.exists(dest)) {
+ let destExists = true;
+ if (yield ioUtil.isDirectory(dest)) {
+ // If dest is directory copy src into dest
+ dest = path.join(dest, path.basename(source));
+ destExists = yield ioUtil.exists(dest);
+ }
+ if (destExists) {
+ if (options.force == null || options.force) {
+ yield rmRF(dest);
+ }
+ else {
+ throw new Error('Destination already exists');
+ }
+ }
+ }
+ yield mkdirP(path.dirname(dest));
+ yield ioUtil.rename(source, dest);
});
}
-
-function buildAccessors(obj, header) {
- const accessorName = utils$1.toCamelCase(' ' + header);
-
- ['get', 'set', 'has'].forEach(methodName => {
- Object.defineProperty(obj, methodName + accessorName, {
- value: function(arg1, arg2, arg3) {
- return this[methodName].call(this, header, arg1, arg2, arg3);
- },
- configurable: true
+/**
+ * Remove a path recursively with force
+ *
+ * @param inputPath path to remove
+ */
+function rmRF(inputPath) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ if (ioUtil.IS_WINDOWS) {
+ // Check for invalid characters
+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
+ if (/[*"<>|]/.test(inputPath)) {
+ throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
+ }
+ }
+ try {
+ // note if path does not exist, error is silent
+ yield ioUtil.rm(inputPath, {
+ force: true,
+ maxRetries: 3,
+ recursive: true,
+ retryDelay: 300
+ });
+ }
+ catch (err) {
+ throw new Error(`File was unable to be removed ${err}`);
+ }
});
- });
}
+/**
+ * Make a directory. Creates the full path with folders in between
+ * Will throw if it fails
+ *
+ * @param fsPath path to create
+ * @returns Promise
+ */
+function mkdirP(fsPath) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ ok(fsPath, 'a path argument must be provided');
+ yield ioUtil.mkdir(fsPath, { recursive: true });
+ });
+}
+/**
+ * Returns path of a tool had the tool actually been invoked. Resolves via paths.
+ * If you check and the tool does not exist, it will throw.
+ *
+ * @param tool name of the tool
+ * @param check whether to check if tool exists
+ * @returns Promise path to tool
+ */
+function which(tool, check) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ if (!tool) {
+ throw new Error("parameter 'tool' is required");
+ }
+ // recursive when check=true
+ if (check) {
+ const result = yield which(tool, false);
+ if (!result) {
+ if (IS_WINDOWS) {
+ throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
+ }
+ else {
+ throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
+ }
+ }
+ return result;
+ }
+ const matches = yield findInPath(tool);
+ if (matches && matches.length > 0) {
+ return matches[0];
+ }
+ return '';
+ });
+}
+/**
+ * Returns a list of all occurrences of the given tool on the system path.
+ *
+ * @returns Promise the paths of the tool
+ */
+function findInPath(tool) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ if (!tool) {
+ throw new Error("parameter 'tool' is required");
+ }
+ // build the list of extensions to try
+ const extensions = [];
+ if (IS_WINDOWS && process.env['PATHEXT']) {
+ for (const extension of process.env['PATHEXT'].split(external_path_.delimiter)) {
+ if (extension) {
+ extensions.push(extension);
+ }
+ }
+ }
+ // if it's rooted, return it if exists. otherwise return empty.
+ if (isRooted(tool)) {
+ const filePath = yield tryGetExecutablePath(tool, extensions);
+ if (filePath) {
+ return [filePath];
+ }
+ return [];
+ }
+ // if any path separators, return empty
+ if (tool.includes(external_path_.sep)) {
+ return [];
+ }
+ // build the list of directories
+ //
+ // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
+ // it feels like we should not do this. Checking the current directory seems like more of a use
+ // case of a shell, and the which() function exposed by the toolkit should strive for consistency
+ // across platforms.
+ const directories = [];
+ if (process.env.PATH) {
+ for (const p of process.env.PATH.split(external_path_.delimiter)) {
+ if (p) {
+ directories.push(p);
+ }
+ }
+ }
+ // find all matches
+ const matches = [];
+ for (const directory of directories) {
+ const filePath = yield tryGetExecutablePath(external_path_.join(directory, tool), extensions);
+ if (filePath) {
+ matches.push(filePath);
+ }
+ }
+ return matches;
+ });
+}
+function readCopyOptions(options) {
+ const force = options.force == null ? true : options.force;
+ const recursive = Boolean(options.recursive);
+ const copySourceDirectory = options.copySourceDirectory == null
+ ? true
+ : Boolean(options.copySourceDirectory);
+ return { force, recursive, copySourceDirectory };
+}
+function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ // Ensure there is not a run away recursive copy
+ if (currentDepth >= 255)
+ return;
+ currentDepth++;
+ yield mkdirP(destDir);
+ const files = yield ioUtil.readdir(sourceDir);
+ for (const fileName of files) {
+ const srcFile = `${sourceDir}/${fileName}`;
+ const destFile = `${destDir}/${fileName}`;
+ const srcFileStat = yield ioUtil.lstat(srcFile);
+ if (srcFileStat.isDirectory()) {
+ // Recurse
+ yield cpDirRecursive(srcFile, destFile, currentDepth, force);
+ }
+ else {
+ yield io_copyFile(srcFile, destFile, force);
+ }
+ }
+ // Change the mode for the newly created directory
+ yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
+ });
+}
+// Buffered file copy
+function io_copyFile(srcFile, destFile, force) {
+ return io_awaiter(this, void 0, void 0, function* () {
+ if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
+ // unlink/re-link it
+ try {
+ yield ioUtil.lstat(destFile);
+ yield ioUtil.unlink(destFile);
+ }
+ catch (e) {
+ // Try to override file permission
+ if (e.code === 'EPERM') {
+ yield ioUtil.chmod(destFile, '0666');
+ yield ioUtil.unlink(destFile);
+ }
+ // other errors = it doesn't exist, no work to do
+ }
+ // Copy over symlink
+ const symlinkFull = yield ioUtil.readlink(srcFile);
+ yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
+ }
+ else if (!(yield ioUtil.exists(destFile)) || force) {
+ yield ioUtil.copyFile(srcFile, destFile);
+ }
+ });
+}
+//# sourceMappingURL=io.js.map
+;// CONCATENATED MODULE: external "timers"
+const external_timers_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers");
+;// CONCATENATED MODULE: ./node_modules/@actions/exec/lib/toolrunner.js
+var toolrunner_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
-class AxiosHeaders {
- constructor(headers) {
- headers && this.set(headers);
- }
-
- set(header, valueOrRewrite, rewrite) {
- const self = this;
- function setHeader(_value, _header, _rewrite) {
- const lHeader = normalizeHeader(_header);
- if (!lHeader) {
- throw new Error('header name must be a non-empty string');
- }
- const key = utils$1.findKey(self, lHeader);
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
- self[key || _header] = normalizeValue(_value);
- }
- }
- const setHeaders = (headers, _rewrite) =>
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
- setHeaders(header, valueOrRewrite);
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
- setHeaders(parseHeaders(header), valueOrRewrite);
- } else if (utils$1.isHeaders(header)) {
- for (const [key, value] of header.entries()) {
- setHeader(value, key, rewrite);
- }
- } else {
- header != null && setHeader(valueOrRewrite, header, rewrite);
+/* eslint-disable @typescript-eslint/unbound-method */
+const toolrunner_IS_WINDOWS = process.platform === 'win32';
+/*
+ * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
+ */
+class ToolRunner extends external_events_.EventEmitter {
+ constructor(toolPath, args, options) {
+ super();
+ if (!toolPath) {
+ throw new Error("Parameter 'toolPath' cannot be null or empty.");
+ }
+ this.toolPath = toolPath;
+ this.args = args || [];
+ this.options = options || {};
}
-
- return this;
- }
-
- get(header, parser) {
- header = normalizeHeader(header);
-
- if (header) {
- const key = utils$1.findKey(this, header);
-
- if (key) {
- const value = this[key];
-
- if (!parser) {
- return value;
+ _debug(message) {
+ if (this.options.listeners && this.options.listeners.debug) {
+ this.options.listeners.debug(message);
}
-
- if (parser === true) {
- return parseTokens(value);
+ }
+ _getCommandString(options, noPrefix) {
+ const toolPath = this._getSpawnFileName();
+ const args = this._getSpawnArgs(options);
+ let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
+ if (toolrunner_IS_WINDOWS) {
+ // Windows + cmd file
+ if (this._isCmdFile()) {
+ cmd += toolPath;
+ for (const a of args) {
+ cmd += ` ${a}`;
+ }
+ }
+ // Windows + verbatim
+ else if (options.windowsVerbatimArguments) {
+ cmd += `"${toolPath}"`;
+ for (const a of args) {
+ cmd += ` ${a}`;
+ }
+ }
+ // Windows (regular)
+ else {
+ cmd += this._windowsQuoteCmdArg(toolPath);
+ for (const a of args) {
+ cmd += ` ${this._windowsQuoteCmdArg(a)}`;
+ }
+ }
}
-
- if (utils$1.isFunction(parser)) {
- return parser.call(this, value, key);
+ else {
+ // OSX/Linux - this can likely be improved with some form of quoting.
+ // creating processes on Unix is fundamentally different than Windows.
+ // on Unix, execvp() takes an arg array.
+ cmd += toolPath;
+ for (const a of args) {
+ cmd += ` ${a}`;
+ }
}
-
- if (utils$1.isRegExp(parser)) {
- return parser.exec(value);
+ return cmd;
+ }
+ _processLineBuffer(data, strBuffer, onLine) {
+ try {
+ let s = strBuffer + data.toString();
+ let n = s.indexOf(external_os_.EOL);
+ while (n > -1) {
+ const line = s.substring(0, n);
+ onLine(line);
+ // the rest of the string ...
+ s = s.substring(n + external_os_.EOL.length);
+ n = s.indexOf(external_os_.EOL);
+ }
+ return s;
+ }
+ catch (err) {
+ // streaming lines to console is best effort. Don't fail a build.
+ this._debug(`error processing line. Failed with error ${err}`);
+ return '';
}
-
- throw new TypeError('parser must be boolean|regexp|function');
- }
}
- }
-
- has(header, matcher) {
- header = normalizeHeader(header);
-
- if (header) {
- const key = utils$1.findKey(this, header);
-
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ _getSpawnFileName() {
+ if (toolrunner_IS_WINDOWS) {
+ if (this._isCmdFile()) {
+ return process.env['COMSPEC'] || 'cmd.exe';
+ }
+ }
+ return this.toolPath;
+ }
+ _getSpawnArgs(options) {
+ if (toolrunner_IS_WINDOWS) {
+ if (this._isCmdFile()) {
+ let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
+ for (const a of this.args) {
+ argline += ' ';
+ argline += options.windowsVerbatimArguments
+ ? a
+ : this._windowsQuoteCmdArg(a);
+ }
+ argline += '"';
+ return [argline];
+ }
+ }
+ return this.args;
}
-
- return false;
- }
-
- delete(header, matcher) {
- const self = this;
- let deleted = false;
-
- function deleteHeader(_header) {
- _header = normalizeHeader(_header);
-
- if (_header) {
- const key = utils$1.findKey(self, _header);
-
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
- delete self[key];
-
- deleted = true;
+ _endsWith(str, end) {
+ return str.endsWith(end);
+ }
+ _isCmdFile() {
+ const upperToolPath = this.toolPath.toUpperCase();
+ return (this._endsWith(upperToolPath, '.CMD') ||
+ this._endsWith(upperToolPath, '.BAT'));
+ }
+ _windowsQuoteCmdArg(arg) {
+ // for .exe, apply the normal quoting rules that libuv applies
+ if (!this._isCmdFile()) {
+ return this._uvQuoteCmdArg(arg);
}
- }
+ // otherwise apply quoting rules specific to the cmd.exe command line parser.
+ // the libuv rules are generic and are not designed specifically for cmd.exe
+ // command line parser.
+ //
+ // for a detailed description of the cmd.exe command line parser, refer to
+ // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
+ // need quotes for empty arg
+ if (!arg) {
+ return '""';
+ }
+ // determine whether the arg needs to be quoted
+ const cmdSpecialChars = [
+ ' ',
+ '\t',
+ '&',
+ '(',
+ ')',
+ '[',
+ ']',
+ '{',
+ '}',
+ '^',
+ '=',
+ ';',
+ '!',
+ "'",
+ '+',
+ ',',
+ '`',
+ '~',
+ '|',
+ '<',
+ '>',
+ '"'
+ ];
+ let needsQuotes = false;
+ for (const char of arg) {
+ if (cmdSpecialChars.some(x => x === char)) {
+ needsQuotes = true;
+ break;
+ }
+ }
+ // short-circuit if quotes not needed
+ if (!needsQuotes) {
+ return arg;
+ }
+ // the following quoting rules are very similar to the rules that by libuv applies.
+ //
+ // 1) wrap the string in quotes
+ //
+ // 2) double-up quotes - i.e. " => ""
+ //
+ // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
+ // doesn't work well with a cmd.exe command line.
+ //
+ // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
+ // for example, the command line:
+ // foo.exe "myarg:""my val"""
+ // is parsed by a .NET console app into an arg array:
+ // [ "myarg:\"my val\"" ]
+ // which is the same end result when applying libuv quoting rules. although the actual
+ // command line from libuv quoting rules would look like:
+ // foo.exe "myarg:\"my val\""
+ //
+ // 3) double-up slashes that precede a quote,
+ // e.g. hello \world => "hello \world"
+ // hello\"world => "hello\\""world"
+ // hello\\"world => "hello\\\\""world"
+ // hello world\ => "hello world\\"
+ //
+ // technically this is not required for a cmd.exe command line, or the batch argument parser.
+ // the reasons for including this as a .cmd quoting rule are:
+ //
+ // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
+ // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
+ //
+ // b) it's what we've been doing previously (by deferring to node default behavior) and we
+ // haven't heard any complaints about that aspect.
+ //
+ // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
+ // escaped when used on the command line directly - even though within a .cmd file % can be escaped
+ // by using %%.
+ //
+ // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
+ // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
+ //
+ // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
+ // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
+ // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
+ // to an external program.
+ //
+ // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
+ // % can be escaped within a .cmd file.
+ let reverse = '"';
+ let quoteHit = true;
+ for (let i = arg.length; i > 0; i--) {
+ // walk the string in reverse
+ reverse += arg[i - 1];
+ if (quoteHit && arg[i - 1] === '\\') {
+ reverse += '\\'; // double the slash
+ }
+ else if (arg[i - 1] === '"') {
+ quoteHit = true;
+ reverse += '"'; // double the quote
+ }
+ else {
+ quoteHit = false;
+ }
+ }
+ reverse += '"';
+ return reverse.split('').reverse().join('');
+ }
+ _uvQuoteCmdArg(arg) {
+ // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
+ // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
+ // is used.
+ //
+ // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
+ // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
+ // pasting copyright notice from Node within this function:
+ //
+ // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
+ // of this software and associated documentation files (the "Software"), to
+ // deal in the Software without restriction, including without limitation the
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ // sell copies of the Software, and to permit persons to whom the Software is
+ // furnished to do so, subject to the following conditions:
+ //
+ // The above copyright notice and this permission notice shall be included in
+ // all copies or substantial portions of the Software.
+ //
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ // IN THE SOFTWARE.
+ if (!arg) {
+ // Need double quotation for empty argument
+ return '""';
+ }
+ if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
+ // No quotation needed
+ return arg;
+ }
+ if (!arg.includes('"') && !arg.includes('\\')) {
+ // No embedded double quotes or backslashes, so I can just wrap
+ // quote marks around the whole thing.
+ return `"${arg}"`;
+ }
+ // Expected input/output:
+ // input : hello"world
+ // output: "hello\"world"
+ // input : hello""world
+ // output: "hello\"\"world"
+ // input : hello\world
+ // output: hello\world
+ // input : hello\\world
+ // output: hello\\world
+ // input : hello\"world
+ // output: "hello\\\"world"
+ // input : hello\\"world
+ // output: "hello\\\\\"world"
+ // input : hello world\
+ // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
+ // but it appears the comment is wrong, it should be "hello world\\"
+ let reverse = '"';
+ let quoteHit = true;
+ for (let i = arg.length; i > 0; i--) {
+ // walk the string in reverse
+ reverse += arg[i - 1];
+ if (quoteHit && arg[i - 1] === '\\') {
+ reverse += '\\';
+ }
+ else if (arg[i - 1] === '"') {
+ quoteHit = true;
+ reverse += '\\';
+ }
+ else {
+ quoteHit = false;
+ }
+ }
+ reverse += '"';
+ return reverse.split('').reverse().join('');
+ }
+ _cloneExecOptions(options) {
+ options = options || {};
+ const result = {
+ cwd: options.cwd || process.cwd(),
+ env: options.env || process.env,
+ silent: options.silent || false,
+ windowsVerbatimArguments: options.windowsVerbatimArguments || false,
+ failOnStdErr: options.failOnStdErr || false,
+ ignoreReturnCode: options.ignoreReturnCode || false,
+ delay: options.delay || 10000
+ };
+ result.outStream = options.outStream || process.stdout;
+ result.errStream = options.errStream || process.stderr;
+ return result;
}
-
- if (utils$1.isArray(header)) {
- header.forEach(deleteHeader);
- } else {
- deleteHeader(header);
+ _getSpawnOptions(options, toolPath) {
+ options = options || {};
+ const result = {};
+ result.cwd = options.cwd;
+ result.env = options.env;
+ result['windowsVerbatimArguments'] =
+ options.windowsVerbatimArguments || this._isCmdFile();
+ if (options.windowsVerbatimArguments) {
+ result.argv0 = `"${toolPath}"`;
+ }
+ return result;
}
-
- return deleted;
- }
-
- clear(matcher) {
- const keys = Object.keys(this);
- let i = keys.length;
- let deleted = false;
-
- while (i--) {
- const key = keys[i];
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
- delete this[key];
- deleted = true;
- }
+ /**
+ * Exec a tool.
+ * Output will be streamed to the live console.
+ * Returns promise with return code
+ *
+ * @param tool path to tool to exec
+ * @param options optional exec options. See ExecOptions
+ * @returns number
+ */
+ exec() {
+ return toolrunner_awaiter(this, void 0, void 0, function* () {
+ // root the tool path if it is unrooted and contains relative pathing
+ if (!isRooted(this.toolPath) &&
+ (this.toolPath.includes('/') ||
+ (toolrunner_IS_WINDOWS && this.toolPath.includes('\\')))) {
+ // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
+ this.toolPath = external_path_.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
+ }
+ // if the tool is only a file name, then resolve it from the PATH
+ // otherwise verify it exists (add extension on Windows if necessary)
+ this.toolPath = yield which(this.toolPath, true);
+ return new Promise((resolve, reject) => toolrunner_awaiter(this, void 0, void 0, function* () {
+ this._debug(`exec tool: ${this.toolPath}`);
+ this._debug('arguments:');
+ for (const arg of this.args) {
+ this._debug(` ${arg}`);
+ }
+ const optionsNonNull = this._cloneExecOptions(this.options);
+ if (!optionsNonNull.silent && optionsNonNull.outStream) {
+ optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + external_os_.EOL);
+ }
+ const state = new ExecState(optionsNonNull, this.toolPath);
+ state.on('debug', (message) => {
+ this._debug(message);
+ });
+ if (this.options.cwd && !(yield exists(this.options.cwd))) {
+ return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
+ }
+ const fileName = this._getSpawnFileName();
+ const cp = external_child_process_namespaceObject.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
+ let stdbuffer = '';
+ if (cp.stdout) {
+ cp.stdout.on('data', (data) => {
+ if (this.options.listeners && this.options.listeners.stdout) {
+ this.options.listeners.stdout(data);
+ }
+ if (!optionsNonNull.silent && optionsNonNull.outStream) {
+ optionsNonNull.outStream.write(data);
+ }
+ stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
+ if (this.options.listeners && this.options.listeners.stdline) {
+ this.options.listeners.stdline(line);
+ }
+ });
+ });
+ }
+ let errbuffer = '';
+ if (cp.stderr) {
+ cp.stderr.on('data', (data) => {
+ state.processStderr = true;
+ if (this.options.listeners && this.options.listeners.stderr) {
+ this.options.listeners.stderr(data);
+ }
+ if (!optionsNonNull.silent &&
+ optionsNonNull.errStream &&
+ optionsNonNull.outStream) {
+ const s = optionsNonNull.failOnStdErr
+ ? optionsNonNull.errStream
+ : optionsNonNull.outStream;
+ s.write(data);
+ }
+ errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
+ if (this.options.listeners && this.options.listeners.errline) {
+ this.options.listeners.errline(line);
+ }
+ });
+ });
+ }
+ cp.on('error', (err) => {
+ state.processError = err.message;
+ state.processExited = true;
+ state.processClosed = true;
+ state.CheckComplete();
+ });
+ cp.on('exit', (code) => {
+ state.processExitCode = code;
+ state.processExited = true;
+ this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
+ state.CheckComplete();
+ });
+ cp.on('close', (code) => {
+ state.processExitCode = code;
+ state.processExited = true;
+ state.processClosed = true;
+ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
+ state.CheckComplete();
+ });
+ state.on('done', (error, exitCode) => {
+ if (stdbuffer.length > 0) {
+ this.emit('stdline', stdbuffer);
+ }
+ if (errbuffer.length > 0) {
+ this.emit('errline', errbuffer);
+ }
+ cp.removeAllListeners();
+ if (error) {
+ reject(error);
+ }
+ else {
+ resolve(exitCode);
+ }
+ });
+ if (this.options.input) {
+ if (!cp.stdin) {
+ throw new Error('child process missing stdin');
+ }
+ cp.stdin.end(this.options.input);
+ }
+ }));
+ });
}
-
- return deleted;
- }
-
- normalize(format) {
- const self = this;
- const headers = {};
-
- utils$1.forEach(this, (value, header) => {
- const key = utils$1.findKey(headers, header);
-
- if (key) {
- self[key] = normalizeValue(value);
- delete self[header];
- return;
- }
-
- const normalized = format ? formatHeader(header) : String(header).trim();
-
- if (normalized !== header) {
- delete self[header];
- }
-
- self[normalized] = normalizeValue(value);
-
- headers[normalized] = true;
+}
+/**
+ * Convert an arg string to an array of args. Handles escaping
+ *
+ * @param argString string of arguments
+ * @returns string[] array of arguments
+ */
+function argStringToArray(argString) {
+ const args = [];
+ let inQuotes = false;
+ let escaped = false;
+ let arg = '';
+ function append(c) {
+ // we only escape double quotes.
+ if (escaped && c !== '"') {
+ arg += '\\';
+ }
+ arg += c;
+ escaped = false;
+ }
+ for (let i = 0; i < argString.length; i++) {
+ const c = argString.charAt(i);
+ if (c === '"') {
+ if (!escaped) {
+ inQuotes = !inQuotes;
+ }
+ else {
+ append(c);
+ }
+ continue;
+ }
+ if (c === '\\' && escaped) {
+ append(c);
+ continue;
+ }
+ if (c === '\\' && inQuotes) {
+ escaped = true;
+ continue;
+ }
+ if (c === ' ' && !inQuotes) {
+ if (arg.length > 0) {
+ args.push(arg);
+ arg = '';
+ }
+ continue;
+ }
+ append(c);
+ }
+ if (arg.length > 0) {
+ args.push(arg.trim());
+ }
+ return args;
+}
+class ExecState extends external_events_.EventEmitter {
+ constructor(options, toolPath) {
+ super();
+ this.processClosed = false; // tracks whether the process has exited and stdio is closed
+ this.processError = '';
+ this.processExitCode = 0;
+ this.processExited = false; // tracks whether the process has exited
+ this.processStderr = false; // tracks whether stderr was written to
+ this.delay = 10000; // 10 seconds
+ this.done = false;
+ this.timeout = null;
+ if (!toolPath) {
+ throw new Error('toolPath must not be empty');
+ }
+ this.options = options;
+ this.toolPath = toolPath;
+ if (options.delay) {
+ this.delay = options.delay;
+ }
+ }
+ CheckComplete() {
+ if (this.done) {
+ return;
+ }
+ if (this.processClosed) {
+ this._setResult();
+ }
+ else if (this.processExited) {
+ this.timeout = (0,external_timers_namespaceObject.setTimeout)(ExecState.HandleTimeout, this.delay, this);
+ }
+ }
+ _debug(message) {
+ this.emit('debug', message);
+ }
+ _setResult() {
+ // determine whether there is an error
+ let error;
+ if (this.processExited) {
+ if (this.processError) {
+ error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
+ }
+ else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
+ error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
+ }
+ else if (this.processStderr && this.options.failOnStdErr) {
+ error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
+ }
+ }
+ // clear the timeout
+ if (this.timeout) {
+ clearTimeout(this.timeout);
+ this.timeout = null;
+ }
+ this.done = true;
+ this.emit('done', error, this.processExitCode);
+ }
+ static HandleTimeout(state) {
+ if (state.done) {
+ return;
+ }
+ if (!state.processClosed && state.processExited) {
+ const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
+ state._debug(message);
+ }
+ state._setResult();
+ }
+}
+//# sourceMappingURL=toolrunner.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/exec/lib/exec.js
+var exec_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
});
+};
- return this;
- }
-
- concat(...targets) {
- return this.constructor.concat(this, ...targets);
- }
-
- toJSON(asStrings) {
- const obj = Object.create(null);
- utils$1.forEach(this, (value, header) => {
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+/**
+ * Exec a command.
+ * Output will be streamed to the live console.
+ * Returns promise with return code
+ *
+ * @param commandLine command to execute (can include additional args). Must be correctly escaped.
+ * @param args optional arguments for tool. Escaping is handled by the lib.
+ * @param options optional exec options. See ExecOptions
+ * @returns Promise exit code
+ */
+function exec_exec(commandLine, args, options) {
+ return exec_awaiter(this, void 0, void 0, function* () {
+ const commandArgs = tr.argStringToArray(commandLine);
+ if (commandArgs.length === 0) {
+ throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
+ }
+ // Path to tool to execute should be first arg
+ const toolPath = commandArgs[0];
+ args = commandArgs.slice(1).concat(args || []);
+ const runner = new tr.ToolRunner(toolPath, args, options);
+ return runner.exec();
});
+}
+/**
+ * Exec a command and get the output.
+ * Output will be streamed to the live console.
+ * Returns promise with the exit code and collected stdout and stderr
+ *
+ * @param commandLine command to execute (can include additional args). Must be correctly escaped.
+ * @param args optional arguments for tool. Escaping is handled by the lib.
+ * @param options optional exec options. See ExecOptions
+ * @returns Promise exit code, stdout, and stderr
+ */
+function getExecOutput(commandLine, args, options) {
+ return exec_awaiter(this, void 0, void 0, function* () {
+ var _a, _b;
+ let stdout = '';
+ let stderr = '';
+ //Using string decoder covers the case where a mult-byte character is split
+ const stdoutDecoder = new StringDecoder('utf8');
+ const stderrDecoder = new StringDecoder('utf8');
+ const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
+ const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
+ const stdErrListener = (data) => {
+ stderr += stderrDecoder.write(data);
+ if (originalStdErrListener) {
+ originalStdErrListener(data);
+ }
+ };
+ const stdOutListener = (data) => {
+ stdout += stdoutDecoder.write(data);
+ if (originalStdoutListener) {
+ originalStdoutListener(data);
+ }
+ };
+ const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
+ const exitCode = yield exec_exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
+ //flush any remaining characters
+ stdout += stdoutDecoder.end();
+ stderr += stderrDecoder.end();
+ return {
+ exitCode,
+ stdout,
+ stderr
+ };
+ });
+}
+//# sourceMappingURL=exec.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/platform.js
+var platform_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
- return obj;
- }
-
- [Symbol.iterator]() {
- return Object.entries(this.toJSON())[Symbol.iterator]();
- }
-
- toString() {
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
- }
-
- get [Symbol.toStringTag]() {
- return 'AxiosHeaders';
- }
-
- static from(thing) {
- return thing instanceof this ? thing : new this(thing);
- }
-
- static concat(first, ...targets) {
- const computed = new this(first);
-
- targets.forEach((target) => computed.set(target));
-
- return computed;
- }
- static accessor(header) {
- const internals = this[$internals] = (this[$internals] = {
- accessors: {}
+const getWindowsInfo = () => platform_awaiter(void 0, void 0, void 0, function* () {
+ const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, {
+ silent: true
});
+ const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, {
+ silent: true
+ });
+ return {
+ name: name.trim(),
+ version: version.trim()
+ };
+});
+const getMacOsInfo = () => platform_awaiter(void 0, void 0, void 0, function* () {
+ var _a, _b, _c, _d;
+ const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {
+ silent: true
+ });
+ const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';
+ const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';
+ return {
+ name,
+ version
+ };
+});
+const getLinuxInfo = () => platform_awaiter(void 0, void 0, void 0, function* () {
+ const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
+ silent: true
+ });
+ const [name, version] = stdout.trim().split('\n');
+ return {
+ name,
+ version
+ };
+});
+const platform = external_os_.platform();
+const arch = external_os_.arch();
+const isWindows = platform === 'win32';
+const isMacOS = platform === 'darwin';
+const isLinux = platform === 'linux';
+function getDetails() {
+ return platform_awaiter(this, void 0, void 0, function* () {
+ return Object.assign(Object.assign({}, (yield (isWindows
+ ? getWindowsInfo()
+ : isMacOS
+ ? getMacOsInfo()
+ : getLinuxInfo()))), { platform,
+ arch,
+ isWindows,
+ isMacOS,
+ isLinux });
+ });
+}
+//# sourceMappingURL=platform.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/core/lib/core.js
+var core_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
- const accessors = internals.accessors;
- const prototype = this.prototype;
-
- function defineAccessor(_header) {
- const lHeader = normalizeHeader(_header);
- if (!accessors[lHeader]) {
- buildAccessors(prototype, _header);
- accessors[lHeader] = true;
- }
- }
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
- return this;
- }
-}
-AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
-// reserved names hotfix
-utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
- return {
- get: () => value,
- set(headerValue) {
- this[mapped] = headerValue;
+/**
+ * The code to exit an action
+ */
+var ExitCode;
+(function (ExitCode) {
+ /**
+ * A code indicating that the action was successful
+ */
+ ExitCode[ExitCode["Success"] = 0] = "Success";
+ /**
+ * A code indicating that the action was a failure
+ */
+ ExitCode[ExitCode["Failure"] = 1] = "Failure";
+})(ExitCode || (ExitCode = {}));
+//-----------------------------------------------------------------------
+// Variables
+//-----------------------------------------------------------------------
+/**
+ * Sets env variable for this action and future actions in the job
+ * @param name the name of the variable to set
+ * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function exportVariable(name, val) {
+ const convertedVal = toCommandValue(val);
+ process.env[name] = convertedVal;
+ const filePath = process.env['GITHUB_ENV'] || '';
+ if (filePath) {
+ return issueFileCommand('ENV', prepareKeyValueMessage(name, val));
}
- }
-});
-
-utils$1.freezeMethods(AxiosHeaders);
-
-const AxiosHeaders$1 = AxiosHeaders;
-
+ issueCommand('set-env', { name }, convertedVal);
+}
/**
- * Transform the data for a request or a response
+ * Registers a secret which will get masked from logs
*
- * @param {Array|Function} fns A single function or Array of functions
- * @param {?Object} response The response object
+ * @param secret - Value of the secret to be masked
+ * @remarks
+ * This function instructs the Actions runner to mask the specified value in any
+ * logs produced during the workflow run. Once registered, the secret value will
+ * be replaced with asterisks (***) whenever it appears in console output, logs,
+ * or error messages.
*
- * @returns {*} The resulting transformed data
+ * This is useful for protecting sensitive information such as:
+ * - API keys
+ * - Access tokens
+ * - Authentication credentials
+ * - URL parameters containing signatures (SAS tokens)
+ *
+ * Note that masking only affects future logs; any previous appearances of the
+ * secret in logs before calling this function will remain unmasked.
+ *
+ * @example
+ * ```typescript
+ * // Register an API token as a secret
+ * const apiToken = "abc123xyz456";
+ * setSecret(apiToken);
+ *
+ * // Now any logs containing this value will show *** instead
+ * console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
+ * ```
*/
-function transformData(fns, response) {
- const config = this || defaults$1;
- const context = response || config;
- const headers = AxiosHeaders$1.from(context.headers);
- let data = context.data;
-
- utils$1.forEach(fns, function transform(fn) {
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
- });
-
- headers.normalize();
-
- return data;
+function core_setSecret(secret) {
+ issueCommand('add-mask', {}, secret);
}
-
-function isCancel(value) {
- return !!(value && value.__CANCEL__);
+/**
+ * Prepends inputPath to the PATH (for this action and future actions)
+ * @param inputPath
+ */
+function addPath(inputPath) {
+ const filePath = process.env['GITHUB_PATH'] || '';
+ if (filePath) {
+ issueFileCommand('PATH', inputPath);
+ }
+ else {
+ issueCommand('add-path', {}, inputPath);
+ }
+ process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
-
/**
- * A `CanceledError` is an object that is thrown when an operation is canceled.
- *
- * @param {string=} message The message.
- * @param {Object=} config The config.
- * @param {Object=} request The request.
+ * Gets the value of an input.
+ * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
+ * Returns an empty string if the value is not defined.
*
- * @returns {CanceledError} The created error.
+ * @param name name of the input to get
+ * @param options optional. See InputOptions.
+ * @returns string
*/
-function CanceledError(message, config, request) {
- // eslint-disable-next-line no-eq-null,eqeqeq
- AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
- this.name = 'CanceledError';
+function getInput(name, options) {
+ const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
+ if (options && options.required && !val) {
+ throw new Error(`Input required and not supplied: ${name}`);
+ }
+ if (options && options.trimWhitespace === false) {
+ return val;
+ }
+ return val.trim();
}
-
-utils$1.inherits(CanceledError, AxiosError, {
- __CANCEL__: true
-});
-
/**
- * Resolve or reject a Promise based on response status.
+ * Gets the values of an multiline input. Each value is also trimmed.
*
- * @param {Function} resolve A function that resolves the promise.
- * @param {Function} reject A function that rejects the promise.
- * @param {object} response The response.
+ * @param name name of the input to get
+ * @param options optional. See InputOptions.
+ * @returns string[]
*
- * @returns {object} The response.
*/
-function settle(resolve, reject, response) {
- const validateStatus = response.config.validateStatus;
- if (!response.status || !validateStatus || validateStatus(response.status)) {
- resolve(response);
- } else {
- reject(new AxiosError(
- 'Request failed with status code ' + response.status,
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
- response.config,
- response.request,
- response
- ));
- }
+function getMultilineInput(name, options) {
+ const inputs = getInput(name, options)
+ .split('\n')
+ .filter(x => x !== '');
+ if (options && options.trimWhitespace === false) {
+ return inputs;
+ }
+ return inputs.map(input => input.trim());
}
-
/**
- * Determines whether the specified URL is absolute
- *
- * @param {string} url The URL to test
+ * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
+ * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
+ * The return value is also in boolean type.
+ * ref: https://yaml.org/spec/1.2/spec.html#id2804923
*
- * @returns {boolean} True if the specified URL is absolute, otherwise false
+ * @param name name of the input to get
+ * @param options optional. See InputOptions.
+ * @returns boolean
*/
-function isAbsoluteURL(url) {
- // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
- // by any combination of letters, digits, plus, period, or hyphen.
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+function getBooleanInput(name, options) {
+ const trueValue = ['true', 'True', 'TRUE'];
+ const falseValue = ['false', 'False', 'FALSE'];
+ const val = getInput(name, options);
+ if (trueValue.includes(val))
+ return true;
+ if (falseValue.includes(val))
+ return false;
+ throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
+ `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
}
-
/**
- * Creates a new URL by combining the specified URLs
+ * Sets the value of an output.
*
- * @param {string} baseURL The base URL
- * @param {string} relativeURL The relative URL
+ * @param name name of the output to set
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function setOutput(name, value) {
+ const filePath = process.env['GITHUB_OUTPUT'] || '';
+ if (filePath) {
+ return file_command_issueFileCommand('OUTPUT', file_command_prepareKeyValueMessage(name, value));
+ }
+ process.stdout.write(external_os_.EOL);
+ command_issueCommand('set-output', { name }, utils_toCommandValue(value));
+}
+/**
+ * Enables or disables the echoing of commands into stdout for the rest of the step.
+ * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
*
- * @returns {string} The combined URL
*/
-function combineURLs(baseURL, relativeURL) {
- return relativeURL
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
- : baseURL;
+function setCommandEcho(enabled) {
+ issue('echo', enabled ? 'on' : 'off');
}
-
+//-----------------------------------------------------------------------
+// Results
+//-----------------------------------------------------------------------
/**
- * Creates a new URL by combining the baseURL with the requestedURL,
- * only when the requestedURL is not already an absolute URL.
- * If the requestURL is absolute, this function returns the requestedURL untouched.
+ * Sets the action status to failed.
+ * When the action exits it will be with an exit code of 1
+ * @param message add error issue message
+ */
+function setFailed(message) {
+ process.exitCode = ExitCode.Failure;
+ core_error(message);
+}
+//-----------------------------------------------------------------------
+// Logging Commands
+//-----------------------------------------------------------------------
+/**
+ * Gets whether Actions Step Debug is on or not
+ */
+function isDebug() {
+ return process.env['RUNNER_DEBUG'] === '1';
+}
+/**
+ * Writes debug message to user log
+ * @param message debug message
+ */
+function core_debug(message) {
+ issueCommand('debug', {}, message);
+}
+/**
+ * Adds an error issue
+ * @param message error issue message. Errors will be converted to string via toString()
+ * @param properties optional properties to add to the annotation.
+ */
+function core_error(message, properties = {}) {
+ command_issueCommand('error', utils_toCommandProperties(properties), message instanceof Error ? message.toString() : message);
+}
+/**
+ * Adds a warning issue
+ * @param message warning issue message. Errors will be converted to string via toString()
+ * @param properties optional properties to add to the annotation.
+ */
+function warning(message, properties = {}) {
+ issueCommand('warning', toCommandProperties(properties), message instanceof Error ? message.toString() : message);
+}
+/**
+ * Adds a notice issue
+ * @param message notice issue message. Errors will be converted to string via toString()
+ * @param properties optional properties to add to the annotation.
+ */
+function notice(message, properties = {}) {
+ issueCommand('notice', toCommandProperties(properties), message instanceof Error ? message.toString() : message);
+}
+/**
+ * Writes info to log with console.log.
+ * @param message info message
+ */
+function info(message) {
+ process.stdout.write(message + os.EOL);
+}
+/**
+ * Begin an output group.
*
- * @param {string} baseURL The base URL
- * @param {string} requestedURL Absolute or relative URL to combine
+ * Output until the next `groupEnd` will be foldable in this group
*
- * @returns {string} The combined full path
+ * @param name The name of the output group
*/
-function buildFullPath(baseURL, requestedURL) {
- if (baseURL && !isAbsoluteURL(requestedURL)) {
- return combineURLs(baseURL, requestedURL);
- }
- return requestedURL;
+function startGroup(name) {
+ issue('group', name);
}
-
-const VERSION = "1.7.2";
-
-function parseProtocol(url) {
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
- return match && match[1] || '';
+/**
+ * End an output group.
+ */
+function endGroup() {
+ issue('endgroup');
}
-
-const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
-
/**
- * Parse data uri to a Buffer or Blob
+ * Wrap an asynchronous function call in a group.
*
- * @param {String} uri
- * @param {?Boolean} asBlob
- * @param {?Object} options
- * @param {?Function} options.Blob
+ * Returns the same type as the function itself.
*
- * @returns {Buffer|Blob}
+ * @param name The name of the group
+ * @param fn The function to wrap in the group
*/
-function fromDataURI(uri, asBlob, options) {
- const _Blob = options && options.Blob || platform.classes.Blob;
- const protocol = parseProtocol(uri);
-
- if (asBlob === undefined && _Blob) {
- asBlob = true;
- }
-
- if (protocol === 'data') {
- uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
-
- const match = DATA_URL_PATTERN.exec(uri);
-
- if (!match) {
- throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
- }
-
- const mime = match[1];
- const isBase64 = match[2];
- const body = match[3];
- const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
-
- if (asBlob) {
- if (!_Blob) {
- throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
- }
-
- return new _Blob([buffer], {type: mime});
- }
-
- return buffer;
- }
-
- throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
+function group(name, fn) {
+ return core_awaiter(this, void 0, void 0, function* () {
+ startGroup(name);
+ let result;
+ try {
+ result = yield fn();
+ }
+ finally {
+ endGroup();
+ }
+ return result;
+ });
}
-
+//-----------------------------------------------------------------------
+// Wrapper action state
+//-----------------------------------------------------------------------
/**
- * Throttle decorator
- * @param {Function} fn
- * @param {Number} freq
- * @return {Function}
+ * Saves state for current action, the state can only be retrieved by this action's post job execution.
+ *
+ * @param name name of the state to store
+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
-function throttle(fn, freq) {
- let timestamp = 0;
- const threshold = 1000 / freq;
- let timer = null;
- return function throttled() {
- const force = this === true;
-
- const now = Date.now();
- if (force || now - timestamp > threshold) {
- if (timer) {
- clearTimeout(timer);
- timer = null;
- }
- timestamp = now;
- return fn.apply(null, arguments);
- }
- if (!timer) {
- timer = setTimeout(() => {
- timer = null;
- timestamp = Date.now();
- return fn.apply(null, arguments);
- }, threshold - (now - timestamp));
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+function saveState(name, value) {
+ const filePath = process.env['GITHUB_STATE'] || '';
+ if (filePath) {
+ return file_command_issueFileCommand('STATE', file_command_prepareKeyValueMessage(name, value));
}
- };
+ command_issueCommand('save-state', { name }, utils_toCommandValue(value));
}
+/**
+ * Gets the value of an state set by this action's main execution.
+ *
+ * @param name name of the state to get
+ * @returns string
+ */
+function getState(name) {
+ return process.env[`STATE_${name}`] || '';
+}
+function getIDToken(aud) {
+ return core_awaiter(this, void 0, void 0, function* () {
+ return yield OidcClient.getIDToken(aud);
+ });
+}
+/**
+ * Summary exports
+ */
/**
- * Calculate data maxRate
- * @param {Number} [samplesCount= 10]
- * @param {Number} [min= 1000]
- * @returns {Function}
+ * @deprecated use core.summary
*/
-function speedometer(samplesCount, min) {
- samplesCount = samplesCount || 10;
- const bytes = new Array(samplesCount);
- const timestamps = new Array(samplesCount);
- let head = 0;
- let tail = 0;
- let firstSampleTS;
- min = min !== undefined ? min : 1000;
+/**
+ * Path exports
+ */
- return function push(chunkLength) {
- const now = Date.now();
+/**
+ * Platform utilities exports
+ */
- const startedAt = timestamps[tail];
+//# sourceMappingURL=core.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/context.js
- if (!firstSampleTS) {
- firstSampleTS = now;
+
+class Context {
+ /**
+ * Hydrate the context from the environment
+ */
+ constructor() {
+ var _a, _b, _c;
+ this.payload = {};
+ if (process.env.GITHUB_EVENT_PATH) {
+ if ((0,external_fs_.existsSync)(process.env.GITHUB_EVENT_PATH)) {
+ this.payload = JSON.parse((0,external_fs_.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
+ }
+ else {
+ const path = process.env.GITHUB_EVENT_PATH;
+ process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${external_os_.EOL}`);
+ }
+ }
+ this.eventName = process.env.GITHUB_EVENT_NAME;
+ this.sha = process.env.GITHUB_SHA;
+ this.ref = process.env.GITHUB_REF;
+ this.workflow = process.env.GITHUB_WORKFLOW;
+ this.action = process.env.GITHUB_ACTION;
+ this.actor = process.env.GITHUB_ACTOR;
+ this.job = process.env.GITHUB_JOB;
+ this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10);
+ this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
+ this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
+ this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
+ this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
+ this.graphqlUrl =
+ (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
+ }
+ get issue() {
+ const payload = this.payload;
+ return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
+ }
+ get repo() {
+ if (process.env.GITHUB_REPOSITORY) {
+ const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
+ return { owner, repo };
+ }
+ if (this.payload.repository) {
+ return {
+ owner: this.payload.repository.owner.login,
+ repo: this.payload.repository.name
+ };
+ }
+ throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
}
+}
+//# sourceMappingURL=context.js.map
+// EXTERNAL MODULE: ./node_modules/@actions/http-client/lib/index.js
+var lib = __nccwpck_require__(4844);
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/internal/utils.js
+var utils_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
- bytes[head] = chunkLength;
- timestamps[head] = now;
-
- let i = tail;
- let bytesCount = 0;
- while (i !== head) {
- bytesCount += bytes[i++];
- i = i % samplesCount;
+function getAuthString(token, options) {
+ if (!token && !options.auth) {
+ throw new Error('Parameter token or opts.auth is required');
}
-
- head = (head + 1) % samplesCount;
-
- if (head === tail) {
- tail = (tail + 1) % samplesCount;
+ else if (token && options.auth) {
+ throw new Error('Parameters token and opts.auth may not both be specified');
}
-
- if (now - firstSampleTS < min) {
- return;
+ return typeof options.auth === 'string' ? options.auth : `token ${token}`;
+}
+function getProxyAgent(destinationUrl) {
+ const hc = new lib.HttpClient();
+ return hc.getAgent(destinationUrl);
+}
+function getProxyAgentDispatcher(destinationUrl) {
+ const hc = new lib.HttpClient();
+ return hc.getAgentDispatcher(destinationUrl);
+}
+function getProxyFetch(destinationUrl) {
+ const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
+ const proxyFetch = (url, opts) => utils_awaiter(this, void 0, void 0, function* () {
+ return (0,undici.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
+ });
+ return proxyFetch;
+}
+function getApiBaseUrl() {
+ return process.env['GITHUB_API_URL'] || 'https://api.github.com';
+}
+function getUserAgentWithOrchestrationId(baseUserAgent) {
+ var _a;
+ const orchId = (_a = process.env['ACTIONS_ORCHESTRATION_ID']) === null || _a === void 0 ? void 0 : _a.trim();
+ if (orchId) {
+ const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
+ const tag = `actions_orchestration_id/${sanitizedId}`;
+ if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag))
+ return baseUserAgent;
+ const ua = baseUserAgent ? `${baseUserAgent} ` : '';
+ return `${ua}${tag}`;
}
-
- const passed = startedAt && now - startedAt;
-
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
- };
+ return baseUserAgent;
}
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
+function getUserAgent() {
+ if (typeof navigator === "object" && "userAgent" in navigator) {
+ return navigator.userAgent;
+ }
-const kInternals = Symbol('internals');
+ if (typeof process === "object" && process.version !== undefined) {
+ return `Node.js/${process.version.substr(1)} (${process.platform}; ${
+ process.arch
+ })`;
+ }
-class AxiosTransformStream extends stream__default["default"].Transform{
- constructor(options) {
- options = utils$1.toFlatObject(options, {
- maxRate: 0,
- chunkSize: 64 * 1024,
- minChunkSize: 100,
- timeWindow: 500,
- ticksRate: 2,
- samplesCount: 15
- }, null, (prop, source) => {
- return !utils$1.isUndefined(source[prop]);
- });
+ return "";
+}
- super({
- readableHighWaterMark: options.chunkSize
- });
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/register.js
+// @ts-check
- const self = this;
+function register(state, name, method, options) {
+ if (typeof method !== "function") {
+ throw new Error("method for before hook must be a function");
+ }
- const internals = this[kInternals] = {
- length: options.length,
- timeWindow: options.timeWindow,
- ticksRate: options.ticksRate,
- chunkSize: options.chunkSize,
- maxRate: options.maxRate,
- minChunkSize: options.minChunkSize,
- bytesSeen: 0,
- isCaptured: false,
- notifiedBytesLoaded: 0,
- ts: Date.now(),
- bytes: 0,
- onReadCallback: null
- };
+ if (!options) {
+ options = {};
+ }
- const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
+ if (Array.isArray(name)) {
+ return name.reverse().reduce((callback, name) => {
+ return register.bind(null, state, name, callback, options);
+ }, method)();
+ }
- this.on('newListener', event => {
- if (event === 'progress') {
- if (!internals.isCaptured) {
- internals.isCaptured = true;
- }
- }
- });
+ return Promise.resolve().then(() => {
+ if (!state.registry[name]) {
+ return method(options);
+ }
- let bytesNotified = 0;
+ return state.registry[name].reduce((method, registered) => {
+ return registered.hook.bind(null, method, options);
+ }, method)();
+ });
+}
- internals.updateProgress = throttle(function throttledHandler() {
- const totalBytes = internals.length;
- const bytesTransferred = internals.bytesSeen;
- const progressBytes = bytesTransferred - bytesNotified;
- if (!progressBytes || self.destroyed) return;
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/add.js
+// @ts-check
- const rate = _speedometer(progressBytes);
+function addHook(state, kind, name, hook) {
+ const orig = hook;
+ if (!state.registry[name]) {
+ state.registry[name] = [];
+ }
- bytesNotified = bytesTransferred;
+ if (kind === "before") {
+ hook = (method, options) => {
+ return Promise.resolve()
+ .then(orig.bind(null, options))
+ .then(method.bind(null, options));
+ };
+ }
- process.nextTick(() => {
- self.emit('progress', {
- loaded: bytesTransferred,
- total: totalBytes,
- progress: totalBytes ? (bytesTransferred / totalBytes) : undefined,
- bytes: progressBytes,
- rate: rate ? rate : undefined,
- estimated: rate && totalBytes && bytesTransferred <= totalBytes ?
- (totalBytes - bytesTransferred) / rate : undefined,
- lengthComputable: totalBytes != null
+ if (kind === "after") {
+ hook = (method, options) => {
+ let result;
+ return Promise.resolve()
+ .then(method.bind(null, options))
+ .then((result_) => {
+ result = result_;
+ return orig(result, options);
+ })
+ .then(() => {
+ return result;
});
- });
- }, internals.ticksRate);
-
- const onFinish = () => {
- internals.updateProgress.call(true);
};
+ }
- this.once('end', onFinish);
- this.once('error', onFinish);
+ if (kind === "error") {
+ hook = (method, options) => {
+ return Promise.resolve()
+ .then(method.bind(null, options))
+ .catch((error) => {
+ return orig(error, options);
+ });
+ };
}
- _read(size) {
- const internals = this[kInternals];
+ state.registry[name].push({
+ hook: hook,
+ orig: orig,
+ });
+}
- if (internals.onReadCallback) {
- internals.onReadCallback();
- }
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/remove.js
+// @ts-check
- return super._read(size);
+function removeHook(state, name, method) {
+ if (!state.registry[name]) {
+ return;
}
- _transform(chunk, encoding, callback) {
- const self = this;
- const internals = this[kInternals];
- const maxRate = internals.maxRate;
-
- const readableHighWaterMark = this.readableHighWaterMark;
-
- const timeWindow = internals.timeWindow;
+ const index = state.registry[name]
+ .map((registered) => {
+ return registered.orig;
+ })
+ .indexOf(method);
- const divider = 1000 / timeWindow;
- const bytesThreshold = (maxRate / divider);
- const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+ if (index === -1) {
+ return;
+ }
- function pushChunk(_chunk, _callback) {
- const bytes = Buffer.byteLength(_chunk);
- internals.bytesSeen += bytes;
- internals.bytes += bytes;
+ state.registry[name].splice(index, 1);
+}
- if (internals.isCaptured) {
- internals.updateProgress();
- }
+;// CONCATENATED MODULE: ./node_modules/before-after-hook/index.js
+// @ts-check
- if (self.push(_chunk)) {
- process.nextTick(_callback);
- } else {
- internals.onReadCallback = () => {
- internals.onReadCallback = null;
- process.nextTick(_callback);
- };
- }
- }
- const transformChunk = (_chunk, _callback) => {
- const chunkSize = Buffer.byteLength(_chunk);
- let chunkRemainder = null;
- let maxChunkSize = readableHighWaterMark;
- let bytesLeft;
- let passed = 0;
- if (maxRate) {
- const now = Date.now();
- if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
- internals.ts = now;
- bytesLeft = bytesThreshold - internals.bytes;
- internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
- passed = 0;
- }
- bytesLeft = bytesThreshold - internals.bytes;
- }
+// bind with array of arguments: https://stackoverflow.com/a/21792913
+const bind = Function.bind;
+const bindable = bind.bind(bind);
- if (maxRate) {
- if (bytesLeft <= 0) {
- // next time window
- return setTimeout(() => {
- _callback(null, _chunk);
- }, timeWindow - passed);
- }
+function bindApi(hook, state, name) {
+ const removeHookRef = bindable(removeHook, null).apply(
+ null,
+ name ? [state, name] : [state]
+ );
+ hook.api = { remove: removeHookRef };
+ hook.remove = removeHookRef;
+ ["before", "error", "after", "wrap"].forEach((kind) => {
+ const args = name ? [state, kind, name] : [state, kind];
+ hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
+ });
+}
- if (bytesLeft < maxChunkSize) {
- maxChunkSize = bytesLeft;
- }
- }
+function Singular() {
+ const singularHookName = Symbol("Singular");
+ const singularHookState = {
+ registry: {},
+ };
+ const singularHook = register.bind(null, singularHookState, singularHookName);
+ bindApi(singularHook, singularHookState, singularHookName);
+ return singularHook;
+}
- if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
- chunkRemainder = _chunk.subarray(maxChunkSize);
- _chunk = _chunk.subarray(0, maxChunkSize);
- }
+function Collection() {
+ const state = {
+ registry: {},
+ };
- pushChunk(_chunk, chunkRemainder ? () => {
- process.nextTick(_callback, null, chunkRemainder);
- } : _callback);
- };
+ const hook = register.bind(null, state);
+ bindApi(hook, state);
- transformChunk(chunk, function transformNextChunk(err, _chunk) {
- if (err) {
- return callback(err);
- }
+ return hook;
+}
- if (_chunk) {
- transformChunk(_chunk, transformNextChunk);
- } else {
- callback(null);
- }
- });
- }
+/* harmony default export */ const before_after_hook = ({ Singular, Collection });
- setLength(length) {
- this[kInternals].length = +length;
- return this;
- }
-}
+;// CONCATENATED MODULE: ./node_modules/@octokit/endpoint/dist-bundle/index.js
+// pkg/dist-src/defaults.js
-const AxiosTransformStream$1 = AxiosTransformStream;
-const {asyncIterator} = Symbol;
+// pkg/dist-src/version.js
+var VERSION = "0.0.0-development";
-const readBlob = async function* (blob) {
- if (blob.stream) {
- yield* blob.stream();
- } else if (blob.arrayBuffer) {
- yield await blob.arrayBuffer();
- } else if (blob[asyncIterator]) {
- yield* blob[asyncIterator]();
- } else {
- yield blob;
+// pkg/dist-src/defaults.js
+var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
+var DEFAULTS = {
+ method: "GET",
+ baseUrl: "https://api.github.com",
+ headers: {
+ accept: "application/vnd.github.v3+json",
+ "user-agent": userAgent
+ },
+ mediaType: {
+ format: ""
}
};
-const readBlob$1 = readBlob;
-
-const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
-
-const textEncoder = new util.TextEncoder();
-
-const CRLF = '\r\n';
-const CRLF_BYTES = textEncoder.encode(CRLF);
-const CRLF_BYTES_COUNT = 2;
-
-class FormDataPart {
- constructor(name, value) {
- const {escapeName} = this.constructor;
- const isStringValue = utils$1.isString(value);
+// pkg/dist-src/util/lowercase-keys.js
+function dist_bundle_lowercaseKeys(object) {
+ if (!object) {
+ return {};
+ }
+ return Object.keys(object).reduce((newObj, key) => {
+ newObj[key.toLowerCase()] = object[key];
+ return newObj;
+ }, {});
+}
- let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
- !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
- }${CRLF}`;
+// pkg/dist-src/util/is-plain-object.js
+function isPlainObject(value) {
+ if (typeof value !== "object" || value === null) return false;
+ if (Object.prototype.toString.call(value) !== "[object Object]") return false;
+ const proto = Object.getPrototypeOf(value);
+ if (proto === null) return true;
+ const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
+ return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
+}
- if (isStringValue) {
- value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
+// pkg/dist-src/util/merge-deep.js
+function mergeDeep(defaults, options) {
+ const result = Object.assign({}, defaults);
+ Object.keys(options).forEach((key) => {
+ if (isPlainObject(options[key])) {
+ if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
+ else result[key] = mergeDeep(defaults[key], options[key]);
} else {
- headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
+ Object.assign(result, { [key]: options[key] });
}
+ });
+ return result;
+}
- this.headers = textEncoder.encode(headers + CRLF);
-
- this.contentLength = isStringValue ? value.byteLength : value.size;
+// pkg/dist-src/util/remove-undefined-properties.js
+function removeUndefinedProperties(obj) {
+ for (const key in obj) {
+ if (obj[key] === void 0) {
+ delete obj[key];
+ }
+ }
+ return obj;
+}
- this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+// pkg/dist-src/merge.js
+function merge(defaults, route, options) {
+ if (typeof route === "string") {
+ let [method, url] = route.split(" ");
+ options = Object.assign(url ? { method, url } : { url: method }, options);
+ } else {
+ options = Object.assign({}, route);
+ }
+ options.headers = dist_bundle_lowercaseKeys(options.headers);
+ removeUndefinedProperties(options);
+ removeUndefinedProperties(options.headers);
+ const mergedOptions = mergeDeep(defaults || {}, options);
+ if (options.url === "/graphql") {
+ if (defaults && defaults.mediaType.previews?.length) {
+ mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
+ (preview) => !mergedOptions.mediaType.previews.includes(preview)
+ ).concat(mergedOptions.mediaType.previews);
+ }
+ mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
+ }
+ return mergedOptions;
+}
- this.name = name;
- this.value = value;
+// pkg/dist-src/util/add-query-parameters.js
+function addQueryParameters(url, parameters) {
+ const separator = /\?/.test(url) ? "&" : "?";
+ const names = Object.keys(parameters);
+ if (names.length === 0) {
+ return url;
}
+ return url + separator + names.map((name) => {
+ if (name === "q") {
+ return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
+ }
+ return `${name}=${encodeURIComponent(parameters[name])}`;
+ }).join("&");
+}
- async *encode(){
- yield this.headers;
+// pkg/dist-src/util/extract-url-variable-names.js
+var urlVariableRegex = /\{[^{}}]+\}/g;
+function removeNonChars(variableName) {
+ return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []);
+}
- const {value} = this;
+// pkg/dist-src/util/omit.js
+function omit(object, keysToOmit) {
+ const result = { __proto__: null };
+ for (const key of Object.keys(object)) {
+ if (keysToOmit.indexOf(key) === -1) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
- if(utils$1.isTypedArray(value)) {
- yield value;
+// pkg/dist-src/util/url-template.js
+function encodeReserved(str) {
+ return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
+ if (!/%[0-9A-Fa-f]/.test(part)) {
+ part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
+ }
+ return part;
+ }).join("");
+}
+function encodeUnreserved(str) {
+ return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
+ });
+}
+function encodeValue(operator, value, key) {
+ value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
+ if (key) {
+ return encodeUnreserved(key) + "=" + value;
+ } else {
+ return value;
+ }
+}
+function isDefined(value) {
+ return value !== void 0 && value !== null;
+}
+function isKeyOperator(operator) {
+ return operator === ";" || operator === "&" || operator === "?";
+}
+function getValues(context, operator, key, modifier) {
+ var value = context[key], result = [];
+ if (isDefined(value) && value !== "") {
+ if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
+ value = value.toString();
+ if (modifier && modifier !== "*") {
+ value = value.substring(0, parseInt(modifier, 10));
+ }
+ result.push(
+ encodeValue(operator, value, isKeyOperator(operator) ? key : "")
+ );
} else {
- yield* readBlob$1(value);
+ if (modifier === "*") {
+ if (Array.isArray(value)) {
+ value.filter(isDefined).forEach(function(value2) {
+ result.push(
+ encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
+ );
+ });
+ } else {
+ Object.keys(value).forEach(function(k) {
+ if (isDefined(value[k])) {
+ result.push(encodeValue(operator, value[k], k));
+ }
+ });
+ }
+ } else {
+ const tmp = [];
+ if (Array.isArray(value)) {
+ value.filter(isDefined).forEach(function(value2) {
+ tmp.push(encodeValue(operator, value2));
+ });
+ } else {
+ Object.keys(value).forEach(function(k) {
+ if (isDefined(value[k])) {
+ tmp.push(encodeUnreserved(k));
+ tmp.push(encodeValue(operator, value[k].toString()));
+ }
+ });
+ }
+ if (isKeyOperator(operator)) {
+ result.push(encodeUnreserved(key) + "=" + tmp.join(","));
+ } else if (tmp.length !== 0) {
+ result.push(tmp.join(","));
+ }
+ }
+ }
+ } else {
+ if (operator === ";") {
+ if (isDefined(value)) {
+ result.push(encodeUnreserved(key));
+ }
+ } else if (value === "" && (operator === "&" || operator === "?")) {
+ result.push(encodeUnreserved(key) + "=");
+ } else if (value === "") {
+ result.push("");
}
-
- yield CRLF_BYTES;
}
-
- static escapeName(name) {
- return String(name).replace(/[\r\n"]/g, (match) => ({
- '\r' : '%0D',
- '\n' : '%0A',
- '"' : '%22',
- }[match]));
+ return result;
+}
+function parseUrl(template) {
+ return {
+ expand: expand.bind(null, template)
+ };
+}
+function expand(template, context) {
+ var operators = ["+", "#", ".", "/", ";", "?", "&"];
+ template = template.replace(
+ /\{([^\{\}]+)\}|([^\{\}]+)/g,
+ function(_, expression, literal) {
+ if (expression) {
+ let operator = "";
+ const values = [];
+ if (operators.indexOf(expression.charAt(0)) !== -1) {
+ operator = expression.charAt(0);
+ expression = expression.substr(1);
+ }
+ expression.split(/,/g).forEach(function(variable) {
+ var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
+ values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
+ });
+ if (operator && operator !== "+") {
+ var separator = ",";
+ if (operator === "?") {
+ separator = "&";
+ } else if (operator !== "#") {
+ separator = operator;
+ }
+ return (values.length !== 0 ? operator : "") + values.join(separator);
+ } else {
+ return values.join(",");
+ }
+ } else {
+ return encodeReserved(literal);
+ }
+ }
+ );
+ if (template === "/") {
+ return template;
+ } else {
+ return template.replace(/\/$/, "");
}
}
-const formDataToStream = (form, headersHandler, options) => {
- const {
- tag = 'form-data-boundary',
- size = 25,
- boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
- } = options || {};
-
- if(!utils$1.isFormData(form)) {
- throw TypeError('FormData instance required');
- }
-
- if (boundary.length < 1 || boundary.length > 70) {
- throw Error('boundary must be 10-70 characters long')
- }
-
- const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
- let contentLength = footerBytes.byteLength;
-
- const parts = Array.from(form.entries()).map(([name, value]) => {
- const part = new FormDataPart(name, value);
- contentLength += part.size;
- return part;
- });
-
- contentLength += boundaryBytes.byteLength * parts.length;
-
- contentLength = utils$1.toFiniteNumber(contentLength);
-
- const computedHeaders = {
- 'Content-Type': `multipart/form-data; boundary=${boundary}`
- };
-
- if (Number.isFinite(contentLength)) {
- computedHeaders['Content-Length'] = contentLength;
+// pkg/dist-src/parse.js
+function parse(options) {
+ let method = options.method.toUpperCase();
+ let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
+ let headers = Object.assign({}, options.headers);
+ let body;
+ let parameters = omit(options, [
+ "method",
+ "baseUrl",
+ "url",
+ "headers",
+ "request",
+ "mediaType"
+ ]);
+ const urlVariableNames = extractUrlVariableNames(url);
+ url = parseUrl(url).expand(parameters);
+ if (!/^http/.test(url)) {
+ url = options.baseUrl + url;
}
-
- headersHandler && headersHandler(computedHeaders);
-
- return stream.Readable.from((async function *() {
- for(const part of parts) {
- yield boundaryBytes;
- yield* part.encode();
+ const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
+ const remainingParameters = omit(parameters, omittedParameters);
+ const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
+ if (!isBinaryRequest) {
+ if (options.mediaType.format) {
+ headers.accept = headers.accept.split(/,/).map(
+ (format) => format.replace(
+ /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
+ `application/vnd$1$2.${options.mediaType.format}`
+ )
+ ).join(",");
+ }
+ if (url.endsWith("/graphql")) {
+ if (options.mediaType.previews?.length) {
+ const previewsFromAcceptHeader = headers.accept.match(/(? {
+ const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
+ return `application/vnd.github.${preview}-preview${format}`;
+ }).join(",");
+ }
}
-
- yield footerBytes;
- })());
-};
-
-const formDataToStream$1 = formDataToStream;
-
-class ZlibHeaderTransformStream extends stream__default["default"].Transform {
- __transform(chunk, encoding, callback) {
- this.push(chunk);
- callback();
}
-
- _transform(chunk, encoding, callback) {
- if (chunk.length !== 0) {
- this._transform = this.__transform;
-
- // Add Default Compression headers if no zlib headers are present
- if (chunk[0] !== 120) { // Hex: 78
- const header = Buffer.alloc(2);
- header[0] = 120; // Hex: 78
- header[1] = 156; // Hex: 9C
- this.push(header, encoding);
+ if (["GET", "HEAD"].includes(method)) {
+ url = addQueryParameters(url, remainingParameters);
+ } else {
+ if ("data" in remainingParameters) {
+ body = remainingParameters.data;
+ } else {
+ if (Object.keys(remainingParameters).length) {
+ body = remainingParameters;
}
}
-
- this.__transform(chunk, encoding, callback);
}
+ if (!headers["content-type"] && typeof body !== "undefined") {
+ headers["content-type"] = "application/json; charset=utf-8";
+ }
+ if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
+ body = "";
+ }
+ return Object.assign(
+ { method, url, headers },
+ typeof body !== "undefined" ? { body } : null,
+ options.request ? { request: options.request } : null
+ );
}
-const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
-
-const callbackify = (fn, reducer) => {
- return utils$1.isAsyncFn(fn) ? function (...args) {
- const cb = args.pop();
- fn.apply(this, args).then((value) => {
- try {
- reducer ? cb(null, ...reducer(value)) : cb(null, value);
- } catch (err) {
- cb(err);
- }
- }, cb);
- } : fn;
-};
-
-const callbackify$1 = callbackify;
+// pkg/dist-src/endpoint-with-defaults.js
+function endpointWithDefaults(defaults, route, options) {
+ return parse(merge(defaults, route, options));
+}
-const zlibOptions = {
- flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
- finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
-};
+// pkg/dist-src/with-defaults.js
+function withDefaults(oldDefaults, newDefaults) {
+ const DEFAULTS2 = merge(oldDefaults, newDefaults);
+ const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
+ return Object.assign(endpoint2, {
+ DEFAULTS: DEFAULTS2,
+ defaults: withDefaults.bind(null, DEFAULTS2),
+ merge: merge.bind(null, DEFAULTS2),
+ parse
+ });
+}
-const brotliOptions = {
- flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH,
- finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH
-};
+// pkg/dist-src/index.js
+var endpoint = withDefaults(null, DEFAULTS);
-const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
-const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"];
+// EXTERNAL MODULE: ./node_modules/content-type/dist/index.js
+var dist = __nccwpck_require__(4649);
+;// CONCATENATED MODULE: ./node_modules/json-with-bigint/json-with-bigint.js
+const intRegex = /^-?\d+$/;
+const noiseValue = /^-?\d+n+$/; // Noise - strings that match the custom format before being converted to it
+const originalStringify = JSON.stringify;
+const originalParse = JSON.parse;
+const customFormat = /^-?\d+n$/;
-const isHttps = /https:?/;
+const bigIntsStringify = /([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g;
+const noiseStringify = /([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g;
-const supportedProtocols = platform.protocols.map(protocol => {
- return protocol + ':';
-});
+/**
+ * @typedef {(this: any, key: string | number | undefined, value: any) => any} Replacer
+ * @typedef {(key: string | number | undefined, value: any, context?: { source: string }) => any} Reviver
+ */
/**
- * If the proxy or config beforeRedirects functions are defined, call them with the options
- * object.
- *
- * @param {Object} options - The options object that was passed to the request.
+ * Checks if a value is unstringifiable according to native JSON.stringify rules.
*
- * @returns {Object}
+ * @param {any} val The value to check.
+ * @returns {boolean} True if the value is undefined, a function, or a symbol.
*/
-function dispatchBeforeRedirect(options, responseDetails) {
- if (options.beforeRedirects.proxy) {
- options.beforeRedirects.proxy(options);
- }
- if (options.beforeRedirects.config) {
- options.beforeRedirects.config(options, responseDetails);
- }
-}
+const isUnstringifiable = (val) =>
+ val === undefined || typeof val === "function" || typeof val === "symbol";
/**
- * If the proxy or config afterRedirects functions are defined, call them with the options
- *
- * @param {http.ClientRequestArgs} options
- * @param {AxiosProxyConfig} configProxy configuration from Axios options object
- * @param {string} location
+ * Checks if a value is a native JSON.rawJSON object (Node.js 22+).
*
- * @returns {http.ClientRequestArgs}
+ * @param {any} val The value to check.
+ * @returns {boolean} True if the value is a RawJSON instance.
*/
-function setProxy(options, configProxy, location) {
- let proxy = configProxy;
- if (!proxy && proxy !== false) {
- const proxyUrl = proxyFromEnv.getProxyForUrl(location);
- if (proxyUrl) {
- proxy = new URL(proxyUrl);
- }
- }
- if (proxy) {
- // Basic proxy authorization
- if (proxy.username) {
- proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');
- }
-
- if (proxy.auth) {
- // Support proxy auth object form
- if (proxy.auth.username || proxy.auth.password) {
- proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
- }
- const base64 = Buffer
- .from(proxy.auth, 'utf8')
- .toString('base64');
- options.headers['Proxy-Authorization'] = 'Basic ' + base64;
- }
-
- options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
- const proxyHost = proxy.hostname || proxy.host;
- options.hostname = proxyHost;
- // Replace 'host' since options is not a URL object
- options.host = proxyHost;
- options.port = proxy.port;
- options.path = location;
- if (proxy.protocol) {
- options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
- }
- }
-
- options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
- // Configure proxy for redirected request, passing the original config proxy to apply
- // the exact same logic as if the redirected request was performed by axios directly.
- setProxy(redirectOptions, configProxy, redirectOptions.href);
- };
-}
-
-const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
-
-// temporary hotfix
-
-const wrapAsync = (asyncExecutor) => {
- return new Promise((resolve, reject) => {
- let onDone;
- let isDone;
-
- const done = (value, isRejected) => {
- if (isDone) return;
- isDone = true;
- onDone && onDone(value, isRejected);
- };
-
- const _resolve = (value) => {
- done(value);
- resolve(value);
- };
-
- const _reject = (reason) => {
- done(reason, true);
- reject(reason);
- };
+const isRawJSON = (val) =>
+ val !== null &&
+ typeof val === "object" &&
+ val.constructor &&
+ val.constructor.name === "RawJSON";
- asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
- })
-};
+/**
+ * Iteratively converts a JS value to a JSON string.
+ * Used as a fallback when the native JSON.stringify hits the Maximum Call Stack size.
+ * Fully compliant with JSON formatting (space), replacers, and toJSON behaviors.
+ *
+ * @param {any} rootValue The value to stringify.
+ * @param {Replacer | Array | null} [replacer] User's custom replacer function.
+ * @param {string | number} [spaceParam] Indentation for pretty-printing.
+ * @returns {string | undefined} The generated JSON string.
+ */
+const stringifyIteratively = (rootValue, replacer, spaceParam) => {
+ let space = "";
-const resolveFamily = ({address, family}) => {
- if (!utils$1.isString(address)) {
- throw TypeError('address must be a string');
+ if (typeof spaceParam === "number") {
+ space = " ".repeat(Math.min(10, Math.max(0, Math.floor(spaceParam))));
+ } else if (typeof spaceParam === "string") {
+ space = spaceParam.slice(0, 10);
}
- return ({
- address,
- family: family || (address.indexOf('.') < 0 ? 6 : 4)
- });
-};
-
-const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
-
-/*eslint consistent-return:0*/
-const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
- return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
- let {data, lookup, family} = config;
- const {responseType, responseEncoding} = config;
- const method = config.method.toUpperCase();
- let isDone;
- let rejected = false;
- let req;
-
- if (lookup) {
- const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]);
- // hotfix to support opt.all option which is required for node 20.x
- lookup = (hostname, opt, cb) => {
- _lookup(hostname, opt, (err, arg0, arg1) => {
- if (err) {
- return cb(err);
- }
-
- const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
-
- opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
- });
- };
- }
-
- // temporary internal emitter until the AxiosRequest class will be implemented
- const emitter = new events.EventEmitter();
-
- const onFinished = () => {
- if (config.cancelToken) {
- config.cancelToken.unsubscribe(abort);
- }
-
- if (config.signal) {
- config.signal.removeEventListener('abort', abort);
- }
-
- emitter.removeAllListeners();
- };
-
- onDone((value, isRejected) => {
- isDone = true;
- if (isRejected) {
- rejected = true;
- onFinished();
- }
- });
- function abort(reason) {
- emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
- }
+ const isFunctionReplacer = typeof replacer === "function";
+ const propertyList = Array.isArray(replacer)
+ ? new Set(replacer.map(String))
+ : null;
- emitter.once('abort', reject);
+ /**
+ * Prepares a value for stringification by resolving toJSON, handling BigInts,
+ * applying custom replacers, and unwrapping primitive objects.
+ *
+ * @param {object|Array} parent The parent object or array holding the value.
+ * @param {string} key The key associated with the value.
+ * @param {any} val The raw value to process.
+ * @returns {any} The processed value ready for stringification.
+ */
+ const prepareVal = (parent, key, val) => {
+ const isObject = val !== null && typeof val === "object";
+ const hasToJSON = isObject && typeof val.toJSON === "function";
- if (config.cancelToken || config.signal) {
- config.cancelToken && config.cancelToken.subscribe(abort);
- if (config.signal) {
- config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
- }
+ if (hasToJSON) {
+ val = val.toJSON(key);
}
- // Parse url
- const fullPath = buildFullPath(config.baseURL, config.url);
- const parsed = new URL(fullPath, 'http://localhost');
- const protocol = parsed.protocol || supportedProtocols[0];
-
- if (protocol === 'data:') {
- let convertedData;
-
- if (method !== 'GET') {
- return settle(resolve, reject, {
- status: 405,
- statusText: 'method not allowed',
- headers: {},
- config
- });
- }
+ const isNoise = typeof val === "string" && noiseValue.test(val);
- try {
- convertedData = fromDataURI(config.url, responseType === 'blob', {
- Blob: config.env && config.env.Blob
- });
- } catch (err) {
- throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
- }
+ if (isNoise) return val + "n";
- if (responseType === 'text') {
- convertedData = convertedData.toString(responseEncoding);
+ const isBigInt = typeof val === "bigint";
- if (!responseEncoding || responseEncoding === 'utf8') {
- convertedData = utils$1.stripBOM(convertedData);
- }
- } else if (responseType === 'stream') {
- convertedData = stream__default["default"].Readable.from(convertedData);
- }
+ if (isBigInt) {
+ const supportsRawJSON = "rawJSON" in JSON;
- return settle(resolve, reject, {
- data: convertedData,
- status: 200,
- statusText: 'OK',
- headers: new AxiosHeaders$1(),
- config
- });
- }
+ if (supportsRawJSON) return JSON.rawJSON(val.toString());
- if (supportedProtocols.indexOf(protocol) === -1) {
- return reject(new AxiosError(
- 'Unsupported protocol ' + protocol,
- AxiosError.ERR_BAD_REQUEST,
- config
- ));
+ return val.toString() + "n";
}
- const headers = AxiosHeaders$1.from(config.headers).normalize();
-
- // Set User-Agent (required by some servers)
- // See https://github.com/axios/axios/issues/69
- // User-Agent is specified; handle case where no UA header is desired
- // Only set header if it hasn't been set in config
- headers.set('User-Agent', 'axios/' + VERSION, false);
-
- const onDownloadProgress = config.onDownloadProgress;
- const onUploadProgress = config.onUploadProgress;
- const maxRate = config.maxRate;
- let maxUploadRate = undefined;
- let maxDownloadRate = undefined;
-
- // support for spec compliant FormData objects
- if (utils$1.isSpecCompliantForm(data)) {
- const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
-
- data = formDataToStream$1(data, (formHeaders) => {
- headers.set(formHeaders);
- }, {
- tag: `axios-${VERSION}-boundary`,
- boundary: userBoundary && userBoundary[1] || undefined
- });
- // support for https://www.npmjs.com/package/form-data api
- } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
- headers.set(data.getHeaders());
-
- if (!headers.hasContentLength()) {
- try {
- const knownLength = await util__default["default"].promisify(data.getLength).call(data);
- Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
- /*eslint no-empty:0*/
- } catch (e) {
- }
- }
- } else if (utils$1.isBlob(data)) {
- data.size && headers.setContentType(data.type || 'application/octet-stream');
- headers.setContentLength(data.size || 0);
- data = stream__default["default"].Readable.from(readBlob$1(data));
- } else if (data && !utils$1.isStream(data)) {
- if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
- data = Buffer.from(new Uint8Array(data));
- } else if (utils$1.isString(data)) {
- data = Buffer.from(data, 'utf-8');
- } else {
- return reject(new AxiosError(
- 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
- AxiosError.ERR_BAD_REQUEST,
- config
- ));
- }
-
- // Add Content-Length header if data exists
- headers.setContentLength(data.length, false);
-
- if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
- return reject(new AxiosError(
- 'Request body larger than maxBodyLength limit',
- AxiosError.ERR_BAD_REQUEST,
- config
- ));
- }
+ if (isFunctionReplacer) {
+ val = replacer.call(parent, key, val);
}
- const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
+ const isPostReplacerObject = val !== null && typeof val === "object";
- if (utils$1.isArray(maxRate)) {
- maxUploadRate = maxRate[0];
- maxDownloadRate = maxRate[1];
- } else {
- maxUploadRate = maxDownloadRate = maxRate;
- }
+ if (isPostReplacerObject) {
+ const isPrimitiveWrapper =
+ val instanceof Number ||
+ val instanceof String ||
+ val instanceof Boolean;
- if (data && (onUploadProgress || maxUploadRate)) {
- if (!utils$1.isStream(data)) {
- data = stream__default["default"].Readable.from(data, {objectMode: false});
+ if (isPrimitiveWrapper) {
+ val = val.valueOf();
}
-
- data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
- length: contentLength,
- maxRate: utils$1.toFiniteNumber(maxUploadRate)
- })], utils$1.noop);
-
- onUploadProgress && data.on('progress', progress => {
- onUploadProgress(Object.assign(progress, {
- upload: true
- }));
- });
- }
-
- // HTTP basic authentication
- let auth = undefined;
- if (config.auth) {
- const username = config.auth.username || '';
- const password = config.auth.password || '';
- auth = username + ':' + password;
- }
-
- if (!auth && parsed.username) {
- const urlUsername = parsed.username;
- const urlPassword = parsed.password;
- auth = urlUsername + ':' + urlPassword;
}
- auth && headers.delete('authorization');
+ return val;
+ };
- let path;
+ const rootProcessed = prepareVal({ "": rootValue }, "", rootValue);
- try {
- path = buildURL(
- parsed.pathname + parsed.search,
- config.params,
- config.paramsSerializer
- ).replace(/^\?/, '');
- } catch (err) {
- const customErr = new Error(err.message);
- customErr.config = config;
- customErr.url = config.url;
- customErr.exists = true;
- return reject(customErr);
- }
+ if (isUnstringifiable(rootProcessed)) {
+ return undefined;
+ }
- headers.set(
- 'Accept-Encoding',
- 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
- );
+ const isRootPrimitive =
+ rootProcessed === null || typeof rootProcessed !== "object";
+ const isRootNativeRawJSON = isRawJSON(rootProcessed);
- const options = {
- path,
- method: method,
- headers: headers.toJSON(),
- agents: { http: config.httpAgent, https: config.httpsAgent },
- auth,
- protocol,
- family,
- beforeRedirect: dispatchBeforeRedirect,
- beforeRedirects: {}
- };
+ if (isRootPrimitive || isRootNativeRawJSON) {
+ return originalStringify(rootProcessed);
+ }
- // cacheable-lookup integration hotfix
- !utils$1.isUndefined(lookup) && (options.lookup = lookup);
+ const chunks = [];
+ let level = 0;
- if (config.socketPath) {
- options.socketPath = config.socketPath;
- } else {
- options.hostname = parsed.hostname;
- options.port = parsed.port;
- setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
- }
+ const stack = [
+ {
+ parent: { "": rootProcessed },
+ key: "",
+ val: rootProcessed,
+ isArray: Array.isArray(rootProcessed),
+ keys: Array.isArray(rootProcessed) ? null : Object.keys(rootProcessed),
+ index: 0,
+ first: true,
+ },
+ ];
- let transport;
- const isHttpsRequest = isHttps.test(options.protocol);
- options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
- if (config.transport) {
- transport = config.transport;
- } else if (config.maxRedirects === 0) {
- transport = isHttpsRequest ? https__default["default"] : http__default["default"];
- } else {
- if (config.maxRedirects) {
- options.maxRedirects = config.maxRedirects;
- }
- if (config.beforeRedirect) {
- options.beforeRedirects.config = config.beforeRedirect;
- }
- transport = isHttpsRequest ? httpsFollow : httpFollow;
- }
+ const visited = new WeakSet([rootProcessed]);
- if (config.maxBodyLength > -1) {
- options.maxBodyLength = config.maxBodyLength;
- } else {
- // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
- options.maxBodyLength = Infinity;
- }
+ while (stack.length > 0) {
+ const node = stack[stack.length - 1];
- if (config.insecureHTTPParser) {
- options.insecureHTTPParser = config.insecureHTTPParser;
+ if (node.index === 0) {
+ chunks.push(node.isArray ? "[" : "{");
+ level++;
}
- // Create the request
- req = transport.request(options, function handleResponse(res) {
- if (req.destroyed) return;
-
- const streams = [res];
-
- const responseLength = +res.headers['content-length'];
-
- if (onDownloadProgress) {
- const transformStream = new AxiosTransformStream$1({
- length: utils$1.toFiniteNumber(responseLength),
- maxRate: utils$1.toFiniteNumber(maxDownloadRate)
- });
+ let isDone = false;
- onDownloadProgress && transformStream.on('progress', progress => {
- onDownloadProgress(Object.assign(progress, {
- download: true
- }));
- });
+ if (node.isArray) {
+ if (node.index < node.val.length) {
+ if (!node.first) chunks.push(",");
- streams.push(transformStream);
- }
+ if (space) chunks.push("\n" + space.repeat(level));
- // decompress the response body transparently if required
- let responseStream = res;
+ const childRaw = node.val[node.index];
+ const childVal = prepareVal(node.val, String(node.index), childRaw);
- // return the last request in case of redirects
- const lastRequest = res.req || req;
+ if (isUnstringifiable(childVal)) {
+ chunks.push("null");
+ node.first = false;
+ node.index++;
+ } else {
+ const isComplexObject =
+ childVal !== null && typeof childVal === "object";
+ const isNativeRaw = isRawJSON(childVal);
- // if decompress disabled we should not decompress
- if (config.decompress !== false && res.headers['content-encoding']) {
- // if no content, but headers still say that it is encoded,
- // remove the header not confuse downstream operations
- if (method === 'HEAD' || res.statusCode === 204) {
- delete res.headers['content-encoding'];
- }
+ if (isComplexObject && !isNativeRaw) {
+ if (visited.has(childVal)) {
+ throw new TypeError("Converting circular structure to JSON");
+ }
- switch ((res.headers['content-encoding'] || '').toLowerCase()) {
- /*eslint default-case:0*/
- case 'gzip':
- case 'x-gzip':
- case 'compress':
- case 'x-compress':
- // add the unzipper to the body stream processing pipeline
- streams.push(zlib__default["default"].createUnzip(zlibOptions));
-
- // remove the content-encoding in order to not confuse downstream operations
- delete res.headers['content-encoding'];
- break;
- case 'deflate':
- streams.push(new ZlibHeaderTransformStream$1());
+ visited.add(childVal);
- // add the unzipper to the body stream processing pipeline
- streams.push(zlib__default["default"].createUnzip(zlibOptions));
+ stack.push({
+ parent: node.val,
+ key: String(node.index),
+ val: childVal,
+ isArray: Array.isArray(childVal),
+ keys: Array.isArray(childVal) ? null : Object.keys(childVal),
+ index: 0,
+ first: true,
+ });
- // remove the content-encoding in order to not confuse downstream operations
- delete res.headers['content-encoding'];
- break;
- case 'br':
- if (isBrotliSupported) {
- streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions));
- delete res.headers['content-encoding'];
+ node.first = false;
+ node.index++;
+ } else {
+ chunks.push(originalStringify(childVal));
+ node.first = false;
+ node.index++;
}
}
- }
-
- responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0];
-
- const offListeners = stream__default["default"].finished(responseStream, () => {
- offListeners();
- onFinished();
- });
-
- const response = {
- status: res.statusCode,
- statusText: res.statusMessage,
- headers: new AxiosHeaders$1(res.headers),
- config,
- request: lastRequest
- };
-
- if (responseType === 'stream') {
- response.data = responseStream;
- settle(resolve, reject, response);
} else {
- const responseBuffer = [];
- let totalResponseBytes = 0;
-
- responseStream.on('data', function handleStreamData(chunk) {
- responseBuffer.push(chunk);
- totalResponseBytes += chunk.length;
-
- // make sure the content length is not over the maxContentLength if specified
- if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
- // stream.destroy() emit aborted event before calling reject() on Node.js v16
- rejected = true;
- responseStream.destroy();
- reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
- AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
- }
- });
-
- responseStream.on('aborted', function handlerStreamAborted() {
- if (rejected) {
- return;
- }
-
- const err = new AxiosError(
- 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
- AxiosError.ERR_BAD_RESPONSE,
- config,
- lastRequest
- );
- responseStream.destroy(err);
- reject(err);
- });
-
- responseStream.on('error', function handleStreamError(err) {
- if (req.destroyed) return;
- reject(AxiosError.from(err, null, config, lastRequest));
- });
-
- responseStream.on('end', function handleStreamEnd() {
- try {
- let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
- if (responseType !== 'arraybuffer') {
- responseData = responseData.toString(responseEncoding);
- if (!responseEncoding || responseEncoding === 'utf8') {
- responseData = utils$1.stripBOM(responseData);
- }
- }
- response.data = responseData;
- } catch (err) {
- return reject(AxiosError.from(err, null, config, response.request, response));
- }
- settle(resolve, reject, response);
- });
+ isDone = true;
}
+ } else {
+ while (node.index < node.keys.length) {
+ const k = node.keys[node.index++];
- emitter.once('abort', err => {
- if (!responseStream.destroyed) {
- responseStream.emit('error', err);
- responseStream.destroy();
- }
- });
- });
-
- emitter.once('abort', err => {
- reject(err);
- req.destroy(err);
- });
+ const isFilteredOutByArray = propertyList && !propertyList.has(k);
- // Handle errors
- req.on('error', function handleRequestError(err) {
- // @todo remove
- // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
- reject(AxiosError.from(err, null, config, req));
- });
+ if (isFilteredOutByArray) continue;
- // set tcp keep alive to prevent drop connection by peer
- req.on('socket', function handleRequestSocket(socket) {
- // default interval of sending ack packet is 1 minute
- socket.setKeepAlive(true, 1000 * 60);
- });
+ const childRaw = node.val[k];
+ const childVal = prepareVal(node.val, k, childRaw);
- // Handle request timeout
- if (config.timeout) {
- // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
- const timeout = parseInt(config.timeout, 10);
+ if (isUnstringifiable(childVal)) continue;
- if (Number.isNaN(timeout)) {
- reject(new AxiosError(
- 'error trying to parse `config.timeout` to int',
- AxiosError.ERR_BAD_OPTION_VALUE,
- config,
- req
- ));
+ if (!node.first) chunks.push(",");
- return;
- }
+ if (space) {
+ chunks.push("\n" + space.repeat(level) + originalStringify(k) + ": ");
+ } else {
+ chunks.push(originalStringify(k) + ":");
+ }
- // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
- // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
- // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
- // And then these socket which be hang up will devouring CPU little by little.
- // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
- req.setTimeout(timeout, function handleRequestTimeout() {
- if (isDone) return;
- let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
- const transitional = config.transitional || transitionalDefaults;
- if (config.timeoutErrorMessage) {
- timeoutErrorMessage = config.timeoutErrorMessage;
- }
- reject(new AxiosError(
- timeoutErrorMessage,
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
- config,
- req
- ));
- abort();
- });
- }
+ const isComplexObject =
+ childVal !== null && typeof childVal === "object";
+ const isNativeRaw = isRawJSON(childVal);
+ if (isComplexObject && !isNativeRaw) {
+ if (visited.has(childVal)) {
+ throw new TypeError("Converting circular structure to JSON");
+ }
- // Send the request
- if (utils$1.isStream(data)) {
- let ended = false;
- let errored = false;
+ visited.add(childVal);
- data.on('end', () => {
- ended = true;
- });
+ stack.push({
+ parent: node.val,
+ key: k,
+ val: childVal,
+ isArray: Array.isArray(childVal),
+ keys: Array.isArray(childVal) ? null : Object.keys(childVal),
+ index: 0,
+ first: true,
+ });
- data.once('error', err => {
- errored = true;
- req.destroy(err);
- });
+ node.first = false;
- data.on('close', () => {
- if (!ended && !errored) {
- abort(new CanceledError('Request stream has been aborted', config, req));
+ break; // Stop current loop level to process the newly pushed stack node
+ } else {
+ chunks.push(originalStringify(childVal));
+ node.first = false;
}
- });
+ }
- data.pipe(req);
- } else {
- req.end(data);
+ const isNodeFullyProcessed =
+ node.index >= node.keys.length && stack[stack.length - 1] === node;
+
+ if (isNodeFullyProcessed) {
+ isDone = true;
+ }
}
- });
+
+ if (isDone) {
+ level--;
+
+ if (!node.first && space) chunks.push("\n" + space.repeat(level));
+
+ chunks.push(node.isArray ? "]" : "}");
+ visited.delete(node.val);
+ stack.pop();
+ }
+ }
+
+ return chunks.join("");
};
-const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
- let bytesNotified = 0;
- const _speedometer = speedometer(50, 250);
+/**
+ * Converts a JavaScript value to a JSON string.
+ *
+ * Supports serialization of BigInt values using two strategies:
+ * 1. Custom format "123n" → "123" (universal fallback)
+ * 2. Native JSON.rawJSON() (Node.js 22+, fastest) when available
+ *
+ * All other values are serialized exactly like native JSON.stringify().
+ *
+ * @param {*} value The value to convert to a JSON string.
+ * @param {Replacer | Array | null} [replacer]
+ * A function that alters the behavior of the stringification process,
+ * or an array of strings/numbers to indicate properties to exclude.
+ * @param {string | number} [space]
+ * A string or number to specify indentation or pretty-printing.
+ * @returns {string} The JSON string representation.
+ */
+const JSONStringify = (value, replacer, space) => {
+ try {
+ const supportsRawJSON = "rawJSON" in JSON;
- return throttle(e => {
- const loaded = e.loaded;
- const total = e.lengthComputable ? e.total : undefined;
- const progressBytes = loaded - bytesNotified;
- const rate = _speedometer(progressBytes);
- const inRange = loaded <= total;
+ if (supportsRawJSON) {
+ return originalStringify(
+ value,
+ (key, val) => {
+ if (typeof val === "bigint") return JSON.rawJSON(val.toString());
- bytesNotified = loaded;
+ const hasFunctionReplacer = typeof replacer === "function";
- const data = {
- loaded,
- total,
- progress: total ? (loaded / total) : undefined,
- bytes: progressBytes,
- rate: rate ? rate : undefined,
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
- event: e,
- lengthComputable: total != null
- };
+ if (hasFunctionReplacer) return replacer(key, val);
- data[isDownloadStream ? 'download' : 'upload'] = true;
+ const isKeyInArrayReplacer =
+ Array.isArray(replacer) && replacer.includes(key);
- listener(data);
- }, freq);
-};
+ if (isKeyInArrayReplacer) return val;
-const isURLSameOrigin = platform.hasStandardBrowserEnv ?
+ return val;
+ },
+ space,
+ );
+ }
-// Standard browser envs have full support of the APIs needed to test
-// whether the request URL is of the same origin as current location.
- (function standardBrowserEnv() {
- const msie = /(msie|trident)/i.test(navigator.userAgent);
- const urlParsingNode = document.createElement('a');
- let originURL;
+ if (!value) return originalStringify(value, replacer, space);
- /**
- * Parse a URL to discover its components
- *
- * @param {String} url The URL to be parsed
- * @returns {Object}
- */
- function resolveURL(url) {
- let href = url;
+ const convertedToCustomJSON = originalStringify(
+ value,
+ (key, val) => {
+ const isNoise = typeof val === "string" && noiseValue.test(val);
- if (msie) {
- // IE needs attribute set twice to normalize properties
- urlParsingNode.setAttribute('href', href);
- href = urlParsingNode.href;
- }
+ if (isNoise) return val.toString() + "n"; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
- urlParsingNode.setAttribute('href', href);
+ if (typeof val === "bigint") return val.toString() + "n";
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
- return {
- href: urlParsingNode.href,
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
- host: urlParsingNode.host,
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
- hostname: urlParsingNode.hostname,
- port: urlParsingNode.port,
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
- urlParsingNode.pathname :
- '/' + urlParsingNode.pathname
- };
- }
+ const hasFunctionReplacer = typeof replacer === "function";
- originURL = resolveURL(window.location.href);
+ if (hasFunctionReplacer) return replacer(key, val);
- /**
- * Determine if a URL shares the same origin as the current location
- *
- * @param {String} requestURL The URL to test
- * @returns {boolean} True if URL shares the same origin, otherwise false
- */
- return function isURLSameOrigin(requestURL) {
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
- return (parsed.protocol === originURL.protocol &&
- parsed.host === originURL.host);
- };
- })() :
+ const isKeyInArrayReplacer =
+ Array.isArray(replacer) && replacer.includes(key);
- // Non standard browser envs (web workers, react-native) lack needed support.
- (function nonStandardBrowserEnv() {
- return function isURLSameOrigin() {
- return true;
- };
- })();
+ if (isKeyInArrayReplacer) return val;
-const cookies = platform.hasStandardBrowserEnv ?
+ return val;
+ },
+ space,
+ );
- // Standard browser envs support document.cookie
- {
- write(name, value, expires, path, domain, secure) {
- const cookie = [name + '=' + encodeURIComponent(value)];
+ const processedJSON = convertedToCustomJSON.replace(
+ bigIntsStringify,
+ "$1$2$3",
+ ); // Delete one "n" off the end of every BigInt value
- utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
+ const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); // Remove one "n" off the end of every noisy string
- utils$1.isString(path) && cookie.push('path=' + path);
+ return denoisedJSON;
+ } catch (error) {
+ if (error instanceof RangeError) {
+ const convertedJSON = stringifyIteratively(value, replacer, space);
- utils$1.isString(domain) && cookie.push('domain=' + domain);
+ if (convertedJSON === undefined) return undefined;
- secure === true && cookie.push('secure');
+ const supportsRawJSON = "rawJSON" in JSON;
- document.cookie = cookie.join('; ');
- },
+ if (supportsRawJSON) return convertedJSON;
- read(name) {
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
- return (match ? decodeURIComponent(match[3]) : null);
- },
+ const processedJSON = convertedJSON.replace(bigIntsStringify, "$1$2$3");
- remove(name) {
- this.write(name, '', Date.now() - 86400000);
+ return processedJSON.replace(noiseStringify, "$1$2$3");
}
- }
-
- :
- // Non-standard browser env (web workers, react-native) lack needed support.
- {
- write() {},
- read() {
- return null;
- },
- remove() {}
- };
+ throw error;
+ }
+};
-const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
+const featureCache = new Map();
/**
- * Config-specific merge-function which creates a new config-object
- * by merging two configuration objects together.
+ * Detects if the current JSON.parse implementation supports the context.source feature.
*
- * @param {Object} config1
- * @param {Object} config2
+ * Uses toString() fingerprinting to cache results and automatically detect runtime
+ * replacements of JSON.parse (polyfills, mocks, etc.).
*
- * @returns {Object} New object resulting from merging config2 to config1
+ * @returns {boolean} true if context.source is supported, false otherwise.
*/
-function mergeConfig(config1, config2) {
- // eslint-disable-next-line no-param-reassign
- config2 = config2 || {};
- const config = {};
+const isContextSourceSupported = () => {
+ const parseFingerprint = JSON.parse.toString();
- function getMergedValue(target, source, caseless) {
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
- return utils$1.merge.call({caseless}, target, source);
- } else if (utils$1.isPlainObject(source)) {
- return utils$1.merge({}, source);
- } else if (utils$1.isArray(source)) {
- return source.slice();
- }
- return source;
+ if (featureCache.has(parseFingerprint)) {
+ return featureCache.get(parseFingerprint);
}
- // eslint-disable-next-line consistent-return
- function mergeDeepProperties(a, b, caseless) {
- if (!utils$1.isUndefined(b)) {
- return getMergedValue(a, b, caseless);
- } else if (!utils$1.isUndefined(a)) {
- return getMergedValue(undefined, a, caseless);
- }
- }
+ try {
+ const result = JSON.parse(
+ "1",
+ (_, __, context) => !!context?.source && context.source === "1",
+ );
+ featureCache.set(parseFingerprint, result);
- // eslint-disable-next-line consistent-return
- function valueFromConfig2(a, b) {
- if (!utils$1.isUndefined(b)) {
- return getMergedValue(undefined, b);
- }
- }
+ return result;
+ } catch {
+ featureCache.set(parseFingerprint, false);
- // eslint-disable-next-line consistent-return
- function defaultToConfig2(a, b) {
- if (!utils$1.isUndefined(b)) {
- return getMergedValue(undefined, b);
- } else if (!utils$1.isUndefined(a)) {
- return getMergedValue(undefined, a);
- }
+ return false;
}
+};
- // eslint-disable-next-line consistent-return
- function mergeDirectKeys(a, b, prop) {
- if (prop in config2) {
- return getMergedValue(a, b);
- } else if (prop in config1) {
- return getMergedValue(undefined, a);
- }
- }
+/**
+ * Reviver function that converts custom-format BigInt strings back to BigInt values.
+ * Also handles "noise" strings that accidentally match the BigInt format.
+ *
+ * @param {string | number | undefined} key The object key.
+ * @param {*} value The value being parsed.
+ * @param {object} [context] Parse context (if supported by JSON.parse).
+ * @param {Reviver} [userReviver] User's custom reviver function.
+ * @returns {any} The transformed value.
+ */
+const convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
+ const isCustomFormatBigInt =
+ typeof value === "string" && customFormat.test(value);
- const mergeMap = {
- url: valueFromConfig2,
- method: valueFromConfig2,
- data: valueFromConfig2,
- baseURL: defaultToConfig2,
- transformRequest: defaultToConfig2,
- transformResponse: defaultToConfig2,
- paramsSerializer: defaultToConfig2,
- timeout: defaultToConfig2,
- timeoutMessage: defaultToConfig2,
- withCredentials: defaultToConfig2,
- withXSRFToken: defaultToConfig2,
- adapter: defaultToConfig2,
- responseType: defaultToConfig2,
- xsrfCookieName: defaultToConfig2,
- xsrfHeaderName: defaultToConfig2,
- onUploadProgress: defaultToConfig2,
- onDownloadProgress: defaultToConfig2,
- decompress: defaultToConfig2,
- maxContentLength: defaultToConfig2,
- maxBodyLength: defaultToConfig2,
- beforeRedirect: defaultToConfig2,
- transport: defaultToConfig2,
- httpAgent: defaultToConfig2,
- httpsAgent: defaultToConfig2,
- cancelToken: defaultToConfig2,
- socketPath: defaultToConfig2,
- responseEncoding: defaultToConfig2,
- validateStatus: mergeDirectKeys,
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
- };
+ if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
+
+ const isNoiseValue = typeof value === "string" && noiseValue.test(value);
+ if (isNoiseValue) return value.slice(0, -1);
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
- const merge = mergeMap[prop] || mergeDeepProperties;
- const configValue = merge(config1[prop], config2[prop], prop);
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+ const hasUserReviver = typeof userReviver === "function";
+
+ if (!hasUserReviver) return value;
+
+ return userReviver(key, value, context);
+};
+
+/**
+ * Fast JSON.parse implementation (~2x faster than classic fallback).
+ * Uses JSON.parse's context.source feature to detect integers and convert
+ * large numbers directly to BigInt without string manipulation.
+ *
+ * Does not support legacy custom format from v1 of this library.
+ *
+ * @param {string} text JSON string to parse.
+ * @param {Reviver} [reviver] Transform function to apply to each value.
+ * @returns {any} Parsed JavaScript value.
+ */
+const JSONParseV2 = (text, reviver) => {
+ return JSON.parse(text, (key, value, context) => {
+ const isNumber = typeof value === "number";
+ const isOutOfBounds =
+ value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER;
+ const isBigNumber = isNumber && isOutOfBounds;
+ const isInt = context && intRegex.test(context.source);
+ const isBigInt = isBigNumber && isInt;
+
+ if (isBigInt) return BigInt(context.source);
+
+ const hasCustomReviver = typeof reviver === "function";
+
+ if (!hasCustomReviver) return value;
+
+ return reviver(key, value, context);
});
+};
- return config;
-}
+const MAX_INT = Number.MAX_SAFE_INTEGER.toString();
+const MAX_DIGITS = MAX_INT.length;
+const stringsOrLargeNumbers =
+ /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
+const noiseValueWithQuotes = /^"-?\d+n+"$/; // Noise - strings that match the custom format before being converted to it
-const resolveConfig = (config) => {
- const newConfig = mergeConfig({}, config);
+/**
+ * Iteratively traverses the parsed object bottom-up (post-order),
+ * emulating the native JSON.parse reviver behavior.
+ * This avoids Call Stack overflows (RangeError) on deeply nested structures.
+ *
+ * @param {any} parsed The natively parsed JSON object.
+ * @param {Reviver} [userReviver] User's custom reviver function.
+ * @returns {any} The fully processed object.
+ */
+const applyReviverIteratively = (parsed, userReviver) => {
+ const rootHolder = { "": parsed };
+ const stack = [{ parent: rootHolder, key: "", visited: false }];
- let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
+ while (stack.length > 0) {
+ const node = stack[stack.length - 1];
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
+ if (!node.visited) {
+ node.visited = true;
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
+ const value = node.parent[node.key];
+ const isComplexObject = value !== null && typeof value === "object";
- // HTTP basic authentication
- if (auth) {
- headers.set('Authorization', 'Basic ' +
- btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
- );
- }
+ if (isComplexObject) {
+ const keys = Object.keys(value);
- let contentType;
+ for (let i = keys.length - 1; i >= 0; i--) {
+ stack.push({ parent: value, key: keys[i], visited: false });
+ }
+ }
+ } else {
+ const { parent, key } = node;
+ let value = parent[key];
- if (utils$1.isFormData(data)) {
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
- headers.setContentType(undefined); // Let the browser set it
- } else if ((contentType = headers.getContentType()) !== false) {
- // fix semicolon duplication issue for ReactNative FormData implementation
- const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
- headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
- }
- }
+ if (typeof value === "string") {
+ const isCustomFormatBigInt = customFormat.test(value);
- // Add xsrf header
- // This is only done if running in a standard browser environment.
- // Specifically not if we're in a web worker, or react-native.
+ if (isCustomFormatBigInt) {
+ value = BigInt(value.slice(0, -1));
+ } else {
+ const isNoise = noiseValue.test(value);
- if (platform.hasStandardBrowserEnv) {
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
+ if (isNoise) value = value.slice(0, -1);
+ }
+ }
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
- // Add xsrf header
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
+ const hasUserReviver = typeof userReviver === "function";
- if (xsrfValue) {
- headers.set(xsrfHeaderName, xsrfValue);
+ if (hasUserReviver) {
+ value = userReviver.call(parent, key, value);
+ }
+
+ const isDeleted = value === undefined;
+
+ if (isDeleted) {
+ delete parent[key];
+ } else {
+ parent[key] = value;
}
+
+ stack.pop();
}
}
- return newConfig;
+ return rootHolder[""];
};
-const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+/**
+ * Pre-processes the JSON string to mark large numbers with an 'n' suffix.
+ *
+ * @param {string} text The raw JSON string.
+ * @returns {string} The serialized string with marked BigInts.
+ */
+const serializeBigInts = (text) => {
+ return text.replace(
+ stringsOrLargeNumbers,
+ (match, digits, fractional, exponential) => {
+ const isString = match[0] === '"';
+ const isNoise = isString && noiseValueWithQuotes.test(match);
-const xhrAdapter = isXHRAdapterSupported && function (config) {
- return new Promise(function dispatchXhrRequest(resolve, reject) {
- const _config = resolveConfig(config);
- let requestData = _config.data;
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
- let {responseType} = _config;
- let onCanceled;
- function done() {
- if (_config.cancelToken) {
- _config.cancelToken.unsubscribe(onCanceled);
- }
+ if (isNoise) return match.substring(0, match.length - 1) + 'n"'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
- if (_config.signal) {
- _config.signal.removeEventListener('abort', onCanceled);
- }
- }
+ const hasFractionalOrExponential = fractional || exponential;
- let request = new XMLHttpRequest();
+ // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison
+ const isLessThanMaxSafeInt =
+ digits &&
+ (digits.length < MAX_DIGITS ||
+ (digits.length === MAX_DIGITS && digits <= MAX_INT));
- request.open(_config.method.toUpperCase(), _config.url, true);
+ const isStandardValue =
+ isString || hasFractionalOrExponential || isLessThanMaxSafeInt;
- // Set the request timeout in MS
- request.timeout = _config.timeout;
+ if (isStandardValue) return match;
- function onloadend() {
- if (!request) {
- return;
- }
- // Prepare the response
- const responseHeaders = AxiosHeaders$1.from(
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
- );
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
- request.responseText : request.response;
- const response = {
- data: responseData,
- status: request.status,
- statusText: request.statusText,
- headers: responseHeaders,
- config,
- request
- };
+ return '"' + match + 'n"';
+ },
+ );
+};
- settle(function _resolve(value) {
- resolve(value);
- done();
- }, function _reject(err) {
- reject(err);
- done();
- }, response);
+/**
+ * Converts a JSON string into a JavaScript value.
+ *
+ * Supports parsing of large integers using two strategies:
+ * 1. Classic fallback: Marks large numbers with "123n" format, then converts to BigInt
+ * 2. Fast path (JSONParseV2): Uses context.source feature (~2x faster) when available
+ *
+ * All other JSON values are parsed exactly like native JSON.parse().
+ *
+ * @param {string} text A valid JSON string.
+ * @param {Reviver} [reviver]
+ * A function that transforms the results. This function is called for each member
+ * of the object. If a member contains nested objects, the nested objects are
+ * transformed before the parent object is.
+ * @returns {any} The parsed JavaScript value.
+ * @throws {SyntaxError} If text is not valid JSON.
+ */
+const JSONParse = (text, reviver) => {
+ if (!text) return originalParse(text, reviver);
- // Clean up request
- request = null;
+ try {
+ if (isContextSourceSupported()) return JSONParseV2(text, reviver); // Shortcut to a faster (2x) and simpler version
+
+ // Find and mark big numbers with "n"
+ const serializedData = serializeBigInts(text);
+
+ return originalParse(serializedData, (key, value, context) =>
+ convertMarkedBigIntsReviver(key, value, context, reviver),
+ );
+ } catch (error) {
+ if (error instanceof RangeError) {
+ const serializedData = serializeBigInts(text);
+ const parsed = originalParse(serializedData);
+
+ return applyReviverIteratively(parsed, reviver);
}
- if ('onloadend' in request) {
- // Use onloadend if available
- request.onloadend = onloadend;
- } else {
- // Listen for ready state to emulate onloadend
- request.onreadystatechange = function handleLoad() {
- if (!request || request.readyState !== 4) {
- return;
- }
+ throw error;
+ }
+};
- // The request errored out and we didn't get a response, this will be
- // handled by onerror instead
- // With one exception: request that using file: protocol, most browsers
- // will return status as 0 even though it's a successful request
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
- return;
- }
- // readystate handler is calling before onerror or ontimeout handlers,
- // so we should call onloadend on the next 'tick'
- setTimeout(onloadend);
- };
+
+
+;// CONCATENATED MODULE: ./node_modules/@octokit/request-error/dist-src/index.js
+class RequestError extends Error {
+ name;
+ /**
+ * http status code
+ */
+ status;
+ /**
+ * Request options that lead to the error.
+ */
+ request;
+ /**
+ * Response object if a response was received
+ */
+ response;
+ constructor(message, statusCode, options) {
+ super(message, { cause: options.cause });
+ this.name = "HttpError";
+ this.status = Number.parseInt(statusCode);
+ if (Number.isNaN(this.status)) {
+ this.status = 0;
+ }
+ /* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */
+ if ("response" in options) {
+ this.response = options.response;
+ }
+ const requestCopy = Object.assign({}, options.request);
+ if (options.request.headers.authorization) {
+ requestCopy.headers = Object.assign({}, options.request.headers, {
+ authorization: options.request.headers.authorization.replace(
+ /(? "";
+async function fetchWrapper(requestOptions) {
+ const fetch = requestOptions.request?.fetch || globalThis.fetch;
+ if (!fetch) {
+ throw new Error(
+ "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
+ );
+ }
+ const log = requestOptions.request?.log || console;
+ const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
+ const body = dist_bundle_isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
+ const requestHeaders = Object.fromEntries(
+ Object.entries(requestOptions.headers).map(([name, value]) => [
+ name,
+ String(value)
+ ])
+ );
+ let fetchResponse;
+ try {
+ fetchResponse = await fetch(requestOptions.url, {
+ method: requestOptions.method,
+ body,
+ redirect: requestOptions.request?.redirect,
+ headers: requestHeaders,
+ signal: requestOptions.request?.signal,
+ // duplex must be set if request.body is ReadableStream or Async Iterables.
+ // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
+ ...requestOptions.body && { duplex: "half" }
+ });
+ } catch (error) {
+ let message = "Unknown Error";
+ if (error instanceof Error) {
+ if (error.name === "AbortError") {
+ error.status = 500;
+ throw error;
+ }
+ message = error.message;
+ if (error.name === "TypeError" && "cause" in error) {
+ if (error.cause instanceof Error) {
+ message = error.cause.message;
+ } else if (typeof error.cause === "string") {
+ message = error.cause;
+ }
+ }
+ }
+ const requestError = new RequestError(message, 500, {
+ request: requestOptions
+ });
+ requestError.cause = error;
+ throw requestError;
+ }
+ const status = fetchResponse.status;
+ const url = fetchResponse.url;
+ const responseHeaders = {};
+ for (const [key, value] of fetchResponse.headers) {
+ responseHeaders[key] = value;
+ }
+ const octokitResponse = {
+ url,
+ status,
+ headers: responseHeaders,
+ data: ""
+ };
+ if ("deprecation" in responseHeaders) {
+ const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
+ const deprecationLink = matches && matches.pop();
+ log.warn(
+ `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
+ );
+ }
+ if (status === 204 || status === 205) {
+ return octokitResponse;
+ }
+ if (requestOptions.method === "HEAD") {
+ if (status < 400) {
+ return octokitResponse;
+ }
+ throw new RequestError(fetchResponse.statusText, status, {
+ response: octokitResponse,
+ request: requestOptions
+ });
+ }
+ if (status === 304) {
+ octokitResponse.data = await getResponseData(fetchResponse);
+ throw new RequestError("Not modified", status, {
+ response: octokitResponse,
+ request: requestOptions
+ });
+ }
+ if (status >= 400) {
+ octokitResponse.data = await getResponseData(fetchResponse);
+ throw new RequestError(toErrorMessage(octokitResponse.data), status, {
+ response: octokitResponse,
+ request: requestOptions
+ });
+ }
+ octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
+ return octokitResponse;
+}
+async function getResponseData(response) {
+ const contentType = response.headers.get("content-type");
+ if (!contentType) {
+ return response.text().catch(noop);
+ }
+ const mimetype = (0,dist/* parse */.qg)(contentType);
+ if (isJSONResponse(mimetype)) {
+ let text = "";
+ try {
+ text = await response.text();
+ return JSONParse(text);
+ } catch (err) {
+ return text;
}
+ } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
+ return response.text().catch(noop);
+ } else {
+ return response.arrayBuffer().catch(
+ /* v8 ignore next -- @preserve */
+ () => new ArrayBuffer(0)
+ );
+ }
+}
+function isJSONResponse(mimetype) {
+ return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
+}
+function toErrorMessage(data) {
+ if (typeof data === "string") {
+ return data;
+ }
+ if (data instanceof ArrayBuffer) {
+ return "Unknown error";
+ }
+ if (typeof data === "object" && data !== null && "message" in data) {
+ const objectData = data;
+ const suffix = "documentation_url" in objectData ? ` - ${objectData.documentation_url}` : "";
+ return Array.isArray(objectData.errors) ? `${objectData.message}: ${objectData.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${objectData.message}${suffix}`;
+ }
+ return `Unknown error: ${JSON.stringify(data)}`;
+}
- // Add responseType to request if needed
- if (responseType && responseType !== 'json') {
- request.responseType = _config.responseType;
+// pkg/dist-src/with-defaults.js
+function dist_bundle_withDefaults(oldEndpoint, newDefaults) {
+ const endpoint2 = oldEndpoint.defaults(newDefaults);
+ const newApi = function(route, parameters) {
+ const endpointOptions = endpoint2.merge(route, parameters);
+ if (!endpointOptions.request || !endpointOptions.request.hook) {
+ return fetchWrapper(endpoint2.parse(endpointOptions));
}
+ const request2 = (route2, parameters2) => {
+ return fetchWrapper(
+ endpoint2.parse(endpoint2.merge(route2, parameters2))
+ );
+ };
+ Object.assign(request2, {
+ endpoint: endpoint2,
+ defaults: dist_bundle_withDefaults.bind(null, endpoint2)
+ });
+ return endpointOptions.request.hook(request2, endpointOptions);
+ };
+ return Object.assign(newApi, {
+ endpoint: endpoint2,
+ defaults: dist_bundle_withDefaults.bind(null, endpoint2)
+ });
+}
- // Handle progress if needed
- if (typeof _config.onDownloadProgress === 'function') {
- request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));
+// pkg/dist-src/index.js
+var request = dist_bundle_withDefaults(endpoint, defaults_default);
+
+/* v8 ignore next -- @preserve */
+/* v8 ignore else -- @preserve */
+
+;// CONCATENATED MODULE: ./node_modules/@octokit/graphql/dist-bundle/index.js
+// pkg/dist-src/index.js
+
+
+
+// pkg/dist-src/version.js
+var graphql_dist_bundle_VERSION = "0.0.0-development";
+
+// pkg/dist-src/with-defaults.js
+
+
+// pkg/dist-src/graphql.js
+
+
+// pkg/dist-src/error.js
+function _buildMessageForResponseErrors(data) {
+ return `Request failed due to following response errors:
+` + data.errors.map((e) => ` - ${e.message}`).join("\n");
+}
+var GraphqlResponseError = class extends Error {
+ constructor(request2, headers, response) {
+ super(_buildMessageForResponseErrors(response));
+ this.request = request2;
+ this.headers = headers;
+ this.response = response;
+ this.errors = response.errors;
+ this.data = response.data;
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
}
+ }
+ name = "GraphqlResponseError";
+ errors;
+ data;
+};
- // Not all browsers support upload events
- if (typeof _config.onUploadProgress === 'function' && request.upload) {
- request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));
+// pkg/dist-src/graphql.js
+var NON_VARIABLE_OPTIONS = [
+ "method",
+ "baseUrl",
+ "url",
+ "headers",
+ "request",
+ "query",
+ "mediaType",
+ "operationName"
+];
+var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
+var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
+function graphql(request2, query, options) {
+ if (options) {
+ if (typeof query === "string" && "query" in options) {
+ return Promise.reject(
+ new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
+ );
+ }
+ for (const key in options) {
+ if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
+ return Promise.reject(
+ new Error(
+ `[@octokit/graphql] "${key}" cannot be used as variable name`
+ )
+ );
+ }
+ }
+ const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
+ const requestOptions = Object.keys(
+ parsedOptions
+ ).reduce((result, key) => {
+ if (NON_VARIABLE_OPTIONS.includes(key)) {
+ result[key] = parsedOptions[key];
+ return result;
+ }
+ if (!result.variables) {
+ result.variables = {};
}
-
- if (_config.cancelToken || _config.signal) {
- // Handle cancellation
- // eslint-disable-next-line func-names
- onCanceled = cancel => {
- if (!request) {
- return;
- }
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
- request.abort();
- request = null;
- };
-
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
- if (_config.signal) {
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
+ result.variables[key] = parsedOptions[key];
+ return result;
+ }, {});
+ const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
+ if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
+ requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
+ }
+ return request2(requestOptions).then((response) => {
+ if (response.data.errors) {
+ const headers = {};
+ for (const key of Object.keys(response.headers)) {
+ headers[key] = response.headers[key];
}
+ throw new GraphqlResponseError(
+ requestOptions,
+ headers,
+ response.data
+ );
}
-
- const protocol = parseProtocol(_config.url);
-
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
- return;
- }
-
-
- // Send the request
- request.send(requestData || null);
+ return response.data.data;
});
-};
-
-const composeSignals = (signals, timeout) => {
- let controller = new AbortController();
-
- let aborted;
-
- const onabort = function (cancel) {
- if (!aborted) {
- aborted = true;
- unsubscribe();
- const err = cancel instanceof Error ? cancel : this.reason;
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
- }
- };
-
- let timer = timeout && setTimeout(() => {
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
- }, timeout);
+}
- const unsubscribe = () => {
- if (signals) {
- timer && clearTimeout(timer);
- timer = null;
- signals.forEach(signal => {
- signal &&
- (signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
- });
- signals = null;
- }
+// pkg/dist-src/with-defaults.js
+function graphql_dist_bundle_withDefaults(request2, newDefaults) {
+ const newRequest = request2.defaults(newDefaults);
+ const newApi = (query, options) => {
+ return graphql(newRequest, query, options);
};
+ return Object.assign(newApi, {
+ defaults: graphql_dist_bundle_withDefaults.bind(null, newRequest),
+ endpoint: newRequest.endpoint
+ });
+}
- signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
-
- const {signal} = controller;
-
- signal.unsubscribe = unsubscribe;
+// pkg/dist-src/index.js
+var graphql2 = graphql_dist_bundle_withDefaults(request, {
+ headers: {
+ "user-agent": `octokit-graphql.js/${graphql_dist_bundle_VERSION} ${getUserAgent()}`
+ },
+ method: "POST",
+ url: "/graphql"
+});
+function withCustomRequest(customRequest) {
+ return graphql_dist_bundle_withDefaults(customRequest, {
+ method: "POST",
+ url: "/graphql"
+ });
+}
- return [signal, () => {
- timer && clearTimeout(timer);
- timer = null;
- }];
-};
-const composeSignals$1 = composeSignals;
+;// CONCATENATED MODULE: ./node_modules/@octokit/auth-token/dist-bundle/index.js
+// pkg/dist-src/is-jwt.js
+var b64url = "(?:[a-zA-Z0-9_-]+)";
+var sep = "\\.";
+var jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`);
+var isJWT = jwtRE.test.bind(jwtRE);
-const streamChunk = function* (chunk, chunkSize) {
- let len = chunk.byteLength;
+// pkg/dist-src/auth.js
+async function auth(token) {
+ const isApp = isJWT(token);
+ const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
+ const isUserToServer = token.startsWith("ghu_");
+ const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
+ return {
+ type: "token",
+ token,
+ tokenType
+ };
+}
- if (!chunkSize || len < chunkSize) {
- yield chunk;
- return;
+// pkg/dist-src/with-authorization-prefix.js
+function withAuthorizationPrefix(token) {
+ if (token.split(/\./).length === 3) {
+ return `bearer ${token}`;
}
+ return `token ${token}`;
+}
- let pos = 0;
- let end;
+// pkg/dist-src/hook.js
+async function hook(token, request, route, parameters) {
+ const endpoint = request.endpoint.merge(
+ route,
+ parameters
+ );
+ endpoint.headers.authorization = withAuthorizationPrefix(token);
+ return request(endpoint);
+}
- while (pos < len) {
- end = pos + chunkSize;
- yield chunk.slice(pos, end);
- pos = end;
+// pkg/dist-src/index.js
+var createTokenAuth = function createTokenAuth2(token) {
+ if (!token) {
+ throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
}
-};
-
-const readBytes = async function* (iterable, chunkSize, encode) {
- for await (const chunk of iterable) {
- yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
+ if (typeof token !== "string") {
+ throw new Error(
+ "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
+ );
}
+ token = token.replace(/^(token|bearer) +/i, "");
+ return Object.assign(auth.bind(null, token), {
+ hook: hook.bind(null, token)
+ });
};
-const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
- const iterator = readBytes(stream, chunkSize, encode);
-
- let bytes = 0;
-
- return new ReadableStream({
- type: 'bytes',
-
- async pull(controller) {
- const {done, value} = await iterator.next();
-
- if (done) {
- controller.close();
- onFinish();
- return;
- }
-
- let len = value.byteLength;
- onProgress && onProgress(bytes += len);
- controller.enqueue(new Uint8Array(value));
- },
- cancel(reason) {
- onFinish(reason);
- return iterator.return();
- }
- }, {
- highWaterMark: 2
- })
-};
-const fetchProgressDecorator = (total, fn) => {
- const lengthComputable = total != null;
- return (loaded) => setTimeout(() => fn({
- lengthComputable,
- total,
- loaded
- }));
-};
+;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/version.js
+const version_VERSION = "7.0.6";
-const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
-const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
-// used only inside the fetch adapter
-const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
- async (str) => new Uint8Array(await new Response(str).arrayBuffer())
-);
+;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/index.js
-const supportsRequestStream = isReadableStreamSupported && (() => {
- let duplexAccessed = false;
- const hasContentType = new Request(platform.origin, {
- body: new ReadableStream(),
- method: 'POST',
- get duplex() {
- duplexAccessed = true;
- return 'half';
- },
- }).headers.has('Content-Type');
- return duplexAccessed && !hasContentType;
-})();
-const DEFAULT_CHUNK_SIZE = 64 * 1024;
-const supportsResponseStream = isReadableStreamSupported && !!(()=> {
- try {
- return utils$1.isReadableStream(new Response('').body);
- } catch(err) {
- // return undefined
- }
-})();
-const resolvers = {
- stream: supportsResponseStream && ((res) => res.body)
+const dist_src_noop = () => {
};
-
-isFetchSupported && (((res) => {
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
- (_, config) => {
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
- });
- });
-})(new Response));
-
-const getBodyLength = async (body) => {
- if (body == null) {
- return 0;
+const consoleWarn = console.warn.bind(console);
+const consoleError = console.error.bind(console);
+function createLogger(logger = {}) {
+ if (typeof logger.debug !== "function") {
+ logger.debug = dist_src_noop;
}
-
- if(utils$1.isBlob(body)) {
- return body.size;
+ if (typeof logger.info !== "function") {
+ logger.info = dist_src_noop;
}
-
- if(utils$1.isSpecCompliantForm(body)) {
- return (await new Request(body).arrayBuffer()).byteLength;
+ if (typeof logger.warn !== "function") {
+ logger.warn = consoleWarn;
}
-
- if(utils$1.isArrayBufferView(body)) {
- return body.byteLength;
+ if (typeof logger.error !== "function") {
+ logger.error = consoleError;
}
-
- if(utils$1.isURLSearchParams(body)) {
- body = body + '';
+ return logger;
+}
+const userAgentTrail = `octokit-core.js/${version_VERSION} ${getUserAgent()}`;
+class Octokit {
+ static VERSION = version_VERSION;
+ static defaults(defaults) {
+ const OctokitWithDefaults = class extends this {
+ constructor(...args) {
+ const options = args[0] || {};
+ if (typeof defaults === "function") {
+ super(defaults(options));
+ return;
+ }
+ super(
+ Object.assign(
+ {},
+ defaults,
+ options,
+ options.userAgent && defaults.userAgent ? {
+ userAgent: `${options.userAgent} ${defaults.userAgent}`
+ } : null
+ )
+ );
+ }
+ };
+ return OctokitWithDefaults;
}
-
- if(utils$1.isString(body)) {
- return (await encodeText(body)).byteLength;
+ static plugins = [];
+ /**
+ * Attach a plugin (or many) to your Octokit instance.
+ *
+ * @example
+ * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
+ */
+ static plugin(...newPlugins) {
+ const currentPlugins = this.plugins;
+ const NewOctokit = class extends this {
+ static plugins = currentPlugins.concat(
+ newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
+ );
+ };
+ return NewOctokit;
}
-};
-
-const resolveBodyLength = async (headers, body) => {
- const length = utils$1.toFiniteNumber(headers.getContentLength());
-
- return length == null ? getBodyLength(body) : length;
-};
-
-const fetchAdapter = isFetchSupported && (async (config) => {
- let {
- url,
- method,
- data,
- signal,
- cancelToken,
- timeout,
- onDownloadProgress,
- onUploadProgress,
- responseType,
- headers,
- withCredentials = 'same-origin',
- fetchOptions
- } = resolveConfig(config);
-
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
-
- let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
- composeSignals$1([signal, cancelToken], timeout) : [];
-
- let finished, request;
-
- const onFinish = () => {
- !finished && setTimeout(() => {
- composedSignal && composedSignal.unsubscribe();
- });
-
- finished = true;
- };
+ constructor(options = {}) {
+ const hook = new before_after_hook.Collection();
+ const requestDefaults = {
+ baseUrl: request.endpoint.DEFAULTS.baseUrl,
+ headers: {},
+ request: Object.assign({}, options.request, {
+ // @ts-ignore internal usage only, no need to type
+ hook: hook.bind(null, "request")
+ }),
+ mediaType: {
+ previews: [],
+ format: ""
+ }
+ };
+ requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
+ if (options.baseUrl) {
+ requestDefaults.baseUrl = options.baseUrl;
+ }
+ if (options.previews) {
+ requestDefaults.mediaType.previews = options.previews;
+ }
+ if (options.timeZone) {
+ requestDefaults.headers["time-zone"] = options.timeZone;
+ }
+ this.request = request.defaults(requestDefaults);
+ this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
+ this.log = createLogger(options.log);
+ this.hook = hook;
+ if (!options.authStrategy) {
+ if (!options.auth) {
+ this.auth = async () => ({
+ type: "unauthenticated"
+ });
+ } else {
+ const auth = createTokenAuth(options.auth);
+ hook.wrap("request", auth.hook);
+ this.auth = auth;
+ }
+ } else {
+ const { authStrategy, ...otherOptions } = options;
+ const auth = authStrategy(
+ Object.assign(
+ {
+ request: this.request,
+ log: this.log,
+ // we pass the current octokit instance as well as its constructor options
+ // to allow for authentication strategies that return a new octokit instance
+ // that shares the same internal state as the current one. The original
+ // requirement for this was the "event-octokit" authentication strategy
+ // of https://github.com/probot/octokit-auth-probot.
+ octokit: this,
+ octokitOptions: otherOptions
+ },
+ options.auth
+ )
+ );
+ hook.wrap("request", auth.hook);
+ this.auth = auth;
+ }
+ const classConstructor = this.constructor;
+ for (let i = 0; i < classConstructor.plugins.length; ++i) {
+ Object.assign(this, classConstructor.plugins[i](this, options));
+ }
+ }
+ // assigned during constructor
+ request;
+ graphql;
+ log;
+ hook;
+ // TODO: type `octokit.auth` based on passed options.authStrategy
+ auth;
+}
- let requestContentLength;
- try {
- if (
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
- ) {
- let _request = new Request(url, {
- method: 'POST',
- body: data,
- duplex: "half"
- });
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
+const dist_src_version_VERSION = "17.0.0";
- let contentTypeHeader;
+//# sourceMappingURL=version.js.map
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
- headers.setContentType(contentTypeHeader);
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
+const Endpoints = {
+ actions: {
+ addCustomLabelsToSelfHostedRunnerForOrg: [
+ "POST /orgs/{org}/actions/runners/{runner_id}/labels"
+ ],
+ addCustomLabelsToSelfHostedRunnerForRepo: [
+ "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+ ],
+ addRepoAccessToSelfHostedRunnerGroupInOrg: [
+ "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"
+ ],
+ addSelectedRepoToOrgSecret: [
+ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ addSelectedRepoToOrgVariable: [
+ "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
+ ],
+ approveWorkflowRun: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
+ ],
+ cancelWorkflowRun: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
+ ],
+ createEnvironmentVariable: [
+ "POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
+ ],
+ createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"],
+ createOrUpdateEnvironmentSecret: [
+ "PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+ ],
+ createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
+ createOrUpdateRepoSecret: [
+ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
+ ],
+ createOrgVariable: ["POST /orgs/{org}/actions/variables"],
+ createRegistrationTokenForOrg: [
+ "POST /orgs/{org}/actions/runners/registration-token"
+ ],
+ createRegistrationTokenForRepo: [
+ "POST /repos/{owner}/{repo}/actions/runners/registration-token"
+ ],
+ createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
+ createRemoveTokenForRepo: [
+ "POST /repos/{owner}/{repo}/actions/runners/remove-token"
+ ],
+ createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
+ createWorkflowDispatch: [
+ "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
+ ],
+ deleteActionsCacheById: [
+ "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
+ ],
+ deleteActionsCacheByKey: [
+ "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
+ ],
+ deleteArtifact: [
+ "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
+ ],
+ deleteCustomImageFromOrg: [
+ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
+ ],
+ deleteCustomImageVersionFromOrg: [
+ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
+ ],
+ deleteEnvironmentSecret: [
+ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+ ],
+ deleteEnvironmentVariable: [
+ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+ ],
+ deleteHostedRunnerForOrg: [
+ "DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+ ],
+ deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
+ deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
+ deleteRepoSecret: [
+ "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
+ ],
+ deleteRepoVariable: [
+ "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
+ ],
+ deleteSelfHostedRunnerFromOrg: [
+ "DELETE /orgs/{org}/actions/runners/{runner_id}"
+ ],
+ deleteSelfHostedRunnerFromRepo: [
+ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
+ ],
+ deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
+ deleteWorkflowRunLogs: [
+ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
+ ],
+ disableSelectedRepositoryGithubActionsOrganization: [
+ "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
+ ],
+ disableWorkflow: [
+ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
+ ],
+ downloadArtifact: [
+ "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
+ ],
+ downloadJobLogsForWorkflowRun: [
+ "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
+ ],
+ downloadWorkflowRunAttemptLogs: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
+ ],
+ downloadWorkflowRunLogs: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
+ ],
+ enableSelectedRepositoryGithubActionsOrganization: [
+ "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
+ ],
+ enableWorkflow: [
+ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
+ ],
+ forceCancelWorkflowRun: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
+ ],
+ generateRunnerJitconfigForOrg: [
+ "POST /orgs/{org}/actions/runners/generate-jitconfig"
+ ],
+ generateRunnerJitconfigForRepo: [
+ "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
+ ],
+ getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
+ getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
+ getActionsCacheUsageByRepoForOrg: [
+ "GET /orgs/{org}/actions/cache/usage-by-repository"
+ ],
+ getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
+ getAllowedActionsOrganization: [
+ "GET /orgs/{org}/actions/permissions/selected-actions"
+ ],
+ getAllowedActionsRepository: [
+ "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
+ ],
+ getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
+ getCustomImageForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"
+ ],
+ getCustomImageVersionForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"
+ ],
+ getCustomOidcSubClaimForRepo: [
+ "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
+ ],
+ getEnvironmentPublicKey: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"
+ ],
+ getEnvironmentSecret: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
+ ],
+ getEnvironmentVariable: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+ ],
+ getGithubActionsDefaultWorkflowPermissionsOrganization: [
+ "GET /orgs/{org}/actions/permissions/workflow"
+ ],
+ getGithubActionsDefaultWorkflowPermissionsRepository: [
+ "GET /repos/{owner}/{repo}/actions/permissions/workflow"
+ ],
+ getGithubActionsPermissionsOrganization: [
+ "GET /orgs/{org}/actions/permissions"
+ ],
+ getGithubActionsPermissionsRepository: [
+ "GET /repos/{owner}/{repo}/actions/permissions"
+ ],
+ getHostedRunnerForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+ ],
+ getHostedRunnersGithubOwnedImagesForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/github-owned"
+ ],
+ getHostedRunnersLimitsForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/limits"
+ ],
+ getHostedRunnersMachineSpecsForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/machine-sizes"
+ ],
+ getHostedRunnersPartnerImagesForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/partner"
+ ],
+ getHostedRunnersPlatformsForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/platforms"
+ ],
+ getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
+ getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
+ getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
+ getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
+ getPendingDeploymentsForRun: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
+ ],
+ getRepoPermissions: [
+ "GET /repos/{owner}/{repo}/actions/permissions",
+ {},
+ { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
+ ],
+ getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
+ getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
+ getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
+ getReviewsForRun: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
+ ],
+ getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
+ getSelfHostedRunnerForRepo: [
+ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
+ ],
+ getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
+ getWorkflowAccessToRepository: [
+ "GET /repos/{owner}/{repo}/actions/permissions/access"
+ ],
+ getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
+ getWorkflowRunAttempt: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
+ ],
+ getWorkflowRunUsage: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
+ ],
+ getWorkflowUsage: [
+ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
+ ],
+ listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
+ listCustomImageVersionsForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"
+ ],
+ listCustomImagesForOrg: [
+ "GET /orgs/{org}/actions/hosted-runners/images/custom"
+ ],
+ listEnvironmentSecrets: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
+ ],
+ listEnvironmentVariables: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables"
+ ],
+ listGithubHostedRunnersInGroupForOrg: [
+ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"
+ ],
+ listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"],
+ listJobsForWorkflowRun: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
+ ],
+ listJobsForWorkflowRunAttempt: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
+ ],
+ listLabelsForSelfHostedRunnerForOrg: [
+ "GET /orgs/{org}/actions/runners/{runner_id}/labels"
+ ],
+ listLabelsForSelfHostedRunnerForRepo: [
+ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+ ],
+ listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
+ listOrgVariables: ["GET /orgs/{org}/actions/variables"],
+ listRepoOrganizationSecrets: [
+ "GET /repos/{owner}/{repo}/actions/organization-secrets"
+ ],
+ listRepoOrganizationVariables: [
+ "GET /repos/{owner}/{repo}/actions/organization-variables"
+ ],
+ listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
+ listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
+ listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
+ listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
+ listRunnerApplicationsForRepo: [
+ "GET /repos/{owner}/{repo}/actions/runners/downloads"
+ ],
+ listSelectedReposForOrgSecret: [
+ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
+ ],
+ listSelectedReposForOrgVariable: [
+ "GET /orgs/{org}/actions/variables/{name}/repositories"
+ ],
+ listSelectedRepositoriesEnabledGithubActionsOrganization: [
+ "GET /orgs/{org}/actions/permissions/repositories"
+ ],
+ listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
+ listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
+ listWorkflowRunArtifacts: [
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
+ ],
+ listWorkflowRuns: [
+ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
+ ],
+ listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
+ reRunJobForWorkflowRun: [
+ "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
+ ],
+ reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
+ reRunWorkflowFailedJobs: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
+ ],
+ removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
+ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
+ ],
+ removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
+ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+ ],
+ removeCustomLabelFromSelfHostedRunnerForOrg: [
+ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
+ ],
+ removeCustomLabelFromSelfHostedRunnerForRepo: [
+ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
+ ],
+ removeSelectedRepoFromOrgSecret: [
+ "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ removeSelectedRepoFromOrgVariable: [
+ "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
+ ],
+ reviewCustomGatesForRun: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
+ ],
+ reviewPendingDeploymentsForRun: [
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
+ ],
+ setAllowedActionsOrganization: [
+ "PUT /orgs/{org}/actions/permissions/selected-actions"
+ ],
+ setAllowedActionsRepository: [
+ "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
+ ],
+ setCustomLabelsForSelfHostedRunnerForOrg: [
+ "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
+ ],
+ setCustomLabelsForSelfHostedRunnerForRepo: [
+ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
+ ],
+ setCustomOidcSubClaimForRepo: [
+ "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
+ ],
+ setGithubActionsDefaultWorkflowPermissionsOrganization: [
+ "PUT /orgs/{org}/actions/permissions/workflow"
+ ],
+ setGithubActionsDefaultWorkflowPermissionsRepository: [
+ "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
+ ],
+ setGithubActionsPermissionsOrganization: [
+ "PUT /orgs/{org}/actions/permissions"
+ ],
+ setGithubActionsPermissionsRepository: [
+ "PUT /repos/{owner}/{repo}/actions/permissions"
+ ],
+ setSelectedReposForOrgSecret: [
+ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
+ ],
+ setSelectedReposForOrgVariable: [
+ "PUT /orgs/{org}/actions/variables/{name}/repositories"
+ ],
+ setSelectedRepositoriesEnabledGithubActionsOrganization: [
+ "PUT /orgs/{org}/actions/permissions/repositories"
+ ],
+ setWorkflowAccessToRepository: [
+ "PUT /repos/{owner}/{repo}/actions/permissions/access"
+ ],
+ updateEnvironmentVariable: [
+ "PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
+ ],
+ updateHostedRunnerForOrg: [
+ "PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"
+ ],
+ updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
+ updateRepoVariable: [
+ "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
+ ]
+ },
+ activity: {
+ checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
+ deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
+ deleteThreadSubscription: [
+ "DELETE /notifications/threads/{thread_id}/subscription"
+ ],
+ getFeeds: ["GET /feeds"],
+ getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
+ getThread: ["GET /notifications/threads/{thread_id}"],
+ getThreadSubscriptionForAuthenticatedUser: [
+ "GET /notifications/threads/{thread_id}/subscription"
+ ],
+ listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
+ listNotificationsForAuthenticatedUser: ["GET /notifications"],
+ listOrgEventsForAuthenticatedUser: [
+ "GET /users/{username}/events/orgs/{org}"
+ ],
+ listPublicEvents: ["GET /events"],
+ listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
+ listPublicEventsForUser: ["GET /users/{username}/events/public"],
+ listPublicOrgEvents: ["GET /orgs/{org}/events"],
+ listReceivedEventsForUser: ["GET /users/{username}/received_events"],
+ listReceivedPublicEventsForUser: [
+ "GET /users/{username}/received_events/public"
+ ],
+ listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
+ listRepoNotificationsForAuthenticatedUser: [
+ "GET /repos/{owner}/{repo}/notifications"
+ ],
+ listReposStarredByAuthenticatedUser: ["GET /user/starred"],
+ listReposStarredByUser: ["GET /users/{username}/starred"],
+ listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
+ listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
+ listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
+ listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
+ markNotificationsAsRead: ["PUT /notifications"],
+ markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
+ markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
+ markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
+ setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
+ setThreadSubscription: [
+ "PUT /notifications/threads/{thread_id}/subscription"
+ ],
+ starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
+ unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
+ },
+ apps: {
+ addRepoToInstallation: [
+ "PUT /user/installations/{installation_id}/repositories/{repository_id}",
+ {},
+ { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
+ ],
+ addRepoToInstallationForAuthenticatedUser: [
+ "PUT /user/installations/{installation_id}/repositories/{repository_id}"
+ ],
+ checkToken: ["POST /applications/{client_id}/token"],
+ createFromManifest: ["POST /app-manifests/{code}/conversions"],
+ createInstallationAccessToken: [
+ "POST /app/installations/{installation_id}/access_tokens"
+ ],
+ deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
+ deleteInstallation: ["DELETE /app/installations/{installation_id}"],
+ deleteToken: ["DELETE /applications/{client_id}/token"],
+ getAuthenticated: ["GET /app"],
+ getBySlug: ["GET /apps/{app_slug}"],
+ getInstallation: ["GET /app/installations/{installation_id}"],
+ getOrgInstallation: ["GET /orgs/{org}/installation"],
+ getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
+ getSubscriptionPlanForAccount: [
+ "GET /marketplace_listing/accounts/{account_id}"
+ ],
+ getSubscriptionPlanForAccountStubbed: [
+ "GET /marketplace_listing/stubbed/accounts/{account_id}"
+ ],
+ getUserInstallation: ["GET /users/{username}/installation"],
+ getWebhookConfigForApp: ["GET /app/hook/config"],
+ getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
+ listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
+ listAccountsForPlanStubbed: [
+ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
+ ],
+ listInstallationReposForAuthenticatedUser: [
+ "GET /user/installations/{installation_id}/repositories"
+ ],
+ listInstallationRequestsForAuthenticatedApp: [
+ "GET /app/installation-requests"
+ ],
+ listInstallations: ["GET /app/installations"],
+ listInstallationsForAuthenticatedUser: ["GET /user/installations"],
+ listPlans: ["GET /marketplace_listing/plans"],
+ listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
+ listReposAccessibleToInstallation: ["GET /installation/repositories"],
+ listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
+ listSubscriptionsForAuthenticatedUserStubbed: [
+ "GET /user/marketplace_purchases/stubbed"
+ ],
+ listWebhookDeliveries: ["GET /app/hook/deliveries"],
+ redeliverWebhookDelivery: [
+ "POST /app/hook/deliveries/{delivery_id}/attempts"
+ ],
+ removeRepoFromInstallation: [
+ "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
+ {},
+ { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
+ ],
+ removeRepoFromInstallationForAuthenticatedUser: [
+ "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
+ ],
+ resetToken: ["PATCH /applications/{client_id}/token"],
+ revokeInstallationAccessToken: ["DELETE /installation/token"],
+ scopeToken: ["POST /applications/{client_id}/token/scoped"],
+ suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
+ unsuspendInstallation: [
+ "DELETE /app/installations/{installation_id}/suspended"
+ ],
+ updateWebhookConfigForApp: ["PATCH /app/hook/config"]
+ },
+ billing: {
+ getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
+ getGithubActionsBillingUser: [
+ "GET /users/{username}/settings/billing/actions"
+ ],
+ getGithubBillingPremiumRequestUsageReportOrg: [
+ "GET /organizations/{org}/settings/billing/premium_request/usage"
+ ],
+ getGithubBillingPremiumRequestUsageReportUser: [
+ "GET /users/{username}/settings/billing/premium_request/usage"
+ ],
+ getGithubBillingUsageReportOrg: [
+ "GET /organizations/{org}/settings/billing/usage"
+ ],
+ getGithubBillingUsageReportUser: [
+ "GET /users/{username}/settings/billing/usage"
+ ],
+ getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
+ getGithubPackagesBillingUser: [
+ "GET /users/{username}/settings/billing/packages"
+ ],
+ getSharedStorageBillingOrg: [
+ "GET /orgs/{org}/settings/billing/shared-storage"
+ ],
+ getSharedStorageBillingUser: [
+ "GET /users/{username}/settings/billing/shared-storage"
+ ]
+ },
+ campaigns: {
+ createCampaign: ["POST /orgs/{org}/campaigns"],
+ deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"],
+ getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"],
+ listOrgCampaigns: ["GET /orgs/{org}/campaigns"],
+ updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"]
+ },
+ checks: {
+ create: ["POST /repos/{owner}/{repo}/check-runs"],
+ createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
+ get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
+ getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
+ listAnnotations: [
+ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
+ ],
+ listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
+ listForSuite: [
+ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
+ ],
+ listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
+ rerequestRun: [
+ "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
+ ],
+ rerequestSuite: [
+ "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
+ ],
+ setSuitesPreferences: [
+ "PATCH /repos/{owner}/{repo}/check-suites/preferences"
+ ],
+ update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
+ },
+ codeScanning: {
+ commitAutofix: [
+ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"
+ ],
+ createAutofix: [
+ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"
+ ],
+ createVariantAnalysis: [
+ "POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
+ ],
+ deleteAnalysis: [
+ "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
+ ],
+ deleteCodeqlDatabase: [
+ "DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
+ ],
+ getAlert: [
+ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
+ {},
+ { renamedParameters: { alert_id: "alert_number" } }
+ ],
+ getAnalysis: [
+ "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
+ ],
+ getAutofix: [
+ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"
+ ],
+ getCodeqlDatabase: [
+ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
+ ],
+ getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
+ getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
+ getVariantAnalysis: [
+ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"
+ ],
+ getVariantAnalysisRepoTask: [
+ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"
+ ],
+ listAlertInstances: [
+ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
+ ],
+ listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
+ listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
+ listAlertsInstances: [
+ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
+ {},
+ { renamed: ["codeScanning", "listAlertInstances"] }
+ ],
+ listCodeqlDatabases: [
+ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
+ ],
+ listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
+ updateAlert: [
+ "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
+ ],
+ updateDefaultSetup: [
+ "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
+ ],
+ uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
+ },
+ codeSecurity: {
+ attachConfiguration: [
+ "POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"
+ ],
+ attachEnterpriseConfiguration: [
+ "POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"
+ ],
+ createConfiguration: ["POST /orgs/{org}/code-security/configurations"],
+ createConfigurationForEnterprise: [
+ "POST /enterprises/{enterprise}/code-security/configurations"
+ ],
+ deleteConfiguration: [
+ "DELETE /orgs/{org}/code-security/configurations/{configuration_id}"
+ ],
+ deleteConfigurationForEnterprise: [
+ "DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+ ],
+ detachConfiguration: [
+ "DELETE /orgs/{org}/code-security/configurations/detach"
+ ],
+ getConfiguration: [
+ "GET /orgs/{org}/code-security/configurations/{configuration_id}"
+ ],
+ getConfigurationForRepository: [
+ "GET /repos/{owner}/{repo}/code-security-configuration"
+ ],
+ getConfigurationsForEnterprise: [
+ "GET /enterprises/{enterprise}/code-security/configurations"
+ ],
+ getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"],
+ getDefaultConfigurations: [
+ "GET /orgs/{org}/code-security/configurations/defaults"
+ ],
+ getDefaultConfigurationsForEnterprise: [
+ "GET /enterprises/{enterprise}/code-security/configurations/defaults"
+ ],
+ getRepositoriesForConfiguration: [
+ "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"
+ ],
+ getRepositoriesForEnterpriseConfiguration: [
+ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"
+ ],
+ getSingleConfigurationForEnterprise: [
+ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+ ],
+ setConfigurationAsDefault: [
+ "PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"
+ ],
+ setConfigurationAsDefaultForEnterprise: [
+ "PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"
+ ],
+ updateConfiguration: [
+ "PATCH /orgs/{org}/code-security/configurations/{configuration_id}"
+ ],
+ updateEnterpriseConfiguration: [
+ "PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"
+ ]
+ },
+ codesOfConduct: {
+ getAllCodesOfConduct: ["GET /codes_of_conduct"],
+ getConductCode: ["GET /codes_of_conduct/{key}"]
+ },
+ codespaces: {
+ addRepositoryForSecretForAuthenticatedUser: [
+ "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ addSelectedRepoToOrgSecret: [
+ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ checkPermissionsForDevcontainer: [
+ "GET /repos/{owner}/{repo}/codespaces/permissions_check"
+ ],
+ codespaceMachinesForAuthenticatedUser: [
+ "GET /user/codespaces/{codespace_name}/machines"
+ ],
+ createForAuthenticatedUser: ["POST /user/codespaces"],
+ createOrUpdateOrgSecret: [
+ "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
+ ],
+ createOrUpdateRepoSecret: [
+ "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+ ],
+ createOrUpdateSecretForAuthenticatedUser: [
+ "PUT /user/codespaces/secrets/{secret_name}"
+ ],
+ createWithPrForAuthenticatedUser: [
+ "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
+ ],
+ createWithRepoForAuthenticatedUser: [
+ "POST /repos/{owner}/{repo}/codespaces"
+ ],
+ deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
+ deleteFromOrganization: [
+ "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
+ ],
+ deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
+ deleteRepoSecret: [
+ "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+ ],
+ deleteSecretForAuthenticatedUser: [
+ "DELETE /user/codespaces/secrets/{secret_name}"
+ ],
+ exportForAuthenticatedUser: [
+ "POST /user/codespaces/{codespace_name}/exports"
+ ],
+ getCodespacesForUserInOrg: [
+ "GET /orgs/{org}/members/{username}/codespaces"
+ ],
+ getExportDetailsForAuthenticatedUser: [
+ "GET /user/codespaces/{codespace_name}/exports/{export_id}"
+ ],
+ getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
+ getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
+ getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
+ getPublicKeyForAuthenticatedUser: [
+ "GET /user/codespaces/secrets/public-key"
+ ],
+ getRepoPublicKey: [
+ "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
+ ],
+ getRepoSecret: [
+ "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
+ ],
+ getSecretForAuthenticatedUser: [
+ "GET /user/codespaces/secrets/{secret_name}"
+ ],
+ listDevcontainersInRepositoryForAuthenticatedUser: [
+ "GET /repos/{owner}/{repo}/codespaces/devcontainers"
+ ],
+ listForAuthenticatedUser: ["GET /user/codespaces"],
+ listInOrganization: [
+ "GET /orgs/{org}/codespaces",
+ {},
+ { renamedParameters: { org_id: "org" } }
+ ],
+ listInRepositoryForAuthenticatedUser: [
+ "GET /repos/{owner}/{repo}/codespaces"
+ ],
+ listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
+ listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
+ listRepositoriesForSecretForAuthenticatedUser: [
+ "GET /user/codespaces/secrets/{secret_name}/repositories"
+ ],
+ listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
+ listSelectedReposForOrgSecret: [
+ "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
+ ],
+ preFlightWithRepoForAuthenticatedUser: [
+ "GET /repos/{owner}/{repo}/codespaces/new"
+ ],
+ publishForAuthenticatedUser: [
+ "POST /user/codespaces/{codespace_name}/publish"
+ ],
+ removeRepositoryForSecretForAuthenticatedUser: [
+ "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ removeSelectedRepoFromOrgSecret: [
+ "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ repoMachinesForAuthenticatedUser: [
+ "GET /repos/{owner}/{repo}/codespaces/machines"
+ ],
+ setRepositoriesForSecretForAuthenticatedUser: [
+ "PUT /user/codespaces/secrets/{secret_name}/repositories"
+ ],
+ setSelectedReposForOrgSecret: [
+ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
+ ],
+ startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
+ stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
+ stopInOrganization: [
+ "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
+ ],
+ updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
+ },
+ copilot: {
+ addCopilotSeatsForTeams: [
+ "POST /orgs/{org}/copilot/billing/selected_teams"
+ ],
+ addCopilotSeatsForUsers: [
+ "POST /orgs/{org}/copilot/billing/selected_users"
+ ],
+ cancelCopilotSeatAssignmentForTeams: [
+ "DELETE /orgs/{org}/copilot/billing/selected_teams"
+ ],
+ cancelCopilotSeatAssignmentForUsers: [
+ "DELETE /orgs/{org}/copilot/billing/selected_users"
+ ],
+ copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"],
+ copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],
+ getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
+ getCopilotSeatDetailsForUser: [
+ "GET /orgs/{org}/members/{username}/copilot"
+ ],
+ listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
+ },
+ credentials: { revoke: ["POST /credentials/revoke"] },
+ dependabot: {
+ addSelectedRepoToOrgSecret: [
+ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ createOrUpdateOrgSecret: [
+ "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
+ ],
+ createOrUpdateRepoSecret: [
+ "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+ ],
+ deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
+ deleteRepoSecret: [
+ "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+ ],
+ getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
+ getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
+ getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
+ getRepoPublicKey: [
+ "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
+ ],
+ getRepoSecret: [
+ "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
+ ],
+ listAlertsForEnterprise: [
+ "GET /enterprises/{enterprise}/dependabot/alerts"
+ ],
+ listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
+ listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
+ listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
+ listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
+ listSelectedReposForOrgSecret: [
+ "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
+ ],
+ removeSelectedRepoFromOrgSecret: [
+ "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
+ ],
+ repositoryAccessForOrg: [
+ "GET /organizations/{org}/dependabot/repository-access"
+ ],
+ setRepositoryAccessDefaultLevel: [
+ "PUT /organizations/{org}/dependabot/repository-access/default-level"
+ ],
+ setSelectedReposForOrgSecret: [
+ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
+ ],
+ updateAlert: [
+ "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
+ ],
+ updateRepositoryAccessForOrg: [
+ "PATCH /organizations/{org}/dependabot/repository-access"
+ ]
+ },
+ dependencyGraph: {
+ createRepositorySnapshot: [
+ "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
+ ],
+ diffRange: [
+ "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
+ ],
+ exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
+ },
+ emojis: { get: ["GET /emojis"] },
+ enterpriseTeamMemberships: {
+ add: [
+ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+ ],
+ bulkAdd: [
+ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"
+ ],
+ bulkRemove: [
+ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"
+ ],
+ get: [
+ "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+ ],
+ list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],
+ remove: [
+ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"
+ ]
+ },
+ enterpriseTeamOrganizations: {
+ add: [
+ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+ ],
+ bulkAdd: [
+ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"
+ ],
+ bulkRemove: [
+ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"
+ ],
+ delete: [
+ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+ ],
+ getAssignment: [
+ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"
+ ],
+ getAssignments: [
+ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"
+ ]
+ },
+ enterpriseTeams: {
+ create: ["POST /enterprises/{enterprise}/teams"],
+ delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"],
+ get: ["GET /enterprises/{enterprise}/teams/{team_slug}"],
+ list: ["GET /enterprises/{enterprise}/teams"],
+ update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"]
+ },
+ gists: {
+ checkIsStarred: ["GET /gists/{gist_id}/star"],
+ create: ["POST /gists"],
+ createComment: ["POST /gists/{gist_id}/comments"],
+ delete: ["DELETE /gists/{gist_id}"],
+ deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
+ fork: ["POST /gists/{gist_id}/forks"],
+ get: ["GET /gists/{gist_id}"],
+ getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
+ getRevision: ["GET /gists/{gist_id}/{sha}"],
+ list: ["GET /gists"],
+ listComments: ["GET /gists/{gist_id}/comments"],
+ listCommits: ["GET /gists/{gist_id}/commits"],
+ listForUser: ["GET /users/{username}/gists"],
+ listForks: ["GET /gists/{gist_id}/forks"],
+ listPublic: ["GET /gists/public"],
+ listStarred: ["GET /gists/starred"],
+ star: ["PUT /gists/{gist_id}/star"],
+ unstar: ["DELETE /gists/{gist_id}/star"],
+ update: ["PATCH /gists/{gist_id}"],
+ updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
+ },
+ git: {
+ createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
+ createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
+ createRef: ["POST /repos/{owner}/{repo}/git/refs"],
+ createTag: ["POST /repos/{owner}/{repo}/git/tags"],
+ createTree: ["POST /repos/{owner}/{repo}/git/trees"],
+ deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
+ getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
+ getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
+ getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
+ getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
+ getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
+ listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
+ updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
+ },
+ gitignore: {
+ getAllTemplates: ["GET /gitignore/templates"],
+ getTemplate: ["GET /gitignore/templates/{name}"]
+ },
+ hostedCompute: {
+ createNetworkConfigurationForOrg: [
+ "POST /orgs/{org}/settings/network-configurations"
+ ],
+ deleteNetworkConfigurationFromOrg: [
+ "DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+ ],
+ getNetworkConfigurationForOrg: [
+ "GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+ ],
+ getNetworkSettingsForOrg: [
+ "GET /orgs/{org}/settings/network-settings/{network_settings_id}"
+ ],
+ listNetworkConfigurationsForOrg: [
+ "GET /orgs/{org}/settings/network-configurations"
+ ],
+ updateNetworkConfigurationForOrg: [
+ "PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"
+ ]
+ },
+ interactions: {
+ getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
+ getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
+ getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
+ getRestrictionsForYourPublicRepos: [
+ "GET /user/interaction-limits",
+ {},
+ { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
+ ],
+ removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
+ removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
+ removeRestrictionsForRepo: [
+ "DELETE /repos/{owner}/{repo}/interaction-limits"
+ ],
+ removeRestrictionsForYourPublicRepos: [
+ "DELETE /user/interaction-limits",
+ {},
+ { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
+ ],
+ setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
+ setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
+ setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
+ setRestrictionsForYourPublicRepos: [
+ "PUT /user/interaction-limits",
+ {},
+ { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
+ ]
+ },
+ issues: {
+ addAssignees: [
+ "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
+ ],
+ addBlockedByDependency: [
+ "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
+ ],
+ addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
+ addSubIssue: [
+ "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
+ ],
+ checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
+ checkUserCanBeAssignedToIssue: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
+ ],
+ create: ["POST /repos/{owner}/{repo}/issues"],
+ createComment: [
+ "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
+ ],
+ createLabel: ["POST /repos/{owner}/{repo}/labels"],
+ createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
+ deleteComment: [
+ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
+ ],
+ deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
+ deleteMilestone: [
+ "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
+ ],
+ get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
+ getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
+ getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
+ getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
+ getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
+ getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],
+ list: ["GET /issues"],
+ listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
+ listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
+ listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
+ listDependenciesBlockedBy: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"
+ ],
+ listDependenciesBlocking: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"
+ ],
+ listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
+ listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
+ listEventsForTimeline: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
+ ],
+ listForAuthenticatedUser: ["GET /user/issues"],
+ listForOrg: ["GET /orgs/{org}/issues"],
+ listForRepo: ["GET /repos/{owner}/{repo}/issues"],
+ listLabelsForMilestone: [
+ "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
+ ],
+ listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
+ listLabelsOnIssue: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
+ ],
+ listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
+ listSubIssues: [
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"
+ ],
+ lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
+ removeAllLabels: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
+ ],
+ removeAssignees: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
+ ],
+ removeDependencyBlockedBy: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"
+ ],
+ removeLabel: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
+ ],
+ removeSubIssue: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"
+ ],
+ reprioritizeSubIssue: [
+ "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"
+ ],
+ setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
+ unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
+ update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
+ updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
+ updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
+ updateMilestone: [
+ "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
+ ]
+ },
+ licenses: {
+ get: ["GET /licenses/{license}"],
+ getAllCommonlyUsed: ["GET /licenses"],
+ getForRepo: ["GET /repos/{owner}/{repo}/license"]
+ },
+ markdown: {
+ render: ["POST /markdown"],
+ renderRaw: [
+ "POST /markdown/raw",
+ { headers: { "content-type": "text/plain; charset=utf-8" } }
+ ]
+ },
+ meta: {
+ get: ["GET /meta"],
+ getAllVersions: ["GET /versions"],
+ getOctocat: ["GET /octocat"],
+ getZen: ["GET /zen"],
+ root: ["GET /"]
+ },
+ migrations: {
+ deleteArchiveForAuthenticatedUser: [
+ "DELETE /user/migrations/{migration_id}/archive"
+ ],
+ deleteArchiveForOrg: [
+ "DELETE /orgs/{org}/migrations/{migration_id}/archive"
+ ],
+ downloadArchiveForOrg: [
+ "GET /orgs/{org}/migrations/{migration_id}/archive"
+ ],
+ getArchiveForAuthenticatedUser: [
+ "GET /user/migrations/{migration_id}/archive"
+ ],
+ getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
+ getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
+ listForAuthenticatedUser: ["GET /user/migrations"],
+ listForOrg: ["GET /orgs/{org}/migrations"],
+ listReposForAuthenticatedUser: [
+ "GET /user/migrations/{migration_id}/repositories"
+ ],
+ listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
+ listReposForUser: [
+ "GET /user/migrations/{migration_id}/repositories",
+ {},
+ { renamed: ["migrations", "listReposForAuthenticatedUser"] }
+ ],
+ startForAuthenticatedUser: ["POST /user/migrations"],
+ startForOrg: ["POST /orgs/{org}/migrations"],
+ unlockRepoForAuthenticatedUser: [
+ "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
+ ],
+ unlockRepoForOrg: [
+ "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
+ ]
+ },
+ oidc: {
+ getOidcCustomSubTemplateForOrg: [
+ "GET /orgs/{org}/actions/oidc/customization/sub"
+ ],
+ updateOidcCustomSubTemplateForOrg: [
+ "PUT /orgs/{org}/actions/oidc/customization/sub"
+ ]
+ },
+ orgs: {
+ addSecurityManagerTeam: [
+ "PUT /orgs/{org}/security-managers/teams/{team_slug}",
+ {},
+ {
+ deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"
}
-
- if (_request.body) {
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
- requestContentLength,
- progressEventReducer(onUploadProgress)
- ), null, encodeText);
+ ],
+ assignTeamToOrgRole: [
+ "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
+ ],
+ assignUserToOrgRole: [
+ "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
+ ],
+ blockUser: ["PUT /orgs/{org}/blocks/{username}"],
+ cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
+ checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
+ checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
+ checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
+ convertMemberToOutsideCollaborator: [
+ "PUT /orgs/{org}/outside_collaborators/{username}"
+ ],
+ createArtifactStorageRecord: [
+ "POST /orgs/{org}/artifacts/metadata/storage-record"
+ ],
+ createInvitation: ["POST /orgs/{org}/invitations"],
+ createIssueType: ["POST /orgs/{org}/issue-types"],
+ createWebhook: ["POST /orgs/{org}/hooks"],
+ customPropertiesForOrgsCreateOrUpdateOrganizationValues: [
+ "PATCH /organizations/{org}/org-properties/values"
+ ],
+ customPropertiesForOrgsGetOrganizationValues: [
+ "GET /organizations/{org}/org-properties/values"
+ ],
+ customPropertiesForReposCreateOrUpdateOrganizationDefinition: [
+ "PUT /orgs/{org}/properties/schema/{custom_property_name}"
+ ],
+ customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [
+ "PATCH /orgs/{org}/properties/schema"
+ ],
+ customPropertiesForReposCreateOrUpdateOrganizationValues: [
+ "PATCH /orgs/{org}/properties/values"
+ ],
+ customPropertiesForReposDeleteOrganizationDefinition: [
+ "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
+ ],
+ customPropertiesForReposGetOrganizationDefinition: [
+ "GET /orgs/{org}/properties/schema/{custom_property_name}"
+ ],
+ customPropertiesForReposGetOrganizationDefinitions: [
+ "GET /orgs/{org}/properties/schema"
+ ],
+ customPropertiesForReposGetOrganizationValues: [
+ "GET /orgs/{org}/properties/values"
+ ],
+ delete: ["DELETE /orgs/{org}"],
+ deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"],
+ deleteAttestationsById: [
+ "DELETE /orgs/{org}/attestations/{attestation_id}"
+ ],
+ deleteAttestationsBySubjectDigest: [
+ "DELETE /orgs/{org}/attestations/digest/{subject_digest}"
+ ],
+ deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"],
+ deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
+ disableSelectedRepositoryImmutableReleasesOrganization: [
+ "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
+ ],
+ enableSelectedRepositoryImmutableReleasesOrganization: [
+ "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"
+ ],
+ get: ["GET /orgs/{org}"],
+ getImmutableReleasesSettings: [
+ "GET /orgs/{org}/settings/immutable-releases"
+ ],
+ getImmutableReleasesSettingsRepositories: [
+ "GET /orgs/{org}/settings/immutable-releases/repositories"
+ ],
+ getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
+ getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
+ getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
+ getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"],
+ getOrgRulesetVersion: [
+ "GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"
+ ],
+ getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
+ getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
+ getWebhookDelivery: [
+ "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
+ ],
+ list: ["GET /organizations"],
+ listAppInstallations: ["GET /orgs/{org}/installations"],
+ listArtifactStorageRecords: [
+ "GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"
+ ],
+ listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"],
+ listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"],
+ listAttestationsBulk: [
+ "POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"
+ ],
+ listBlockedUsers: ["GET /orgs/{org}/blocks"],
+ listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
+ listForAuthenticatedUser: ["GET /user/orgs"],
+ listForUser: ["GET /users/{username}/orgs"],
+ listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
+ listIssueTypes: ["GET /orgs/{org}/issue-types"],
+ listMembers: ["GET /orgs/{org}/members"],
+ listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
+ listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
+ listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
+ listOrgRoles: ["GET /orgs/{org}/organization-roles"],
+ listOrganizationFineGrainedPermissions: [
+ "GET /orgs/{org}/organization-fine-grained-permissions"
+ ],
+ listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
+ listPatGrantRepositories: [
+ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
+ ],
+ listPatGrantRequestRepositories: [
+ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
+ ],
+ listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
+ listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
+ listPendingInvitations: ["GET /orgs/{org}/invitations"],
+ listPublicMembers: ["GET /orgs/{org}/public_members"],
+ listSecurityManagerTeams: [
+ "GET /orgs/{org}/security-managers",
+ {},
+ {
+ deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"
}
- }
-
- if (!utils$1.isString(withCredentials)) {
- withCredentials = withCredentials ? 'cors' : 'omit';
- }
-
- request = new Request(url, {
- ...fetchOptions,
- signal: composedSignal,
- method: method.toUpperCase(),
- headers: headers.normalize().toJSON(),
- body: data,
- duplex: "half",
- withCredentials
- });
-
- let response = await fetch(request);
-
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
-
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
- const options = {};
-
- ['status', 'statusText', 'headers'].forEach(prop => {
- options[prop] = response[prop];
- });
-
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
-
- response = new Response(
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
- responseContentLength,
- progressEventReducer(onDownloadProgress, true)
- ), isStreamResponse && onFinish, encodeText),
- options
- );
- }
-
- responseType = responseType || 'text';
-
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
-
- !isStreamResponse && onFinish();
-
- stopTimeout && stopTimeout();
-
- return await new Promise((resolve, reject) => {
- settle(resolve, reject, {
- data: responseData,
- headers: AxiosHeaders$1.from(response.headers),
- status: response.status,
- statusText: response.statusText,
- config,
- request
- });
- })
- } catch (err) {
- onFinish();
-
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
- throw Object.assign(
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
- {
- cause: err.cause || err
- }
- )
- }
-
- throw AxiosError.from(err, err && err.code, config, request);
- }
-});
-
-const knownAdapters = {
- http: httpAdapter,
- xhr: xhrAdapter,
- fetch: fetchAdapter
-};
-
-utils$1.forEach(knownAdapters, (fn, value) => {
- if (fn) {
- try {
- Object.defineProperty(fn, 'name', {value});
- } catch (e) {
- // eslint-disable-next-line no-empty
- }
- Object.defineProperty(fn, 'adapterName', {value});
- }
-});
-
-const renderReason = (reason) => `- ${reason}`;
-
-const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
-
-const adapters = {
- getAdapter: (adapters) => {
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
-
- const {length} = adapters;
- let nameOrAdapter;
- let adapter;
-
- const rejectedReasons = {};
-
- for (let i = 0; i < length; i++) {
- nameOrAdapter = adapters[i];
- let id;
-
- adapter = nameOrAdapter;
-
- if (!isResolvedHandle(nameOrAdapter)) {
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
-
- if (adapter === undefined) {
- throw new AxiosError(`Unknown adapter '${id}'`);
- }
+ ],
+ listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
+ listWebhooks: ["GET /orgs/{org}/hooks"],
+ pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
+ redeliverWebhookDelivery: [
+ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
+ ],
+ removeMember: ["DELETE /orgs/{org}/members/{username}"],
+ removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
+ removeOutsideCollaborator: [
+ "DELETE /orgs/{org}/outside_collaborators/{username}"
+ ],
+ removePublicMembershipForAuthenticatedUser: [
+ "DELETE /orgs/{org}/public_members/{username}"
+ ],
+ removeSecurityManagerTeam: [
+ "DELETE /orgs/{org}/security-managers/teams/{team_slug}",
+ {},
+ {
+ deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"
}
-
- if (adapter) {
- break;
+ ],
+ reviewPatGrantRequest: [
+ "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
+ ],
+ reviewPatGrantRequestsInBulk: [
+ "POST /orgs/{org}/personal-access-token-requests"
+ ],
+ revokeAllOrgRolesTeam: [
+ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
+ ],
+ revokeAllOrgRolesUser: [
+ "DELETE /orgs/{org}/organization-roles/users/{username}"
+ ],
+ revokeOrgRoleTeam: [
+ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
+ ],
+ revokeOrgRoleUser: [
+ "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
+ ],
+ setImmutableReleasesSettings: [
+ "PUT /orgs/{org}/settings/immutable-releases"
+ ],
+ setImmutableReleasesSettingsRepositories: [
+ "PUT /orgs/{org}/settings/immutable-releases/repositories"
+ ],
+ setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
+ setPublicMembershipForAuthenticatedUser: [
+ "PUT /orgs/{org}/public_members/{username}"
+ ],
+ unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
+ update: ["PATCH /orgs/{org}"],
+ updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"],
+ updateMembershipForAuthenticatedUser: [
+ "PATCH /user/memberships/orgs/{org}"
+ ],
+ updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
+ updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
+ updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
+ updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
+ },
+ packages: {
+ deletePackageForAuthenticatedUser: [
+ "DELETE /user/packages/{package_type}/{package_name}"
+ ],
+ deletePackageForOrg: [
+ "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
+ ],
+ deletePackageForUser: [
+ "DELETE /users/{username}/packages/{package_type}/{package_name}"
+ ],
+ deletePackageVersionForAuthenticatedUser: [
+ "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ deletePackageVersionForOrg: [
+ "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ deletePackageVersionForUser: [
+ "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ getAllPackageVersionsForAPackageOwnedByAnOrg: [
+ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
+ {},
+ { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
+ ],
+ getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
+ "GET /user/packages/{package_type}/{package_name}/versions",
+ {},
+ {
+ renamed: [
+ "packages",
+ "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
+ ]
}
-
- rejectedReasons[id || '#' + i] = adapter;
- }
-
- if (!adapter) {
-
- const reasons = Object.entries(rejectedReasons)
- .map(([id, state]) => `adapter ${id} ` +
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
- );
-
- let s = length ?
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
- 'as no adapter specified';
-
- throw new AxiosError(
- `There is no suitable adapter to dispatch the request ` + s,
- 'ERR_NOT_SUPPORT'
- );
- }
-
- return adapter;
+ ],
+ getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
+ "GET /user/packages/{package_type}/{package_name}/versions"
+ ],
+ getAllPackageVersionsForPackageOwnedByOrg: [
+ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
+ ],
+ getAllPackageVersionsForPackageOwnedByUser: [
+ "GET /users/{username}/packages/{package_type}/{package_name}/versions"
+ ],
+ getPackageForAuthenticatedUser: [
+ "GET /user/packages/{package_type}/{package_name}"
+ ],
+ getPackageForOrganization: [
+ "GET /orgs/{org}/packages/{package_type}/{package_name}"
+ ],
+ getPackageForUser: [
+ "GET /users/{username}/packages/{package_type}/{package_name}"
+ ],
+ getPackageVersionForAuthenticatedUser: [
+ "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ getPackageVersionForOrganization: [
+ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ getPackageVersionForUser: [
+ "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
+ ],
+ listDockerMigrationConflictingPackagesForAuthenticatedUser: [
+ "GET /user/docker/conflicts"
+ ],
+ listDockerMigrationConflictingPackagesForOrganization: [
+ "GET /orgs/{org}/docker/conflicts"
+ ],
+ listDockerMigrationConflictingPackagesForUser: [
+ "GET /users/{username}/docker/conflicts"
+ ],
+ listPackagesForAuthenticatedUser: ["GET /user/packages"],
+ listPackagesForOrganization: ["GET /orgs/{org}/packages"],
+ listPackagesForUser: ["GET /users/{username}/packages"],
+ restorePackageForAuthenticatedUser: [
+ "POST /user/packages/{package_type}/{package_name}/restore{?token}"
+ ],
+ restorePackageForOrg: [
+ "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
+ ],
+ restorePackageForUser: [
+ "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
+ ],
+ restorePackageVersionForAuthenticatedUser: [
+ "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+ ],
+ restorePackageVersionForOrg: [
+ "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+ ],
+ restorePackageVersionForUser: [
+ "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
+ ]
+ },
+ privateRegistries: {
+ createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"],
+ deleteOrgPrivateRegistry: [
+ "DELETE /orgs/{org}/private-registries/{secret_name}"
+ ],
+ getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"],
+ getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"],
+ listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"],
+ updateOrgPrivateRegistry: [
+ "PATCH /orgs/{org}/private-registries/{secret_name}"
+ ]
+ },
+ projects: {
+ addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"],
+ addItemForUser: [
+ "POST /users/{username}/projectsV2/{project_number}/items"
+ ],
+ deleteItemForOrg: [
+ "DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
+ ],
+ deleteItemForUser: [
+ "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ ],
+ getFieldForOrg: [
+ "GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"
+ ],
+ getFieldForUser: [
+ "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"
+ ],
+ getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"],
+ getForUser: ["GET /users/{username}/projectsV2/{project_number}"],
+ getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],
+ getUserItem: [
+ "GET /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ ],
+ listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"],
+ listFieldsForUser: [
+ "GET /users/{username}/projectsV2/{project_number}/fields"
+ ],
+ listForOrg: ["GET /orgs/{org}/projectsV2"],
+ listForUser: ["GET /users/{username}/projectsV2"],
+ listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"],
+ listItemsForUser: [
+ "GET /users/{username}/projectsV2/{project_number}/items"
+ ],
+ updateItemForOrg: [
+ "PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"
+ ],
+ updateItemForUser: [
+ "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"
+ ]
+ },
+ pulls: {
+ checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
+ create: ["POST /repos/{owner}/{repo}/pulls"],
+ createReplyForReviewComment: [
+ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
+ ],
+ createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
+ createReviewComment: [
+ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
+ ],
+ deletePendingReview: [
+ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+ ],
+ deleteReviewComment: [
+ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
+ ],
+ dismissReview: [
+ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
+ ],
+ get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
+ getReview: [
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+ ],
+ getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
+ list: ["GET /repos/{owner}/{repo}/pulls"],
+ listCommentsForReview: [
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
+ ],
+ listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
+ listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
+ listRequestedReviewers: [
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+ ],
+ listReviewComments: [
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
+ ],
+ listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
+ listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
+ merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
+ removeRequestedReviewers: [
+ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+ ],
+ requestReviewers: [
+ "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
+ ],
+ submitReview: [
+ "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
+ ],
+ update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
+ updateBranch: [
+ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
+ ],
+ updateReview: [
+ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
+ ],
+ updateReviewComment: [
+ "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
+ ]
+ },
+ rateLimit: { get: ["GET /rate_limit"] },
+ reactions: {
+ createForCommitComment: [
+ "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
+ ],
+ createForIssue: [
+ "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
+ ],
+ createForIssueComment: [
+ "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
+ ],
+ createForPullRequestReviewComment: [
+ "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
+ ],
+ createForRelease: [
+ "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
+ ],
+ createForTeamDiscussionCommentInOrg: [
+ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
+ ],
+ createForTeamDiscussionInOrg: [
+ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
+ ],
+ deleteForCommitComment: [
+ "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
+ ],
+ deleteForIssue: [
+ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
+ ],
+ deleteForIssueComment: [
+ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
+ ],
+ deleteForPullRequestComment: [
+ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
+ ],
+ deleteForRelease: [
+ "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
+ ],
+ deleteForTeamDiscussion: [
+ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
+ ],
+ deleteForTeamDiscussionComment: [
+ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
+ ],
+ listForCommitComment: [
+ "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
+ ],
+ listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
+ listForIssueComment: [
+ "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
+ ],
+ listForPullRequestReviewComment: [
+ "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
+ ],
+ listForRelease: [
+ "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
+ ],
+ listForTeamDiscussionCommentInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
+ ],
+ listForTeamDiscussionInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
+ ]
+ },
+ repos: {
+ acceptInvitation: [
+ "PATCH /user/repository_invitations/{invitation_id}",
+ {},
+ { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
+ ],
+ acceptInvitationForAuthenticatedUser: [
+ "PATCH /user/repository_invitations/{invitation_id}"
+ ],
+ addAppAccessRestrictions: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+ {},
+ { mapToData: "apps" }
+ ],
+ addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
+ addStatusCheckContexts: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+ {},
+ { mapToData: "contexts" }
+ ],
+ addTeamAccessRestrictions: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+ {},
+ { mapToData: "teams" }
+ ],
+ addUserAccessRestrictions: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+ {},
+ { mapToData: "users" }
+ ],
+ cancelPagesDeployment: [
+ "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
+ ],
+ checkAutomatedSecurityFixes: [
+ "GET /repos/{owner}/{repo}/automated-security-fixes"
+ ],
+ checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
+ checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"],
+ checkPrivateVulnerabilityReporting: [
+ "GET /repos/{owner}/{repo}/private-vulnerability-reporting"
+ ],
+ checkVulnerabilityAlerts: [
+ "GET /repos/{owner}/{repo}/vulnerability-alerts"
+ ],
+ codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
+ compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
+ compareCommitsWithBasehead: [
+ "GET /repos/{owner}/{repo}/compare/{basehead}"
+ ],
+ createAttestation: ["POST /repos/{owner}/{repo}/attestations"],
+ createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
+ createCommitComment: [
+ "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
+ ],
+ createCommitSignatureProtection: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+ ],
+ createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
+ createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
+ createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
+ createDeploymentBranchPolicy: [
+ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
+ ],
+ createDeploymentProtectionRule: [
+ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
+ ],
+ createDeploymentStatus: [
+ "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
+ ],
+ createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
+ createForAuthenticatedUser: ["POST /user/repos"],
+ createFork: ["POST /repos/{owner}/{repo}/forks"],
+ createInOrg: ["POST /orgs/{org}/repos"],
+ createOrUpdateEnvironment: [
+ "PUT /repos/{owner}/{repo}/environments/{environment_name}"
+ ],
+ createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
+ createOrgRuleset: ["POST /orgs/{org}/rulesets"],
+ createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
+ createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
+ createRelease: ["POST /repos/{owner}/{repo}/releases"],
+ createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
+ createUsingTemplate: [
+ "POST /repos/{template_owner}/{template_repo}/generate"
+ ],
+ createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
+ customPropertiesForReposCreateOrUpdateRepositoryValues: [
+ "PATCH /repos/{owner}/{repo}/properties/values"
+ ],
+ customPropertiesForReposGetRepositoryValues: [
+ "GET /repos/{owner}/{repo}/properties/values"
+ ],
+ declineInvitation: [
+ "DELETE /user/repository_invitations/{invitation_id}",
+ {},
+ { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
+ ],
+ declineInvitationForAuthenticatedUser: [
+ "DELETE /user/repository_invitations/{invitation_id}"
+ ],
+ delete: ["DELETE /repos/{owner}/{repo}"],
+ deleteAccessRestrictions: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
+ ],
+ deleteAdminBranchProtection: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+ ],
+ deleteAnEnvironment: [
+ "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
+ ],
+ deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
+ deleteBranchProtection: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
+ ],
+ deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
+ deleteCommitSignatureProtection: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+ ],
+ deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
+ deleteDeployment: [
+ "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
+ ],
+ deleteDeploymentBranchPolicy: [
+ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+ ],
+ deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
+ deleteInvitation: [
+ "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
+ ],
+ deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
+ deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
+ deletePullRequestReviewProtection: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+ ],
+ deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
+ deleteReleaseAsset: [
+ "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
+ ],
+ deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+ deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
+ disableAutomatedSecurityFixes: [
+ "DELETE /repos/{owner}/{repo}/automated-security-fixes"
+ ],
+ disableDeploymentProtectionRule: [
+ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
+ ],
+ disableImmutableReleases: [
+ "DELETE /repos/{owner}/{repo}/immutable-releases"
+ ],
+ disablePrivateVulnerabilityReporting: [
+ "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
+ ],
+ disableVulnerabilityAlerts: [
+ "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
+ ],
+ downloadArchive: [
+ "GET /repos/{owner}/{repo}/zipball/{ref}",
+ {},
+ { renamed: ["repos", "downloadZipballArchive"] }
+ ],
+ downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
+ downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
+ enableAutomatedSecurityFixes: [
+ "PUT /repos/{owner}/{repo}/automated-security-fixes"
+ ],
+ enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"],
+ enablePrivateVulnerabilityReporting: [
+ "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
+ ],
+ enableVulnerabilityAlerts: [
+ "PUT /repos/{owner}/{repo}/vulnerability-alerts"
+ ],
+ generateReleaseNotes: [
+ "POST /repos/{owner}/{repo}/releases/generate-notes"
+ ],
+ get: ["GET /repos/{owner}/{repo}"],
+ getAccessRestrictions: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
+ ],
+ getAdminBranchProtection: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+ ],
+ getAllDeploymentProtectionRules: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
+ ],
+ getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
+ getAllStatusCheckContexts: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
+ ],
+ getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
+ getAppsWithAccessToProtectedBranch: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
+ ],
+ getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
+ getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
+ getBranchProtection: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection"
+ ],
+ getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
+ getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
+ getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
+ getCollaboratorPermissionLevel: [
+ "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
+ ],
+ getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
+ getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
+ getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
+ getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
+ getCommitSignatureProtection: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
+ ],
+ getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
+ getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
+ getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
+ getCustomDeploymentProtectionRule: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
+ ],
+ getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
+ getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
+ getDeploymentBranchPolicy: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+ ],
+ getDeploymentStatus: [
+ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
+ ],
+ getEnvironment: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}"
+ ],
+ getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
+ getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
+ getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
+ getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
+ getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
+ getOrgRulesets: ["GET /orgs/{org}/rulesets"],
+ getPages: ["GET /repos/{owner}/{repo}/pages"],
+ getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
+ getPagesDeployment: [
+ "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
+ ],
+ getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
+ getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
+ getPullRequestReviewProtection: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+ ],
+ getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
+ getReadme: ["GET /repos/{owner}/{repo}/readme"],
+ getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
+ getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
+ getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
+ getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
+ getRepoRuleSuite: [
+ "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
+ ],
+ getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
+ getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+ getRepoRulesetHistory: [
+ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"
+ ],
+ getRepoRulesetVersion: [
+ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"
+ ],
+ getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
+ getStatusChecksProtection: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+ ],
+ getTeamsWithAccessToProtectedBranch: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
+ ],
+ getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
+ getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
+ getUsersWithAccessToProtectedBranch: [
+ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
+ ],
+ getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
+ getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
+ getWebhookConfigForRepo: [
+ "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
+ ],
+ getWebhookDelivery: [
+ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
+ ],
+ listActivities: ["GET /repos/{owner}/{repo}/activity"],
+ listAttestations: [
+ "GET /repos/{owner}/{repo}/attestations/{subject_digest}"
+ ],
+ listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
+ listBranches: ["GET /repos/{owner}/{repo}/branches"],
+ listBranchesForHeadCommit: [
+ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
+ ],
+ listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
+ listCommentsForCommit: [
+ "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
+ ],
+ listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
+ listCommitStatusesForRef: [
+ "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
+ ],
+ listCommits: ["GET /repos/{owner}/{repo}/commits"],
+ listContributors: ["GET /repos/{owner}/{repo}/contributors"],
+ listCustomDeploymentRuleIntegrations: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
+ ],
+ listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
+ listDeploymentBranchPolicies: [
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
+ ],
+ listDeploymentStatuses: [
+ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
+ ],
+ listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
+ listForAuthenticatedUser: ["GET /user/repos"],
+ listForOrg: ["GET /orgs/{org}/repos"],
+ listForUser: ["GET /users/{username}/repos"],
+ listForks: ["GET /repos/{owner}/{repo}/forks"],
+ listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
+ listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
+ listLanguages: ["GET /repos/{owner}/{repo}/languages"],
+ listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
+ listPublic: ["GET /repositories"],
+ listPullRequestsAssociatedWithCommit: [
+ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
+ ],
+ listReleaseAssets: [
+ "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
+ ],
+ listReleases: ["GET /repos/{owner}/{repo}/releases"],
+ listTags: ["GET /repos/{owner}/{repo}/tags"],
+ listTeams: ["GET /repos/{owner}/{repo}/teams"],
+ listWebhookDeliveries: [
+ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
+ ],
+ listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
+ merge: ["POST /repos/{owner}/{repo}/merges"],
+ mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
+ pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
+ redeliverWebhookDelivery: [
+ "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
+ ],
+ removeAppAccessRestrictions: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+ {},
+ { mapToData: "apps" }
+ ],
+ removeCollaborator: [
+ "DELETE /repos/{owner}/{repo}/collaborators/{username}"
+ ],
+ removeStatusCheckContexts: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+ {},
+ { mapToData: "contexts" }
+ ],
+ removeStatusCheckProtection: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+ ],
+ removeTeamAccessRestrictions: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+ {},
+ { mapToData: "teams" }
+ ],
+ removeUserAccessRestrictions: [
+ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+ {},
+ { mapToData: "users" }
+ ],
+ renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
+ replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
+ requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
+ setAdminBranchProtection: [
+ "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
+ ],
+ setAppAccessRestrictions: [
+ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
+ {},
+ { mapToData: "apps" }
+ ],
+ setStatusCheckContexts: [
+ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
+ {},
+ { mapToData: "contexts" }
+ ],
+ setTeamAccessRestrictions: [
+ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
+ {},
+ { mapToData: "teams" }
+ ],
+ setUserAccessRestrictions: [
+ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
+ {},
+ { mapToData: "users" }
+ ],
+ testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
+ transfer: ["POST /repos/{owner}/{repo}/transfer"],
+ update: ["PATCH /repos/{owner}/{repo}"],
+ updateBranchProtection: [
+ "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
+ ],
+ updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
+ updateDeploymentBranchPolicy: [
+ "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
+ ],
+ updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
+ updateInvitation: [
+ "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
+ ],
+ updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
+ updatePullRequestReviewProtection: [
+ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
+ ],
+ updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
+ updateReleaseAsset: [
+ "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
+ ],
+ updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
+ updateStatusCheckPotection: [
+ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
+ {},
+ { renamed: ["repos", "updateStatusCheckProtection"] }
+ ],
+ updateStatusCheckProtection: [
+ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
+ ],
+ updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
+ updateWebhookConfigForRepo: [
+ "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
+ ],
+ uploadReleaseAsset: [
+ "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
+ { baseUrl: "https://uploads.github.com" }
+ ]
},
- adapters: knownAdapters
-};
-
-/**
- * Throws a `CanceledError` if cancellation has been requested.
- *
- * @param {Object} config The config that is to be used for the request
- *
- * @returns {void}
- */
-function throwIfCancellationRequested(config) {
- if (config.cancelToken) {
- config.cancelToken.throwIfRequested();
- }
-
- if (config.signal && config.signal.aborted) {
- throw new CanceledError(null, config);
- }
-}
-
-/**
- * Dispatch a request to the server using the configured adapter.
- *
- * @param {object} config The config that is to be used for the request
- *
- * @returns {Promise} The Promise to be fulfilled
- */
-function dispatchRequest(config) {
- throwIfCancellationRequested(config);
-
- config.headers = AxiosHeaders$1.from(config.headers);
-
- // Transform request data
- config.data = transformData.call(
- config,
- config.transformRequest
- );
-
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
- config.headers.setContentType('application/x-www-form-urlencoded', false);
+ search: {
+ code: ["GET /search/code"],
+ commits: ["GET /search/commits"],
+ issuesAndPullRequests: ["GET /search/issues"],
+ labels: ["GET /search/labels"],
+ repos: ["GET /search/repositories"],
+ topics: ["GET /search/topics"],
+ users: ["GET /search/users"]
+ },
+ secretScanning: {
+ createPushProtectionBypass: [
+ "POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"
+ ],
+ getAlert: [
+ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
+ ],
+ getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],
+ listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
+ listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
+ listLocationsForAlert: [
+ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
+ ],
+ listOrgPatternConfigs: [
+ "GET /orgs/{org}/secret-scanning/pattern-configurations"
+ ],
+ updateAlert: [
+ "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
+ ],
+ updateOrgPatternConfigs: [
+ "PATCH /orgs/{org}/secret-scanning/pattern-configurations"
+ ]
+ },
+ securityAdvisories: {
+ createFork: [
+ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
+ ],
+ createPrivateVulnerabilityReport: [
+ "POST /repos/{owner}/{repo}/security-advisories/reports"
+ ],
+ createRepositoryAdvisory: [
+ "POST /repos/{owner}/{repo}/security-advisories"
+ ],
+ createRepositoryAdvisoryCveRequest: [
+ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
+ ],
+ getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
+ getRepositoryAdvisory: [
+ "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
+ ],
+ listGlobalAdvisories: ["GET /advisories"],
+ listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
+ listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
+ updateRepositoryAdvisory: [
+ "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
+ ]
+ },
+ teams: {
+ addOrUpdateMembershipForUserInOrg: [
+ "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
+ ],
+ addOrUpdateRepoPermissionsInOrg: [
+ "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+ ],
+ checkPermissionsForRepoInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+ ],
+ create: ["POST /orgs/{org}/teams"],
+ createDiscussionCommentInOrg: [
+ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
+ ],
+ createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
+ deleteDiscussionCommentInOrg: [
+ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+ ],
+ deleteDiscussionInOrg: [
+ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+ ],
+ deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
+ getByName: ["GET /orgs/{org}/teams/{team_slug}"],
+ getDiscussionCommentInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+ ],
+ getDiscussionInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+ ],
+ getMembershipForUserInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
+ ],
+ list: ["GET /orgs/{org}/teams"],
+ listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
+ listDiscussionCommentsInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
+ ],
+ listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
+ listForAuthenticatedUser: ["GET /user/teams"],
+ listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
+ listPendingInvitationsInOrg: [
+ "GET /orgs/{org}/teams/{team_slug}/invitations"
+ ],
+ listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
+ removeMembershipForUserInOrg: [
+ "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
+ ],
+ removeRepoInOrg: [
+ "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
+ ],
+ updateDiscussionCommentInOrg: [
+ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
+ ],
+ updateDiscussionInOrg: [
+ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
+ ],
+ updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
+ },
+ users: {
+ addEmailForAuthenticated: [
+ "POST /user/emails",
+ {},
+ { renamed: ["users", "addEmailForAuthenticatedUser"] }
+ ],
+ addEmailForAuthenticatedUser: ["POST /user/emails"],
+ addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
+ block: ["PUT /user/blocks/{username}"],
+ checkBlocked: ["GET /user/blocks/{username}"],
+ checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
+ checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
+ createGpgKeyForAuthenticated: [
+ "POST /user/gpg_keys",
+ {},
+ { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
+ ],
+ createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
+ createPublicSshKeyForAuthenticated: [
+ "POST /user/keys",
+ {},
+ { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
+ ],
+ createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
+ createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
+ deleteAttestationsBulk: [
+ "POST /users/{username}/attestations/delete-request"
+ ],
+ deleteAttestationsById: [
+ "DELETE /users/{username}/attestations/{attestation_id}"
+ ],
+ deleteAttestationsBySubjectDigest: [
+ "DELETE /users/{username}/attestations/digest/{subject_digest}"
+ ],
+ deleteEmailForAuthenticated: [
+ "DELETE /user/emails",
+ {},
+ { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
+ ],
+ deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
+ deleteGpgKeyForAuthenticated: [
+ "DELETE /user/gpg_keys/{gpg_key_id}",
+ {},
+ { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
+ ],
+ deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
+ deletePublicSshKeyForAuthenticated: [
+ "DELETE /user/keys/{key_id}",
+ {},
+ { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
+ ],
+ deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
+ deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
+ deleteSshSigningKeyForAuthenticatedUser: [
+ "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
+ ],
+ follow: ["PUT /user/following/{username}"],
+ getAuthenticated: ["GET /user"],
+ getById: ["GET /user/{account_id}"],
+ getByUsername: ["GET /users/{username}"],
+ getContextForUser: ["GET /users/{username}/hovercard"],
+ getGpgKeyForAuthenticated: [
+ "GET /user/gpg_keys/{gpg_key_id}",
+ {},
+ { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
+ ],
+ getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
+ getPublicSshKeyForAuthenticated: [
+ "GET /user/keys/{key_id}",
+ {},
+ { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
+ ],
+ getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
+ getSshSigningKeyForAuthenticatedUser: [
+ "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
+ ],
+ list: ["GET /users"],
+ listAttestations: ["GET /users/{username}/attestations/{subject_digest}"],
+ listAttestationsBulk: [
+ "POST /users/{username}/attestations/bulk-list{?per_page,before,after}"
+ ],
+ listBlockedByAuthenticated: [
+ "GET /user/blocks",
+ {},
+ { renamed: ["users", "listBlockedByAuthenticatedUser"] }
+ ],
+ listBlockedByAuthenticatedUser: ["GET /user/blocks"],
+ listEmailsForAuthenticated: [
+ "GET /user/emails",
+ {},
+ { renamed: ["users", "listEmailsForAuthenticatedUser"] }
+ ],
+ listEmailsForAuthenticatedUser: ["GET /user/emails"],
+ listFollowedByAuthenticated: [
+ "GET /user/following",
+ {},
+ { renamed: ["users", "listFollowedByAuthenticatedUser"] }
+ ],
+ listFollowedByAuthenticatedUser: ["GET /user/following"],
+ listFollowersForAuthenticatedUser: ["GET /user/followers"],
+ listFollowersForUser: ["GET /users/{username}/followers"],
+ listFollowingForUser: ["GET /users/{username}/following"],
+ listGpgKeysForAuthenticated: [
+ "GET /user/gpg_keys",
+ {},
+ { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
+ ],
+ listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
+ listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
+ listPublicEmailsForAuthenticated: [
+ "GET /user/public_emails",
+ {},
+ { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
+ ],
+ listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
+ listPublicKeysForUser: ["GET /users/{username}/keys"],
+ listPublicSshKeysForAuthenticated: [
+ "GET /user/keys",
+ {},
+ { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
+ ],
+ listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
+ listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
+ listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
+ listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
+ listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
+ setPrimaryEmailVisibilityForAuthenticated: [
+ "PATCH /user/email/visibility",
+ {},
+ { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
+ ],
+ setPrimaryEmailVisibilityForAuthenticatedUser: [
+ "PATCH /user/email/visibility"
+ ],
+ unblock: ["DELETE /user/blocks/{username}"],
+ unfollow: ["DELETE /user/following/{username}"],
+ updateAuthenticated: ["PATCH /user"]
}
+};
+var endpoints_default = Endpoints;
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
+//# sourceMappingURL=endpoints.js.map
- return adapter(config).then(function onAdapterResolution(response) {
- throwIfCancellationRequested(config);
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
- // Transform response data
- response.data = transformData.call(
- config,
- config.transformResponse,
- response
+const endpointMethodsMap = /* @__PURE__ */ new Map();
+for (const [scope, endpoints] of Object.entries(endpoints_default)) {
+ for (const [methodName, endpoint] of Object.entries(endpoints)) {
+ const [route, defaults, decorations] = endpoint;
+ const [method, url] = route.split(/ /);
+ const endpointDefaults = Object.assign(
+ {
+ method,
+ url
+ },
+ defaults
);
-
- response.headers = AxiosHeaders$1.from(response.headers);
-
- return response;
- }, function onAdapterRejection(reason) {
- if (!isCancel(reason)) {
- throwIfCancellationRequested(config);
-
- // Transform response data
- if (reason && reason.response) {
- reason.response.data = transformData.call(
- config,
- config.transformResponse,
- reason.response
- );
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
- }
- }
-
- return Promise.reject(reason);
- });
-}
-
-const validators$1 = {};
-
-// eslint-disable-next-line func-names
-['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
- validators$1[type] = function validator(thing) {
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
- };
-});
-
-const deprecatedWarnings = {};
-
-/**
- * Transitional option validator
- *
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
- * @param {string?} version - deprecated version / removed since version
- * @param {string?} message - some message with additional info
- *
- * @returns {function}
- */
-validators$1.transitional = function transitional(validator, version, message) {
- function formatMessage(opt, desc) {
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
- }
-
- // eslint-disable-next-line func-names
- return (value, opt, opts) => {
- if (validator === false) {
- throw new AxiosError(
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
- AxiosError.ERR_DEPRECATED
- );
- }
-
- if (version && !deprecatedWarnings[opt]) {
- deprecatedWarnings[opt] = true;
- // eslint-disable-next-line no-console
- console.warn(
- formatMessage(
- opt,
- ' has been deprecated since v' + version + ' and will be removed in the near future'
- )
- );
- }
-
- return validator ? validator(value, opt, opts) : true;
- };
-};
-
-/**
- * Assert object's properties type
- *
- * @param {object} options
- * @param {object} schema
- * @param {boolean?} allowUnknown
- *
- * @returns {object}
- */
-
-function assertOptions(options, schema, allowUnknown) {
- if (typeof options !== 'object') {
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
- }
- const keys = Object.keys(options);
- let i = keys.length;
- while (i-- > 0) {
- const opt = keys[i];
- const validator = schema[opt];
- if (validator) {
- const value = options[opt];
- const result = value === undefined || validator(value, opt, options);
- if (result !== true) {
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
- }
- continue;
- }
- if (allowUnknown !== true) {
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
+ if (!endpointMethodsMap.has(scope)) {
+ endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
}
+ endpointMethodsMap.get(scope).set(methodName, {
+ scope,
+ methodName,
+ endpointDefaults,
+ decorations
+ });
}
}
-
-const validator = {
- assertOptions,
- validators: validators$1
-};
-
-const validators = validator.validators;
-
-/**
- * Create a new instance of Axios
- *
- * @param {Object} instanceConfig The default config for the instance
- *
- * @return {Axios} A new instance of Axios
- */
-class Axios {
- constructor(instanceConfig) {
- this.defaults = instanceConfig;
- this.interceptors = {
- request: new InterceptorManager$1(),
- response: new InterceptorManager$1()
+const handler = {
+ has({ scope }, methodName) {
+ return endpointMethodsMap.get(scope).has(methodName);
+ },
+ getOwnPropertyDescriptor(target, methodName) {
+ return {
+ value: this.get(target, methodName),
+ // ensures method is in the cache
+ configurable: true,
+ writable: true,
+ enumerable: true
};
- }
-
- /**
- * Dispatch a request
- *
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
- * @param {?Object} config
- *
- * @returns {Promise} The Promise to be fulfilled
- */
- async request(configOrUrl, config) {
- try {
- return await this._request(configOrUrl, config);
- } catch (err) {
- if (err instanceof Error) {
- let dummy;
-
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
-
- // slice off the Error: ... line
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
- try {
- if (!err.stack) {
- err.stack = stack;
- // match without the 2 top stack lines
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
- err.stack += '\n' + stack;
- }
- } catch (e) {
- // ignore the case where "stack" is an un-writable property
- }
- }
-
- throw err;
+ },
+ defineProperty(target, methodName, descriptor) {
+ Object.defineProperty(target.cache, methodName, descriptor);
+ return true;
+ },
+ deleteProperty(target, methodName) {
+ delete target.cache[methodName];
+ return true;
+ },
+ ownKeys({ scope }) {
+ return [...endpointMethodsMap.get(scope).keys()];
+ },
+ set(target, methodName, value) {
+ return target.cache[methodName] = value;
+ },
+ get({ octokit, scope, cache }, methodName) {
+ if (cache[methodName]) {
+ return cache[methodName];
+ }
+ const method = endpointMethodsMap.get(scope).get(methodName);
+ if (!method) {
+ return void 0;
}
- }
-
- _request(configOrUrl, config) {
- /*eslint no-param-reassign:0*/
- // Allow for axios('example/url'[, config]) a la fetch API
- if (typeof configOrUrl === 'string') {
- config = config || {};
- config.url = configOrUrl;
+ const { endpointDefaults, decorations } = method;
+ if (decorations) {
+ cache[methodName] = decorate(
+ octokit,
+ scope,
+ methodName,
+ endpointDefaults,
+ decorations
+ );
} else {
- config = configOrUrl || {};
+ cache[methodName] = octokit.request.defaults(endpointDefaults);
}
-
- config = mergeConfig(this.defaults, config);
-
- const {transitional, paramsSerializer, headers} = config;
-
- if (transitional !== undefined) {
- validator.assertOptions(transitional, {
- silentJSONParsing: validators.transitional(validators.boolean),
- forcedJSONParsing: validators.transitional(validators.boolean),
- clarifyTimeoutError: validators.transitional(validators.boolean)
- }, false);
+ return cache[methodName];
+ }
+};
+function endpointsToMethods(octokit) {
+ const newMethods = {};
+ for (const scope of endpointMethodsMap.keys()) {
+ newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
+ }
+ return newMethods;
+}
+function decorate(octokit, scope, methodName, defaults, decorations) {
+ const requestWithDefaults = octokit.request.defaults(defaults);
+ function withDecorations(...args) {
+ let options = requestWithDefaults.endpoint.merge(...args);
+ if (decorations.mapToData) {
+ options = Object.assign({}, options, {
+ data: options[decorations.mapToData],
+ [decorations.mapToData]: void 0
+ });
+ return requestWithDefaults(options);
}
-
- if (paramsSerializer != null) {
- if (utils$1.isFunction(paramsSerializer)) {
- config.paramsSerializer = {
- serialize: paramsSerializer
- };
- } else {
- validator.assertOptions(paramsSerializer, {
- encode: validators.function,
- serialize: validators.function
- }, true);
- }
+ if (decorations.renamed) {
+ const [newScope, newMethodName] = decorations.renamed;
+ octokit.log.warn(
+ `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
+ );
}
-
- // Set config.method
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
-
- // Flatten headers
- let contextHeaders = headers && utils$1.merge(
- headers.common,
- headers[config.method]
- );
-
- headers && utils$1.forEach(
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
- (method) => {
- delete headers[method];
- }
- );
-
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
-
- // filter out skipped interceptors
- const requestInterceptorChain = [];
- let synchronousRequestInterceptors = true;
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
- return;
- }
-
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
-
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
-
- const responseInterceptorChain = [];
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
- });
-
- let promise;
- let i = 0;
- let len;
-
- if (!synchronousRequestInterceptors) {
- const chain = [dispatchRequest.bind(this), undefined];
- chain.unshift.apply(chain, requestInterceptorChain);
- chain.push.apply(chain, responseInterceptorChain);
- len = chain.length;
-
- promise = Promise.resolve(config);
-
- while (i < len) {
- promise = promise.then(chain[i++], chain[i++]);
+ if (decorations.deprecated) {
+ octokit.log.warn(decorations.deprecated);
+ }
+ if (decorations.renamedParameters) {
+ const options2 = requestWithDefaults.endpoint.merge(...args);
+ for (const [name, alias] of Object.entries(
+ decorations.renamedParameters
+ )) {
+ if (name in options2) {
+ octokit.log.warn(
+ `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
+ );
+ if (!(alias in options2)) {
+ options2[alias] = options2[name];
+ }
+ delete options2[name];
+ }
}
-
- return promise;
+ return requestWithDefaults(options2);
}
+ return requestWithDefaults(...args);
+ }
+ return Object.assign(withDecorations, requestWithDefaults);
+}
- len = requestInterceptorChain.length;
-
- let newConfig = config;
+//# sourceMappingURL=endpoints-to-methods.js.map
- i = 0;
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
- while (i < len) {
- const onFulfilled = requestInterceptorChain[i++];
- const onRejected = requestInterceptorChain[i++];
- try {
- newConfig = onFulfilled(newConfig);
- } catch (error) {
- onRejected.call(this, error);
- break;
- }
- }
- try {
- promise = dispatchRequest.call(this, newConfig);
- } catch (error) {
- return Promise.reject(error);
- }
+function restEndpointMethods(octokit) {
+ const api = endpointsToMethods(octokit);
+ return {
+ rest: api
+ };
+}
+restEndpointMethods.VERSION = dist_src_version_VERSION;
+function legacyRestEndpointMethods(octokit) {
+ const api = endpointsToMethods(octokit);
+ return {
+ ...api,
+ rest: api
+ };
+}
+legacyRestEndpointMethods.VERSION = dist_src_version_VERSION;
- i = 0;
- len = responseInterceptorChain.length;
+//# sourceMappingURL=index.js.map
- while (i < len) {
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
- }
+;// CONCATENATED MODULE: ./node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js
+// pkg/dist-src/version.js
+var plugin_paginate_rest_dist_bundle_VERSION = "0.0.0-development";
- return promise;
+// pkg/dist-src/normalize-paginated-list-response.js
+function normalizePaginatedListResponse(response) {
+ if (!response.data) {
+ return {
+ ...response,
+ data: []
+ };
}
-
- getUri(config) {
- config = mergeConfig(this.defaults, config);
- const fullPath = buildFullPath(config.baseURL, config.url);
- return buildURL(fullPath, config.params, config.paramsSerializer);
+ const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data);
+ if (!responseNeedsNormalization) return response;
+ const incompleteResults = response.data.incomplete_results;
+ const repositorySelection = response.data.repository_selection;
+ const totalCount = response.data.total_count;
+ const totalCommits = response.data.total_commits;
+ delete response.data.incomplete_results;
+ delete response.data.repository_selection;
+ delete response.data.total_count;
+ delete response.data.total_commits;
+ const namespaceKey = Object.keys(response.data)[0];
+ const data = response.data[namespaceKey];
+ response.data = data;
+ if (typeof incompleteResults !== "undefined") {
+ response.data.incomplete_results = incompleteResults;
+ }
+ if (typeof repositorySelection !== "undefined") {
+ response.data.repository_selection = repositorySelection;
}
+ response.data.total_count = totalCount;
+ response.data.total_commits = totalCommits;
+ return response;
}
-// Provide aliases for supported request methods
-utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
- /*eslint func-names:0*/
- Axios.prototype[method] = function(url, config) {
- return this.request(mergeConfig(config || {}, {
- method,
- url,
- data: (config || {}).data
- }));
+// pkg/dist-src/iterator.js
+function iterator(octokit, route, parameters) {
+ const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
+ const requestMethod = typeof route === "function" ? route : octokit.request;
+ const method = options.method;
+ const headers = options.headers;
+ let url = options.url;
+ return {
+ [Symbol.asyncIterator]: () => ({
+ async next() {
+ if (!url) return { done: true };
+ try {
+ const response = await requestMethod({ method, url, headers });
+ const normalizedResponse = normalizePaginatedListResponse(response);
+ url = ((normalizedResponse.headers.link || "").match(
+ /<([^<>]+)>;\s*rel="next"/
+ ) || [])[1];
+ if (!url && "total_commits" in normalizedResponse.data) {
+ const parsedUrl = new URL(normalizedResponse.url);
+ const params = parsedUrl.searchParams;
+ const page = parseInt(params.get("page") || "1", 10);
+ const per_page = parseInt(params.get("per_page") || "250", 10);
+ if (page * per_page < normalizedResponse.data.total_commits) {
+ params.set("page", String(page + 1));
+ url = parsedUrl.toString();
+ }
+ }
+ return { value: normalizedResponse };
+ } catch (error) {
+ if (error.status !== 409) throw error;
+ url = "";
+ return {
+ value: {
+ status: 200,
+ headers: {},
+ data: []
+ }
+ };
+ }
+ }
+ })
};
-});
-
-utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
- /*eslint func-names:0*/
+}
- function generateHTTPMethod(isForm) {
- return function httpMethod(url, data, config) {
- return this.request(mergeConfig(config || {}, {
- method,
- headers: isForm ? {
- 'Content-Type': 'multipart/form-data'
- } : {},
- url,
- data
- }));
- };
+// pkg/dist-src/paginate.js
+function paginate(octokit, route, parameters, mapFn) {
+ if (typeof parameters === "function") {
+ mapFn = parameters;
+ parameters = void 0;
}
-
- Axios.prototype[method] = generateHTTPMethod();
-
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
-});
-
-const Axios$1 = Axios;
-
-/**
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
- *
- * @param {Function} executor The executor function.
- *
- * @returns {CancelToken}
- */
-class CancelToken {
- constructor(executor) {
- if (typeof executor !== 'function') {
- throw new TypeError('executor must be a function.');
+ return gather(
+ octokit,
+ [],
+ iterator(octokit, route, parameters)[Symbol.asyncIterator](),
+ mapFn
+ );
+}
+function gather(octokit, results, iterator2, mapFn) {
+ return iterator2.next().then((result) => {
+ if (result.done) {
+ return results;
}
+ let earlyExit = false;
+ function done() {
+ earlyExit = true;
+ }
+ results = results.concat(
+ mapFn ? mapFn(result.value, done) : result.value.data
+ );
+ if (earlyExit) {
+ return results;
+ }
+ return gather(octokit, results, iterator2, mapFn);
+ });
+}
- let resolvePromise;
-
- this.promise = new Promise(function promiseExecutor(resolve) {
- resolvePromise = resolve;
- });
-
- const token = this;
-
- // eslint-disable-next-line func-names
- this.promise.then(cancel => {
- if (!token._listeners) return;
-
- let i = token._listeners.length;
+// pkg/dist-src/compose-paginate.js
+var composePaginateRest = Object.assign(paginate, {
+ iterator
+});
- while (i-- > 0) {
- token._listeners[i](cancel);
- }
- token._listeners = null;
- });
+// pkg/dist-src/generated/paginating-endpoints.js
+var paginatingEndpoints = (/* unused pure expression or super */ null && ([
+ "GET /advisories",
+ "GET /app/hook/deliveries",
+ "GET /app/installation-requests",
+ "GET /app/installations",
+ "GET /assignments/{assignment_id}/accepted_assignments",
+ "GET /classrooms",
+ "GET /classrooms/{classroom_id}/assignments",
+ "GET /enterprises/{enterprise}/code-security/configurations",
+ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories",
+ "GET /enterprises/{enterprise}/dependabot/alerts",
+ "GET /enterprises/{enterprise}/teams",
+ "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships",
+ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations",
+ "GET /events",
+ "GET /gists",
+ "GET /gists/public",
+ "GET /gists/starred",
+ "GET /gists/{gist_id}/comments",
+ "GET /gists/{gist_id}/commits",
+ "GET /gists/{gist_id}/forks",
+ "GET /installation/repositories",
+ "GET /issues",
+ "GET /licenses",
+ "GET /marketplace_listing/plans",
+ "GET /marketplace_listing/plans/{plan_id}/accounts",
+ "GET /marketplace_listing/stubbed/plans",
+ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
+ "GET /networks/{owner}/{repo}/events",
+ "GET /notifications",
+ "GET /organizations",
+ "GET /organizations/{org}/dependabot/repository-access",
+ "GET /orgs/{org}/actions/cache/usage-by-repository",
+ "GET /orgs/{org}/actions/hosted-runners",
+ "GET /orgs/{org}/actions/permissions/repositories",
+ "GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories",
+ "GET /orgs/{org}/actions/runner-groups",
+ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners",
+ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories",
+ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners",
+ "GET /orgs/{org}/actions/runners",
+ "GET /orgs/{org}/actions/secrets",
+ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
+ "GET /orgs/{org}/actions/variables",
+ "GET /orgs/{org}/actions/variables/{name}/repositories",
+ "GET /orgs/{org}/attestations/repositories",
+ "GET /orgs/{org}/attestations/{subject_digest}",
+ "GET /orgs/{org}/blocks",
+ "GET /orgs/{org}/campaigns",
+ "GET /orgs/{org}/code-scanning/alerts",
+ "GET /orgs/{org}/code-security/configurations",
+ "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories",
+ "GET /orgs/{org}/codespaces",
+ "GET /orgs/{org}/codespaces/secrets",
+ "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
+ "GET /orgs/{org}/copilot/billing/seats",
+ "GET /orgs/{org}/copilot/metrics",
+ "GET /orgs/{org}/dependabot/alerts",
+ "GET /orgs/{org}/dependabot/secrets",
+ "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
+ "GET /orgs/{org}/events",
+ "GET /orgs/{org}/failed_invitations",
+ "GET /orgs/{org}/hooks",
+ "GET /orgs/{org}/hooks/{hook_id}/deliveries",
+ "GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}",
+ "GET /orgs/{org}/insights/api/subject-stats",
+ "GET /orgs/{org}/insights/api/user-stats/{user_id}",
+ "GET /orgs/{org}/installations",
+ "GET /orgs/{org}/invitations",
+ "GET /orgs/{org}/invitations/{invitation_id}/teams",
+ "GET /orgs/{org}/issues",
+ "GET /orgs/{org}/members",
+ "GET /orgs/{org}/members/{username}/codespaces",
+ "GET /orgs/{org}/migrations",
+ "GET /orgs/{org}/migrations/{migration_id}/repositories",
+ "GET /orgs/{org}/organization-roles/{role_id}/teams",
+ "GET /orgs/{org}/organization-roles/{role_id}/users",
+ "GET /orgs/{org}/outside_collaborators",
+ "GET /orgs/{org}/packages",
+ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
+ "GET /orgs/{org}/personal-access-token-requests",
+ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
+ "GET /orgs/{org}/personal-access-tokens",
+ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
+ "GET /orgs/{org}/private-registries",
+ "GET /orgs/{org}/projects",
+ "GET /orgs/{org}/projectsV2",
+ "GET /orgs/{org}/projectsV2/{project_number}/fields",
+ "GET /orgs/{org}/projectsV2/{project_number}/items",
+ "GET /orgs/{org}/properties/values",
+ "GET /orgs/{org}/public_members",
+ "GET /orgs/{org}/repos",
+ "GET /orgs/{org}/rulesets",
+ "GET /orgs/{org}/rulesets/rule-suites",
+ "GET /orgs/{org}/rulesets/{ruleset_id}/history",
+ "GET /orgs/{org}/secret-scanning/alerts",
+ "GET /orgs/{org}/security-advisories",
+ "GET /orgs/{org}/settings/immutable-releases/repositories",
+ "GET /orgs/{org}/settings/network-configurations",
+ "GET /orgs/{org}/team/{team_slug}/copilot/metrics",
+ "GET /orgs/{org}/teams",
+ "GET /orgs/{org}/teams/{team_slug}/discussions",
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
+ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
+ "GET /orgs/{org}/teams/{team_slug}/invitations",
+ "GET /orgs/{org}/teams/{team_slug}/members",
+ "GET /orgs/{org}/teams/{team_slug}/projects",
+ "GET /orgs/{org}/teams/{team_slug}/repos",
+ "GET /orgs/{org}/teams/{team_slug}/teams",
+ "GET /projects/{project_id}/collaborators",
+ "GET /repos/{owner}/{repo}/actions/artifacts",
+ "GET /repos/{owner}/{repo}/actions/caches",
+ "GET /repos/{owner}/{repo}/actions/organization-secrets",
+ "GET /repos/{owner}/{repo}/actions/organization-variables",
+ "GET /repos/{owner}/{repo}/actions/runners",
+ "GET /repos/{owner}/{repo}/actions/runs",
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
+ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
+ "GET /repos/{owner}/{repo}/actions/secrets",
+ "GET /repos/{owner}/{repo}/actions/variables",
+ "GET /repos/{owner}/{repo}/actions/workflows",
+ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
+ "GET /repos/{owner}/{repo}/activity",
+ "GET /repos/{owner}/{repo}/assignees",
+ "GET /repos/{owner}/{repo}/attestations/{subject_digest}",
+ "GET /repos/{owner}/{repo}/branches",
+ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
+ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
+ "GET /repos/{owner}/{repo}/code-scanning/alerts",
+ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
+ "GET /repos/{owner}/{repo}/code-scanning/analyses",
+ "GET /repos/{owner}/{repo}/codespaces",
+ "GET /repos/{owner}/{repo}/codespaces/devcontainers",
+ "GET /repos/{owner}/{repo}/codespaces/secrets",
+ "GET /repos/{owner}/{repo}/collaborators",
+ "GET /repos/{owner}/{repo}/comments",
+ "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
+ "GET /repos/{owner}/{repo}/commits",
+ "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
+ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
+ "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
+ "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
+ "GET /repos/{owner}/{repo}/commits/{ref}/status",
+ "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
+ "GET /repos/{owner}/{repo}/compare/{basehead}",
+ "GET /repos/{owner}/{repo}/compare/{base}...{head}",
+ "GET /repos/{owner}/{repo}/contributors",
+ "GET /repos/{owner}/{repo}/dependabot/alerts",
+ "GET /repos/{owner}/{repo}/dependabot/secrets",
+ "GET /repos/{owner}/{repo}/deployments",
+ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
+ "GET /repos/{owner}/{repo}/environments",
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets",
+ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables",
+ "GET /repos/{owner}/{repo}/events",
+ "GET /repos/{owner}/{repo}/forks",
+ "GET /repos/{owner}/{repo}/hooks",
+ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
+ "GET /repos/{owner}/{repo}/invitations",
+ "GET /repos/{owner}/{repo}/issues",
+ "GET /repos/{owner}/{repo}/issues/comments",
+ "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
+ "GET /repos/{owner}/{repo}/issues/events",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues",
+ "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
+ "GET /repos/{owner}/{repo}/keys",
+ "GET /repos/{owner}/{repo}/labels",
+ "GET /repos/{owner}/{repo}/milestones",
+ "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
+ "GET /repos/{owner}/{repo}/notifications",
+ "GET /repos/{owner}/{repo}/pages/builds",
+ "GET /repos/{owner}/{repo}/projects",
+ "GET /repos/{owner}/{repo}/pulls",
+ "GET /repos/{owner}/{repo}/pulls/comments",
+ "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
+ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
+ "GET /repos/{owner}/{repo}/releases",
+ "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
+ "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
+ "GET /repos/{owner}/{repo}/rules/branches/{branch}",
+ "GET /repos/{owner}/{repo}/rulesets",
+ "GET /repos/{owner}/{repo}/rulesets/rule-suites",
+ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history",
+ "GET /repos/{owner}/{repo}/secret-scanning/alerts",
+ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
+ "GET /repos/{owner}/{repo}/security-advisories",
+ "GET /repos/{owner}/{repo}/stargazers",
+ "GET /repos/{owner}/{repo}/subscribers",
+ "GET /repos/{owner}/{repo}/tags",
+ "GET /repos/{owner}/{repo}/teams",
+ "GET /repos/{owner}/{repo}/topics",
+ "GET /repositories",
+ "GET /search/code",
+ "GET /search/commits",
+ "GET /search/issues",
+ "GET /search/labels",
+ "GET /search/repositories",
+ "GET /search/topics",
+ "GET /search/users",
+ "GET /teams/{team_id}/discussions",
+ "GET /teams/{team_id}/discussions/{discussion_number}/comments",
+ "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
+ "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
+ "GET /teams/{team_id}/invitations",
+ "GET /teams/{team_id}/members",
+ "GET /teams/{team_id}/projects",
+ "GET /teams/{team_id}/repos",
+ "GET /teams/{team_id}/teams",
+ "GET /user/blocks",
+ "GET /user/codespaces",
+ "GET /user/codespaces/secrets",
+ "GET /user/emails",
+ "GET /user/followers",
+ "GET /user/following",
+ "GET /user/gpg_keys",
+ "GET /user/installations",
+ "GET /user/installations/{installation_id}/repositories",
+ "GET /user/issues",
+ "GET /user/keys",
+ "GET /user/marketplace_purchases",
+ "GET /user/marketplace_purchases/stubbed",
+ "GET /user/memberships/orgs",
+ "GET /user/migrations",
+ "GET /user/migrations/{migration_id}/repositories",
+ "GET /user/orgs",
+ "GET /user/packages",
+ "GET /user/packages/{package_type}/{package_name}/versions",
+ "GET /user/public_emails",
+ "GET /user/repos",
+ "GET /user/repository_invitations",
+ "GET /user/social_accounts",
+ "GET /user/ssh_signing_keys",
+ "GET /user/starred",
+ "GET /user/subscriptions",
+ "GET /user/teams",
+ "GET /users",
+ "GET /users/{username}/attestations/{subject_digest}",
+ "GET /users/{username}/events",
+ "GET /users/{username}/events/orgs/{org}",
+ "GET /users/{username}/events/public",
+ "GET /users/{username}/followers",
+ "GET /users/{username}/following",
+ "GET /users/{username}/gists",
+ "GET /users/{username}/gpg_keys",
+ "GET /users/{username}/keys",
+ "GET /users/{username}/orgs",
+ "GET /users/{username}/packages",
+ "GET /users/{username}/projects",
+ "GET /users/{username}/projectsV2",
+ "GET /users/{username}/projectsV2/{project_number}/fields",
+ "GET /users/{username}/projectsV2/{project_number}/items",
+ "GET /users/{username}/received_events",
+ "GET /users/{username}/received_events/public",
+ "GET /users/{username}/repos",
+ "GET /users/{username}/social_accounts",
+ "GET /users/{username}/ssh_signing_keys",
+ "GET /users/{username}/starred",
+ "GET /users/{username}/subscriptions"
+]));
- // eslint-disable-next-line func-names
- this.promise.then = onfulfilled => {
- let _resolve;
- // eslint-disable-next-line func-names
- const promise = new Promise(resolve => {
- token.subscribe(resolve);
- _resolve = resolve;
- }).then(onfulfilled);
+// pkg/dist-src/paginating-endpoints.js
+function isPaginatingEndpoint(arg) {
+ if (typeof arg === "string") {
+ return paginatingEndpoints.includes(arg);
+ } else {
+ return false;
+ }
+}
- promise.cancel = function reject() {
- token.unsubscribe(_resolve);
- };
+// pkg/dist-src/index.js
+function paginateRest(octokit) {
+ return {
+ paginate: Object.assign(paginate.bind(null, octokit), {
+ iterator: iterator.bind(null, octokit)
+ })
+ };
+}
+paginateRest.VERSION = plugin_paginate_rest_dist_bundle_VERSION;
- return promise;
- };
- executor(function cancel(message, config, request) {
- if (token.reason) {
- // Cancellation has already been requested
- return;
- }
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/utils.js
- token.reason = new CanceledError(message, config, request);
- resolvePromise(token.reason);
- });
- }
- /**
- * Throws a `CanceledError` if cancellation has been requested.
- */
- throwIfRequested() {
- if (this.reason) {
- throw this.reason;
- }
- }
+// octokit + plugins
- /**
- * Subscribe to the cancel signal
- */
- subscribe(listener) {
- if (this.reason) {
- listener(this.reason);
- return;
- }
- if (this._listeners) {
- this._listeners.push(listener);
- } else {
- this._listeners = [listener];
+const context = new Context();
+const baseUrl = getApiBaseUrl();
+const defaults = {
+ baseUrl,
+ request: {
+ agent: getProxyAgent(baseUrl),
+ fetch: getProxyFetch(baseUrl)
}
- }
-
- /**
- * Unsubscribe from the cancel signal
- */
+};
+const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults);
- unsubscribe(listener) {
- if (!this._listeners) {
- return;
+/**
+ * Convience function to correctly format Octokit Options to pass into the constructor.
+ *
+ * @param token the repo PAT or GITHUB_TOKEN
+ * @param options other options to set
+ */
+function getOctokitOptions(token, options) {
+ const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
+ // Auth
+ const auth = getAuthString(token, opts);
+ if (auth) {
+ opts.auth = auth;
}
- const index = this._listeners.indexOf(listener);
- if (index !== -1) {
- this._listeners.splice(index, 1);
+ // Orchestration ID
+ const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
+ if (userAgent) {
+ opts.userAgent = userAgent;
}
- }
-
- /**
- * Returns an object that contains a new `CancelToken` and a function that, when called,
- * cancels the `CancelToken`.
- */
- static source() {
- let cancel;
- const token = new CancelToken(function executor(c) {
- cancel = c;
- });
- return {
- token,
- cancel
- };
- }
+ return opts;
}
+//# sourceMappingURL=utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@actions/github/lib/github.js
-const CancelToken$1 = CancelToken;
+const github_context = new Context();
/**
- * Syntactic sugar for invoking a function and expanding an array for arguments.
- *
- * Common use case would be to use `Function.prototype.apply`.
- *
- * ```js
- * function f(x, y, z) {}
- * var args = [1, 2, 3];
- * f.apply(null, args);
- * ```
- *
- * With `spread` this example can be re-written.
- *
- * ```js
- * spread(function(x, y, z) {})([1, 2, 3]);
- * ```
- *
- * @param {Function} callback
+ * Returns a hydrated octokit ready to use for GitHub Actions
*
- * @returns {Function}
+ * @param token the repo PAT or GITHUB_TOKEN
+ * @param options other options to set
*/
-function spread(callback) {
- return function wrap(arr) {
- return callback.apply(null, arr);
- };
+function getOctokit(token, options, ...additionalPlugins) {
+ const GitHubWithPlugins = GitHub.plugin(...additionalPlugins);
+ return new GitHubWithPlugins(getOctokitOptions(token, options));
}
+//# sourceMappingURL=github.js.map
+;// CONCATENATED MODULE: ./lib/create.js
-/**
- * Determines whether the payload is an error thrown by Axios
- *
- * @param {*} payload The value to test
- *
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
- */
-function isAxiosError(payload) {
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
+async function invalidatePreviousDeployments(octokitClient, environment) {
+ const deployments = await octokitClient.rest.repos.listDeployments({
+ ...github_context.repo,
+ ref: github_context.ref,
+ environment
+ });
+ await Promise.all(deployments.data.map(async (deployment) => {
+ const statuses = await octokitClient.rest.repos.listDeploymentStatuses({
+ ...github_context.repo,
+ deployment_id: deployment.id
+ });
+ const lastStatus = statuses.data.sort((a, b) => a.id - b.id).slice(-1)[0];
+ console.log(`last status for deployment_id '${deployment.id}': ${JSON.stringify(lastStatus, null, 2)}`);
+ // invalidate the deployment
+ if (lastStatus?.state === 'success') {
+ console.log(`invalidating deployment: ${JSON.stringify(deployment, null, 2)}`);
+ await octokitClient.rest.repos.createDeploymentStatus({
+ ...github_context.repo,
+ deployment_id: deployment.id,
+ state: 'inactive',
+ environment_url: lastStatus.environment_url,
+ log_url: lastStatus.log_url
+ });
+ }
+ }));
}
-
-const HttpStatusCode = {
- Continue: 100,
- SwitchingProtocols: 101,
- Processing: 102,
- EarlyHints: 103,
- Ok: 200,
- Created: 201,
- Accepted: 202,
- NonAuthoritativeInformation: 203,
- NoContent: 204,
- ResetContent: 205,
- PartialContent: 206,
- MultiStatus: 207,
- AlreadyReported: 208,
- ImUsed: 226,
- MultipleChoices: 300,
- MovedPermanently: 301,
- Found: 302,
- SeeOther: 303,
- NotModified: 304,
- UseProxy: 305,
- Unused: 306,
- TemporaryRedirect: 307,
- PermanentRedirect: 308,
- BadRequest: 400,
- Unauthorized: 401,
- PaymentRequired: 402,
- Forbidden: 403,
- NotFound: 404,
- MethodNotAllowed: 405,
- NotAcceptable: 406,
- ProxyAuthenticationRequired: 407,
- RequestTimeout: 408,
- Conflict: 409,
- Gone: 410,
- LengthRequired: 411,
- PreconditionFailed: 412,
- PayloadTooLarge: 413,
- UriTooLong: 414,
- UnsupportedMediaType: 415,
- RangeNotSatisfiable: 416,
- ExpectationFailed: 417,
- ImATeapot: 418,
- MisdirectedRequest: 421,
- UnprocessableEntity: 422,
- Locked: 423,
- FailedDependency: 424,
- TooEarly: 425,
- UpgradeRequired: 426,
- PreconditionRequired: 428,
- TooManyRequests: 429,
- RequestHeaderFieldsTooLarge: 431,
- UnavailableForLegalReasons: 451,
- InternalServerError: 500,
- NotImplemented: 501,
- BadGateway: 502,
- ServiceUnavailable: 503,
- GatewayTimeout: 504,
- HttpVersionNotSupported: 505,
- VariantAlsoNegotiates: 506,
- InsufficientStorage: 507,
- LoopDetected: 508,
- NotExtended: 510,
- NetworkAuthenticationRequired: 511,
-};
-
-Object.entries(HttpStatusCode).forEach(([key, value]) => {
- HttpStatusCode[value] = key;
-});
-
-const HttpStatusCode$1 = HttpStatusCode;
-
-/**
- * Create an instance of Axios
- *
- * @param {Object} defaultConfig The default config for the instance
- *
- * @returns {Axios} A new instance of Axios
- */
-function createInstance(defaultConfig) {
- const context = new Axios$1(defaultConfig);
- const instance = bind(Axios$1.prototype.request, context);
-
- // Copy axios.prototype to instance
- utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
-
- // Copy context to instance
- utils$1.extend(instance, context, null, {allOwnKeys: true});
-
- // Factory for creating new instances
- instance.create = function create(instanceConfig) {
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
- };
-
- return instance;
+async function getMainSha(octokitClient, branch) {
+ try {
+ const response = await octokitClient.rest.repos.getBranch({ ...github_context.repo, branch });
+ const sha = String(response.data.commit.sha);
+ console.log(`${branch} branch sha: ${sha}`);
+ return sha;
+ }
+ catch (error) {
+ console.error(error.message);
+ return `no_${branch}`;
+ }
+}
+async function create(octokitClient, logUrl, description, initialStatus, environment, environmentUrl, mainBranch) {
+ await invalidatePreviousDeployments(octokitClient, environment);
+ // get main branch sha to store in payload
+ const mainBranchSha = await getMainSha(octokitClient, mainBranch);
+ const payload = JSON.stringify({ actor: github_context.actor, main_sha: mainBranchSha });
+ const deployment = await octokitClient.rest.repos.createDeployment({
+ ...github_context.repo,
+ ref: github_context.ref,
+ required_contexts: [],
+ environment,
+ transient_environment: true,
+ auto_merge: false,
+ description,
+ payload
+ });
+ const deploymentId = deployment.data.id;
+ console.log(`created deployment: ${JSON.stringify(deployment.data, null, 2)}`);
+ const status = await octokitClient.rest.repos.createDeploymentStatus({
+ ...github_context.repo,
+ deployment_id: deploymentId,
+ state: initialStatus,
+ log_url: logUrl,
+ environment_url: environmentUrl
+ });
+ console.log(`created deployment status: ${JSON.stringify(status.data, null, 2)}`);
+ return deploymentId.toString();
}
-// Create the default instance to be exported
-const axios = createInstance(defaults$1);
-
-// Expose Axios class to allow class inheritance
-axios.Axios = Axios$1;
-
-// Expose Cancel & CancelToken
-axios.CanceledError = CanceledError;
-axios.CancelToken = CancelToken$1;
-axios.isCancel = isCancel;
-axios.VERSION = VERSION;
-axios.toFormData = toFormData;
-
-// Expose AxiosError class
-axios.AxiosError = AxiosError;
-
-// alias for CanceledError for backward compatibility
-axios.Cancel = axios.CanceledError;
-
-// Expose all/spread
-axios.all = function all(promises) {
- return Promise.all(promises);
-};
-
-axios.spread = spread;
-
-// Expose isAxiosError
-axios.isAxiosError = isAxiosError;
-
-// Expose mergeConfig
-axios.mergeConfig = mergeConfig;
-
-axios.AxiosHeaders = AxiosHeaders$1;
+;// CONCATENATED MODULE: ./lib/delete-all.js
-axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
+async function deleteAll(octokitClient, environment) {
+ const deployments = await octokitClient.rest.repos.listDeployments({
+ ...github_context.repo,
+ environment
+ });
+ await Promise.all(deployments.data.map(async (deployment) => {
+ // invalidate deployment first
+ // since we can't delete active deployment
+ console.log(`invalidate deployment: ${deployment.id}`);
+ await octokitClient.rest.repos.createDeploymentStatus({
+ ...github_context.repo,
+ deployment_id: deployment.id,
+ state: 'failure'
+ });
+ // then delete it
+ console.log(`delete deployment: ${deployment.url}`);
+ await octokitClient.request(deployment.url, { method: 'DELETE' });
+ }));
+}
-axios.getAdapter = adapters.getAdapter;
+;// CONCATENATED MODULE: ./lib/delete.js
-axios.HttpStatusCode = HttpStatusCode$1;
+async function deleteDeployment(octoKitClient, deploymentId) {
+ // invalidate deployment first
+ // since we can't delete active deployment
+ console.log(`invalidate deployment: ${deploymentId}`);
+ const status = await octoKitClient.rest.repos.createDeploymentStatus({
+ ...github_context.repo,
+ deployment_id: deploymentId,
+ state: 'failure'
+ });
+ // then delete it
+ const deploymentUrl = String(status.data.deployment_url);
+ console.log(`delete deployment: ${deploymentUrl}`);
+ await octoKitClient.request(deploymentUrl, { method: 'DELETE' });
+}
-axios.default = axios;
+// EXTERNAL MODULE: ./node_modules/@slack/web-api/dist/index.js
+var web_api_dist = __nccwpck_require__(5105);
+;// CONCATENATED MODULE: ./lib/utils.js
-module.exports = axios;
-//# sourceMappingURL=axios.cjs.map
+const DEPLOYMENT_ID_STATE_NAME = 'deployment_id';
+// nullify getInput empty results
+// to allow coalescence ?? operator
+function utils_getInput(name, options) {
+ const result = getInput(name, options);
+ if (result === '') {
+ return null;
+ }
+ return result;
+}
+function getEnvironment(ref) {
+ // default to branch name w/o `deploy-` prefix
+ const environment = utils_getInput('environment') ?? ref.replace('refs/heads/', '').replace(/^deploy-/, '');
+ console.log(`environment: ${environment}`);
+ return environment;
+}
+async function postSlackNotification(slackToken, slackChannel, environment, status, context, deploymentConfidenceUrl, sha) {
+ if (slackToken === '' || slackChannel === '') {
+ return;
+ }
+ const { actor, repo, payload } = context;
+ try {
+ const statusIcon = status === 'success' ? '✅' : '❌';
+ const afterSha = sha.slice(0, 7);
+ const repoUrl = `https://github.com/${repo.owner}/${repo.repo}`;
+ const deploymentUrl = `${repoUrl}/deployments?environment=${environment}#activity-log`;
+ const commitUrl = `${repoUrl}/commit/${sha}`;
+ let commitText = `<${commitUrl}|${afterSha}>`;
+ const payloadForPushes = payload;
+ if (payloadForPushes?.compare !== undefined) {
+ const beforeSha = payloadForPushes.before.slice(0, 7);
+ const afterShaMessage = payloadForPushes.head_commit.message ?? '';
+ const shortShaMessage = trimEllipsis(afterShaMessage.replace(/(\r\n|\n|\r).*$/gm, ''), 60); // keep only some first symbols of the first line
+ commitText = `<${payloadForPushes.compare}|${beforeSha} ⇢ ${afterSha} ${shortShaMessage}>`;
+ }
+ // message formatting reference - https://api.slack.com/reference/surfaces/formatting
+ let text;
+ const baseText = `<${repoUrl}|${repo.repo}> deployment 🚀 to <${deploymentUrl}|${environment}> by <@${actor.toLowerCase()}> completed with ${status} ${statusIcon} - ${commitText}.`;
+ if (deploymentConfidenceUrl !== '' && status === 'success') {
+ text = `${baseText}\n\n:toolbox: Check out our <${deploymentConfidenceUrl}|deployment confidence dashboard> so you are the first to know if anything is broken.`;
+ }
+ else {
+ text = baseText;
+ }
+ const slackClient = new WebClient(slackToken);
+ const slackParams = {
+ channel: slackChannel,
+ unfurl_links: false,
+ mrkdwn: true,
+ text
+ };
+ console.log(`Posting Slack message: ${text}`);
+ // API description - https://api.slack.com/methods/chat.postMessage
+ await slackClient.chat.postMessage(slackParams);
+ console.log(`Slack message posted to channel: ${slackChannel}`);
+ }
+ catch (error) {
+ core.error(error);
+ }
+}
+function trimEllipsis(str, length) {
+ return str.length > length ? `${str.substring(0, length)}...` : str;
+}
-/***/ }),
+;// CONCATENATED MODULE: ./lib/main.js
-/***/ 9087:
-/***/ ((module) => {
-"use strict";
-module.exports = JSON.parse('{"_from":"@slack/web-api@^7.0.2","_id":"@slack/web-api@7.2.0","_inBundle":false,"_integrity":"sha512-Dicpm9h/M9gZXHVlsDurUxQOzhh5QDZ6jahnsYRl9ZLAD58SPfgZdlS5a6Rz3zs82RnYWhNVjMW+pMLysetgRw==","_location":"/@slack/web-api","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"@slack/web-api@^7.0.2","name":"@slack/web-api","escapedName":"@slack%2fweb-api","scope":"@slack","rawSpec":"^7.0.2","saveSpec":null,"fetchSpec":"^7.0.2"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/@slack/web-api/-/web-api-7.2.0.tgz","_shasum":"036322e08418c5dc0c20ded15488960658f93f4a","_spec":"@slack/web-api@^7.0.2","_where":"/Users/shmam/Developer/action-deploy","author":{"name":"Slack Technologies, LLC"},"bugs":{"url":"https://github.com/slackapi/node-slack-sdk/issues"},"bundleDependencies":false,"dependencies":{"@slack/logger":"^4.0.0","@slack/types":"^2.9.0","@types/node":">=18.0.0","@types/retry":"0.12.0","axios":"^1.6.5","eventemitter3":"^5.0.1","form-data":"^4.0.0","is-electron":"2.2.2","is-stream":"^2","p-queue":"^6","p-retry":"^4","retry":"^0.13.1"},"deprecated":false,"description":"Official library for using the Slack Platform\'s Web API","devDependencies":{"@microsoft/api-extractor":"^7","@tsconfig/recommended":"^1","@types/chai":"^4","@types/mocha":"^10","@types/sinon":"^17","@typescript-eslint/eslint-plugin":"^6","@typescript-eslint/parser":"^6","busboy":"^1","c8":"^9.1.0","chai":"^4","eslint":"^8","eslint-config-airbnb-base":"^15","eslint-config-airbnb-typescript":"^17","eslint-plugin-import":"^2","eslint-plugin-import-newlines":"^1.3.4","eslint-plugin-jsdoc":"^48","eslint-plugin-node":"^11","mocha":"^10","nock":"^13","shx":"^0.3.2","sinon":"^17","source-map-support":"^0.5.21","ts-node":"^10","tsd":"^0.30.0","typescript":"5.3.3"},"engines":{"node":">= 18","npm":">= 8.6.0"},"files":["dist/**/*"],"homepage":"https://slack.dev/node-slack-sdk/web-api","keywords":["slack","web-api","bot","client","http","api","proxy","rate-limiting","pagination"],"license":"MIT","main":"dist/index.js","name":"@slack/web-api","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/slackapi/node-slack-sdk.git"},"scripts":{"build":"npm run build:clean && tsc","build:clean":"shx rm -rf ./dist ./coverage","lint":"eslint --ext .ts src","mocha":"mocha --config .mocharc.json src/*.spec.js","prepare":"npm run build","ref-docs:model":"api-extractor run","test":"npm run lint && npm run test:types && npm run test:integration && npm run test:unit","test:integration":"npm run build && node test/integration/commonjs-project/index.js && node test/integration/esm-project/index.mjs","test:types":"tsd","test:unit":"npm run build && c8 npm run mocha","watch":"npx nodemon --watch \'src\' --ext \'ts\' --exec npm run build"},"tsd":{"directory":"test/types"},"types":"./dist/index.d.ts","version":"7.2.0"}');
-/***/ }),
-/***/ 3765:
-/***/ ((module) => {
-"use strict";
-module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}');
-/***/ })
+async function run() {
+ let token;
+ let type;
+ let logsUrl;
+ let description;
+ let status;
+ let environment;
+ let environmentUrl;
+ let deploymentId;
+ let mainBranch;
+ const { actor, ref } = github_context;
+ console.log('### main.context ###');
+ console.log(`actor: ${actor}`);
+ console.log(`ref: ${ref}`);
+ console.log('\n');
+ try {
+ console.log('### main.inputs ###');
+ token = utils_getInput('token', { required: true }) ?? '';
+ type = utils_getInput('type', { required: true });
+ console.log(`type: ${type}`);
+ logsUrl = utils_getInput('logs') ?? '';
+ console.log(`logs: ${logsUrl}`);
+ description = utils_getInput('description') ?? `deployed by ${actor}`;
+ console.log(`description: ${description}`);
+ status = (utils_getInput('status') ?? 'in_progress');
+ console.log(`status: ${status}`);
+ environment = getEnvironment(ref);
+ environmentUrl = utils_getInput('environment_url') ?? '';
+ console.log(`environmentUrl: ${environmentUrl}`);
+ mainBranch = utils_getInput('main_branch') ?? 'master';
+ console.log(`main branch: ${mainBranch}`);
+ const shouldRequireDeploymentId = type === 'delete';
+ deploymentId = utils_getInput(DEPLOYMENT_ID_STATE_NAME, { required: shouldRequireDeploymentId }) ?? '0';
+ console.log(`deploymentId: ${deploymentId}`);
+ }
+ catch (error) {
+ core_error(error);
+ setFailed(`Wrong parameters given: ${JSON.stringify(error, null, 2)}`);
+ throw error;
+ }
+ console.log('\n');
+ const octokitClient = getOctokit(token);
+ console.log('### run ###');
+ switch (type) {
+ case 'create':
+ try {
+ // If a deployment was already created on a previous job,
+ // don't create one again.
+ if (deploymentId === '0') {
+ deploymentId = await create(octokitClient, logsUrl, description, status, environment, environmentUrl, mainBranch);
+ }
+ console.log(`saveState::${DEPLOYMENT_ID_STATE_NAME}: ${deploymentId}`);
+ saveState(DEPLOYMENT_ID_STATE_NAME, deploymentId); // for internal use
+ setOutput(DEPLOYMENT_ID_STATE_NAME, deploymentId); // keep that output for external dependencies
+ }
+ catch (error) {
+ core_error(error);
+ setFailed(`Create deployment failed: ${JSON.stringify(error, null, 2)}`);
+ throw error;
+ }
+ break;
+ case 'delete':
+ try {
+ await deleteDeployment(octokitClient, Number(deploymentId));
+ }
+ catch (error) {
+ core_error(error);
+ setFailed(`Delete deployment failed: ${JSON.stringify(error, null, 2)}`);
+ throw error;
+ }
+ break;
+ case 'delete-all':
+ try {
+ await deleteAll(octokitClient, environment);
+ }
+ catch (error) {
+ core_error(error);
+ setFailed(`Delete all deployments failed: ${JSON.stringify(error, null, 2)}`);
+ throw error;
+ }
+ break;
+ }
+}
+if (process.env.NODE_ENV !== 'test')
+ run(); // eslint-disable-line @typescript-eslint/no-floating-promises
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __nccwpck_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ var threw = true;
-/******/ try {
-/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
-/******/ threw = false;
-/******/ } finally {
-/******/ if(threw) delete __webpack_module_cache__[moduleId];
-/******/ }
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat */
-/******/
-/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module is referenced by other modules so it can't be inlined
-/******/ var __webpack_exports__ = __nccwpck_require__(3109);
-/******/ module.exports = __webpack_exports__;
-/******/
-/******/ })()
-;
\ No newline at end of file
+var __webpack_exports__run = __webpack_exports__.e;
+export { __webpack_exports__run as run };
diff --git a/dist/post/index.js b/dist/post/index.js
index b7f2ebe..9d27b54 100644
--- a/dist/post/index.js
+++ b/dist/post/index.js
@@ -1,162 +1,11 @@
-/******/ (() => { // webpackBootstrap
-/******/ var __webpack_modules__ = ({
+import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
+/******/ var __webpack_modules__ = ({
-/***/ 8774:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.complete = void 0;
-const github_1 = __nccwpck_require__(5438);
-async function complete(octokitClient, deploymentId, status) {
- const statuses = await octokitClient.rest.repos.listDeploymentStatuses({
- ...github_1.context.repo,
- deployment_id: deploymentId
- });
- const lastStatus = statuses.data.sort((a, b) => a.id - b.id).slice(-1)[0];
- console.log(`last status for deployment_id '${deploymentId}': ${JSON.stringify(lastStatus, null, 2)}`);
- const statusResult = await octokitClient.rest.repos.createDeploymentStatus({
- ...github_1.context.repo,
- deployment_id: deploymentId,
- state: status,
- environment_url: lastStatus.environment_url,
- log_url: lastStatus.log_url
- });
- console.log(`created deployment status: ${JSON.stringify(statusResult.data, null, 2)}`);
-}
-exports.complete = complete;
-
-
-/***/ }),
-
-/***/ 95:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.post = void 0;
-const core = __importStar(__nccwpck_require__(2186));
-const github = __importStar(__nccwpck_require__(5438));
-const complete_1 = __nccwpck_require__(8774);
-const utils_1 = __nccwpck_require__(918);
-async function post() {
- let token;
- let type;
- let deploymentId;
- let jobStatus;
- let environment;
- let slackToken;
- let slackChannel;
- let deploymentConfidenceUrl;
- let mutateDeployment;
- let currentSha;
- const { actor, ref, repo, sha } = github.context;
- console.log('### post.context ###');
- console.log(`actor: ${actor}`);
- console.log(`ref: ${ref}`);
- console.log(`owner: ${repo.owner}`);
- console.log(`repo: ${repo.repo}`);
- console.log(`compare: ${github.context.payload.compare}`);
- console.log(`new_sha: ${sha}`);
- console.log('\n');
- try {
- console.log('### post.inputs ###');
- token = (0, utils_1.getInput)('token', { required: true }) ?? '';
- type = (0, utils_1.getInput)('type', { required: true });
- console.log(`type: ${type}`);
- jobStatus = (0, utils_1.getInput)('job_status') ?? 'success';
- console.log(`job_status: ${jobStatus}`);
- environment = (0, utils_1.getEnvironment)(ref);
- slackToken = (0, utils_1.getInput)('slack_token') ?? '';
- console.log(`slack_token: ${slackToken === '' ? 'none' : 'passed'}`);
- slackChannel = (0, utils_1.getInput)('slack_channel') ?? '';
- console.log(`slack_channel: ${slackChannel}`);
- // We want to mutate the Deployment by default, unless the deployment
- // was already mutated by another action and we just want to notify
- mutateDeployment = (0, utils_1.getInput)('mutate_deployment') !== 'false';
- console.log(`mutate_deployment: ${mutateDeployment.toString()}`);
- currentSha = (0, utils_1.getInput)('current_sha') ?? sha;
- console.log(`current_sha: ${currentSha}`);
- deploymentConfidenceUrl = (0, utils_1.getInput)('deployment_confidence_url') ?? '';
- console.log(`deployment confidence dashboard URL: ${deploymentConfidenceUrl}`);
- }
- catch (error) {
- core.error(error);
- core.setFailed(`Wrong parameters given: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- console.log('\n');
- console.log('### post ###');
- const octokitClient = github.getOctokit(token, { previews: ['ant-man', 'flash'] });
- const status = jobStatus === 'success' ? 'success' : 'failure';
- console.log(`status: ${status}`);
- switch (type) {
- case 'create':
- deploymentId = core.getState(utils_1.DEPLOYMENT_ID_STATE_NAME);
- console.log(`deploymentId: ${deploymentId}`);
- if (deploymentId === undefined || deploymentId === '') {
- console.log('No deploymentId provided, skip status update');
- return;
- }
- // Post Slack notification
- await (0, utils_1.postSlackNotification)(slackToken, slackChannel, environment, status, github.context, deploymentConfidenceUrl, currentSha);
- try {
- // If the deployment was managed by another workflow we don't want to mutate it here
- if (mutateDeployment)
- await (0, complete_1.complete)(octokitClient, Number(deploymentId), status);
- }
- catch (error) {
- if (error.name === 'HttpError' && error.status === 404) {
- console.log('Couldn\'t complete a deployment: not found');
- return;
- }
- core.error(error);
- core.setFailed(`Complete deployment failed: ${JSON.stringify(error, null, 2)}`);
- throw error;
- }
- break;
- default:
- console.log(`No post script for type: ${type}`);
- break;
- }
-}
-exports.post = post;
-if (process.env.NODE_ENV !== 'test')
- post(); // eslint-disable-line @typescript-eslint/no-floating-promises
-
-
-/***/ }),
-
-/***/ 918:
+/***/ 4844:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
+/* eslint-disable @typescript-eslint/no-explicit-any */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -173,210 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : 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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.postSlackNotification = exports.getEnvironment = exports.getInput = exports.DEPLOYMENT_ID_STATE_NAME = void 0;
-const core = __importStar(__nccwpck_require__(2186));
-const web_api_1 = __nccwpck_require__(431);
-exports.DEPLOYMENT_ID_STATE_NAME = 'deployment_id';
-// nullify getInput empty results
-// to allow coalescence ?? operator
-function getInput(name, options) {
- const result = core.getInput(name, options);
- if (result === '') {
- return null;
- }
- return result;
-}
-exports.getInput = getInput;
-function getEnvironment(ref) {
- // default to branch name w/o `deploy-` prefix
- const environment = getInput('environment') ?? ref.replace('refs/heads/', '').replace(/^deploy-/, '');
- console.log(`environment: ${environment}`);
- return environment;
-}
-exports.getEnvironment = getEnvironment;
-async function postSlackNotification(slackToken, slackChannel, environment, status, context, deploymentConfidenceUrl, sha) {
- if (slackToken === '' || slackChannel === '') {
- return;
- }
- const { actor, repo, payload } = context;
- try {
- const statusIcon = status === 'success' ? '✅' : '❌';
- const afterSha = sha.slice(0, 7);
- const repoUrl = `https://github.com/${repo.owner}/${repo.repo}`;
- const deploymentUrl = `${repoUrl}/deployments?environment=${environment}#activity-log`;
- const commitUrl = `${repoUrl}/commit/${sha}`;
- let commitText = `<${commitUrl}|${afterSha}>`;
- const payloadForPushes = payload;
- if (payloadForPushes?.compare !== undefined) {
- const beforeSha = payloadForPushes.before.slice(0, 7);
- const afterShaMessage = payloadForPushes.head_commit.message ?? '';
- const shortShaMessage = trimEllipsis(afterShaMessage.replace(/(\r\n|\n|\r).*$/gm, ''), 60); // keep only some first symbols of the first line
- commitText = `<${payloadForPushes.compare}|${beforeSha} ⇢ ${afterSha} ${shortShaMessage}>`;
- }
- // message formatting reference - https://api.slack.com/reference/surfaces/formatting
- let text;
- const baseText = `<${repoUrl}|${repo.repo}> deployment 🚀 to <${deploymentUrl}|${environment}> by <@${actor.toLowerCase()}> completed with ${status} ${statusIcon} - ${commitText}.`;
- if (deploymentConfidenceUrl !== '' && status === 'success') {
- text = `${baseText}\n\n:toolbox: Check out our <${deploymentConfidenceUrl}|deployment confidence dashboard> so you are the first to know if anything is broken.`;
- }
- else {
- text = baseText;
- }
- const slackClient = new web_api_1.WebClient(slackToken);
- const slackParams = {
- channel: slackChannel,
- unfurl_links: false,
- mrkdwn: true,
- text
+var __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
};
- console.log(`Posting Slack message: ${text}`);
- // API description - https://api.slack.com/methods/chat.postMessage
- await slackClient.chat.postMessage(slackParams);
- console.log(`Slack message posted to channel: ${slackChannel}`);
- }
- catch (error) {
- core.error(error);
- }
-}
-exports.postSlackNotification = postSlackNotification;
-function trimEllipsis(str, length) {
- return str.length > length ? `${str.substring(0, length)}...` : str;
-}
-
-
-/***/ }),
-
-/***/ 7351:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.issue = exports.issueCommand = void 0;
-const os = __importStar(__nccwpck_require__(2037));
-const utils_1 = __nccwpck_require__(5278);
-/**
- * Commands
- *
- * Command Format:
- * ::name key=value,key=value::message
- *
- * Examples:
- * ::warning::This is the message
- * ::set-env name=MY_VAR::some value
- */
-function issueCommand(command, properties, message) {
- const cmd = new Command(command, properties, message);
- process.stdout.write(cmd.toString() + os.EOL);
-}
-exports.issueCommand = issueCommand;
-function issue(name, message = '') {
- issueCommand(name, {}, message);
-}
-exports.issue = issue;
-const CMD_STRING = '::';
-class Command {
- constructor(command, properties, message) {
- if (!command) {
- command = 'missing.command';
- }
- this.command = command;
- this.properties = properties;
- this.message = message;
- }
- toString() {
- let cmdStr = CMD_STRING + this.command;
- if (this.properties && Object.keys(this.properties).length > 0) {
- cmdStr += ' ';
- let first = true;
- for (const key in this.properties) {
- if (this.properties.hasOwnProperty(key)) {
- const val = this.properties[key];
- if (val) {
- if (first) {
- first = false;
- }
- else {
- cmdStr += ',';
- }
- cmdStr += `${key}=${escapeProperty(val)}`;
- }
- }
- }
- }
- cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
- return cmdStr;
- }
-}
-function escapeData(s) {
- return utils_1.toCommandValue(s)
- .replace(/%/g, '%25')
- .replace(/\r/g, '%0D')
- .replace(/\n/g, '%0A');
-}
-function escapeProperty(s) {
- return utils_1.toCommandValue(s)
- .replace(/%/g, '%25')
- .replace(/\r/g, '%0D')
- .replace(/\n/g, '%0A')
- .replace(/:/g, '%3A')
- .replace(/,/g, '%2C');
-}
-//# sourceMappingURL=command.js.map
-
-/***/ }),
-
-/***/ 2186:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -387,730 +49,1333 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
-const command_1 = __nccwpck_require__(7351);
-const file_command_1 = __nccwpck_require__(717);
-const utils_1 = __nccwpck_require__(5278);
-const os = __importStar(__nccwpck_require__(2037));
-const path = __importStar(__nccwpck_require__(1017));
-const oidc_utils_1 = __nccwpck_require__(8041);
-/**
- * The code to exit an action
- */
-var ExitCode;
-(function (ExitCode) {
- /**
- * A code indicating that the action was successful
- */
- ExitCode[ExitCode["Success"] = 0] = "Success";
- /**
- * A code indicating that the action was a failure
- */
- ExitCode[ExitCode["Failure"] = 1] = "Failure";
-})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
-//-----------------------------------------------------------------------
-// Variables
-//-----------------------------------------------------------------------
+exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
+exports.getProxyUrl = getProxyUrl;
+exports.isHttps = isHttps;
+const http = __importStar(__nccwpck_require__(8611));
+const https = __importStar(__nccwpck_require__(5692));
+const pm = __importStar(__nccwpck_require__(4988));
+const tunnel = __importStar(__nccwpck_require__(770));
+const undici_1 = __nccwpck_require__(6752);
+var HttpCodes;
+(function (HttpCodes) {
+ HttpCodes[HttpCodes["OK"] = 200] = "OK";
+ HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
+ HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
+ HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
+ HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
+ HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
+ HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
+ HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
+ HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
+ HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
+ HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
+ HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
+ HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
+ HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
+ HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
+ HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
+ HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
+ HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
+ HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
+ HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
+ HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
+ HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
+ HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
+ HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
+ HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
+ HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
+ HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
+})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
+var Headers;
+(function (Headers) {
+ Headers["Accept"] = "accept";
+ Headers["ContentType"] = "content-type";
+})(Headers || (exports.Headers = Headers = {}));
+var MediaTypes;
+(function (MediaTypes) {
+ MediaTypes["ApplicationJson"] = "application/json";
+})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
/**
- * Sets env variable for this action and future actions in the job
- * @param name the name of the variable to set
- * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
+ * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
+ * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function exportVariable(name, val) {
- const convertedVal = utils_1.toCommandValue(val);
- process.env[name] = convertedVal;
- const filePath = process.env['GITHUB_ENV'] || '';
- if (filePath) {
- const delimiter = '_GitHubActionsFileCommandDelimeter_';
- const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
- file_command_1.issueCommand('ENV', commandValue);
+function getProxyUrl(serverUrl) {
+ const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
+ return proxyUrl ? proxyUrl.href : '';
+}
+const HttpRedirectCodes = [
+ HttpCodes.MovedPermanently,
+ HttpCodes.ResourceMoved,
+ HttpCodes.SeeOther,
+ HttpCodes.TemporaryRedirect,
+ HttpCodes.PermanentRedirect
+];
+const HttpResponseRetryCodes = [
+ HttpCodes.BadGateway,
+ HttpCodes.ServiceUnavailable,
+ HttpCodes.GatewayTimeout
+];
+const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
+const ExponentialBackoffCeiling = 10;
+const ExponentialBackoffTimeSlice = 5;
+class HttpClientError extends Error {
+ constructor(message, statusCode) {
+ super(message);
+ this.name = 'HttpClientError';
+ this.statusCode = statusCode;
+ Object.setPrototypeOf(this, HttpClientError.prototype);
}
- else {
- command_1.issueCommand('set-env', { name }, convertedVal);
+}
+exports.HttpClientError = HttpClientError;
+class HttpClientResponse {
+ constructor(message) {
+ this.message = message;
+ }
+ readBody() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ let output = Buffer.alloc(0);
+ this.message.on('data', (chunk) => {
+ output = Buffer.concat([output, chunk]);
+ });
+ this.message.on('end', () => {
+ resolve(output.toString());
+ });
+ }));
+ });
+ }
+ readBodyBuffer() {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
+ const chunks = [];
+ this.message.on('data', (chunk) => {
+ chunks.push(chunk);
+ });
+ this.message.on('end', () => {
+ resolve(Buffer.concat(chunks));
+ });
+ }));
+ });
}
}
-exports.exportVariable = exportVariable;
-/**
- * Registers a secret which will get masked from logs
- * @param secret value of the secret
- */
-function setSecret(secret) {
- command_1.issueCommand('add-mask', {}, secret);
+exports.HttpClientResponse = HttpClientResponse;
+function isHttps(requestUrl) {
+ const parsedUrl = new URL(requestUrl);
+ return parsedUrl.protocol === 'https:';
}
-exports.setSecret = setSecret;
-/**
- * Prepends inputPath to the PATH (for this action and future actions)
- * @param inputPath
- */
-function addPath(inputPath) {
- const filePath = process.env['GITHUB_PATH'] || '';
- if (filePath) {
- file_command_1.issueCommand('PATH', inputPath);
+class HttpClient {
+ constructor(userAgent, handlers, requestOptions) {
+ this._ignoreSslError = false;
+ this._allowRedirects = true;
+ this._allowRedirectDowngrade = false;
+ this._maxRedirects = 50;
+ this._allowRetries = false;
+ this._maxRetries = 1;
+ this._keepAlive = false;
+ this._disposed = false;
+ this.userAgent = this._getUserAgentWithOrchestrationId(userAgent);
+ this.handlers = handlers || [];
+ this.requestOptions = requestOptions;
+ if (requestOptions) {
+ if (requestOptions.ignoreSslError != null) {
+ this._ignoreSslError = requestOptions.ignoreSslError;
+ }
+ this._socketTimeout = requestOptions.socketTimeout;
+ if (requestOptions.allowRedirects != null) {
+ this._allowRedirects = requestOptions.allowRedirects;
+ }
+ if (requestOptions.allowRedirectDowngrade != null) {
+ this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
+ }
+ if (requestOptions.maxRedirects != null) {
+ this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
+ }
+ if (requestOptions.keepAlive != null) {
+ this._keepAlive = requestOptions.keepAlive;
+ }
+ if (requestOptions.allowRetries != null) {
+ this._allowRetries = requestOptions.allowRetries;
+ }
+ if (requestOptions.maxRetries != null) {
+ this._maxRetries = requestOptions.maxRetries;
+ }
+ }
}
- else {
- command_1.issueCommand('add-path', {}, inputPath);
+ options(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
+ });
}
- process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
-}
-exports.addPath = addPath;
-/**
- * Gets the value of an input.
- * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
- * Returns an empty string if the value is not defined.
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns string
- */
-function getInput(name, options) {
- const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
- if (options && options.required && !val) {
- throw new Error(`Input required and not supplied: ${name}`);
+ get(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('GET', requestUrl, null, additionalHeaders || {});
+ });
}
- if (options && options.trimWhitespace === false) {
- return val;
+ del(requestUrl, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('DELETE', requestUrl, null, additionalHeaders || {});
+ });
}
- return val.trim();
-}
-exports.getInput = getInput;
-/**
- * Gets the values of an multiline input. Each value is also trimmed.
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns string[]
- *
- */
-function getMultilineInput(name, options) {
- const inputs = getInput(name, options)
- .split('\n')
- .filter(x => x !== '');
- return inputs;
-}
-exports.getMultilineInput = getMultilineInput;
-/**
- * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
- * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
- * The return value is also in boolean type.
- * ref: https://yaml.org/spec/1.2/spec.html#id2804923
- *
- * @param name name of the input to get
- * @param options optional. See InputOptions.
- * @returns boolean
- */
-function getBooleanInput(name, options) {
- const trueValue = ['true', 'True', 'TRUE'];
- const falseValue = ['false', 'False', 'FALSE'];
- const val = getInput(name, options);
- if (trueValue.includes(val))
- return true;
- if (falseValue.includes(val))
- return false;
- throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
- `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
-}
-exports.getBooleanInput = getBooleanInput;
-/**
- * Sets the value of an output.
- *
- * @param name name of the output to set
- * @param value value to store. Non-string values will be converted to a string via JSON.stringify
- */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function setOutput(name, value) {
- process.stdout.write(os.EOL);
- command_1.issueCommand('set-output', { name }, value);
-}
-exports.setOutput = setOutput;
-/**
- * Enables or disables the echoing of commands into stdout for the rest of the step.
- * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
- *
- */
-function setCommandEcho(enabled) {
- command_1.issue('echo', enabled ? 'on' : 'off');
-}
-exports.setCommandEcho = setCommandEcho;
-//-----------------------------------------------------------------------
-// Results
-//-----------------------------------------------------------------------
-/**
- * Sets the action status to failed.
- * When the action exits it will be with an exit code of 1
- * @param message add error issue message
- */
-function setFailed(message) {
- process.exitCode = ExitCode.Failure;
- error(message);
-}
-exports.setFailed = setFailed;
-//-----------------------------------------------------------------------
-// Logging Commands
-//-----------------------------------------------------------------------
-/**
- * Gets whether Actions Step Debug is on or not
- */
-function isDebug() {
- return process.env['RUNNER_DEBUG'] === '1';
-}
-exports.isDebug = isDebug;
-/**
- * Writes debug message to user log
- * @param message debug message
- */
-function debug(message) {
- command_1.issueCommand('debug', {}, message);
-}
-exports.debug = debug;
-/**
- * Adds an error issue
- * @param message error issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function error(message, properties = {}) {
- command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.error = error;
-/**
- * Adds a warning issue
- * @param message warning issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function warning(message, properties = {}) {
- command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.warning = warning;
-/**
- * Adds a notice issue
- * @param message notice issue message. Errors will be converted to string via toString()
- * @param properties optional properties to add to the annotation.
- */
-function notice(message, properties = {}) {
- command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
-}
-exports.notice = notice;
-/**
- * Writes info to log with console.log.
- * @param message info message
- */
-function info(message) {
- process.stdout.write(message + os.EOL);
-}
-exports.info = info;
-/**
- * Begin an output group.
- *
- * Output until the next `groupEnd` will be foldable in this group
- *
- * @param name The name of the output group
- */
-function startGroup(name) {
- command_1.issue('group', name);
-}
-exports.startGroup = startGroup;
-/**
- * End an output group.
- */
-function endGroup() {
- command_1.issue('endgroup');
-}
-exports.endGroup = endGroup;
-/**
- * Wrap an asynchronous function call in a group.
- *
- * Returns the same type as the function itself.
- *
- * @param name The name of the group
- * @param fn The function to wrap in the group
- */
-function group(name, fn) {
- return __awaiter(this, void 0, void 0, function* () {
- startGroup(name);
- let result;
- try {
- result = yield fn();
- }
- finally {
- endGroup();
- }
- return result;
- });
-}
-exports.group = group;
-//-----------------------------------------------------------------------
-// Wrapper action state
-//-----------------------------------------------------------------------
-/**
- * Saves state for current action, the state can only be retrieved by this action's post job execution.
- *
- * @param name name of the state to store
- * @param value value to store. Non-string values will be converted to a string via JSON.stringify
- */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-function saveState(name, value) {
- command_1.issueCommand('save-state', { name }, value);
-}
-exports.saveState = saveState;
-/**
- * Gets the value of an state set by this action's main execution.
- *
- * @param name name of the state to get
- * @returns string
- */
-function getState(name) {
- return process.env[`STATE_${name}`] || '';
-}
-exports.getState = getState;
-function getIDToken(aud) {
- return __awaiter(this, void 0, void 0, function* () {
- return yield oidc_utils_1.OidcClient.getIDToken(aud);
- });
-}
-exports.getIDToken = getIDToken;
-//# sourceMappingURL=core.js.map
-
-/***/ }),
-
-/***/ 717:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-// For internal use, subject to change.
-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
-}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.issueCommand = void 0;
-// We use any as a valid input type
-/* eslint-disable @typescript-eslint/no-explicit-any */
-const fs = __importStar(__nccwpck_require__(7147));
-const os = __importStar(__nccwpck_require__(2037));
-const utils_1 = __nccwpck_require__(5278);
-function issueCommand(command, message) {
- const filePath = process.env[`GITHUB_${command}`];
- if (!filePath) {
- throw new Error(`Unable to find environment variable for file command ${command}`);
- }
- if (!fs.existsSync(filePath)) {
- throw new Error(`Missing file at path: ${filePath}`);
- }
- fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
- encoding: 'utf8'
- });
-}
-exports.issueCommand = issueCommand;
-//# sourceMappingURL=file-command.js.map
-
-/***/ }),
-
-/***/ 8041:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.OidcClient = void 0;
-const http_client_1 = __nccwpck_require__(9925);
-const auth_1 = __nccwpck_require__(3702);
-const core_1 = __nccwpck_require__(2186);
-class OidcClient {
- static createHttpClient(allowRetry = true, maxRetry = 10) {
- const requestOptions = {
- allowRetries: allowRetry,
- maxRetries: maxRetry
- };
- return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
+ post(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('POST', requestUrl, data, additionalHeaders || {});
+ });
}
- static getRequestToken() {
- const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
- if (!token) {
- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
- }
- return token;
+ patch(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('PATCH', requestUrl, data, additionalHeaders || {});
+ });
}
- static getIDTokenUrl() {
- const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
- if (!runtimeUrl) {
- throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
- }
- return runtimeUrl;
+ put(requestUrl, data, additionalHeaders) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return this.request('PUT', requestUrl, data, additionalHeaders || {});
+ });
}
- static getCall(id_token_url) {
- var _a;
+ head(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
- const httpclient = OidcClient.createHttpClient();
- const res = yield httpclient
- .getJson(id_token_url)
- .catch(error => {
- throw new Error(`Failed to get ID Token. \n
- Error Code : ${error.statusCode}\n
- Error Message: ${error.result.message}`);
- });
- const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
- if (!id_token) {
- throw new Error('Response json body do not have ID Token field');
- }
- return id_token;
+ return this.request('HEAD', requestUrl, null, additionalHeaders || {});
});
}
- static getIDToken(audience) {
+ sendStream(verb, requestUrl, stream, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
- try {
- // New ID Token is requested from action service
- let id_token_url = OidcClient.getIDTokenUrl();
- if (audience) {
- const encodedAudience = encodeURIComponent(audience);
- id_token_url = `${id_token_url}&audience=${encodedAudience}`;
- }
- core_1.debug(`ID token url is ${id_token_url}`);
- const id_token = yield OidcClient.getCall(id_token_url);
- core_1.setSecret(id_token);
- return id_token;
- }
- catch (error) {
- throw new Error(`Error message: ${error.message}`);
- }
+ return this.request(verb, requestUrl, stream, additionalHeaders);
});
}
-}
-exports.OidcClient = OidcClient;
-//# sourceMappingURL=oidc-utils.js.map
-
-/***/ }),
-
-/***/ 5278:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// We use any as a valid input type
-/* eslint-disable @typescript-eslint/no-explicit-any */
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.toCommandProperties = exports.toCommandValue = void 0;
-/**
- * Sanitizes an input into a string so it can be passed into issueCommand safely
- * @param input input to sanitize into a string
- */
-function toCommandValue(input) {
- if (input === null || input === undefined) {
- return '';
+ /**
+ * Gets a typed object from an endpoint
+ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
+ */
+ getJson(requestUrl_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ const res = yield this.get(requestUrl, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- else if (typeof input === 'string' || input instanceof String) {
- return input;
+ postJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.post(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- return JSON.stringify(input);
-}
-exports.toCommandValue = toCommandValue;
-/**
- *
- * @param annotationProperties
- * @returns The command properties to send with the actual annotation command
- * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
- */
-function toCommandProperties(annotationProperties) {
- if (!Object.keys(annotationProperties).length) {
- return {};
+ putJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.put(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
+ }
+ patchJson(requestUrl_1, obj_1) {
+ return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
+ const data = JSON.stringify(obj, null, 2);
+ additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
+ additionalHeaders[Headers.ContentType] =
+ this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
+ const res = yield this.patch(requestUrl, data, additionalHeaders);
+ return this._processResponse(res, this.requestOptions);
+ });
}
- return {
- title: annotationProperties.title,
- file: annotationProperties.file,
- line: annotationProperties.startLine,
- endLine: annotationProperties.endLine,
- col: annotationProperties.startColumn,
- endColumn: annotationProperties.endColumn
- };
-}
-exports.toCommandProperties = toCommandProperties;
-//# sourceMappingURL=utils.js.map
-
-/***/ }),
-
-/***/ 4087:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.Context = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const os_1 = __nccwpck_require__(2037);
-class Context {
/**
- * Hydrate the context from the environment
+ * Makes a raw http request.
+ * All other methods such as get, post, patch, and request ultimately call this.
+ * Prefer get, del, post and patch
*/
- constructor() {
- var _a, _b, _c;
- this.payload = {};
- if (process.env.GITHUB_EVENT_PATH) {
- if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
- this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
- }
- else {
- const path = process.env.GITHUB_EVENT_PATH;
- process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
+ request(verb, requestUrl, data, headers) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this._disposed) {
+ throw new Error('Client has already been disposed.');
}
+ const parsedUrl = new URL(requestUrl);
+ let info = this._prepareRequest(verb, parsedUrl, headers);
+ // Only perform retries on reads since writes may not be idempotent.
+ const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
+ ? this._maxRetries + 1
+ : 1;
+ let numTries = 0;
+ let response;
+ do {
+ response = yield this.requestRaw(info, data);
+ // Check if it's an authentication challenge
+ if (response &&
+ response.message &&
+ response.message.statusCode === HttpCodes.Unauthorized) {
+ let authenticationHandler;
+ for (const handler of this.handlers) {
+ if (handler.canHandleAuthentication(response)) {
+ authenticationHandler = handler;
+ break;
+ }
+ }
+ if (authenticationHandler) {
+ return authenticationHandler.handleAuthentication(this, info, data);
+ }
+ else {
+ // We have received an unauthorized response but have no handlers to handle it.
+ // Let the response return to the caller.
+ return response;
+ }
+ }
+ let redirectsRemaining = this._maxRedirects;
+ while (response.message.statusCode &&
+ HttpRedirectCodes.includes(response.message.statusCode) &&
+ this._allowRedirects &&
+ redirectsRemaining > 0) {
+ const redirectUrl = response.message.headers['location'];
+ if (!redirectUrl) {
+ // if there's no location to redirect to, we won't
+ break;
+ }
+ const parsedRedirectUrl = new URL(redirectUrl);
+ if (parsedUrl.protocol === 'https:' &&
+ parsedUrl.protocol !== parsedRedirectUrl.protocol &&
+ !this._allowRedirectDowngrade) {
+ throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
+ }
+ // we need to finish reading the response before reassigning response
+ // which will leak the open socket.
+ yield response.readBody();
+ // strip authorization header if redirected to a different hostname
+ if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
+ for (const header in headers) {
+ // header names are case insensitive
+ if (header.toLowerCase() === 'authorization') {
+ delete headers[header];
+ }
+ }
+ }
+ // let's make the request with the new redirectUrl
+ info = this._prepareRequest(verb, parsedRedirectUrl, headers);
+ response = yield this.requestRaw(info, data);
+ redirectsRemaining--;
+ }
+ if (!response.message.statusCode ||
+ !HttpResponseRetryCodes.includes(response.message.statusCode)) {
+ // If not a retry code, return immediately instead of retrying
+ return response;
+ }
+ numTries += 1;
+ if (numTries < maxTries) {
+ yield response.readBody();
+ yield this._performExponentialBackoff(numTries);
+ }
+ } while (numTries < maxTries);
+ return response;
+ });
+ }
+ /**
+ * Needs to be called if keepAlive is set to true in request options.
+ */
+ dispose() {
+ if (this._agent) {
+ this._agent.destroy();
}
- this.eventName = process.env.GITHUB_EVENT_NAME;
- this.sha = process.env.GITHUB_SHA;
- this.ref = process.env.GITHUB_REF;
- this.workflow = process.env.GITHUB_WORKFLOW;
- this.action = process.env.GITHUB_ACTION;
- this.actor = process.env.GITHUB_ACTOR;
- this.job = process.env.GITHUB_JOB;
- this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
- this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
- this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
- this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
- this.graphqlUrl =
- (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
+ this._disposed = true;
}
- get issue() {
- const payload = this.payload;
- return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
+ /**
+ * Raw request.
+ * @param info
+ * @param data
+ */
+ requestRaw(info, data) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve, reject) => {
+ function callbackForResult(err, res) {
+ if (err) {
+ reject(err);
+ }
+ else if (!res) {
+ // If `err` is not passed, then `res` must be passed.
+ reject(new Error('Unknown error'));
+ }
+ else {
+ resolve(res);
+ }
+ }
+ this.requestRawWithCallback(info, data, callbackForResult);
+ });
+ });
}
- get repo() {
- if (process.env.GITHUB_REPOSITORY) {
- const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
- return { owner, repo };
+ /**
+ * Raw request with callback.
+ * @param info
+ * @param data
+ * @param onResult
+ */
+ requestRawWithCallback(info, data, onResult) {
+ if (typeof data === 'string') {
+ if (!info.options.headers) {
+ info.options.headers = {};
+ }
+ info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
}
- if (this.payload.repository) {
- return {
- owner: this.payload.repository.owner.login,
- repo: this.payload.repository.name
- };
+ let callbackCalled = false;
+ function handleResult(err, res) {
+ if (!callbackCalled) {
+ callbackCalled = true;
+ onResult(err, res);
+ }
+ }
+ const req = info.httpModule.request(info.options, (msg) => {
+ const res = new HttpClientResponse(msg);
+ handleResult(undefined, res);
+ });
+ let socket;
+ req.on('socket', sock => {
+ socket = sock;
+ });
+ // If we ever get disconnected, we want the socket to timeout eventually
+ req.setTimeout(this._socketTimeout || 3 * 60000, () => {
+ if (socket) {
+ socket.end();
+ }
+ handleResult(new Error(`Request timeout: ${info.options.path}`));
+ });
+ req.on('error', function (err) {
+ // err has statusCode property
+ // res should have headers
+ handleResult(err);
+ });
+ if (data && typeof data === 'string') {
+ req.write(data, 'utf8');
+ }
+ if (data && typeof data !== 'string') {
+ data.on('close', function () {
+ req.end();
+ });
+ data.pipe(req);
+ }
+ else {
+ req.end();
}
- throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
}
-}
-exports.Context = Context;
-//# sourceMappingURL=context.js.map
-
-/***/ }),
-
-/***/ 5438:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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]; } };
+ /**
+ * Gets an http agent. This function is useful when you need an http agent that handles
+ * routing through a proxy server - depending upon the url and proxy environment variables.
+ * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
+ */
+ getAgent(serverUrl) {
+ const parsedUrl = new URL(serverUrl);
+ return this._getAgent(parsedUrl);
+ }
+ getAgentDispatcher(serverUrl) {
+ const parsedUrl = new URL(serverUrl);
+ const proxyUrl = pm.getProxyUrl(parsedUrl);
+ const useProxy = proxyUrl && proxyUrl.hostname;
+ if (!useProxy) {
+ return;
+ }
+ return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
+ }
+ _prepareRequest(method, requestUrl, headers) {
+ const info = {};
+ info.parsedUrl = requestUrl;
+ const usingSsl = info.parsedUrl.protocol === 'https:';
+ info.httpModule = usingSsl ? https : http;
+ const defaultPort = usingSsl ? 443 : 80;
+ info.options = {};
+ info.options.host = info.parsedUrl.hostname;
+ info.options.port = info.parsedUrl.port
+ ? parseInt(info.parsedUrl.port)
+ : defaultPort;
+ info.options.path =
+ (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
+ info.options.method = method;
+ info.options.headers = this._mergeHeaders(headers);
+ if (this.userAgent != null) {
+ info.options.headers['user-agent'] = this.userAgent;
+ }
+ info.options.agent = this._getAgent(info.parsedUrl);
+ // gives handlers an opportunity to participate
+ if (this.handlers) {
+ for (const handler of this.handlers) {
+ handler.prepareRequest(info.options);
+ }
+ }
+ return info;
+ }
+ _mergeHeaders(headers) {
+ if (this.requestOptions && this.requestOptions.headers) {
+ return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
+ }
+ return lowercaseKeys(headers || {});
+ }
+ /**
+ * Gets an existing header value or returns a default.
+ * Handles converting number header values to strings since HTTP headers must be strings.
+ * Note: This returns string | string[] since some headers can have multiple values.
+ * For headers that must always be a single string (like Content-Type), use the
+ * specialized _getExistingOrDefaultContentTypeHeader method instead.
+ */
+ _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
+ let clientHeader;
+ if (this.requestOptions && this.requestOptions.headers) {
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[header];
+ if (headerValue) {
+ clientHeader =
+ typeof headerValue === 'number' ? headerValue.toString() : headerValue;
+ }
+ }
+ const additionalValue = additionalHeaders[header];
+ if (additionalValue !== undefined) {
+ return typeof additionalValue === 'number'
+ ? additionalValue.toString()
+ : additionalValue;
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
+ }
+ return _default;
+ }
+ /**
+ * Specialized version of _getExistingOrDefaultHeader for Content-Type header.
+ * Always returns a single string (not an array) since Content-Type should be a single value.
+ * Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
+ * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
+ * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
+ */
+ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {
+ let clientHeader;
+ if (this.requestOptions && this.requestOptions.headers) {
+ const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];
+ if (headerValue) {
+ if (typeof headerValue === 'number') {
+ clientHeader = String(headerValue);
+ }
+ else if (Array.isArray(headerValue)) {
+ clientHeader = headerValue.join(', ');
+ }
+ else {
+ clientHeader = headerValue;
+ }
+ }
+ }
+ const additionalValue = additionalHeaders[Headers.ContentType];
+ // Return the first non-undefined value, converting numbers or arrays to strings if necessary
+ if (additionalValue !== undefined) {
+ if (typeof additionalValue === 'number') {
+ return String(additionalValue);
+ }
+ else if (Array.isArray(additionalValue)) {
+ return additionalValue.join(', ');
+ }
+ else {
+ return additionalValue;
+ }
+ }
+ if (clientHeader !== undefined) {
+ return clientHeader;
+ }
+ return _default;
+ }
+ _getAgent(parsedUrl) {
+ let agent;
+ const proxyUrl = pm.getProxyUrl(parsedUrl);
+ const useProxy = proxyUrl && proxyUrl.hostname;
+ if (this._keepAlive && useProxy) {
+ agent = this._proxyAgent;
+ }
+ if (!useProxy) {
+ agent = this._agent;
+ }
+ // if agent is already assigned use that agent.
+ if (agent) {
+ return agent;
+ }
+ const usingSsl = parsedUrl.protocol === 'https:';
+ let maxSockets = 100;
+ if (this.requestOptions) {
+ maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
+ }
+ // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
+ if (proxyUrl && proxyUrl.hostname) {
+ const agentOptions = {
+ maxSockets,
+ keepAlive: this._keepAlive,
+ proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
+ proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
+ })), { host: proxyUrl.hostname, port: proxyUrl.port })
+ };
+ let tunnelAgent;
+ const overHttps = proxyUrl.protocol === 'https:';
+ if (usingSsl) {
+ tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
+ }
+ else {
+ tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
+ }
+ agent = tunnelAgent(agentOptions);
+ this._proxyAgent = agent;
+ }
+ // if tunneling agent isn't assigned create a new agent
+ if (!agent) {
+ const options = { keepAlive: this._keepAlive, maxSockets };
+ agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
+ this._agent = agent;
+ }
+ if (usingSsl && this._ignoreSslError) {
+ // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
+ // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
+ // we have to cast it to any and change it directly
+ agent.options = Object.assign(agent.options || {}, {
+ rejectUnauthorized: false
+ });
+ }
+ return agent;
+ }
+ _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
+ let proxyAgent;
+ if (this._keepAlive) {
+ proxyAgent = this._proxyAgentDispatcher;
+ }
+ // if agent is already assigned use that agent.
+ if (proxyAgent) {
+ return proxyAgent;
+ }
+ const usingSsl = parsedUrl.protocol === 'https:';
+ proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
+ token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}`
+ })));
+ this._proxyAgentDispatcher = proxyAgent;
+ if (usingSsl && this._ignoreSslError) {
+ // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
+ // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
+ // we have to cast it to any and change it directly
+ proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
+ rejectUnauthorized: false
+ });
+ }
+ return proxyAgent;
+ }
+ _getUserAgentWithOrchestrationId(userAgent) {
+ const baseUserAgent = userAgent || 'actions/http-client';
+ const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
+ if (orchId) {
+ // Sanitize the orchestration ID to ensure it contains only valid characters
+ // Valid characters: 0-9, a-z, _, -, .
+ const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
+ return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`;
+ }
+ return baseUserAgent;
+ }
+ _performExponentialBackoff(retryNumber) {
+ return __awaiter(this, void 0, void 0, function* () {
+ retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
+ const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
+ return new Promise(resolve => setTimeout(() => resolve(), ms));
+ });
+ }
+ _processResponse(res, options) {
+ return __awaiter(this, void 0, void 0, function* () {
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
+ const statusCode = res.message.statusCode || 0;
+ const response = {
+ statusCode,
+ result: null,
+ headers: {}
+ };
+ // not found leads to null obj returned
+ if (statusCode === HttpCodes.NotFound) {
+ resolve(response);
+ }
+ // get the result from the body
+ function dateTimeDeserializer(key, value) {
+ if (typeof value === 'string') {
+ const a = new Date(value);
+ if (!isNaN(a.valueOf())) {
+ return a;
+ }
+ }
+ return value;
+ }
+ let obj;
+ let contents;
+ try {
+ contents = yield res.readBody();
+ if (contents && contents.length > 0) {
+ if (options && options.deserializeDates) {
+ obj = JSON.parse(contents, dateTimeDeserializer);
+ }
+ else {
+ obj = JSON.parse(contents);
+ }
+ response.result = obj;
+ }
+ response.headers = res.message.headers;
+ }
+ catch (err) {
+ // Invalid resource (contents not json); leaving result obj null
+ }
+ // note that 3xx redirects are handled by the http layer.
+ if (statusCode > 299) {
+ let msg;
+ // if exception/error in body, attempt to get better error
+ if (obj && obj.message) {
+ msg = obj.message;
+ }
+ else if (contents && contents.length > 0) {
+ // it may be the case that the exception is in the body message as string
+ msg = contents;
+ }
+ else {
+ msg = `Failed request: (${statusCode})`;
+ }
+ const err = new HttpClientError(msg, statusCode);
+ err.result = response.result;
+ reject(err);
+ }
+ else {
+ resolve(response);
+ }
+ }));
+ });
}
- 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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getOctokit = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const utils_1 = __nccwpck_require__(3030);
-exports.context = new Context.Context();
-/**
- * Returns a hydrated octokit ready to use for GitHub Actions
- *
- * @param token the repo PAT or GITHUB_TOKEN
- * @param options other options to set
- */
-function getOctokit(token, options, ...additionalPlugins) {
- const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
- return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
}
-exports.getOctokit = getOctokit;
-//# sourceMappingURL=github.js.map
+exports.HttpClient = HttpClient;
+const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
+//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 7914:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/***/ 4988:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
-const httpClient = __importStar(__nccwpck_require__(6341));
-const undici_1 = __nccwpck_require__(1773);
-function getAuthString(token, options) {
- if (!token && !options.auth) {
- throw new Error('Parameter token or opts.auth is required');
+exports.getProxyUrl = getProxyUrl;
+exports.checkBypass = checkBypass;
+function getProxyUrl(reqUrl) {
+ const usingSsl = reqUrl.protocol === 'https:';
+ if (checkBypass(reqUrl)) {
+ return undefined;
}
- else if (token && options.auth) {
- throw new Error('Parameters token and opts.auth may not both be specified');
+ const proxyVar = (() => {
+ if (usingSsl) {
+ return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
+ }
+ else {
+ return process.env['http_proxy'] || process.env['HTTP_PROXY'];
+ }
+ })();
+ if (proxyVar) {
+ try {
+ return new DecodedURL(proxyVar);
+ }
+ catch (_a) {
+ if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
+ return new DecodedURL(`http://${proxyVar}`);
+ }
+ }
+ else {
+ return undefined;
}
- return typeof options.auth === 'string' ? options.auth : `token ${token}`;
-}
-exports.getAuthString = getAuthString;
-function getProxyAgent(destinationUrl) {
- const hc = new httpClient.HttpClient();
- return hc.getAgent(destinationUrl);
}
-exports.getProxyAgent = getProxyAgent;
-function getProxyAgentDispatcher(destinationUrl) {
- const hc = new httpClient.HttpClient();
- return hc.getAgentDispatcher(destinationUrl);
+function checkBypass(reqUrl) {
+ if (!reqUrl.hostname) {
+ return false;
+ }
+ const reqHost = reqUrl.hostname;
+ if (isLoopbackAddress(reqHost)) {
+ return true;
+ }
+ const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
+ if (!noProxy) {
+ return false;
+ }
+ // Determine the request port
+ let reqPort;
+ if (reqUrl.port) {
+ reqPort = Number(reqUrl.port);
+ }
+ else if (reqUrl.protocol === 'http:') {
+ reqPort = 80;
+ }
+ else if (reqUrl.protocol === 'https:') {
+ reqPort = 443;
+ }
+ // Format the request hostname and hostname with port
+ const upperReqHosts = [reqUrl.hostname.toUpperCase()];
+ if (typeof reqPort === 'number') {
+ upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
+ }
+ // Compare request host against noproxy
+ for (const upperNoProxyItem of noProxy
+ .split(',')
+ .map(x => x.trim().toUpperCase())
+ .filter(x => x)) {
+ if (upperNoProxyItem === '*' ||
+ upperReqHosts.some(x => x === upperNoProxyItem ||
+ x.endsWith(`.${upperNoProxyItem}`) ||
+ (upperNoProxyItem.startsWith('.') &&
+ x.endsWith(`${upperNoProxyItem}`)))) {
+ return true;
+ }
+ }
+ return false;
}
-exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
-function getProxyFetch(destinationUrl) {
- const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
- const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
- return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
- });
- return proxyFetch;
+function isLoopbackAddress(host) {
+ const hostLower = host.toLowerCase();
+ return (hostLower === 'localhost' ||
+ hostLower.startsWith('127.') ||
+ hostLower.startsWith('[::1]') ||
+ hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
}
-exports.getProxyFetch = getProxyFetch;
-function getApiBaseUrl() {
- return process.env['GITHUB_API_URL'] || 'https://api.github.com';
+class DecodedURL extends URL {
+ constructor(url, base) {
+ super(url, base);
+ this._decodedUsername = decodeURIComponent(super.username);
+ this._decodedPassword = decodeURIComponent(super.password);
+ }
+ get username() {
+ return this._decodedUsername;
+ }
+ get password() {
+ return this._decodedPassword;
+ }
}
-exports.getApiBaseUrl = getApiBaseUrl;
-//# sourceMappingURL=utils.js.map
+//# sourceMappingURL=proxy.js.map
/***/ }),
-/***/ 3030:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/***/ 9234:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
-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;
-};
+/* eslint-disable no-console */
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
-const Context = __importStar(__nccwpck_require__(4087));
-const Utils = __importStar(__nccwpck_require__(7914));
-// octokit + plugins
-const core_1 = __nccwpck_require__(6762);
-const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
-const plugin_paginate_rest_1 = __nccwpck_require__(4193);
-exports.context = new Context.Context();
-const baseUrl = Utils.getApiBaseUrl();
-exports.defaults = {
- baseUrl,
- request: {
- agent: Utils.getProxyAgent(baseUrl),
- fetch: Utils.getProxyFetch(baseUrl)
- }
-};
-exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
+exports.ConsoleLogger = exports.LogLevel = void 0;
/**
- * Convience function to correctly format Octokit Options to pass into the constructor.
- *
- * @param token the repo PAT or GITHUB_TOKEN
- * @param options other options to set
+ * Severity levels for log entries
*/
-function getOctokitOptions(token, options) {
- const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
- // Auth
- const auth = Utils.getAuthString(token, opts);
- if (auth) {
- opts.auth = auth;
+var LogLevel;
+(function (LogLevel) {
+ LogLevel["ERROR"] = "error";
+ LogLevel["WARN"] = "warn";
+ LogLevel["INFO"] = "info";
+ LogLevel["DEBUG"] = "debug";
+})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
+/**
+ * Default logger which logs to stdout and stderr
+ */
+class ConsoleLogger {
+ constructor() {
+ this.level = LogLevel.INFO;
+ this.name = '';
+ }
+ getLevel() {
+ return this.level;
+ }
+ /**
+ * Sets the instance's log level so that only messages which are equal or more severe are output to the console.
+ */
+ setLevel(level) {
+ this.level = level;
+ }
+ /**
+ * Set the instance's name, which will appear on each log line before the message.
+ */
+ setName(name) {
+ this.name = name;
+ }
+ /**
+ * Log a debug message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ debug(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) {
+ console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg);
+ }
+ }
+ /**
+ * Log an info message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ info(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) {
+ console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg);
+ }
+ }
+ /**
+ * Log a warning message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ warn(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) {
+ console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg);
+ }
+ }
+ /**
+ * Log an error message
+ */
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ error(...msg) {
+ if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) {
+ console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg);
+ }
+ }
+ /**
+ * Helper to compare two log levels and determine if a is equal or more severe than b
+ */
+ static isMoreOrEqualSevere(a, b) {
+ return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b];
}
- return opts;
}
-exports.getOctokitOptions = getOctokitOptions;
-//# sourceMappingURL=utils.js.map
+exports.ConsoleLogger = ConsoleLogger;
+/** Map of labels for each log level */
+ConsoleLogger.labels = (() => {
+ const entries = Object.entries(LogLevel);
+ const map = entries.map(([key, value]) => [value, `[${key}] `]);
+ return new Map(map);
+})();
+/** Map of severity as comparable numbers for each log level */
+ConsoleLogger.severity = {
+ [LogLevel.ERROR]: 400,
+ [LogLevel.WARN]: 300,
+ [LogLevel.INFO]: 200,
+ [LogLevel.DEBUG]: 100,
+};
+//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 6341:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+/***/ 4591:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+// This file contains objects documented here: https://docs.slack.dev/reference/block-kit/block-elements
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=block-elements.js.map
+
+/***/ }),
+
+/***/ 1356:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=blocks.js.map
+
+/***/ }),
+
+/***/ 3819:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+// This file contains objects documented here: https://docs.slack.dev/reference/block-kit/composition-objects
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=composition-objects.js.map
+
+/***/ }),
+
+/***/ 4148:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=extensions.js.map
+
+/***/ }),
+
+/***/ 9110:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+// These types represent users in Slack Calls, which is an API for showing 3rd party calls within the Slack client.
+// More information on the API guide for Calls: https://docs.slack.dev/apis/web-api/using-the-calls-api
+// and on User objects for use with Calls: https://docs.slack.dev/apis/web-api/using-the-calls-api
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=calls.js.map
+
+/***/ }),
+
+/***/ 5523:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=dialog.js.map
+
+/***/ }),
+
+/***/ 4854:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=app.js.map
+
+/***/ }),
+
+/***/ 2149:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=assistant.js.map
+
+/***/ }),
+
+/***/ 6077:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=call.js.map
+
+/***/ }),
+
+/***/ 674:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=channel.js.map
+
+/***/ }),
+
+/***/ 3147:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=dnd.js.map
+
+/***/ }),
+
+/***/ 245:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=email.js.map
+
+/***/ }),
+
+/***/ 9679:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=emoji.js.map
+
+/***/ }),
+
+/***/ 9335:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+// NOTE: `file_comment_added` and `file_comment_edited` are left out because they are discontinued
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=file.js.map
+
+/***/ }),
+
+/***/ 365:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=function.js.map
+
+/***/ }),
+
+/***/ 9660:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=grid-migration.js.map
+
+/***/ }),
+
+/***/ 6850:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=group.js.map
+
+/***/ }),
+
+/***/ 7783:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=im.js.map
+
+/***/ }),
+
+/***/ 6954:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+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 }));
+__exportStar(__nccwpck_require__(4854), exports);
+__exportStar(__nccwpck_require__(2149), exports);
+__exportStar(__nccwpck_require__(6077), exports);
+__exportStar(__nccwpck_require__(674), exports);
+__exportStar(__nccwpck_require__(3147), exports);
+__exportStar(__nccwpck_require__(245), exports);
+__exportStar(__nccwpck_require__(9679), exports);
+__exportStar(__nccwpck_require__(9335), exports);
+__exportStar(__nccwpck_require__(365), exports);
+__exportStar(__nccwpck_require__(9660), exports);
+__exportStar(__nccwpck_require__(6850), exports);
+__exportStar(__nccwpck_require__(7783), exports);
+__exportStar(__nccwpck_require__(8324), exports);
+__exportStar(__nccwpck_require__(2199), exports);
+__exportStar(__nccwpck_require__(495), exports);
+__exportStar(__nccwpck_require__(6286), exports);
+__exportStar(__nccwpck_require__(1710), exports);
+__exportStar(__nccwpck_require__(5710), exports);
+__exportStar(__nccwpck_require__(4178), exports);
+__exportStar(__nccwpck_require__(7662), exports);
+__exportStar(__nccwpck_require__(7145), exports);
+__exportStar(__nccwpck_require__(8064), exports);
+__exportStar(__nccwpck_require__(8974), exports);
+__exportStar(__nccwpck_require__(5876), exports);
+__exportStar(__nccwpck_require__(6000), exports);
+__exportStar(__nccwpck_require__(5906), exports);
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 8324:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=invite.js.map
+
+/***/ }),
+
+/***/ 2199:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=link-shared.js.map
+
+/***/ }),
+
+/***/ 495:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=member.js.map
+
+/***/ }),
+
+/***/ 1710:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=message-metadata.js.map
+
+/***/ }),
+
+/***/ 6286:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=message.js.map
+
+/***/ }),
+
+/***/ 5710:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=pin.js.map
+
+/***/ }),
+
+/***/ 4178:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=reaction.js.map
+
+/***/ }),
+
+/***/ 7662:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=shared-channel.js.map
+
+/***/ }),
+
+/***/ 7145:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=star.js.map
+
+/***/ }),
+
+/***/ 8064:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=steps-from-apps.js.map
+
+/***/ }),
+
+/***/ 8974:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=subteam.js.map
+
+/***/ }),
+
+/***/ 5876:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=team.js.map
+
+/***/ }),
+
+/***/ 6000:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=token.js.map
+
+/***/ }),
+
+/***/ 5906:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=user.js.map
+
+/***/ }),
+
+/***/ 4775:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+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 }));
+__exportStar(__nccwpck_require__(4591), exports);
+__exportStar(__nccwpck_require__(1356), exports);
+__exportStar(__nccwpck_require__(3819), exports);
+__exportStar(__nccwpck_require__(4148), exports);
+__exportStar(__nccwpck_require__(9110), exports);
+__exportStar(__nccwpck_require__(5523), exports);
+__exportStar(__nccwpck_require__(6954), exports);
+__exportStar(__nccwpck_require__(5723), exports);
+__exportStar(__nccwpck_require__(9380), exports);
+__exportStar(__nccwpck_require__(7445), exports);
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 5723:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=message-attachments.js.map
+
+/***/ }),
+
+/***/ 9380:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.CustomFieldType = exports.EntityType = void 0;
+var EntityType;
+(function (EntityType) {
+ EntityType["Task"] = "slack#/entities/task";
+ EntityType["File"] = "slack#/entities/file";
+ EntityType["Item"] = "slack#/entities/item";
+ EntityType["Incident"] = "slack#/entities/incident";
+ EntityType["ContentItem"] = "slack#/entities/content_item";
+})(EntityType || (exports.EntityType = EntityType = {}));
+var CustomFieldType;
+(function (CustomFieldType) {
+ CustomFieldType["Integer"] = "integer";
+ CustomFieldType["String"] = "string";
+ CustomFieldType["Array"] = "array";
+ CustomFieldType["Date"] = "slack#/types/date";
+ CustomFieldType["Timestamp"] = "slack#/types/timestamp";
+ CustomFieldType["Image"] = "slack#/types/image";
+ CustomFieldType["ChannelId"] = "slack#/types/channel_id";
+ CustomFieldType["User"] = "slack#/types/user";
+ CustomFieldType["EntityRef"] = "slack#/types/entity_ref";
+ CustomFieldType["Boolean"] = "boolean";
+ CustomFieldType["Link"] = "slack#/types/link";
+ CustomFieldType["Email"] = "slack#/types/email";
+})(CustomFieldType || (exports.CustomFieldType = CustomFieldType = {}));
+//# sourceMappingURL=message-metadata.js.map
+
+/***/ }),
+
+/***/ 7445:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=views.js.map
+
+/***/ }),
+
+/***/ 4048:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
-/* eslint-disable @typescript-eslint/no-explicit-any */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1127,13 +1392,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : 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 __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -1143,6759 +1418,1648 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
+var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+};
+var __asyncValues = (this && this.__asyncValues) || function (o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
+};
+var __rest = (this && this.__rest) || function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
-const http = __importStar(__nccwpck_require__(3685));
-const https = __importStar(__nccwpck_require__(5687));
-const pm = __importStar(__nccwpck_require__(3466));
-const tunnel = __importStar(__nccwpck_require__(4294));
-const undici_1 = __nccwpck_require__(1773);
-var HttpCodes;
-(function (HttpCodes) {
- HttpCodes[HttpCodes["OK"] = 200] = "OK";
- HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
- HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
- HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
- HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
- HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
- HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
- HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
- HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
- HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
- HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
- HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
- HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
- HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
- HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
- HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
- HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
- HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
- HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
- HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
- HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
- HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
- HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
- HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
- HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
- HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
-})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
-var Headers;
-(function (Headers) {
- Headers["Accept"] = "accept";
- Headers["ContentType"] = "content-type";
-})(Headers || (exports.Headers = Headers = {}));
-var MediaTypes;
-(function (MediaTypes) {
- MediaTypes["ApplicationJson"] = "application/json";
-})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
-/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
+exports.WebClient = exports.WebClientEvent = void 0;
+exports.buildThreadTsWarningMessage = buildThreadTsWarningMessage;
+const node_path_1 = __nccwpck_require__(6760);
+const node_querystring_1 = __nccwpck_require__(1792);
+const node_util_1 = __nccwpck_require__(7975);
+const node_zlib_1 = __importDefault(__nccwpck_require__(8522));
+const axios_1 = __importDefault(__nccwpck_require__(7269));
+const form_data_1 = __importDefault(__nccwpck_require__(6454));
+const is_electron_1 = __importDefault(__nccwpck_require__(201));
+const is_stream_1 = __importDefault(__nccwpck_require__(6543));
+const p_queue_1 = __importDefault(__nccwpck_require__(6459));
+const p_retry_1 = __importStar(__nccwpck_require__(2103));
+const chat_stream_1 = __nccwpck_require__(7760);
+const errors_1 = __nccwpck_require__(8486);
+const file_upload_1 = __nccwpck_require__(2577);
+const helpers_1 = __importDefault(__nccwpck_require__(4060));
+const instrument_1 = __nccwpck_require__(9224);
+const logger_1 = __nccwpck_require__(4385);
+const methods_1 = __nccwpck_require__(9339);
+const retry_policies_1 = __nccwpck_require__(1766);
+/*
+ * Helpers
*/
-function getProxyUrl(serverUrl) {
- const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
- return proxyUrl ? proxyUrl.href : '';
-}
-exports.getProxyUrl = getProxyUrl;
-const HttpRedirectCodes = [
- HttpCodes.MovedPermanently,
- HttpCodes.ResourceMoved,
- HttpCodes.SeeOther,
- HttpCodes.TemporaryRedirect,
- HttpCodes.PermanentRedirect
-];
-const HttpResponseRetryCodes = [
- HttpCodes.BadGateway,
- HttpCodes.ServiceUnavailable,
- HttpCodes.GatewayTimeout
+// Props on axios default headers object to ignore when retrieving full list of actual headers sent in any HTTP requests
+const axiosHeaderPropsToIgnore = [
+ 'delete',
+ 'common',
+ 'get',
+ 'put',
+ 'head',
+ 'post',
+ 'link',
+ 'patch',
+ 'purge',
+ 'unlink',
+ 'options',
];
-const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
-const ExponentialBackoffCeiling = 10;
-const ExponentialBackoffTimeSlice = 5;
-class HttpClientError extends Error {
- constructor(message, statusCode) {
- super(message);
- this.name = 'HttpClientError';
- this.statusCode = statusCode;
- Object.setPrototypeOf(this, HttpClientError.prototype);
- }
-}
-exports.HttpClientError = HttpClientError;
-class HttpClientResponse {
- constructor(message) {
- this.message = message;
- }
- readBody() {
- return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
- let output = Buffer.alloc(0);
- this.message.on('data', (chunk) => {
- output = Buffer.concat([output, chunk]);
- });
- this.message.on('end', () => {
- resolve(output.toString());
- });
- }));
- });
- }
- readBodyBuffer() {
- return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
- const chunks = [];
- this.message.on('data', (chunk) => {
- chunks.push(chunk);
- });
- this.message.on('end', () => {
- resolve(Buffer.concat(chunks));
- });
- }));
- });
- }
-}
-exports.HttpClientResponse = HttpClientResponse;
-function isHttps(requestUrl) {
- const parsedUrl = new URL(requestUrl);
- return parsedUrl.protocol === 'https:';
-}
-exports.isHttps = isHttps;
-class HttpClient {
- constructor(userAgent, handlers, requestOptions) {
- this._ignoreSslError = false;
- this._allowRedirects = true;
- this._allowRedirectDowngrade = false;
- this._maxRedirects = 50;
- this._allowRetries = false;
- this._maxRetries = 1;
- this._keepAlive = false;
- this._disposed = false;
- this.userAgent = userAgent;
- this.handlers = handlers || [];
- this.requestOptions = requestOptions;
- if (requestOptions) {
- if (requestOptions.ignoreSslError != null) {
- this._ignoreSslError = requestOptions.ignoreSslError;
- }
- this._socketTimeout = requestOptions.socketTimeout;
- if (requestOptions.allowRedirects != null) {
- this._allowRedirects = requestOptions.allowRedirects;
- }
- if (requestOptions.allowRedirectDowngrade != null) {
- this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
- }
- if (requestOptions.maxRedirects != null) {
- this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
- }
- if (requestOptions.keepAlive != null) {
- this._keepAlive = requestOptions.keepAlive;
- }
- if (requestOptions.allowRetries != null) {
- this._allowRetries = requestOptions.allowRetries;
- }
- if (requestOptions.maxRetries != null) {
- this._maxRetries = requestOptions.maxRetries;
+const defaultFilename = 'Untitled';
+const defaultPageSize = 200;
+const noopPageReducer = () => undefined;
+var WebClientEvent;
+(function (WebClientEvent) {
+ // TODO: safe to rename this to conform to PascalCase enum type naming convention?
+ WebClientEvent["RATE_LIMITED"] = "rate_limited";
+})(WebClientEvent || (exports.WebClientEvent = WebClientEvent = {}));
+/**
+ * A client for Slack's Web API
+ *
+ * This client provides an alias for each {@link https://docs.slack.dev/reference/methods|Web API method}. Each method is
+ * a convenience wrapper for calling the {@link WebClient#apiCall} method using the method name as the first parameter.
+ */
+class WebClient extends methods_1.Methods {
+ /**
+ * @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`)
+ * @param {Object} [webClientOptions] - Configuration options.
+ * @param {Function} [webClientOptions.requestInterceptor] - An interceptor to mutate outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptors}
+ * @param {Function} [webClientOptions.adapter] - An adapter to allow custom handling of requests. Useful if you would like to use a pre-configured http client. See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter}
+ */
+ constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, allowAbsoluteUrls = true, attachOriginalToWebAPIRequestError = true, requestInterceptor = undefined, adapter = undefined, } = {}) {
+ super();
+ this.token = token;
+ this.slackApiUrl = slackApiUrl;
+ if (!this.slackApiUrl.endsWith('/')) {
+ this.slackApiUrl += '/';
+ }
+ this.retryConfig = retryConfig;
+ this.requestQueue = new p_queue_1.default({ concurrency: maxRequestConcurrency });
+ // NOTE: may want to filter the keys to only those acceptable for TLS options
+ this.tlsConfig = tls !== undefined ? tls : {};
+ this.rejectRateLimitedCalls = rejectRateLimitedCalls;
+ this.teamId = teamId;
+ this.allowAbsoluteUrls = allowAbsoluteUrls;
+ this.attachOriginalToWebAPIRequestError = attachOriginalToWebAPIRequestError;
+ // Logging
+ if (typeof logger !== 'undefined') {
+ this.logger = logger;
+ if (typeof logLevel !== 'undefined') {
+ this.logger.debug('The logLevel given to WebClient was ignored as you also gave logger');
}
}
- }
- options(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
- });
- }
- get(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('GET', requestUrl, null, additionalHeaders || {});
- });
- }
- del(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('DELETE', requestUrl, null, additionalHeaders || {});
- });
- }
- post(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('POST', requestUrl, data, additionalHeaders || {});
+ else {
+ this.logger = (0, logger_1.getLogger)(WebClient.loggerName, logLevel !== null && logLevel !== void 0 ? logLevel : logger_1.LogLevel.INFO, logger);
+ }
+ if (this.token && !headers.Authorization)
+ headers.Authorization = `Bearer ${this.token}`;
+ this.axios = axios_1.default.create({
+ adapter: adapter ? (config) => adapter(Object.assign(Object.assign({}, config), { adapter: undefined })) : undefined,
+ timeout,
+ baseURL: this.slackApiUrl,
+ headers: (0, is_electron_1.default)() ? headers : Object.assign({ 'User-Agent': (0, instrument_1.getUserAgent)() }, headers),
+ httpAgent: agent,
+ httpsAgent: agent,
+ validateStatus: () => true, // all HTTP status codes should result in a resolved promise (as opposed to only 2xx)
+ maxRedirects: 0,
+ // disabling axios' automatic proxy support:
+ // axios would read from envvars to configure a proxy automatically, but it doesn't support TLS destinations.
+ // for compatibility with https://api.slack.com, and for a larger set of possible proxies (SOCKS or other
+ // protocols), users of this package should use the `agent` option to configure a proxy.
+ proxy: false,
});
+ // serializeApiCallData will always determine the appropriate content-type
+ this.axios.defaults.headers.post['Content-Type'] = undefined;
+ // request interceptors have reversed execution order
+ // see: https://github.com/axios/axios/blob/v1.x/test/specs/interceptors.spec.js#L88
+ if (requestInterceptor) {
+ this.axios.interceptors.request.use(requestInterceptor, null);
+ }
+ this.axios.interceptors.request.use(this.serializeApiCallData.bind(this), null);
+ this.logger.debug('initialized');
}
- patch(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('PATCH', requestUrl, data, additionalHeaders || {});
+ /**
+ * Generic method for calling a Web API method
+ * @param method - the Web API method to call {@link https://docs.slack.dev/reference/methods}
+ * @param options - options
+ */
+ apiCall(method_1) {
+ return __awaiter(this, arguments, void 0, function* (method, options = {}) {
+ this.logger.debug(`apiCall('${method}') start`);
+ warnDeprecations(method, this.logger);
+ warnIfFallbackIsMissing(method, this.logger, options);
+ warnIfThreadTsIsNotString(method, this.logger, options);
+ if (typeof options === 'string' || typeof options === 'number' || typeof options === 'boolean') {
+ throw new TypeError(`Expected an options argument but instead received a ${typeof options}`);
+ }
+ (0, file_upload_1.warnIfNotUsingFilesUploadV2)(method, this.logger);
+ // @ts-expect-error insufficient overlap between Record and FilesUploadV2Arguments
+ if (method === 'files.uploadV2')
+ return this.filesUploadV2(options);
+ const headers = {};
+ if (options.token)
+ headers.Authorization = `Bearer ${options.token}`;
+ const url = this.deriveRequestUrl(method);
+ const response = yield this.makeRequest(url, Object.assign({ team_id: this.teamId }, options), headers);
+ const result = yield this.buildResult(response);
+ this.logger.debug(`http request result: ${JSON.stringify(result)}`);
+ // log warnings in response metadata
+ if (result.response_metadata !== undefined && result.response_metadata.warnings !== undefined) {
+ result.response_metadata.warnings.forEach(this.logger.warn.bind(this.logger));
+ }
+ // log warnings and errors in response metadata messages
+ // related to https://docs.slack.dev/changelog/2016/09/28/response-metadata-is-on-the-way
+ if (result.response_metadata !== undefined && result.response_metadata.messages !== undefined) {
+ for (const msg of result.response_metadata.messages) {
+ const errReg = /\[ERROR\](.*)/;
+ const warnReg = /\[WARN\](.*)/;
+ if (errReg.test(msg)) {
+ const errMatch = msg.match(errReg);
+ if (errMatch != null) {
+ this.logger.error(errMatch[1].trim());
+ }
+ }
+ else if (warnReg.test(msg)) {
+ const warnMatch = msg.match(warnReg);
+ if (warnMatch != null) {
+ this.logger.warn(warnMatch[1].trim());
+ }
+ }
+ }
+ }
+ // If result's content is gzip, "ok" property is not returned with successful response
+ // TODO: look into simplifying this code block to only check for the second condition
+ // if an { ok: false } body applies for all API errors
+ if (!result.ok && response.headers['content-type'] !== 'application/gzip') {
+ throw (0, errors_1.platformErrorFromResult)(result);
+ }
+ if ('ok' in result && result.ok === false) {
+ throw (0, errors_1.platformErrorFromResult)(result);
+ }
+ this.logger.debug(`apiCall('${method}') end`);
+ return result;
});
}
- put(requestUrl, data, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('PUT', requestUrl, data, additionalHeaders || {});
- });
+ paginate(method, options, shouldStop, reduce) {
+ const pageSize = (() => {
+ if (options !== undefined && typeof options.limit === 'number') {
+ const { limit } = options;
+ options.limit = undefined;
+ return limit;
+ }
+ return defaultPageSize;
+ })();
+ function generatePages() {
+ return __asyncGenerator(this, arguments, function* generatePages_1() {
+ // when result is undefined, that signals that the first of potentially many calls has not yet been made
+ let result;
+ // paginationOptions stores pagination options not already stored in the options argument
+ let paginationOptions = {
+ limit: pageSize,
+ };
+ if (options !== undefined && options.cursor !== undefined) {
+ paginationOptions.cursor = options.cursor;
+ }
+ // NOTE: test for the situation where you're resuming a pagination using and existing cursor
+ while (result === undefined || paginationOptions !== undefined) {
+ result = yield __await(this.apiCall(method, Object.assign(options !== undefined ? options : {}, paginationOptions)));
+ yield yield __await(result);
+ paginationOptions = paginationOptionsForNextPage(result, pageSize);
+ }
+ });
+ }
+ if (shouldStop === undefined) {
+ return generatePages.call(this);
+ }
+ const pageReducer = reduce !== undefined ? reduce : noopPageReducer;
+ let index = 0;
+ return (() => __awaiter(this, void 0, void 0, function* () {
+ // Unroll the first iteration of the iterator
+ // This is done primarily because in order to satisfy the type system, we need a variable that is typed as A
+ // (shown as accumulator before), but before the first iteration all we have is a variable typed A | undefined.
+ // Unrolling the first iteration allows us to deal with undefined as a special case.
+ var _a, e_1, _b, _c;
+ const pageIterator = generatePages.call(this);
+ const firstIteratorResult = yield pageIterator.next(undefined);
+ // Assumption: there will always be at least one result in a paginated API request
+ // if (firstIteratorResult.done) { return; }
+ const firstPage = firstIteratorResult.value;
+ let accumulator = pageReducer(undefined, firstPage, index);
+ index += 1;
+ if (shouldStop(firstPage)) {
+ return accumulator;
+ }
+ try {
+ // Continue iteration
+ for (var _d = true, pageIterator_1 = __asyncValues(pageIterator), pageIterator_1_1; pageIterator_1_1 = yield pageIterator_1.next(), _a = pageIterator_1_1.done, !_a; _d = true) {
+ _c = pageIterator_1_1.value;
+ _d = false;
+ const page = _c;
+ accumulator = pageReducer(accumulator, page, index);
+ if (shouldStop(page)) {
+ return accumulator;
+ }
+ index += 1;
+ }
+ }
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
+ finally {
+ try {
+ if (!_d && !_a && (_b = pageIterator_1.return)) yield _b.call(pageIterator_1);
+ }
+ finally { if (e_1) throw e_1.error; }
+ }
+ return accumulator;
+ }))();
}
- head(requestUrl, additionalHeaders) {
- return __awaiter(this, void 0, void 0, function* () {
- return this.request('HEAD', requestUrl, null, additionalHeaders || {});
- });
+ /**
+ * Stream markdown text into a conversation.
+ *
+ * @description The "chatStream" method starts a new chat stream in a conversation that can be appended to. After appending an entire message, the stream can be stopped with concluding arguments such as "blocks" for gathering feedback.
+ *
+ * The "markdown_text" content is appended to a buffer before being sent to the recipient, with a default buffer size of "256" characters. Setting the "buffer_size" value to a smaller number sends more frequent updates for the same amount of characters, but might reach rate limits more often.
+ *
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello wo",
+ * });
+ * await streamer.append({
+ * markdown_text: "rld!**",
+ * });
+ * await streamer.stop();
+ *
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ chatStream(params) {
+ const { buffer_size } = params, args = __rest(params, ["buffer_size"]);
+ const options = {
+ buffer_size,
+ };
+ return new chat_stream_1.ChatStreamer(this, this.logger, args, options);
}
- sendStream(verb, requestUrl, stream, additionalHeaders) {
+ /**
+ * This wrapper method provides an easy way to upload files using the following endpoints:
+ *
+ * **#1**: For each file submitted with this method, submit filenames
+ * and file metadata to {@link https://docs.slack.dev/reference/methods/files.getuploadurlexternal files.getUploadURLExternal} to request a URL to
+ * which to send the file data to and an id for the file
+ *
+ * **#2**: for each returned file `upload_url`, upload corresponding file to
+ * URLs returned from step 1 (e.g. https://files.slack.com/upload/v1/...\")
+ *
+ * **#3**: Complete uploads {@link https://docs.slack.dev/reference/methods/files.completeuploadexternal files.completeUploadExternal}
+ * @param options
+ */
+ filesUploadV2(options) {
return __awaiter(this, void 0, void 0, function* () {
- return this.request(verb, requestUrl, stream, additionalHeaders);
+ this.logger.debug('files.uploadV2() start');
+ // 1
+ const fileUploads = yield this.getAllFileUploads(options);
+ const fileUploadsURLRes = yield this.fetchAllUploadURLExternal(fileUploads);
+ // set the upload_url and file_id returned from Slack
+ fileUploadsURLRes.forEach((res, idx) => {
+ fileUploads[idx].upload_url = res.upload_url;
+ fileUploads[idx].file_id = res.file_id;
+ });
+ // 2
+ yield this.postFileUploadsToExternalURL(fileUploads, options);
+ // 3
+ const completion = yield this.completeFileUploads(fileUploads);
+ return { ok: true, files: completion };
});
}
/**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
+ * For each file submitted with this method, submits filenames
+ * and file metadata to files.getUploadURLExternal to request a URL to
+ * which to send the file data to and an id for the file
+ * @param fileUploads
*/
- getJson(requestUrl, additionalHeaders = {}) {
+ fetchAllUploadURLExternal(fileUploads) {
return __awaiter(this, void 0, void 0, function* () {
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- const res = yield this.get(requestUrl, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
+ return Promise.all(fileUploads.map((upload) => {
+ const options = {
+ filename: upload.filename,
+ length: upload.length,
+ alt_text: upload.alt_text,
+ snippet_type: upload.snippet_type,
+ };
+ if ('token' in upload) {
+ options.token = upload.token;
+ }
+ return this.files.getUploadURLExternal(options);
+ }));
});
}
- postJson(requestUrl, obj, additionalHeaders = {}) {
+ /**
+ * Complete uploads.
+ * @param fileUploads
+ * @returns
+ */
+ completeFileUploads(fileUploads) {
return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.post(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
+ const toComplete = Object.values((0, file_upload_1.getAllFileUploadsToComplete)(fileUploads));
+ return Promise.all(toComplete.map((job) => this.files.completeUploadExternal(job)));
});
}
- putJson(requestUrl, obj, additionalHeaders = {}) {
+ /**
+ * for each returned file upload URL, upload corresponding file
+ * @param fileUploads
+ * @returns
+ */
+ postFileUploadsToExternalURL(fileUploads, options) {
return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.put(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
+ return Promise.all(fileUploads.map((upload) => __awaiter(this, void 0, void 0, function* () {
+ const { upload_url, file_id, filename, data } = upload;
+ // either file or content will be defined
+ const body = data;
+ // try to post to external url
+ if (upload_url) {
+ const headers = {};
+ if (options.token)
+ headers.Authorization = `Bearer ${options.token}`;
+ const uploadRes = yield this.makeRequest(upload_url, {
+ body,
+ }, headers);
+ if (uploadRes.status !== 200) {
+ return Promise.reject(Error(`Failed to upload file (id:${file_id}, filename: ${filename})`));
+ }
+ const returnData = { ok: true, body: uploadRes.data };
+ return Promise.resolve(returnData);
+ }
+ return Promise.reject(Error(`No upload url found for file (id: ${file_id}, filename: ${filename}`));
+ })));
});
}
- patchJson(requestUrl, obj, additionalHeaders = {}) {
+ /**
+ * @param options All file uploads arguments
+ * @returns An array of file upload entries
+ */
+ getAllFileUploads(options) {
return __awaiter(this, void 0, void 0, function* () {
- const data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- const res = yield this.patch(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
+ let fileUploads = [];
+ // add single file data to uploads if file or content exists at the top level
+ if ('file' in options || 'content' in options) {
+ fileUploads.push(yield (0, file_upload_1.getFileUploadJob)(options, this.logger));
+ }
+ // add multiple files data when file_uploads is supplied
+ if ('file_uploads' in options) {
+ fileUploads = fileUploads.concat(yield (0, file_upload_1.getMultipleFileUploadJobs)(options, this.logger));
+ }
+ return fileUploads;
});
}
/**
- * Makes a raw http request.
- * All other methods such as get, post, patch, and request ultimately call this.
- * Prefer get, del, post and patch
+ * Low-level function to make a single API request. handles queuing, retries, and http-level errors
*/
- request(verb, requestUrl, data, headers) {
- return __awaiter(this, void 0, void 0, function* () {
- if (this._disposed) {
- throw new Error('Client has already been disposed.');
- }
- const parsedUrl = new URL(requestUrl);
- let info = this._prepareRequest(verb, parsedUrl, headers);
- // Only perform retries on reads since writes may not be idempotent.
- const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
- ? this._maxRetries + 1
- : 1;
- let numTries = 0;
- let response;
- do {
- response = yield this.requestRaw(info, data);
- // Check if it's an authentication challenge
- if (response &&
- response.message &&
- response.message.statusCode === HttpCodes.Unauthorized) {
- let authenticationHandler;
- for (const handler of this.handlers) {
- if (handler.canHandleAuthentication(response)) {
- authenticationHandler = handler;
- break;
- }
- }
- if (authenticationHandler) {
- return authenticationHandler.handleAuthentication(this, info, data);
- }
- else {
- // We have received an unauthorized response but have no handlers to handle it.
- // Let the response return to the caller.
- return response;
- }
- }
- let redirectsRemaining = this._maxRedirects;
- while (response.message.statusCode &&
- HttpRedirectCodes.includes(response.message.statusCode) &&
- this._allowRedirects &&
- redirectsRemaining > 0) {
- const redirectUrl = response.message.headers['location'];
- if (!redirectUrl) {
- // if there's no location to redirect to, we won't
- break;
+ makeRequest(url_1, body_1) {
+ return __awaiter(this, arguments, void 0, function* (url, body, headers = {}) {
+ // TODO: better input types - remove any
+ const task = () => this.requestQueue.add(() => __awaiter(this, void 0, void 0, function* () {
+ try {
+ // biome-ignore lint/suspicious/noExplicitAny: TODO: type this
+ const config = Object.assign({ headers }, this.tlsConfig);
+ // admin.analytics.getFile returns a binary response
+ // To be able to parse it, it should be read as an ArrayBuffer
+ if (url.endsWith('admin.analytics.getFile')) {
+ config.responseType = 'arraybuffer';
}
- const parsedRedirectUrl = new URL(redirectUrl);
- if (parsedUrl.protocol === 'https:' &&
- parsedUrl.protocol !== parsedRedirectUrl.protocol &&
- !this._allowRedirectDowngrade) {
- throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
+ // apps.event.authorizations.list will reject HTTP requests that send token in the body
+ // TODO: consider applying this change to all methods - though that will require thorough integration testing
+ if (url.endsWith('apps.event.authorizations.list')) {
+ body.token = undefined;
}
- // we need to finish reading the response before reassigning response
- // which will leak the open socket.
- yield response.readBody();
- // strip authorization header if redirected to a different hostname
- if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
- for (const header in headers) {
- // header names are case insensitive
- if (header.toLowerCase() === 'authorization') {
- delete headers[header];
+ this.logger.debug(`http request url: ${url}`);
+ this.logger.debug(`http request body: ${JSON.stringify(redact(body))}`);
+ // compile all headers - some set by default under the hood by axios - that will be sent along
+ let allHeaders = Object.keys(this.axios.defaults.headers).reduce((acc, cur) => {
+ if (!axiosHeaderPropsToIgnore.includes(cur)) {
+ acc[cur] = this.axios.defaults.headers[cur];
+ }
+ return acc;
+ }, {});
+ allHeaders = Object.assign(Object.assign(Object.assign({}, this.axios.defaults.headers.common), allHeaders), headers);
+ this.logger.debug(`http request headers: ${JSON.stringify(redact(allHeaders))}`);
+ const response = yield this.axios.post(url, body, config);
+ this.logger.debug('http response received');
+ if (response.status === 429) {
+ const retrySec = parseRetryHeaders(response);
+ if (retrySec !== undefined) {
+ this.emit(WebClientEvent.RATE_LIMITED, retrySec, { url, body });
+ if (this.rejectRateLimitedCalls) {
+ throw new p_retry_1.AbortError((0, errors_1.rateLimitedErrorWithDelay)(retrySec));
}
+ this.logger.info(`API Call failed due to rate limiting. Will retry in ${retrySec} seconds.`);
+ // pause the request queue and then delay the rejection by the amount of time in the retry header
+ this.requestQueue.pause();
+ // NOTE: if there was a way to introspect the current RetryOperation and know what the next timeout
+ // would be, then we could subtract that time from the following delay, knowing that it the next
+ // attempt still wouldn't occur until after the rate-limit header has specified. an even better
+ // solution would be to subtract the time from only the timeout of this next attempt of the
+ // RetryOperation. this would result in the staying paused for the entire duration specified in the
+ // header, yet this operation not having to pay the timeout cost in addition to that.
+ yield (0, helpers_1.default)(retrySec * 1000);
+ // resume the request queue and throw a non-abort error to signal a retry
+ this.requestQueue.start();
+ // TODO: We may want to have more detailed info such as team_id, params except tokens, and so on.
+ throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
}
+ // TODO: turn this into some CodedError
+ throw new p_retry_1.AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));
+ }
+ // Slack's Web API doesn't use meaningful status codes besides 429 and 200
+ if (response.status !== 200) {
+ throw (0, errors_1.httpErrorFromResponse)(response);
}
- // let's make the request with the new redirectUrl
- info = this._prepareRequest(verb, parsedRedirectUrl, headers);
- response = yield this.requestRaw(info, data);
- redirectsRemaining--;
- }
- if (!response.message.statusCode ||
- !HttpResponseRetryCodes.includes(response.message.statusCode)) {
- // If not a retry code, return immediately instead of retrying
return response;
}
- numTries += 1;
- if (numTries < maxTries) {
- yield response.readBody();
- yield this._performExponentialBackoff(numTries);
+ catch (error) {
+ // To make this compatible with tsd, casting here instead of `catch (error: any)`
+ // biome-ignore lint/suspicious/noExplicitAny: errors can be anything
+ const e = error;
+ this.logger.warn('http request failed', e.message);
+ if (e.request) {
+ throw (0, errors_1.requestErrorWithOriginal)(e, this.attachOriginalToWebAPIRequestError);
+ }
+ throw error;
}
- } while (numTries < maxTries);
- return response;
+ }));
+ // biome-ignore lint/suspicious/noExplicitAny: http responses can be anything
+ return (0, p_retry_1.default)(task, this.retryConfig);
});
}
/**
- * Needs to be called if keepAlive is set to true in request options.
+ * Get the complete request URL for the provided URL.
+ * @param url - The resource to POST to. Either a Slack API method or absolute URL.
*/
- dispose() {
- if (this._agent) {
- this._agent.destroy();
+ deriveRequestUrl(url) {
+ const isAbsoluteURL = url.startsWith('https://') || url.startsWith('http://');
+ if (isAbsoluteURL && this.allowAbsoluteUrls) {
+ return url;
}
- this._disposed = true;
- }
- /**
- * Raw request.
- * @param info
- * @param data
- */
- requestRaw(info, data) {
- return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve, reject) => {
- function callbackForResult(err, res) {
- if (err) {
- reject(err);
- }
- else if (!res) {
- // If `err` is not passed, then `res` must be passed.
- reject(new Error('Unknown error'));
- }
- else {
- resolve(res);
- }
- }
- this.requestRawWithCallback(info, data, callbackForResult);
- });
- });
+ return `${this.axios.getUri() + url}`;
}
/**
- * Raw request with callback.
- * @param info
- * @param data
- * @param onResult
+ * Transforms options (a simple key-value object) into an acceptable value for a body. This can be either
+ * a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
+ * when the options contain a binary (a stream or a buffer) and the upload should be done with content-type
+ * multipart/form-data.
+ * @param config - The Axios request configuration object
*/
- requestRawWithCallback(info, data, onResult) {
- if (typeof data === 'string') {
- if (!info.options.headers) {
- info.options.headers = {};
+ serializeApiCallData(config) {
+ const { data, headers } = config;
+ // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for
+ // binary content
+ let containsBinaryData = false;
+ // biome-ignore lint/suspicious/noExplicitAny: HTTP request data can be anything
+ const flattened = Object.entries(data).map(([key, value]) => {
+ if (value === undefined || value === null) {
+ return [];
}
- info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
- }
- let callbackCalled = false;
- function handleResult(err, res) {
- if (!callbackCalled) {
- callbackCalled = true;
- onResult(err, res);
+ let serializedValue = value;
+ if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
+ containsBinaryData = true;
}
- }
- const req = info.httpModule.request(info.options, (msg) => {
- const res = new HttpClientResponse(msg);
- handleResult(undefined, res);
- });
- let socket;
- req.on('socket', sock => {
- socket = sock;
- });
- // If we ever get disconnected, we want the socket to timeout eventually
- req.setTimeout(this._socketTimeout || 3 * 60000, () => {
- if (socket) {
- socket.end();
+ else if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {
+ // if value is anything other than string, number, boolean, binary data, a Stream, or a Buffer, then encode it
+ // as a JSON string.
+ serializedValue = JSON.stringify(value);
}
- handleResult(new Error(`Request timeout: ${info.options.path}`));
- });
- req.on('error', function (err) {
- // err has statusCode property
- // res should have headers
- handleResult(err);
+ return [key, serializedValue];
});
- if (data && typeof data === 'string') {
- req.write(data, 'utf8');
- }
- if (data && typeof data !== 'string') {
- data.on('close', function () {
- req.end();
- });
- data.pipe(req);
- }
- else {
- req.end();
- }
- }
- /**
- * Gets an http agent. This function is useful when you need an http agent that handles
- * routing through a proxy server - depending upon the url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
- getAgent(serverUrl) {
- const parsedUrl = new URL(serverUrl);
- return this._getAgent(parsedUrl);
- }
- getAgentDispatcher(serverUrl) {
- const parsedUrl = new URL(serverUrl);
- const proxyUrl = pm.getProxyUrl(parsedUrl);
- const useProxy = proxyUrl && proxyUrl.hostname;
- if (!useProxy) {
- return;
- }
- return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
- }
- _prepareRequest(method, requestUrl, headers) {
- const info = {};
- info.parsedUrl = requestUrl;
- const usingSsl = info.parsedUrl.protocol === 'https:';
- info.httpModule = usingSsl ? https : http;
- const defaultPort = usingSsl ? 443 : 80;
- info.options = {};
- info.options.host = info.parsedUrl.hostname;
- info.options.port = info.parsedUrl.port
- ? parseInt(info.parsedUrl.port)
- : defaultPort;
- info.options.path =
- (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
- info.options.method = method;
- info.options.headers = this._mergeHeaders(headers);
- if (this.userAgent != null) {
- info.options.headers['user-agent'] = this.userAgent;
- }
- info.options.agent = this._getAgent(info.parsedUrl);
- // gives handlers an opportunity to participate
- if (this.handlers) {
- for (const handler of this.handlers) {
- handler.prepareRequest(info.options);
+ // A body with binary content should be serialized as multipart/form-data
+ if (containsBinaryData) {
+ this.logger.debug('Request arguments contain binary data');
+ const form = flattened.reduce((frm, [key, value]) => {
+ if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
+ const opts = {};
+ opts.filename = (() => {
+ // attempt to find filename from `value`. adapted from:
+ // https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230
+ // formidable and the browser add a name property
+ // fs- and request- streams have path property
+ // biome-ignore lint/suspicious/noExplicitAny: form values can be anything
+ const streamOrBuffer = value;
+ if (typeof streamOrBuffer.name === 'string') {
+ return (0, node_path_1.basename)(streamOrBuffer.name);
+ }
+ if (typeof streamOrBuffer.path === 'string') {
+ return (0, node_path_1.basename)(streamOrBuffer.path);
+ }
+ return defaultFilename;
+ })();
+ frm.append(key, value, opts);
+ }
+ else if (key !== undefined && value !== undefined) {
+ frm.append(key, value);
+ }
+ return frm;
+ }, new form_data_1.default());
+ if (headers) {
+ // Copying FormData-generated headers into headers param
+ // not reassigning to headers param since it is passed by reference and behaves as an inout param
+ for (const [header, value] of Object.entries(form.getHeaders())) {
+ headers[header] = value;
+ }
}
+ config.data = form;
+ config.headers = headers;
+ return config;
}
- return info;
- }
- _mergeHeaders(headers) {
- if (this.requestOptions && this.requestOptions.headers) {
- return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
- }
- return lowercaseKeys(headers || {});
- }
- _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
- let clientHeader;
- if (this.requestOptions && this.requestOptions.headers) {
- clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
- }
- return additionalHeaders[header] || clientHeader || _default;
- }
- _getAgent(parsedUrl) {
- let agent;
- const proxyUrl = pm.getProxyUrl(parsedUrl);
- const useProxy = proxyUrl && proxyUrl.hostname;
- if (this._keepAlive && useProxy) {
- agent = this._proxyAgent;
- }
- if (!useProxy) {
- agent = this._agent;
- }
- // if agent is already assigned use that agent.
- if (agent) {
- return agent;
- }
- const usingSsl = parsedUrl.protocol === 'https:';
- let maxSockets = 100;
- if (this.requestOptions) {
- maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
- }
- // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
- if (proxyUrl && proxyUrl.hostname) {
- const agentOptions = {
- maxSockets,
- keepAlive: this._keepAlive,
- proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
- proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
- })), { host: proxyUrl.hostname, port: proxyUrl.port })
- };
- let tunnelAgent;
- const overHttps = proxyUrl.protocol === 'https:';
- if (usingSsl) {
- tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
- }
- else {
- tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
+ // Otherwise, a simple key-value object is returned
+ if (headers)
+ headers['Content-Type'] = 'application/x-www-form-urlencoded';
+ // biome-ignore lint/suspicious/noExplicitAny: form values can be anything
+ const initialValue = {};
+ config.data = (0, node_querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
+ if (key !== undefined && value !== undefined) {
+ accumulator[key] = value;
}
- agent = tunnelAgent(agentOptions);
- this._proxyAgent = agent;
- }
- // if tunneling agent isn't assigned create a new agent
- if (!agent) {
- const options = { keepAlive: this._keepAlive, maxSockets };
- agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
- this._agent = agent;
- }
- if (usingSsl && this._ignoreSslError) {
- // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
- // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
- // we have to cast it to any and change it directly
- agent.options = Object.assign(agent.options || {}, {
- rejectUnauthorized: false
- });
- }
- return agent;
- }
- _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
- let proxyAgent;
- if (this._keepAlive) {
- proxyAgent = this._proxyAgentDispatcher;
- }
- // if agent is already assigned use that agent.
- if (proxyAgent) {
- return proxyAgent;
- }
- const usingSsl = parsedUrl.protocol === 'https:';
- proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
- token: `${proxyUrl.username}:${proxyUrl.password}`
- })));
- this._proxyAgentDispatcher = proxyAgent;
- if (usingSsl && this._ignoreSslError) {
- // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
- // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
- // we have to cast it to any and change it directly
- proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
- rejectUnauthorized: false
- });
- }
- return proxyAgent;
- }
- _performExponentialBackoff(retryNumber) {
- return __awaiter(this, void 0, void 0, function* () {
- retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
- const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
- return new Promise(resolve => setTimeout(() => resolve(), ms));
- });
+ return accumulator;
+ }, initialValue));
+ config.headers = headers;
+ return config;
}
- _processResponse(res, options) {
+ /**
+ * Processes an HTTP response into a WebAPICallResult by performing JSON parsing on the body and merging relevant
+ * HTTP headers into the object.
+ * @param response - an http response
+ */
+ buildResult(response) {
return __awaiter(this, void 0, void 0, function* () {
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
- const statusCode = res.message.statusCode || 0;
- const response = {
- statusCode,
- result: null,
- headers: {}
- };
- // not found leads to null obj returned
- if (statusCode === HttpCodes.NotFound) {
- resolve(response);
- }
- // get the result from the body
- function dateTimeDeserializer(key, value) {
- if (typeof value === 'string') {
- const a = new Date(value);
- if (!isNaN(a.valueOf())) {
- return a;
- }
- }
- return value;
- }
- let obj;
- let contents;
+ let { data } = response;
+ const isGzipResponse = response.headers['content-type'] === 'application/gzip';
+ // Check for GZIP response - if so, it is a successful response from admin.analytics.getFile
+ if (isGzipResponse) {
+ // admin.analytics.getFile will return a Buffer that can be unzipped
try {
- contents = yield res.readBody();
- if (contents && contents.length > 0) {
- if (options && options.deserializeDates) {
- obj = JSON.parse(contents, dateTimeDeserializer);
- }
- else {
- obj = JSON.parse(contents);
+ const unzippedData = yield new Promise((resolve, reject) => {
+ node_zlib_1.default.unzip(data, (err, buf) => {
+ if (err) {
+ return reject(err);
+ }
+ return resolve(buf.toString().split('\n'));
+ });
+ })
+ .then((res) => res)
+ .catch((err) => {
+ throw err;
+ });
+ const fileData = [];
+ if (Array.isArray(unzippedData)) {
+ for (const dataset of unzippedData) {
+ if (dataset && dataset.length > 0) {
+ fileData.push(JSON.parse(dataset));
+ }
}
- response.result = obj;
}
- response.headers = res.message.headers;
+ data = { file_data: fileData };
}
catch (err) {
- // Invalid resource (contents not json); leaving result obj null
+ data = { ok: false, error: err };
}
- // note that 3xx redirects are handled by the http layer.
- if (statusCode > 299) {
- let msg;
- // if exception/error in body, attempt to get better error
- if (obj && obj.message) {
- msg = obj.message;
- }
- else if (contents && contents.length > 0) {
- // it may be the case that the exception is in the body message as string
- msg = contents;
- }
- else {
- msg = `Failed request: (${statusCode})`;
- }
- const err = new HttpClientError(msg, statusCode);
- err.result = response.result;
- reject(err);
+ }
+ else if (!isGzipResponse && response.request.path === '/api/admin.analytics.getFile') {
+ // if it isn't a Gzip response but is from the admin.analytics.getFile request,
+ // decode the ArrayBuffer to JSON read the error
+ data = JSON.parse(new node_util_1.TextDecoder().decode(data));
+ }
+ if (typeof data === 'string') {
+ // response.data can be a string, not an object for some reason
+ try {
+ data = JSON.parse(data);
}
- else {
- resolve(response);
+ catch (_) {
+ // failed to parse the string value as JSON data
+ data = { ok: false, error: data };
}
- }));
+ }
+ if (data.response_metadata === undefined) {
+ data.response_metadata = {};
+ }
+ // add scopes metadata from headers
+ if (response.headers['x-oauth-scopes'] !== undefined) {
+ data.response_metadata.scopes = response.headers['x-oauth-scopes'].trim().split(/\s*,\s*/);
+ }
+ if (response.headers['x-accepted-oauth-scopes'] !== undefined) {
+ data.response_metadata.acceptedScopes = response.headers['x-accepted-oauth-scopes']
+ .trim()
+ .split(/\s*,\s*/);
+ }
+ // add retry metadata from headers
+ const retrySec = parseRetryHeaders(response);
+ if (retrySec !== undefined) {
+ data.response_metadata.retryAfter = retrySec;
+ }
+ return data;
});
}
}
-exports.HttpClient = HttpClient;
-const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 3466:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.checkBypass = exports.getProxyUrl = void 0;
-function getProxyUrl(reqUrl) {
- const usingSsl = reqUrl.protocol === 'https:';
- if (checkBypass(reqUrl)) {
- return undefined;
+exports.WebClient = WebClient;
+/**
+ * The name used to prefix all logging generated from this object
+ */
+WebClient.loggerName = 'WebClient';
+exports["default"] = WebClient;
+/**
+ * Determines an appropriate set of cursor pagination options for the next request to a paginated API method.
+ * @param previousResult - the result of the last request, where the next cursor might be found.
+ * @param pageSize - the maximum number of additional items to fetch in the next request.
+ */
+function paginationOptionsForNextPage(previousResult, pageSize) {
+ if (previousResult !== undefined &&
+ previousResult.response_metadata !== undefined &&
+ previousResult.response_metadata.next_cursor !== undefined &&
+ previousResult.response_metadata.next_cursor !== '') {
+ return {
+ limit: pageSize,
+ cursor: previousResult.response_metadata.next_cursor,
+ };
}
- const proxyVar = (() => {
- if (usingSsl) {
- return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
- }
- else {
- return process.env['http_proxy'] || process.env['HTTP_PROXY'];
- }
- })();
- if (proxyVar) {
- try {
- return new URL(proxyVar);
- }
- catch (_a) {
- if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
- return new URL(`http://${proxyVar}`);
+ return undefined;
+}
+/**
+ * Extract the amount of time (in seconds) the platform has recommended this client wait before sending another request
+ * from a rate-limited HTTP response (statusCode = 429).
+ */
+function parseRetryHeaders(response) {
+ if (response.headers['retry-after'] !== undefined) {
+ const retryAfter = Number.parseInt(response.headers['retry-after'], 10);
+ if (!Number.isNaN(retryAfter)) {
+ return retryAfter;
}
}
- else {
- return undefined;
- }
+ return undefined;
}
-exports.getProxyUrl = getProxyUrl;
-function checkBypass(reqUrl) {
- if (!reqUrl.hostname) {
- return false;
- }
- const reqHost = reqUrl.hostname;
- if (isLoopbackAddress(reqHost)) {
- return true;
- }
- const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
- if (!noProxy) {
- return false;
- }
- // Determine the request port
- let reqPort;
- if (reqUrl.port) {
- reqPort = Number(reqUrl.port);
- }
- else if (reqUrl.protocol === 'http:') {
- reqPort = 80;
- }
- else if (reqUrl.protocol === 'https:') {
- reqPort = 443;
- }
- // Format the request hostname and hostname with port
- const upperReqHosts = [reqUrl.hostname.toUpperCase()];
- if (typeof reqPort === 'number') {
- upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
+/**
+ * Log a warning when using a deprecated method
+ * @param method api method being called
+ * @param logger instance of web clients logger
+ */
+function warnDeprecations(method, logger) {
+ const deprecatedMethods = ['workflows.stepCompleted', 'workflows.stepFailed', 'workflows.updateStep'];
+ const isDeprecated = deprecatedMethods.some((depMethod) => {
+ const re = new RegExp(`^${depMethod}`);
+ return re.test(method);
+ });
+ if (isDeprecated) {
+ logger.warn(`${method} is deprecated. Please check on https://docs.slack.dev/reference/methods for an alternative.`);
}
- // Compare request host against noproxy
- for (const upperNoProxyItem of noProxy
- .split(',')
- .map(x => x.trim().toUpperCase())
- .filter(x => x)) {
- if (upperNoProxyItem === '*' ||
- upperReqHosts.some(x => x === upperNoProxyItem ||
- x.endsWith(`.${upperNoProxyItem}`) ||
- (upperNoProxyItem.startsWith('.') &&
- x.endsWith(`${upperNoProxyItem}`)))) {
- return true;
+}
+/**
+ * Log a warning when using chat.postMessage without text argument or attachments with fallback argument
+ * @param method api method being called
+ * @param logger instance of we clients logger
+ * @param options arguments for the Web API method
+ */
+function warnIfFallbackIsMissing(method, logger, options) {
+ const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage'];
+ const isTargetMethod = targetMethods.includes(method);
+ const hasAttachments = (args) => Array.isArray(args.attachments) && args.attachments.length;
+ const missingAttachmentFallbackDetected = (args) => Array.isArray(args.attachments) &&
+ args.attachments.some((attachment) => !attachment.fallback || attachment.fallback.trim() === '');
+ const isEmptyText = (args) => (args.text === undefined || args.text === null || args.text === '') &&
+ (args.markdown_text === undefined || args.markdown === null || args.markdown_text === '');
+ const buildMissingTextWarning = () => `The top-level \`text\` argument is missing in the request payload for a ${method} call - It's a best practice to always provide a \`text\` argument when posting a message. The \`text\` is used in places where the content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.`;
+ const buildMissingFallbackWarning = () => `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - To avoid this warning, it is recommended to always provide a top-level \`text\` argument when posting a message. Alternatively, you can provide an attachment-level \`fallback\` argument, though this is now considered a legacy field (see https://docs.slack.dev/legacy/legacy-messaging/legacy-secondary-message-attachments for more details).`;
+ if (isTargetMethod && typeof options === 'object') {
+ if (hasAttachments(options)) {
+ if (missingAttachmentFallbackDetected(options) && isEmptyText(options)) {
+ logger.warn(buildMissingTextWarning());
+ logger.warn(buildMissingFallbackWarning());
+ }
+ }
+ else if (isEmptyText(options)) {
+ logger.warn(buildMissingTextWarning());
}
}
- return false;
}
-exports.checkBypass = checkBypass;
-function isLoopbackAddress(host) {
- const hostLower = host.toLowerCase();
- return (hostLower === 'localhost' ||
- hostLower.startsWith('127.') ||
- hostLower.startsWith('[::1]') ||
- hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
+/**
+ * Log a warning when thread_ts is not a string
+ * @param method api method being called
+ * @param logger instance of web clients logger
+ * @param options arguments for the Web API method
+ */
+function warnIfThreadTsIsNotString(method, logger, options) {
+ const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage', 'files.upload'];
+ const isTargetMethod = targetMethods.includes(method);
+ if (isTargetMethod && (options === null || options === void 0 ? void 0 : options.thread_ts) !== undefined && typeof (options === null || options === void 0 ? void 0 : options.thread_ts) !== 'string') {
+ logger.warn(buildThreadTsWarningMessage(method));
+ }
}
-//# sourceMappingURL=proxy.js.map
+function buildThreadTsWarningMessage(method) {
+ return `The given thread_ts value in the request payload for a ${method} call is a float value. We highly recommend using a string value instead.`;
+}
+/**
+ * Takes an object and redacts specific items
+ * @param body
+ * @returns
+ */
+function redact(body) {
+ // biome-ignore lint/suspicious/noExplicitAny: objects can be anything
+ const flattened = Object.entries(body).map(([key, value]) => {
+ // no value provided
+ if (value === undefined || value === null) {
+ return [];
+ }
+ let serializedValue = value;
+ // redact possible tokens
+ if (key.match(/.*token.*/) !== null || key.match(/[Aa]uthorization/)) {
+ serializedValue = '[[REDACTED]]';
+ }
+ // when value is buffer or stream we can avoid logging it
+ if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
+ serializedValue = '[[BINARY VALUE OMITTED]]';
+ }
+ else if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {
+ serializedValue = JSON.stringify(value);
+ }
+ return [key, serializedValue];
+ });
+ // return as object
+ const initialValue = {};
+ return flattened.reduce((accumulator, [key, value]) => {
+ if (key !== undefined && value !== undefined) {
+ accumulator[key] = value;
+ }
+ return accumulator;
+ }, initialValue);
+}
+//# sourceMappingURL=WebClient.js.map
/***/ }),
-/***/ 3702:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 7760:
+/***/ (function(__unused_webpack_module, exports) {
-"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
Object.defineProperty(exports, "__esModule", ({ value: true }));
-class BasicCredentialHandler {
- constructor(username, password) {
- this.username = username;
- this.password = password;
- }
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' +
- Buffer.from(this.username + ':' + this.password).toString('base64');
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
+exports.ChatStreamer = void 0;
+class ChatStreamer {
+ /**
+ * Instantiate a new chat streamer.
+ *
+ * @description The "constructor" method creates a unique {@link ChatStreamer} instance that keeps track of one chat stream.
+ * @example
+ * const client = new WebClient(process.env.SLACK_BOT_TOKEN);
+ * const logger = new ConsoleLogger();
+ * const args = {
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * };
+ * const streamer = new ChatStreamer(client, logger, args, { buffer_size: 512 });
+ * await streamer.append({
+ * markdown_text: "**hello world!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ constructor(client, logger, args, options) {
+ var _a;
+ this.buffer = '';
+ this.client = client;
+ this.logger = logger;
+ this.options = {
+ buffer_size: (_a = options.buffer_size) !== null && _a !== void 0 ? _a : 256,
+ };
+ this.state = 'starting';
+ this.streamArgs = args;
}
-}
-exports.BasicCredentialHandler = BasicCredentialHandler;
-class BearerCredentialHandler {
- constructor(token) {
- this.token = token;
+ /**
+ * Append to the stream.
+ *
+ * @description The "append" method appends to the chat stream being used. This method can be called multiple times. After the stream is stopped this method cannot be called.
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello wo",
+ * });
+ * await streamer.append({
+ * markdown_text: "rld!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream}
+ */
+ append(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.state === 'completed') {
+ throw new Error(`failed to append stream: stream state is ${this.state}`);
+ }
+ if (args.token) {
+ this.token = args.token;
+ }
+ this.buffer += args.markdown_text;
+ if (this.buffer.length >= this.options.buffer_size) {
+ return yield this.flushBuffer(args);
+ }
+ const details = {
+ bufferLength: this.buffer.length,
+ bufferSize: this.options.buffer_size,
+ channel: this.streamArgs.channel,
+ recipientTeamId: this.streamArgs.recipient_team_id,
+ recipientUserId: this.streamArgs.recipient_user_id,
+ threadTs: this.streamArgs.thread_ts,
+ };
+ this.logger.debug(`ChatStreamer appended to buffer: ${JSON.stringify(details)}`);
+ return null;
+ });
}
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] = 'Bearer ' + this.token;
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
- }
-}
-exports.BearerCredentialHandler = BearerCredentialHandler;
-class PersonalAccessTokenCredentialHandler {
- constructor(token) {
- this.token = token;
- }
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
+ /**
+ * Stop the stream and finalize the message.
+ *
+ * @description The "stop" method stops the chat stream being used. This method can be called once to end the stream. Additional "blocks" and "metadata" can be provided.
+ *
+ * @example
+ * const streamer = client.chatStream({
+ * channel: "C0123456789",
+ * thread_ts: "1700000001.123456",
+ * recipient_team_id: "T0123456789",
+ * recipient_user_id: "U0123456789",
+ * });
+ * await streamer.append({
+ * markdown_text: "**hello world!**",
+ * });
+ * await streamer.stop();
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream}
+ */
+ stop(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (this.state === 'completed') {
+ throw new Error(`failed to stop stream: stream state is ${this.state}`);
+ }
+ if (args === null || args === void 0 ? void 0 : args.token) {
+ this.token = args.token;
+ }
+ if (args === null || args === void 0 ? void 0 : args.markdown_text) {
+ this.buffer += args.markdown_text;
+ }
+ if (!this.streamTs) {
+ const response = yield this.client.chat.startStream(Object.assign(Object.assign({}, this.streamArgs), { token: this.token }));
+ if (!response.ts) {
+ throw new Error('failed to stop stream: stream not started');
+ }
+ this.streamTs = response.ts;
+ this.state = 'in_progress';
+ }
+ const response = yield this.client.chat.stopStream(Object.assign(Object.assign({ token: this.token, channel: this.streamArgs.channel, ts: this.streamTs }, args), { markdown_text: this.buffer }));
+ this.state = 'completed';
+ return response;
+ });
}
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
+ flushBuffer(args) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (!this.streamTs) {
+ const response = yield this.client.chat.startStream(Object.assign(Object.assign(Object.assign(Object.assign({}, this.streamArgs), { token: this.token }), args), { markdown_text: this.buffer }));
+ this.buffer = '';
+ this.streamTs = response.ts;
+ this.state = 'in_progress';
+ return response;
+ }
+ const response = yield this.client.chat.appendStream(Object.assign(Object.assign({ token: this.token, channel: this.streamArgs.channel, ts: this.streamTs }, args), { markdown_text: this.buffer }));
+ this.buffer = '';
+ return response;
+ });
}
}
-exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
-
+exports.ChatStreamer = ChatStreamer;
+//# sourceMappingURL=chat-stream.js.map
/***/ }),
-/***/ 9925:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 8486:
+/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-const http = __nccwpck_require__(3685);
-const https = __nccwpck_require__(5687);
-const pm = __nccwpck_require__(6443);
-let tunnel;
-var HttpCodes;
-(function (HttpCodes) {
- HttpCodes[HttpCodes["OK"] = 200] = "OK";
- HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
- HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
- HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
- HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
- HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
- HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
- HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
- HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
- HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
- HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
- HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
- HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
- HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
- HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
- HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
- HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
- HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
- HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
- HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
- HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
- HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
- HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
- HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
- HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
- HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
-})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
-var Headers;
-(function (Headers) {
- Headers["Accept"] = "accept";
- Headers["ContentType"] = "content-type";
-})(Headers = exports.Headers || (exports.Headers = {}));
-var MediaTypes;
-(function (MediaTypes) {
- MediaTypes["ApplicationJson"] = "application/json";
-})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
+exports.ErrorCode = void 0;
+exports.errorWithCode = errorWithCode;
+exports.requestErrorWithOriginal = requestErrorWithOriginal;
+exports.httpErrorFromResponse = httpErrorFromResponse;
+exports.platformErrorFromResult = platformErrorFromResult;
+exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay;
/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
+ * A dictionary of codes for errors produced by this package
*/
-function getProxyUrl(serverUrl) {
- let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
- return proxyUrl ? proxyUrl.href : '';
+var ErrorCode;
+(function (ErrorCode) {
+ // general error
+ ErrorCode["RequestError"] = "slack_webapi_request_error";
+ ErrorCode["HTTPError"] = "slack_webapi_http_error";
+ ErrorCode["PlatformError"] = "slack_webapi_platform_error";
+ ErrorCode["RateLimitedError"] = "slack_webapi_rate_limited_error";
+ // file uploads errors
+ ErrorCode["FileUploadInvalidArgumentsError"] = "slack_webapi_file_upload_invalid_args_error";
+ ErrorCode["FileUploadReadFileDataError"] = "slack_webapi_file_upload_read_file_data_error";
+})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
+/**
+ * Factory for producing a {@link CodedError} from a generic error
+ */
+function errorWithCode(error, code) {
+ // NOTE: might be able to return something more specific than a CodedError with conditional typing
+ const codedError = error;
+ codedError.code = code;
+ return codedError;
}
-exports.getProxyUrl = getProxyUrl;
-const HttpRedirectCodes = [
- HttpCodes.MovedPermanently,
- HttpCodes.ResourceMoved,
- HttpCodes.SeeOther,
- HttpCodes.TemporaryRedirect,
- HttpCodes.PermanentRedirect
-];
-const HttpResponseRetryCodes = [
- HttpCodes.BadGateway,
- HttpCodes.ServiceUnavailable,
- HttpCodes.GatewayTimeout
-];
-const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
-const ExponentialBackoffCeiling = 10;
-const ExponentialBackoffTimeSlice = 5;
-class HttpClientError extends Error {
- constructor(message, statusCode) {
- super(message);
- this.name = 'HttpClientError';
- this.statusCode = statusCode;
- Object.setPrototypeOf(this, HttpClientError.prototype);
+/**
+ * A factory to create WebAPIRequestError objects
+ * @param original - original error
+ * @param attachOriginal - config indicating if 'original' property should be added on the error object
+ */
+function requestErrorWithOriginal(original, attachOriginal) {
+ const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError);
+ if (attachOriginal) {
+ error.original = original;
}
+ return error;
}
-exports.HttpClientError = HttpClientError;
-class HttpClientResponse {
- constructor(message) {
- this.message = message;
- }
- readBody() {
- return new Promise(async (resolve, reject) => {
- let output = Buffer.alloc(0);
- this.message.on('data', (chunk) => {
- output = Buffer.concat([output, chunk]);
- });
- this.message.on('end', () => {
- resolve(output.toString());
- });
- });
+/**
+ * A factory to create WebAPIHTTPError objects
+ * @param response - original error
+ */
+function httpErrorFromResponse(response) {
+ const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${response.status}`), ErrorCode.HTTPError);
+ error.statusCode = response.status;
+ error.statusMessage = response.statusText;
+ const nonNullHeaders = {};
+ for (const k of Object.keys(response.headers)) {
+ if (k && response.headers[k]) {
+ nonNullHeaders[k] = response.headers[k];
+ }
}
+ error.headers = nonNullHeaders;
+ error.body = response.data;
+ return error;
}
-exports.HttpClientResponse = HttpClientResponse;
-function isHttps(requestUrl) {
- let parsedUrl = new URL(requestUrl);
- return parsedUrl.protocol === 'https:';
+/**
+ * A factory to create WebAPIPlatformError objects
+ * @param result - Web API call result
+ */
+function platformErrorFromResult(result) {
+ const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError);
+ error.data = result;
+ return error;
}
-exports.isHttps = isHttps;
-class HttpClient {
- constructor(userAgent, handlers, requestOptions) {
- this._ignoreSslError = false;
- this._allowRedirects = true;
- this._allowRedirectDowngrade = false;
- this._maxRedirects = 50;
- this._allowRetries = false;
- this._maxRetries = 1;
- this._keepAlive = false;
- this._disposed = false;
- this.userAgent = userAgent;
- this.handlers = handlers || [];
- this.requestOptions = requestOptions;
- if (requestOptions) {
- if (requestOptions.ignoreSslError != null) {
- this._ignoreSslError = requestOptions.ignoreSslError;
- }
- this._socketTimeout = requestOptions.socketTimeout;
- if (requestOptions.allowRedirects != null) {
- this._allowRedirects = requestOptions.allowRedirects;
- }
- if (requestOptions.allowRedirectDowngrade != null) {
- this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
- }
- if (requestOptions.maxRedirects != null) {
- this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
- }
- if (requestOptions.keepAlive != null) {
- this._keepAlive = requestOptions.keepAlive;
- }
- if (requestOptions.allowRetries != null) {
- this._allowRetries = requestOptions.allowRetries;
- }
- if (requestOptions.maxRetries != null) {
- this._maxRetries = requestOptions.maxRetries;
- }
+/**
+ * A factory to create WebAPIRateLimitedError objects
+ * @param retrySec - Number of seconds that the request can be retried in
+ */
+function rateLimitedErrorWithDelay(retrySec) {
+ const error = errorWithCode(new Error(`A rate-limit has been reached, you may retry this request in ${retrySec} seconds`), ErrorCode.RateLimitedError);
+ error.retryAfter = retrySec;
+ return error;
+}
+//# sourceMappingURL=errors.js.map
+
+/***/ }),
+
+/***/ 2577:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.getFileUploadJob = getFileUploadJob;
+exports.getMultipleFileUploadJobs = getMultipleFileUploadJobs;
+exports.getFileData = getFileData;
+exports.getFileDataLength = getFileDataLength;
+exports.getFileDataAsStream = getFileDataAsStream;
+exports.getAllFileUploadsToComplete = getAllFileUploadsToComplete;
+exports.warnIfNotUsingFilesUploadV2 = warnIfNotUsingFilesUploadV2;
+exports.warnIfChannels = warnIfChannels;
+exports.errorIfChannelsCsv = errorIfChannelsCsv;
+exports.errorIfInvalidOrMissingFileData = errorIfInvalidOrMissingFileData;
+exports.warnIfMissingOrInvalidFileNameAndDefault = warnIfMissingOrInvalidFileNameAndDefault;
+exports.warnIfLegacyFileType = warnIfLegacyFileType;
+exports.buildMissingFileIdError = buildMissingFileIdError;
+exports.buildFileSizeErrorMsg = buildFileSizeErrorMsg;
+exports.buildLegacyFileTypeWarning = buildLegacyFileTypeWarning;
+exports.buildMissingFileNameWarning = buildMissingFileNameWarning;
+exports.buildMissingExtensionWarning = buildMissingExtensionWarning;
+exports.buildLegacyMethodWarning = buildLegacyMethodWarning;
+exports.buildGeneralFilesUploadWarning = buildGeneralFilesUploadWarning;
+exports.buildFilesUploadMissingMessage = buildFilesUploadMissingMessage;
+exports.buildChannelsWarning = buildChannelsWarning;
+exports.buildMultipleChannelsErrorMsg = buildMultipleChannelsErrorMsg;
+exports.buildInvalidFilesUploadParamError = buildInvalidFilesUploadParamError;
+const node_fs_1 = __nccwpck_require__(3024);
+const node_stream_1 = __nccwpck_require__(7075);
+const errors_1 = __nccwpck_require__(8486);
+function getFileUploadJob(options, logger) {
+ return __awaiter(this, void 0, void 0, function* () {
+ var _a, _b, _c, _d;
+ // Validate parameters
+ warnIfLegacyFileType(options, logger);
+ warnIfChannels(options, logger);
+ errorIfChannelsCsv(options);
+ const fileName = warnIfMissingOrInvalidFileNameAndDefault(options, logger);
+ const fileData = yield getFileData(options);
+ const fileDataBytesLength = getFileDataLength(fileData);
+ const fileUploadJob = {
+ // supplied by user
+ alt_text: options.alt_text,
+ blocks: options.blocks,
+ channel_id: (_a = options.channels) !== null && _a !== void 0 ? _a : options.channel_id,
+ filename: (_b = options.filename) !== null && _b !== void 0 ? _b : fileName,
+ initial_comment: options.initial_comment,
+ snippet_type: options.snippet_type,
+ title: (_d = (_c = options.title) !== null && _c !== void 0 ? _c : options.filename) !== null && _d !== void 0 ? _d : fileName, // default title to filename unless otherwise specified
+ // calculated
+ data: fileData,
+ length: fileDataBytesLength,
+ };
+ if ('thread_ts' in options) {
+ fileUploadJob.thread_ts = options.thread_ts;
}
- }
- options(requestUrl, additionalHeaders) {
- return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
- }
- get(requestUrl, additionalHeaders) {
- return this.request('GET', requestUrl, null, additionalHeaders || {});
- }
- del(requestUrl, additionalHeaders) {
- return this.request('DELETE', requestUrl, null, additionalHeaders || {});
- }
- post(requestUrl, data, additionalHeaders) {
- return this.request('POST', requestUrl, data, additionalHeaders || {});
- }
- patch(requestUrl, data, additionalHeaders) {
- return this.request('PATCH', requestUrl, data, additionalHeaders || {});
- }
- put(requestUrl, data, additionalHeaders) {
- return this.request('PUT', requestUrl, data, additionalHeaders || {});
- }
- head(requestUrl, additionalHeaders) {
- return this.request('HEAD', requestUrl, null, additionalHeaders || {});
- }
- sendStream(verb, requestUrl, stream, additionalHeaders) {
- return this.request(verb, requestUrl, stream, additionalHeaders);
- }
- /**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
- */
- async getJson(requestUrl, additionalHeaders = {}) {
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- let res = await this.get(requestUrl, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async postJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.post(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async putJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.put(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async patchJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.patch(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- /**
- * Makes a raw http request.
- * All other methods such as get, post, patch, and request ultimately call this.
- * Prefer get, del, post and patch
- */
- async request(verb, requestUrl, data, headers) {
- if (this._disposed) {
- throw new Error('Client has already been disposed.');
- }
- let parsedUrl = new URL(requestUrl);
- let info = this._prepareRequest(verb, parsedUrl, headers);
- // Only perform retries on reads since writes may not be idempotent.
- let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
- ? this._maxRetries + 1
- : 1;
- let numTries = 0;
- let response;
- while (numTries < maxTries) {
- response = await this.requestRaw(info, data);
- // Check if it's an authentication challenge
- if (response &&
- response.message &&
- response.message.statusCode === HttpCodes.Unauthorized) {
- let authenticationHandler;
- for (let i = 0; i < this.handlers.length; i++) {
- if (this.handlers[i].canHandleAuthentication(response)) {
- authenticationHandler = this.handlers[i];
- break;
- }
+ if ('token' in options) {
+ fileUploadJob.token = options.token;
+ }
+ if ('content' in options) {
+ return Object.assign({ content: options.content }, fileUploadJob);
+ }
+ if ('file' in options) {
+ return Object.assign({ file: options.file }, fileUploadJob);
+ }
+ throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You must supply one'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
+ });
+}
+/**
+ * Returns an array of files upload entries when `file_uploads` is supplied.
+ * **Note**
+ * file_uploads should be set when multiple files are intended to be attached to a
+ * single message. To support this, we handle options supplied with
+ * top level `initial_comment`, `thread_ts`, `channel_id` and `file_uploads` parameters.
+ * ```javascript
+ * const res = await client.files.uploadV2({
+ * initial_comment: 'Here are the files!',
+ * thread_ts: '1223313423434.131321',
+ * channel_id: 'C12345',
+ * file_uploads: [
+ * {
+ * file: './test/fixtures/test-txt.txt',
+ * filename: 'test-txt.txt',
+ * },
+ * {
+ * file: './test/fixtures/test-png.png',
+ * filename: 'test-png.png',
+ * },
+ * ],
+ * });
+ * ```
+ * @param options provided by user
+ */
+function getMultipleFileUploadJobs(options, logger) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if ('file_uploads' in options) {
+ // go through each file_upload and create a job for it
+ return Promise.all(options.file_uploads.map((upload) => {
+ // ensure no omitted properties included in files_upload entry
+ // these properties are valid only at the top-level, not
+ // inside file_uploads.
+ const { blocks, channel_id, channels, initial_comment, thread_ts } = upload;
+ if (blocks || channel_id || channels || initial_comment || thread_ts) {
+ throw (0, errors_1.errorWithCode)(new Error(buildInvalidFilesUploadParamError()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- if (authenticationHandler) {
- return authenticationHandler.handleAuthentication(this, info, data);
+ // takes any channel_id, initial_comment and thread_ts
+ // supplied at the top level.
+ const uploadJobArgs = Object.assign(Object.assign({}, upload), { blocks: options.blocks, channels: options.channels, channel_id: options.channel_id, initial_comment: options.initial_comment });
+ if ('thread_ts' in options) {
+ uploadJobArgs.thread_ts = options.thread_ts;
}
- else {
- // We have received an unauthorized response but have no handlers to handle it.
- // Let the response return to the caller.
- return response;
+ if ('token' in options) {
+ uploadJobArgs.token = options.token;
}
- }
- let redirectsRemaining = this._maxRedirects;
- while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
- this._allowRedirects &&
- redirectsRemaining > 0) {
- const redirectUrl = response.message.headers['location'];
- if (!redirectUrl) {
- // if there's no location to redirect to, we won't
- break;
+ if ('content' in upload) {
+ return getFileUploadJob(Object.assign({ content: upload.content }, uploadJobArgs), logger);
}
- let parsedRedirectUrl = new URL(redirectUrl);
- if (parsedUrl.protocol == 'https:' &&
- parsedUrl.protocol != parsedRedirectUrl.protocol &&
- !this._allowRedirectDowngrade) {
- throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
+ if ('file' in upload) {
+ return getFileUploadJob(Object.assign({ file: upload.file }, uploadJobArgs), logger);
}
- // we need to finish reading the response before reassigning response
- // which will leak the open socket.
- await response.readBody();
- // strip authorization header if redirected to a different hostname
- if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
- for (let header in headers) {
- // header names are case insensitive
- if (header.toLowerCase() === 'authorization') {
- delete headers[header];
- }
- }
+ throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You must supply one'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
+ }));
+ }
+ throw new Error(buildFilesUploadMissingMessage());
+ });
+}
+// Helpers to build the FileUploadJob
+/**
+ * Returns a single file upload's data
+ * @param options
+ * @returns Binary data representation of file
+ */
+function getFileData(options) {
+ return __awaiter(this, void 0, void 0, function* () {
+ errorIfInvalidOrMissingFileData(options);
+ if ('file' in options) {
+ const { file } = options;
+ // try to handle as buffer
+ if (Buffer.isBuffer(file))
+ return file;
+ // try to handle as filepath
+ if (typeof file === 'string') {
+ // try to read file as if the string was a file path
+ try {
+ const dataBuffer = (0, node_fs_1.readFileSync)(file);
+ return dataBuffer;
+ }
+ catch (_err) {
+ throw (0, errors_1.errorWithCode)(new Error(`Unable to resolve file data for ${file}. Please supply a filepath string, or binary data Buffer or String directly.`), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- // let's make the request with the new redirectUrl
- info = this._prepareRequest(verb, parsedRedirectUrl, headers);
- response = await this.requestRaw(info, data);
- redirectsRemaining--;
- }
- if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
- // If not a retry code, return immediately instead of retrying
- return response;
- }
- numTries += 1;
- if (numTries < maxTries) {
- await response.readBody();
- await this._performExponentialBackoff(numTries);
}
+ // try to handle as Readable
+ const data = yield getFileDataAsStream(file);
+ if (data)
+ return data;
}
- return response;
- }
- /**
- * Needs to be called if keepAlive is set to true in request options.
- */
- dispose() {
- if (this._agent) {
- this._agent.destroy();
- }
- this._disposed = true;
+ if ('content' in options)
+ return Buffer.from(options.content);
+ // general catch-all error
+ throw (0, errors_1.errorWithCode)(new Error('There was an issue getting the file data for the file or content supplied'), errors_1.ErrorCode.FileUploadReadFileDataError);
+ });
+}
+function getFileDataLength(data) {
+ if (data) {
+ return Buffer.byteLength(data, 'utf8');
}
- /**
- * Raw request.
- * @param info
- * @param data
- */
- requestRaw(info, data) {
+ throw (0, errors_1.errorWithCode)(new Error(buildFileSizeErrorMsg()), errors_1.ErrorCode.FileUploadReadFileDataError);
+}
+function getFileDataAsStream(readable) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const chunks = [];
return new Promise((resolve, reject) => {
- let callbackForResult = function (err, res) {
- if (err) {
- reject(err);
+ readable.on('readable', () => {
+ let chunk = readable.read();
+ while (chunk !== null) {
+ chunks.push(chunk);
+ chunk = readable.read();
}
- resolve(res);
- };
- this.requestRawWithCallback(info, data, callbackForResult);
+ });
+ readable.on('end', () => {
+ if (chunks.length > 0) {
+ const content = Buffer.concat(chunks);
+ resolve(content);
+ }
+ else {
+ reject(Error('No data in supplied file'));
+ }
+ });
});
- }
- /**
- * Raw request with callback.
- * @param info
- * @param data
- * @param onResult
- */
- requestRawWithCallback(info, data, onResult) {
- let socket;
- if (typeof data === 'string') {
- info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
- }
- let callbackCalled = false;
- let handleResult = (err, res) => {
- if (!callbackCalled) {
- callbackCalled = true;
- onResult(err, res);
+ });
+}
+/**
+ * Filters through all fileUploads and groups them into jobs for completion
+ * based on combination of channel_id, thread_ts, initial_comment, blocks.
+ * {@link https://docs.slack.dev/reference/methods/files.completeUploadExternal files.completeUploadExternal} allows for multiple
+ * files to be uploaded with a message (`initial_comment`), and as a threaded message (`thread_ts`)
+ * In order to be grouped together, file uploads must have like properties.
+ * @param fileUploads
+ * @returns
+ */
+function getAllFileUploadsToComplete(fileUploads) {
+ const toComplete = {};
+ for (const upload of fileUploads) {
+ const { blocks, channel_id, thread_ts, initial_comment, file_id, title } = upload;
+ if (file_id) {
+ const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}:::${JSON.stringify(blocks)}`;
+ // biome-ignore lint/suspicious/noPrototypeBuiltins: TODO use hasOwn instead of hasOwnProperty
+ if (!Object.prototype.hasOwnProperty.call(toComplete, compareString)) {
+ toComplete[compareString] = {
+ files: [{ id: file_id, title }],
+ channel_id,
+ blocks,
+ initial_comment,
+ };
+ if (thread_ts && channel_id) {
+ const fileThreadDestinationArgument = {
+ channel_id,
+ thread_ts,
+ };
+ toComplete[compareString] = Object.assign(Object.assign({}, toComplete[compareString]), fileThreadDestinationArgument);
+ }
+ if ('token' in upload) {
+ toComplete[compareString].token = upload.token;
+ }
}
- };
- let req = info.httpModule.request(info.options, (msg) => {
- let res = new HttpClientResponse(msg);
- handleResult(null, res);
- });
- req.on('socket', sock => {
- socket = sock;
- });
- // If we ever get disconnected, we want the socket to timeout eventually
- req.setTimeout(this._socketTimeout || 3 * 60000, () => {
- if (socket) {
- socket.end();
+ else {
+ toComplete[compareString].files.push({
+ id: file_id,
+ title,
+ });
}
- handleResult(new Error('Request timeout: ' + info.options.path), null);
- });
- req.on('error', function (err) {
- // err has statusCode property
- // res should have headers
- handleResult(err, null);
- });
- if (data && typeof data === 'string') {
- req.write(data, 'utf8');
- }
- if (data && typeof data !== 'string') {
- data.on('close', function () {
- req.end();
- });
- data.pipe(req);
}
else {
- req.end();
+ throw new Error(buildMissingFileIdError());
}
}
- /**
- * Gets an http agent. This function is useful when you need an http agent that handles
- * routing through a proxy server - depending upon the url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
- getAgent(serverUrl) {
- let parsedUrl = new URL(serverUrl);
- return this._getAgent(parsedUrl);
+ return toComplete;
+}
+// Validation
+/**
+ * Advise to use the files.uploadV2 method over legacy files.upload method and over
+ * lower-level utilities.
+ * @param method
+ * @param logger
+ */
+function warnIfNotUsingFilesUploadV2(method, logger) {
+ const targetMethods = ['files.upload'];
+ const isTargetMethod = targetMethods.includes(method);
+ if (method === 'files.upload')
+ logger.warn(buildLegacyMethodWarning(method));
+ if (isTargetMethod)
+ logger.info(buildGeneralFilesUploadWarning());
+}
+/**
+ * `channels` param is supported but only when a single channel is specified.
+ * @param options
+ * @param logger
+ */
+function warnIfChannels(options, logger) {
+ if (options.channels)
+ logger.warn(buildChannelsWarning());
+}
+/**
+ * v1 files.upload supported `channels` parameter provided as a comma-separated
+ * string of values, e.g. 'C1234,C5678'. V2 no longer supports this csv value.
+ * You may still supply `channels` with a single channel string value e.g. 'C1234'
+ * but it is highly encouraged to supply `channel_id` instead.
+ * @param options
+ */
+function errorIfChannelsCsv(options) {
+ const channels = options.channels ? options.channels.split(',') : [];
+ if (channels.length > 1) {
+ throw (0, errors_1.errorWithCode)(new Error(buildMultipleChannelsErrorMsg()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- _prepareRequest(method, requestUrl, headers) {
- const info = {};
- info.parsedUrl = requestUrl;
- const usingSsl = info.parsedUrl.protocol === 'https:';
- info.httpModule = usingSsl ? https : http;
- const defaultPort = usingSsl ? 443 : 80;
- info.options = {};
- info.options.host = info.parsedUrl.hostname;
- info.options.port = info.parsedUrl.port
- ? parseInt(info.parsedUrl.port)
- : defaultPort;
- info.options.path =
- (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
- info.options.method = method;
- info.options.headers = this._mergeHeaders(headers);
- if (this.userAgent != null) {
- info.options.headers['user-agent'] = this.userAgent;
- }
- info.options.agent = this._getAgent(info.parsedUrl);
- // gives handlers an opportunity to participate
- if (this.handlers) {
- this.handlers.forEach(handler => {
- handler.prepareRequest(info.options);
- });
- }
- return info;
+}
+/**
+ * Checks for either a file or content property and errors if missing
+ * @param options
+ */
+function errorIfInvalidOrMissingFileData(options) {
+ const hasFile = 'file' in options;
+ const hasContent = 'content' in options;
+ if (!(hasFile || hasContent) || (hasFile && hasContent)) {
+ throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You cannot supply both'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- _mergeHeaders(headers) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- if (this.requestOptions && this.requestOptions.headers) {
- return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
+ if ('file' in options) {
+ const { file } = options;
+ if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || file instanceof node_stream_1.Readable)) {
+ throw (0, errors_1.errorWithCode)(new Error('file must be a valid string path, buffer or Readable'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- return lowercaseKeys(headers || {});
}
- _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- let clientHeader;
- if (this.requestOptions && this.requestOptions.headers) {
- clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
- }
- return additionalHeaders[header] || clientHeader || _default;
+ if ('content' in options && options.content && typeof options.content !== 'string') {
+ throw (0, errors_1.errorWithCode)(new Error('content must be a string'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
}
- _getAgent(parsedUrl) {
- let agent;
- let proxyUrl = pm.getProxyUrl(parsedUrl);
- let useProxy = proxyUrl && proxyUrl.hostname;
- if (this._keepAlive && useProxy) {
- agent = this._proxyAgent;
- }
- if (this._keepAlive && !useProxy) {
- agent = this._agent;
- }
- // if agent is already assigned use that agent.
- if (!!agent) {
- return agent;
- }
- const usingSsl = parsedUrl.protocol === 'https:';
- let maxSockets = 100;
- if (!!this.requestOptions) {
- maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
- }
- if (useProxy) {
- // If using proxy, need tunnel
- if (!tunnel) {
- tunnel = __nccwpck_require__(4294);
- }
- const agentOptions = {
- maxSockets: maxSockets,
- keepAlive: this._keepAlive,
- proxy: {
- ...((proxyUrl.username || proxyUrl.password) && {
- proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
- }),
- host: proxyUrl.hostname,
- port: proxyUrl.port
- }
- };
- let tunnelAgent;
- const overHttps = proxyUrl.protocol === 'https:';
- if (usingSsl) {
- tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
- }
- else {
- tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
- }
- agent = tunnelAgent(agentOptions);
- this._proxyAgent = agent;
- }
- // if reusing agent across request and tunneling agent isn't assigned create a new agent
- if (this._keepAlive && !agent) {
- const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
- agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
- this._agent = agent;
- }
- // if not using private agent and tunnel agent isn't setup then use global agent
- if (!agent) {
- agent = usingSsl ? https.globalAgent : http.globalAgent;
- }
- if (usingSsl && this._ignoreSslError) {
- // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
- // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
- // we have to cast it to any and change it directly
- agent.options = Object.assign(agent.options || {}, {
- rejectUnauthorized: false
- });
- }
- return agent;
+}
+/**
+ * @param options
+ * @param logger
+ * @returns filename if it exists
+ */
+function warnIfMissingOrInvalidFileNameAndDefault(options, logger) {
+ var _a;
+ const DEFAULT_FILETYPE = 'txt';
+ const DEFAULT_FILENAME = `file.${(_a = options.filetype) !== null && _a !== void 0 ? _a : DEFAULT_FILETYPE}`;
+ const { filename } = options;
+ if (!filename) {
+ // Filename was an optional property in legacy method
+ logger.warn(buildMissingFileNameWarning());
+ return DEFAULT_FILENAME;
}
- _performExponentialBackoff(retryNumber) {
- retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
- const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
- return new Promise(resolve => setTimeout(() => resolve(), ms));
- }
- static dateTimeDeserializer(key, value) {
- if (typeof value === 'string') {
- let a = new Date(value);
- if (!isNaN(a.valueOf())) {
- return a;
- }
- }
- return value;
+ if (filename.split('.').length < 2) {
+ // likely filename is missing extension
+ logger.warn(buildMissingExtensionWarning(filename));
}
- async _processResponse(res, options) {
- return new Promise(async (resolve, reject) => {
- const statusCode = res.message.statusCode;
- const response = {
- statusCode: statusCode,
- result: null,
- headers: {}
- };
- // not found leads to null obj returned
- if (statusCode == HttpCodes.NotFound) {
- resolve(response);
- }
- let obj;
- let contents;
- // get the result from the body
- try {
- contents = await res.readBody();
- if (contents && contents.length > 0) {
- if (options && options.deserializeDates) {
- obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
- }
- else {
- obj = JSON.parse(contents);
- }
- response.result = obj;
- }
- response.headers = res.message.headers;
- }
- catch (err) {
- // Invalid resource (contents not json); leaving result obj null
- }
- // note that 3xx redirects are handled by the http layer.
- if (statusCode > 299) {
- let msg;
- // if exception/error in body, attempt to get better error
- if (obj && obj.message) {
- msg = obj.message;
- }
- else if (contents && contents.length > 0) {
- // it may be the case that the exception is in the body message as string
- msg = contents;
- }
- else {
- msg = 'Failed request: (' + statusCode + ')';
- }
- let err = new HttpClientError(msg, statusCode);
- err.result = response.result;
- reject(err);
- }
- else {
- resolve(response);
- }
- });
+ return filename;
+}
+/**
+ * `filetype` param is no longer supported and will be ignored
+ * @param options
+ * @param logger
+ */
+function warnIfLegacyFileType(options, logger) {
+ if (options.filetype) {
+ logger.warn(buildLegacyFileTypeWarning());
}
}
-exports.HttpClient = HttpClient;
-
+// Validation message utilities
+function buildMissingFileIdError() {
+ return 'Missing required file id for file upload completion';
+}
+function buildFileSizeErrorMsg() {
+ return 'There was an issue calculating the size of your file';
+}
+function buildLegacyFileTypeWarning() {
+ return ('filetype is no longer a supported field in files.uploadV2.' +
+ ' \nPlease remove this field. To indicate file type, please do so via the required filename property' +
+ ' using the appropriate file extension, e.g. image.png, text.txt');
+}
+function buildMissingFileNameWarning() {
+ return ('filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' +
+ 'defaulting the filename. For best experience and consistent unfurl behavior, you' +
+ ' should set the filename property with correct file extension, e.g. image.png, text.txt');
+}
+function buildMissingExtensionWarning(filename) {
+ return `filename supplied '${filename}' may be missing a proper extension. Missing extenions may result in unexpected unfurl behavior when shared`;
+}
+function buildLegacyMethodWarning(method) {
+ return `${method} may cause some issues like timeouts for relatively large files.`;
+}
+function buildGeneralFilesUploadWarning() {
+ return ('Our latest recommendation is to use client.files.uploadV2() method, ' +
+ 'which is mostly compatible and much stabler, instead.');
+}
+function buildFilesUploadMissingMessage() {
+ return 'Something went wrong with processing file_uploads';
+}
+function buildChannelsWarning() {
+ return ("Although the 'channels' parameter is still supported for smoother migration from legacy files.upload, " +
+ "we recommend using the new channel_id parameter with a single str value instead (e.g. 'C12345').");
+}
+function buildMultipleChannelsErrorMsg() {
+ return 'Sharing files with multiple channels is no longer supported in v2. Share files in each channel separately instead.';
+}
+function buildInvalidFilesUploadParamError() {
+ return ('You may supply file_uploads only for a single channel, message, or thread respectively. ' +
+ 'Therefore, please supply any channel_id, initial_comment or blocks, or thread_ts in the top-layer.');
+}
+//# sourceMappingURL=file-upload.js.map
/***/ }),
-/***/ 6443:
+/***/ 4060:
/***/ ((__unused_webpack_module, exports) => {
-"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
-function getProxyUrl(reqUrl) {
- let usingSsl = reqUrl.protocol === 'https:';
- let proxyUrl;
- if (checkBypass(reqUrl)) {
- return proxyUrl;
- }
- let proxyVar;
- if (usingSsl) {
- proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
- }
- else {
- proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
- }
- if (proxyVar) {
- proxyUrl = new URL(proxyVar);
- }
- return proxyUrl;
-}
-exports.getProxyUrl = getProxyUrl;
-function checkBypass(reqUrl) {
- if (!reqUrl.hostname) {
- return false;
- }
- let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
- if (!noProxy) {
- return false;
- }
- // Determine the request port
- let reqPort;
- if (reqUrl.port) {
- reqPort = Number(reqUrl.port);
- }
- else if (reqUrl.protocol === 'http:') {
- reqPort = 80;
- }
- else if (reqUrl.protocol === 'https:') {
- reqPort = 443;
- }
- // Format the request hostname and hostname with port
- let upperReqHosts = [reqUrl.hostname.toUpperCase()];
- if (typeof reqPort === 'number') {
- upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
- }
- // Compare request host against noproxy
- for (let upperNoProxyItem of noProxy
- .split(',')
- .map(x => x.trim().toUpperCase())
- .filter(x => x)) {
- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
- return true;
- }
- }
- return false;
+exports["default"] = delay;
+/**
+ * Build a Promise that will resolve after the specified number of milliseconds.
+ * @param ms milliseconds to wait
+ * @param value value for eventual resolution
+ */
+function delay(ms) {
+ return new Promise((resolve) => {
+ setTimeout(resolve, ms);
+ });
}
-exports.checkBypass = checkBypass;
-
+//# sourceMappingURL=helpers.js.map
/***/ }),
-/***/ 334:
-/***/ ((module) => {
+/***/ 5105:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
+///
+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);
};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WebClientEvent = exports.WebClient = exports.retryPolicies = exports.LogLevel = exports.addAppMetadata = exports.ErrorCode = void 0;
+var errors_1 = __nccwpck_require__(8486);
+Object.defineProperty(exports, "ErrorCode", ({ enumerable: true, get: function () { return errors_1.ErrorCode; } }));
+var instrument_1 = __nccwpck_require__(9224);
+Object.defineProperty(exports, "addAppMetadata", ({ enumerable: true, get: function () { return instrument_1.addAppMetadata; } }));
+var logger_1 = __nccwpck_require__(4385);
+Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_1.LogLevel; } }));
+var retry_policies_1 = __nccwpck_require__(1766);
+Object.defineProperty(exports, "retryPolicies", ({ enumerable: true, get: function () { return __importDefault(retry_policies_1).default; } }));
+__exportStar(__nccwpck_require__(381), exports);
+__exportStar(__nccwpck_require__(5591), exports);
+var WebClient_1 = __nccwpck_require__(4048);
+Object.defineProperty(exports, "WebClient", ({ enumerable: true, get: function () { return WebClient_1.WebClient; } }));
+Object.defineProperty(exports, "WebClientEvent", ({ enumerable: true, get: function () { return WebClient_1.WebClientEvent; } }));
+// methods must be exported after WebClient
+__exportStar(__nccwpck_require__(9339), exports);
+//# sourceMappingURL=index.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- createTokenAuth: () => createTokenAuth
-});
-module.exports = __toCommonJS(dist_src_exports);
+/***/ }),
-// pkg/dist-src/auth.js
-var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
-var REGEX_IS_INSTALLATION = /^ghs_/;
-var REGEX_IS_USER_TO_SERVER = /^ghu_/;
-async function auth(token) {
- const isApp = token.split(/\./).length === 3;
- const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
- const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
- const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
- return {
- type: "token",
- token,
- tokenType
- };
-}
+/***/ 9224:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-// pkg/dist-src/with-authorization-prefix.js
-function withAuthorizationPrefix(token) {
- if (token.split(/\./).length === 3) {
- return `bearer ${token}`;
- }
- return `token ${token}`;
-}
-// pkg/dist-src/hook.js
-async function hook(token, request, route, parameters) {
- const endpoint = request.endpoint.merge(
- route,
- parameters
- );
- endpoint.headers.authorization = withAuthorizationPrefix(token);
- return request(endpoint);
+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 () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.addAppMetadata = addAppMetadata;
+exports.getUserAgent = getUserAgent;
+const os = __importStar(__nccwpck_require__(8161));
+const node_path_1 = __nccwpck_require__(6760);
+const packageJson = __nccwpck_require__(6734);
+/**
+ * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.
+ */
+function replaceSlashes(s) {
+ return s.replace('/', ':');
}
-
-// pkg/dist-src/index.js
-var createTokenAuth = function createTokenAuth2(token) {
- if (!token) {
- throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
- }
- if (typeof token !== "string") {
- throw new Error(
- "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
- );
- }
- token = token.replace(/^(token|bearer) +/i, "");
- return Object.assign(auth.bind(null, token), {
- hook: hook.bind(null, token)
- });
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
+// TODO: for the deno build (see the `npm run build:deno` npm run script), we could replace the `os-browserify` npm
+// module shim with our own shim leveraging the deno beta compatibility layer for node's `os` module (for more info
+// see https://deno.land/std@0.116.0/node/os.ts). At the time of writing this TODO (2021/11/25), this required deno
+// v1.16.2 and use of the --unstable flag. Once support for this exists without the --unstable flag, we can improve
+// the `os` module deno shim to correctly report operating system from a deno runtime. Until then, the below `os`-
+// based code will report "browser/undefined" from a deno runtime.
+const baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` +
+ `${(0, node_path_1.basename)(process.title)}/${process.version.replace('v', '')} ` +
+ `${os.platform()}/${os.release()}`;
+const appMetadata = {};
+/**
+ * Appends the app metadata into the User-Agent value
+ * @param appMetadata.name - name of tool to be counted in instrumentation
+ * @param appMetadata.version - version of tool to be counted in instrumentation
+ */
+function addAppMetadata({ name, version }) {
+ appMetadata[replaceSlashes(name)] = version;
+}
+/**
+ * Returns the current User-Agent value for instrumentation
+ */
+function getUserAgent() {
+ const appIdentifier = Object.entries(appMetadata)
+ .map(([name, version]) => `${name}/${version}`)
+ .join(' ');
+ // only prepend the appIdentifier when it's not empty
+ return (appIdentifier.length > 0 ? `${appIdentifier} ` : '') + baseUserAgent;
+}
+//# sourceMappingURL=instrument.js.map
/***/ }),
-/***/ 6762:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 4385:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-"use strict";
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.LogLevel = void 0;
+exports.getLogger = getLogger;
+const logger_1 = __nccwpck_require__(9234);
+var logger_2 = __nccwpck_require__(9234);
+Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_2.LogLevel; } }));
+let instanceCount = 0;
+/**
+ * INTERNAL interface for getting or creating a named Logger.
+ */
+function getLogger(name, level, existingLogger) {
+ // Get a unique ID for the logger.
+ const instanceId = instanceCount;
+ instanceCount += 1;
+ // Set up the logger.
+ const logger = (() => {
+ if (existingLogger !== undefined) {
+ return existingLogger;
+ }
+ return new logger_1.ConsoleLogger();
+ })();
+ logger.setName(`web-api:${name}:${instanceId}`);
+ if (level !== undefined) {
+ logger.setLevel(level);
+ }
+ return logger;
+}
+//# sourceMappingURL=logger.js.map
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- Octokit: () => Octokit
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_universal_user_agent = __nccwpck_require__(5030);
-var import_before_after_hook = __nccwpck_require__(3682);
-var import_request = __nccwpck_require__(6234);
-var import_graphql = __nccwpck_require__(8467);
-var import_auth_token = __nccwpck_require__(334);
+/***/ }),
-// pkg/dist-src/version.js
-var VERSION = "5.2.0";
+/***/ 9339:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-// pkg/dist-src/index.js
-var noop = () => {
-};
-var consoleWarn = console.warn.bind(console);
-var consoleError = console.error.bind(console);
-var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
-var Octokit = class {
- static {
- this.VERSION = VERSION;
- }
- static defaults(defaults) {
- const OctokitWithDefaults = class extends this {
- constructor(...args) {
- const options = args[0] || {};
- if (typeof defaults === "function") {
- super(defaults(options));
- return;
- }
- super(
- Object.assign(
- {},
- defaults,
- options,
- options.userAgent && defaults.userAgent ? {
- userAgent: `${options.userAgent} ${defaults.userAgent}`
- } : null
- )
- );
- }
- };
- return OctokitWithDefaults;
- }
- static {
- this.plugins = [];
- }
- /**
- * Attach a plugin (or many) to your Octokit instance.
- *
- * @example
- * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
- */
- static plugin(...newPlugins) {
- const currentPlugins = this.plugins;
- const NewOctokit = class extends this {
- static {
- this.plugins = currentPlugins.concat(
- newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
- );
- }
- };
- return NewOctokit;
- }
- constructor(options = {}) {
- const hook = new import_before_after_hook.Collection();
- const requestDefaults = {
- baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
- headers: {},
- request: Object.assign({}, options.request, {
- // @ts-ignore internal usage only, no need to type
- hook: hook.bind(null, "request")
- }),
- mediaType: {
- previews: [],
- format: ""
- }
- };
- requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
- if (options.baseUrl) {
- requestDefaults.baseUrl = options.baseUrl;
- }
- if (options.previews) {
- requestDefaults.mediaType.previews = options.previews;
- }
- if (options.timeZone) {
- requestDefaults.headers["time-zone"] = options.timeZone;
+
+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]; } };
}
- this.request = import_request.request.defaults(requestDefaults);
- this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
- this.log = Object.assign(
- {
- debug: noop,
- info: noop,
- warn: consoleWarn,
- error: consoleError
- },
- options.log
- );
- this.hook = hook;
- if (!options.authStrategy) {
- if (!options.auth) {
- this.auth = async () => ({
- type: "unauthenticated"
- });
- } else {
- const auth = (0, import_auth_token.createTokenAuth)(options.auth);
- hook.wrap("request", auth.hook);
- this.auth = auth;
- }
- } else {
- const { authStrategy, ...otherOptions } = options;
- const auth = authStrategy(
- Object.assign(
- {
- request: this.request,
- log: this.log,
- // we pass the current octokit instance as well as its constructor options
- // to allow for authentication strategies that return a new octokit instance
- // that shares the same internal state as the current one. The original
- // requirement for this was the "event-octokit" authentication strategy
- // of https://github.com/probot/octokit-auth-probot.
- octokit: this,
- octokitOptions: otherOptions
- },
- options.auth
- )
- );
- hook.wrap("request", auth.hook);
- this.auth = auth;
- }
- const classConstructor = this.constructor;
- for (let i = 0; i < classConstructor.plugins.length; ++i) {
- Object.assign(this, classConstructor.plugins[i](this, options));
- }
- }
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 9440:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- endpoint: () => endpoint
-});
-module.exports = __toCommonJS(dist_src_exports);
-
-// pkg/dist-src/defaults.js
-var import_universal_user_agent = __nccwpck_require__(5030);
-
-// pkg/dist-src/version.js
-var VERSION = "9.0.5";
-
-// pkg/dist-src/defaults.js
-var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
-var DEFAULTS = {
- method: "GET",
- baseUrl: "https://api.github.com",
- headers: {
- accept: "application/vnd.github.v3+json",
- "user-agent": userAgent
- },
- mediaType: {
- format: ""
- }
-};
-
-// pkg/dist-src/util/lowercase-keys.js
-function lowercaseKeys(object) {
- if (!object) {
- return {};
- }
- return Object.keys(object).reduce((newObj, key) => {
- newObj[key.toLowerCase()] = object[key];
- return newObj;
- }, {});
-}
-
-// pkg/dist-src/util/is-plain-object.js
-function isPlainObject(value) {
- if (typeof value !== "object" || value === null)
- return false;
- if (Object.prototype.toString.call(value) !== "[object Object]")
- return false;
- const proto = Object.getPrototypeOf(value);
- if (proto === null)
- return true;
- const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
-}
-
-// pkg/dist-src/util/merge-deep.js
-function mergeDeep(defaults, options) {
- const result = Object.assign({}, defaults);
- Object.keys(options).forEach((key) => {
- if (isPlainObject(options[key])) {
- if (!(key in defaults))
- Object.assign(result, { [key]: options[key] });
- else
- result[key] = mergeDeep(defaults[key], options[key]);
- } else {
- Object.assign(result, { [key]: options[key] });
- }
- });
- return result;
-}
-
-// pkg/dist-src/util/remove-undefined-properties.js
-function removeUndefinedProperties(obj) {
- for (const key in obj) {
- if (obj[key] === void 0) {
- delete obj[key];
- }
- }
- return obj;
-}
-
-// pkg/dist-src/merge.js
-function merge(defaults, route, options) {
- if (typeof route === "string") {
- let [method, url] = route.split(" ");
- options = Object.assign(url ? { method, url } : { url: method }, options);
- } else {
- options = Object.assign({}, route);
- }
- options.headers = lowercaseKeys(options.headers);
- removeUndefinedProperties(options);
- removeUndefinedProperties(options.headers);
- const mergedOptions = mergeDeep(defaults || {}, options);
- if (options.url === "/graphql") {
- if (defaults && defaults.mediaType.previews?.length) {
- mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
- (preview) => !mergedOptions.mediaType.previews.includes(preview)
- ).concat(mergedOptions.mediaType.previews);
- }
- mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
- }
- return mergedOptions;
-}
-
-// pkg/dist-src/util/add-query-parameters.js
-function addQueryParameters(url, parameters) {
- const separator = /\?/.test(url) ? "&" : "?";
- const names = Object.keys(parameters);
- if (names.length === 0) {
- return url;
- }
- return url + separator + names.map((name) => {
- if (name === "q") {
- return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
- }
- return `${name}=${encodeURIComponent(parameters[name])}`;
- }).join("&");
-}
-
-// pkg/dist-src/util/extract-url-variable-names.js
-var urlVariableRegex = /\{[^}]+\}/g;
-function removeNonChars(variableName) {
- return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
-}
-function extractUrlVariableNames(url) {
- const matches = url.match(urlVariableRegex);
- if (!matches) {
- return [];
- }
- return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
-}
-
-// pkg/dist-src/util/omit.js
-function omit(object, keysToOmit) {
- const result = { __proto__: null };
- for (const key of Object.keys(object)) {
- if (keysToOmit.indexOf(key) === -1) {
- result[key] = object[key];
- }
- }
- return result;
-}
-
-// pkg/dist-src/util/url-template.js
-function encodeReserved(str) {
- return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
- if (!/%[0-9A-Fa-f]/.test(part)) {
- part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
- }
- return part;
- }).join("");
-}
-function encodeUnreserved(str) {
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
- return "%" + c.charCodeAt(0).toString(16).toUpperCase();
- });
-}
-function encodeValue(operator, value, key) {
- value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
- if (key) {
- return encodeUnreserved(key) + "=" + value;
- } else {
- return value;
- }
-}
-function isDefined(value) {
- return value !== void 0 && value !== null;
-}
-function isKeyOperator(operator) {
- return operator === ";" || operator === "&" || operator === "?";
-}
-function getValues(context, operator, key, modifier) {
- var value = context[key], result = [];
- if (isDefined(value) && value !== "") {
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
- value = value.toString();
- if (modifier && modifier !== "*") {
- value = value.substring(0, parseInt(modifier, 10));
- }
- result.push(
- encodeValue(operator, value, isKeyOperator(operator) ? key : "")
- );
- } else {
- if (modifier === "*") {
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function(value2) {
- result.push(
- encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
- );
- });
- } else {
- Object.keys(value).forEach(function(k) {
- if (isDefined(value[k])) {
- result.push(encodeValue(operator, value[k], k));
- }
- });
- }
- } else {
- const tmp = [];
- if (Array.isArray(value)) {
- value.filter(isDefined).forEach(function(value2) {
- tmp.push(encodeValue(operator, value2));
- });
- } else {
- Object.keys(value).forEach(function(k) {
- if (isDefined(value[k])) {
- tmp.push(encodeUnreserved(k));
- tmp.push(encodeValue(operator, value[k].toString()));
- }
- });
- }
- if (isKeyOperator(operator)) {
- result.push(encodeUnreserved(key) + "=" + tmp.join(","));
- } else if (tmp.length !== 0) {
- result.push(tmp.join(","));
- }
- }
- }
- } else {
- if (operator === ";") {
- if (isDefined(value)) {
- result.push(encodeUnreserved(key));
- }
- } else if (value === "" && (operator === "&" || operator === "?")) {
- result.push(encodeUnreserved(key) + "=");
- } else if (value === "") {
- result.push("");
- }
- }
- return result;
-}
-function parseUrl(template) {
- return {
- expand: expand.bind(null, template)
- };
-}
-function expand(template, context) {
- var operators = ["+", "#", ".", "/", ";", "?", "&"];
- template = template.replace(
- /\{([^\{\}]+)\}|([^\{\}]+)/g,
- function(_, expression, literal) {
- if (expression) {
- let operator = "";
- const values = [];
- if (operators.indexOf(expression.charAt(0)) !== -1) {
- operator = expression.charAt(0);
- expression = expression.substr(1);
- }
- expression.split(/,/g).forEach(function(variable) {
- var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
- values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
- });
- if (operator && operator !== "+") {
- var separator = ",";
- if (operator === "?") {
- separator = "&";
- } else if (operator !== "#") {
- separator = operator;
- }
- return (values.length !== 0 ? operator : "") + values.join(separator);
- } else {
- return values.join(",");
- }
- } else {
- return encodeReserved(literal);
- }
- }
- );
- if (template === "/") {
- return template;
- } else {
- return template.replace(/\/$/, "");
- }
-}
-
-// pkg/dist-src/parse.js
-function parse(options) {
- let method = options.method.toUpperCase();
- let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
- let headers = Object.assign({}, options.headers);
- let body;
- let parameters = omit(options, [
- "method",
- "baseUrl",
- "url",
- "headers",
- "request",
- "mediaType"
- ]);
- const urlVariableNames = extractUrlVariableNames(url);
- url = parseUrl(url).expand(parameters);
- if (!/^http/.test(url)) {
- url = options.baseUrl + url;
- }
- const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
- const remainingParameters = omit(parameters, omittedParameters);
- const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
- if (!isBinaryRequest) {
- if (options.mediaType.format) {
- headers.accept = headers.accept.split(/,/).map(
- (format) => format.replace(
- /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
- `application/vnd$1$2.${options.mediaType.format}`
- )
- ).join(",");
- }
- if (url.endsWith("/graphql")) {
- if (options.mediaType.previews?.length) {
- const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
- headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
- const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
- return `application/vnd.github.${preview}-preview${format}`;
- }).join(",");
- }
- }
- }
- if (["GET", "HEAD"].includes(method)) {
- url = addQueryParameters(url, remainingParameters);
- } else {
- if ("data" in remainingParameters) {
- body = remainingParameters.data;
- } else {
- if (Object.keys(remainingParameters).length) {
- body = remainingParameters;
- }
- }
- }
- if (!headers["content-type"] && typeof body !== "undefined") {
- headers["content-type"] = "application/json; charset=utf-8";
- }
- if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
- body = "";
- }
- return Object.assign(
- { method, url, headers },
- typeof body !== "undefined" ? { body } : null,
- options.request ? { request: options.request } : null
- );
-}
-
-// pkg/dist-src/endpoint-with-defaults.js
-function endpointWithDefaults(defaults, route, options) {
- return parse(merge(defaults, route, options));
-}
-
-// pkg/dist-src/with-defaults.js
-function withDefaults(oldDefaults, newDefaults) {
- const DEFAULTS2 = merge(oldDefaults, newDefaults);
- const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
- return Object.assign(endpoint2, {
- DEFAULTS: DEFAULTS2,
- defaults: withDefaults.bind(null, DEFAULTS2),
- merge: merge.bind(null, DEFAULTS2),
- parse
- });
-}
-
-// pkg/dist-src/index.js
-var endpoint = withDefaults(null, DEFAULTS);
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 8467:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- GraphqlResponseError: () => GraphqlResponseError,
- graphql: () => graphql2,
- withCustomRequest: () => withCustomRequest
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_request3 = __nccwpck_require__(6234);
-var import_universal_user_agent = __nccwpck_require__(5030);
-
-// pkg/dist-src/version.js
-var VERSION = "7.1.0";
-
-// pkg/dist-src/with-defaults.js
-var import_request2 = __nccwpck_require__(6234);
-
-// pkg/dist-src/graphql.js
-var import_request = __nccwpck_require__(6234);
-
-// pkg/dist-src/error.js
-function _buildMessageForResponseErrors(data) {
- return `Request failed due to following response errors:
-` + data.errors.map((e) => ` - ${e.message}`).join("\n");
-}
-var GraphqlResponseError = class extends Error {
- constructor(request2, headers, response) {
- super(_buildMessageForResponseErrors(response));
- this.request = request2;
- this.headers = headers;
- this.response = response;
- this.name = "GraphqlResponseError";
- this.errors = response.errors;
- this.data = response.data;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- }
- }
+ 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);
};
-
-// pkg/dist-src/graphql.js
-var NON_VARIABLE_OPTIONS = [
- "method",
- "baseUrl",
- "url",
- "headers",
- "request",
- "query",
- "mediaType"
-];
-var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
-var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
-function graphql(request2, query, options) {
- if (options) {
- if (typeof query === "string" && "query" in options) {
- return Promise.reject(
- new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
- );
- }
- for (const key in options) {
- if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
- continue;
- return Promise.reject(
- new Error(
- `[@octokit/graphql] "${key}" cannot be used as variable name`
- )
- );
- }
- }
- const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
- const requestOptions = Object.keys(
- parsedOptions
- ).reduce((result, key) => {
- if (NON_VARIABLE_OPTIONS.includes(key)) {
- result[key] = parsedOptions[key];
- return result;
- }
- if (!result.variables) {
- result.variables = {};
- }
- result.variables[key] = parsedOptions[key];
- return result;
- }, {});
- const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
- if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
- requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
- }
- return request2(requestOptions).then((response) => {
- if (response.data.errors) {
- const headers = {};
- for (const key of Object.keys(response.headers)) {
- headers[key] = response.headers[key];
- }
- throw new GraphqlResponseError(
- requestOptions,
- headers,
- response.data
- );
- }
- return response.data.data;
- });
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.Methods = void 0;
+const eventemitter3_1 = __nccwpck_require__(2415);
+const WebClient_1 = __nccwpck_require__(4048);
+/**
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`.
+ */
+function bindApiCall(self, method) {
+ const apiMethod = self.apiCall.bind(self, method);
+ return apiMethod;
}
-
-// pkg/dist-src/with-defaults.js
-function withDefaults(request2, newDefaults) {
- const newRequest = request2.defaults(newDefaults);
- const newApi = (query, options) => {
- return graphql(newRequest, query, options);
- };
- return Object.assign(newApi, {
- defaults: withDefaults.bind(null, newRequest),
- endpoint: newRequest.endpoint
- });
+/**
+ * Binds a certain `method` and its (required) arguments and result types to the `apiCall` method in `WebClient`.
+ */
+function bindApiCallWithOptionalArgument(self, method) {
+ const apiMethod = self.apiCall.bind(self, method);
+ return apiMethod;
}
-
-// pkg/dist-src/index.js
-var graphql2 = withDefaults(import_request3.request, {
- headers: {
- "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
- },
- method: "POST",
- url: "/graphql"
-});
-function withCustomRequest(customRequest) {
- return withDefaults(customRequest, {
- method: "POST",
- url: "/graphql"
- });
-}
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 4193:
-/***/ ((module) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- composePaginateRest: () => composePaginateRest,
- isPaginatingEndpoint: () => isPaginatingEndpoint,
- paginateRest: () => paginateRest,
- paginatingEndpoints: () => paginatingEndpoints
-});
-module.exports = __toCommonJS(dist_src_exports);
-
-// pkg/dist-src/version.js
-var VERSION = "9.2.1";
-
-// pkg/dist-src/normalize-paginated-list-response.js
-function normalizePaginatedListResponse(response) {
- if (!response.data) {
- return {
- ...response,
- data: []
- };
- }
- const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
- if (!responseNeedsNormalization)
- return response;
- const incompleteResults = response.data.incomplete_results;
- const repositorySelection = response.data.repository_selection;
- const totalCount = response.data.total_count;
- delete response.data.incomplete_results;
- delete response.data.repository_selection;
- delete response.data.total_count;
- const namespaceKey = Object.keys(response.data)[0];
- const data = response.data[namespaceKey];
- response.data = data;
- if (typeof incompleteResults !== "undefined") {
- response.data.incomplete_results = incompleteResults;
- }
- if (typeof repositorySelection !== "undefined") {
- response.data.repository_selection = repositorySelection;
- }
- response.data.total_count = totalCount;
- return response;
-}
-
-// pkg/dist-src/iterator.js
-function iterator(octokit, route, parameters) {
- const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
- const requestMethod = typeof route === "function" ? route : octokit.request;
- const method = options.method;
- const headers = options.headers;
- let url = options.url;
- return {
- [Symbol.asyncIterator]: () => ({
- async next() {
- if (!url)
- return { done: true };
- try {
- const response = await requestMethod({ method, url, headers });
- const normalizedResponse = normalizePaginatedListResponse(response);
- url = ((normalizedResponse.headers.link || "").match(
- /<([^>]+)>;\s*rel="next"/
- ) || [])[1];
- return { value: normalizedResponse };
- } catch (error) {
- if (error.status !== 409)
- throw error;
- url = "";
- return {
- value: {
- status: 200,
- headers: {},
- data: []
- }
- };
- }
- }
- })
- };
-}
-
-// pkg/dist-src/paginate.js
-function paginate(octokit, route, parameters, mapFn) {
- if (typeof parameters === "function") {
- mapFn = parameters;
- parameters = void 0;
- }
- return gather(
- octokit,
- [],
- iterator(octokit, route, parameters)[Symbol.asyncIterator](),
- mapFn
- );
-}
-function gather(octokit, results, iterator2, mapFn) {
- return iterator2.next().then((result) => {
- if (result.done) {
- return results;
- }
- let earlyExit = false;
- function done() {
- earlyExit = true;
- }
- results = results.concat(
- mapFn ? mapFn(result.value, done) : result.value.data
- );
- if (earlyExit) {
- return results;
- }
- return gather(octokit, results, iterator2, mapFn);
- });
-}
-
-// pkg/dist-src/compose-paginate.js
-var composePaginateRest = Object.assign(paginate, {
- iterator
-});
-
-// pkg/dist-src/generated/paginating-endpoints.js
-var paginatingEndpoints = [
- "GET /advisories",
- "GET /app/hook/deliveries",
- "GET /app/installation-requests",
- "GET /app/installations",
- "GET /assignments/{assignment_id}/accepted_assignments",
- "GET /classrooms",
- "GET /classrooms/{classroom_id}/assignments",
- "GET /enterprises/{enterprise}/dependabot/alerts",
- "GET /enterprises/{enterprise}/secret-scanning/alerts",
- "GET /events",
- "GET /gists",
- "GET /gists/public",
- "GET /gists/starred",
- "GET /gists/{gist_id}/comments",
- "GET /gists/{gist_id}/commits",
- "GET /gists/{gist_id}/forks",
- "GET /installation/repositories",
- "GET /issues",
- "GET /licenses",
- "GET /marketplace_listing/plans",
- "GET /marketplace_listing/plans/{plan_id}/accounts",
- "GET /marketplace_listing/stubbed/plans",
- "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
- "GET /networks/{owner}/{repo}/events",
- "GET /notifications",
- "GET /organizations",
- "GET /orgs/{org}/actions/cache/usage-by-repository",
- "GET /orgs/{org}/actions/permissions/repositories",
- "GET /orgs/{org}/actions/runners",
- "GET /orgs/{org}/actions/secrets",
- "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/actions/variables",
- "GET /orgs/{org}/actions/variables/{name}/repositories",
- "GET /orgs/{org}/blocks",
- "GET /orgs/{org}/code-scanning/alerts",
- "GET /orgs/{org}/codespaces",
- "GET /orgs/{org}/codespaces/secrets",
- "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/copilot/billing/seats",
- "GET /orgs/{org}/dependabot/alerts",
- "GET /orgs/{org}/dependabot/secrets",
- "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
- "GET /orgs/{org}/events",
- "GET /orgs/{org}/failed_invitations",
- "GET /orgs/{org}/hooks",
- "GET /orgs/{org}/hooks/{hook_id}/deliveries",
- "GET /orgs/{org}/installations",
- "GET /orgs/{org}/invitations",
- "GET /orgs/{org}/invitations/{invitation_id}/teams",
- "GET /orgs/{org}/issues",
- "GET /orgs/{org}/members",
- "GET /orgs/{org}/members/{username}/codespaces",
- "GET /orgs/{org}/migrations",
- "GET /orgs/{org}/migrations/{migration_id}/repositories",
- "GET /orgs/{org}/organization-roles/{role_id}/teams",
- "GET /orgs/{org}/organization-roles/{role_id}/users",
- "GET /orgs/{org}/outside_collaborators",
- "GET /orgs/{org}/packages",
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
- "GET /orgs/{org}/personal-access-token-requests",
- "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
- "GET /orgs/{org}/personal-access-tokens",
- "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
- "GET /orgs/{org}/projects",
- "GET /orgs/{org}/properties/values",
- "GET /orgs/{org}/public_members",
- "GET /orgs/{org}/repos",
- "GET /orgs/{org}/rulesets",
- "GET /orgs/{org}/rulesets/rule-suites",
- "GET /orgs/{org}/secret-scanning/alerts",
- "GET /orgs/{org}/security-advisories",
- "GET /orgs/{org}/teams",
- "GET /orgs/{org}/teams/{team_slug}/discussions",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
- "GET /orgs/{org}/teams/{team_slug}/invitations",
- "GET /orgs/{org}/teams/{team_slug}/members",
- "GET /orgs/{org}/teams/{team_slug}/projects",
- "GET /orgs/{org}/teams/{team_slug}/repos",
- "GET /orgs/{org}/teams/{team_slug}/teams",
- "GET /projects/columns/{column_id}/cards",
- "GET /projects/{project_id}/collaborators",
- "GET /projects/{project_id}/columns",
- "GET /repos/{owner}/{repo}/actions/artifacts",
- "GET /repos/{owner}/{repo}/actions/caches",
- "GET /repos/{owner}/{repo}/actions/organization-secrets",
- "GET /repos/{owner}/{repo}/actions/organization-variables",
- "GET /repos/{owner}/{repo}/actions/runners",
- "GET /repos/{owner}/{repo}/actions/runs",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
- "GET /repos/{owner}/{repo}/actions/secrets",
- "GET /repos/{owner}/{repo}/actions/variables",
- "GET /repos/{owner}/{repo}/actions/workflows",
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
- "GET /repos/{owner}/{repo}/activity",
- "GET /repos/{owner}/{repo}/assignees",
- "GET /repos/{owner}/{repo}/branches",
- "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
- "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
- "GET /repos/{owner}/{repo}/code-scanning/alerts",
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
- "GET /repos/{owner}/{repo}/code-scanning/analyses",
- "GET /repos/{owner}/{repo}/codespaces",
- "GET /repos/{owner}/{repo}/codespaces/devcontainers",
- "GET /repos/{owner}/{repo}/codespaces/secrets",
- "GET /repos/{owner}/{repo}/collaborators",
- "GET /repos/{owner}/{repo}/comments",
- "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/commits",
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
- "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
- "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
- "GET /repos/{owner}/{repo}/commits/{ref}/status",
- "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
- "GET /repos/{owner}/{repo}/contributors",
- "GET /repos/{owner}/{repo}/dependabot/alerts",
- "GET /repos/{owner}/{repo}/dependabot/secrets",
- "GET /repos/{owner}/{repo}/deployments",
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
- "GET /repos/{owner}/{repo}/environments",
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
- "GET /repos/{owner}/{repo}/events",
- "GET /repos/{owner}/{repo}/forks",
- "GET /repos/{owner}/{repo}/hooks",
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
- "GET /repos/{owner}/{repo}/invitations",
- "GET /repos/{owner}/{repo}/issues",
- "GET /repos/{owner}/{repo}/issues/comments",
- "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/issues/events",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
- "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
- "GET /repos/{owner}/{repo}/keys",
- "GET /repos/{owner}/{repo}/labels",
- "GET /repos/{owner}/{repo}/milestones",
- "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
- "GET /repos/{owner}/{repo}/notifications",
- "GET /repos/{owner}/{repo}/pages/builds",
- "GET /repos/{owner}/{repo}/projects",
- "GET /repos/{owner}/{repo}/pulls",
- "GET /repos/{owner}/{repo}/pulls/comments",
- "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
- "GET /repos/{owner}/{repo}/releases",
- "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
- "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
- "GET /repos/{owner}/{repo}/rules/branches/{branch}",
- "GET /repos/{owner}/{repo}/rulesets",
- "GET /repos/{owner}/{repo}/rulesets/rule-suites",
- "GET /repos/{owner}/{repo}/secret-scanning/alerts",
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
- "GET /repos/{owner}/{repo}/security-advisories",
- "GET /repos/{owner}/{repo}/stargazers",
- "GET /repos/{owner}/{repo}/subscribers",
- "GET /repos/{owner}/{repo}/tags",
- "GET /repos/{owner}/{repo}/teams",
- "GET /repos/{owner}/{repo}/topics",
- "GET /repositories",
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
- "GET /repositories/{repository_id}/environments/{environment_name}/variables",
- "GET /search/code",
- "GET /search/commits",
- "GET /search/issues",
- "GET /search/labels",
- "GET /search/repositories",
- "GET /search/topics",
- "GET /search/users",
- "GET /teams/{team_id}/discussions",
- "GET /teams/{team_id}/discussions/{discussion_number}/comments",
- "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
- "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
- "GET /teams/{team_id}/invitations",
- "GET /teams/{team_id}/members",
- "GET /teams/{team_id}/projects",
- "GET /teams/{team_id}/repos",
- "GET /teams/{team_id}/teams",
- "GET /user/blocks",
- "GET /user/codespaces",
- "GET /user/codespaces/secrets",
- "GET /user/emails",
- "GET /user/followers",
- "GET /user/following",
- "GET /user/gpg_keys",
- "GET /user/installations",
- "GET /user/installations/{installation_id}/repositories",
- "GET /user/issues",
- "GET /user/keys",
- "GET /user/marketplace_purchases",
- "GET /user/marketplace_purchases/stubbed",
- "GET /user/memberships/orgs",
- "GET /user/migrations",
- "GET /user/migrations/{migration_id}/repositories",
- "GET /user/orgs",
- "GET /user/packages",
- "GET /user/packages/{package_type}/{package_name}/versions",
- "GET /user/public_emails",
- "GET /user/repos",
- "GET /user/repository_invitations",
- "GET /user/social_accounts",
- "GET /user/ssh_signing_keys",
- "GET /user/starred",
- "GET /user/subscriptions",
- "GET /user/teams",
- "GET /users",
- "GET /users/{username}/events",
- "GET /users/{username}/events/orgs/{org}",
- "GET /users/{username}/events/public",
- "GET /users/{username}/followers",
- "GET /users/{username}/following",
- "GET /users/{username}/gists",
- "GET /users/{username}/gpg_keys",
- "GET /users/{username}/keys",
- "GET /users/{username}/orgs",
- "GET /users/{username}/packages",
- "GET /users/{username}/projects",
- "GET /users/{username}/received_events",
- "GET /users/{username}/received_events/public",
- "GET /users/{username}/repos",
- "GET /users/{username}/social_accounts",
- "GET /users/{username}/ssh_signing_keys",
- "GET /users/{username}/starred",
- "GET /users/{username}/subscriptions"
-];
-
-// pkg/dist-src/paginating-endpoints.js
-function isPaginatingEndpoint(arg) {
- if (typeof arg === "string") {
- return paginatingEndpoints.includes(arg);
- } else {
- return false;
- }
-}
-
-// pkg/dist-src/index.js
-function paginateRest(octokit) {
- return {
- paginate: Object.assign(paginate.bind(null, octokit), {
- iterator: iterator.bind(null, octokit)
- })
- };
-}
-paginateRest.VERSION = VERSION;
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 3044:
-/***/ ((module) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- legacyRestEndpointMethods: () => legacyRestEndpointMethods,
- restEndpointMethods: () => restEndpointMethods
-});
-module.exports = __toCommonJS(dist_src_exports);
-
-// pkg/dist-src/version.js
-var VERSION = "10.4.1";
-
-// pkg/dist-src/generated/endpoints.js
-var Endpoints = {
- actions: {
- addCustomLabelsToSelfHostedRunnerForOrg: [
- "POST /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- addCustomLabelsToSelfHostedRunnerForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
- ],
- addSelectedRepoToOrgVariable: [
- "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
- ],
- approveWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
- ],
- cancelWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
- ],
- createEnvironmentVariable: [
- "POST /repositories/{repository_id}/environments/{environment_name}/variables"
- ],
- createOrUpdateEnvironmentSecret: [
- "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
- ],
- createOrgVariable: ["POST /orgs/{org}/actions/variables"],
- createRegistrationTokenForOrg: [
- "POST /orgs/{org}/actions/runners/registration-token"
- ],
- createRegistrationTokenForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/registration-token"
- ],
- createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
- createRemoveTokenForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/remove-token"
- ],
- createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
- createWorkflowDispatch: [
- "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
- ],
- deleteActionsCacheById: [
- "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
- ],
- deleteActionsCacheByKey: [
- "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
- ],
- deleteArtifact: [
- "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
- ],
- deleteEnvironmentSecret: [
- "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- deleteEnvironmentVariable: [
- "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
- deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
- ],
- deleteRepoVariable: [
- "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
- ],
- deleteSelfHostedRunnerFromOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}"
- ],
- deleteSelfHostedRunnerFromRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
- ],
- deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
- deleteWorkflowRunLogs: [
- "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
- ],
- disableSelectedRepositoryGithubActionsOrganization: [
- "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
- ],
- disableWorkflow: [
- "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
- ],
- downloadArtifact: [
- "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
- ],
- downloadJobLogsForWorkflowRun: [
- "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
- ],
- downloadWorkflowRunAttemptLogs: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
- ],
- downloadWorkflowRunLogs: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
- ],
- enableSelectedRepositoryGithubActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
- ],
- enableWorkflow: [
- "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
- ],
- forceCancelWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
- ],
- generateRunnerJitconfigForOrg: [
- "POST /orgs/{org}/actions/runners/generate-jitconfig"
- ],
- generateRunnerJitconfigForRepo: [
- "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
- ],
- getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
- getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
- getActionsCacheUsageByRepoForOrg: [
- "GET /orgs/{org}/actions/cache/usage-by-repository"
- ],
- getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
- getAllowedActionsOrganization: [
- "GET /orgs/{org}/actions/permissions/selected-actions"
- ],
- getAllowedActionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
- ],
- getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
- getCustomOidcSubClaimForRepo: [
- "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
- ],
- getEnvironmentPublicKey: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
- ],
- getEnvironmentSecret: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
- ],
- getEnvironmentVariable: [
- "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- getGithubActionsDefaultWorkflowPermissionsOrganization: [
- "GET /orgs/{org}/actions/permissions/workflow"
- ],
- getGithubActionsDefaultWorkflowPermissionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/workflow"
- ],
- getGithubActionsPermissionsOrganization: [
- "GET /orgs/{org}/actions/permissions"
- ],
- getGithubActionsPermissionsRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions"
- ],
- getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
- getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
- getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
- getPendingDeploymentsForRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
- ],
- getRepoPermissions: [
- "GET /repos/{owner}/{repo}/actions/permissions",
- {},
- { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
- ],
- getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
- getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
- getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
- getReviewsForRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
- ],
- getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
- getSelfHostedRunnerForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
- ],
- getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
- getWorkflowAccessToRepository: [
- "GET /repos/{owner}/{repo}/actions/permissions/access"
- ],
- getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
- getWorkflowRunAttempt: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
- ],
- getWorkflowRunUsage: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
- ],
- getWorkflowUsage: [
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
- ],
- listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
- listEnvironmentSecrets: [
- "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
- ],
- listEnvironmentVariables: [
- "GET /repositories/{repository_id}/environments/{environment_name}/variables"
- ],
- listJobsForWorkflowRun: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
- ],
- listJobsForWorkflowRunAttempt: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
- ],
- listLabelsForSelfHostedRunnerForOrg: [
- "GET /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- listLabelsForSelfHostedRunnerForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
- listOrgVariables: ["GET /orgs/{org}/actions/variables"],
- listRepoOrganizationSecrets: [
- "GET /repos/{owner}/{repo}/actions/organization-secrets"
- ],
- listRepoOrganizationVariables: [
- "GET /repos/{owner}/{repo}/actions/organization-variables"
- ],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
- listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
- listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
- listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
- listRunnerApplicationsForRepo: [
- "GET /repos/{owner}/{repo}/actions/runners/downloads"
- ],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
- ],
- listSelectedReposForOrgVariable: [
- "GET /orgs/{org}/actions/variables/{name}/repositories"
- ],
- listSelectedRepositoriesEnabledGithubActionsOrganization: [
- "GET /orgs/{org}/actions/permissions/repositories"
- ],
- listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
- listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
- listWorkflowRunArtifacts: [
- "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
- ],
- listWorkflowRuns: [
- "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
- ],
- listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
- reRunJobForWorkflowRun: [
- "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
- ],
- reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
- reRunWorkflowFailedJobs: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
- ],
- removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- removeCustomLabelFromSelfHostedRunnerForOrg: [
- "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
- ],
- removeCustomLabelFromSelfHostedRunnerForRepo: [
- "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
- ],
- removeSelectedRepoFromOrgVariable: [
- "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
- ],
- reviewCustomGatesForRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
- ],
- reviewPendingDeploymentsForRun: [
- "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
- ],
- setAllowedActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/selected-actions"
- ],
- setAllowedActionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
- ],
- setCustomLabelsForSelfHostedRunnerForOrg: [
- "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
- ],
- setCustomLabelsForSelfHostedRunnerForRepo: [
- "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
- ],
- setCustomOidcSubClaimForRepo: [
- "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
- ],
- setGithubActionsDefaultWorkflowPermissionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/workflow"
- ],
- setGithubActionsDefaultWorkflowPermissionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
- ],
- setGithubActionsPermissionsOrganization: [
- "PUT /orgs/{org}/actions/permissions"
- ],
- setGithubActionsPermissionsRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
- ],
- setSelectedReposForOrgVariable: [
- "PUT /orgs/{org}/actions/variables/{name}/repositories"
- ],
- setSelectedRepositoriesEnabledGithubActionsOrganization: [
- "PUT /orgs/{org}/actions/permissions/repositories"
- ],
- setWorkflowAccessToRepository: [
- "PUT /repos/{owner}/{repo}/actions/permissions/access"
- ],
- updateEnvironmentVariable: [
- "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
- ],
- updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
- updateRepoVariable: [
- "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
- ]
- },
- activity: {
- checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
- deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
- deleteThreadSubscription: [
- "DELETE /notifications/threads/{thread_id}/subscription"
- ],
- getFeeds: ["GET /feeds"],
- getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
- getThread: ["GET /notifications/threads/{thread_id}"],
- getThreadSubscriptionForAuthenticatedUser: [
- "GET /notifications/threads/{thread_id}/subscription"
- ],
- listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
- listNotificationsForAuthenticatedUser: ["GET /notifications"],
- listOrgEventsForAuthenticatedUser: [
- "GET /users/{username}/events/orgs/{org}"
- ],
- listPublicEvents: ["GET /events"],
- listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
- listPublicEventsForUser: ["GET /users/{username}/events/public"],
- listPublicOrgEvents: ["GET /orgs/{org}/events"],
- listReceivedEventsForUser: ["GET /users/{username}/received_events"],
- listReceivedPublicEventsForUser: [
- "GET /users/{username}/received_events/public"
- ],
- listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
- listRepoNotificationsForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/notifications"
- ],
- listReposStarredByAuthenticatedUser: ["GET /user/starred"],
- listReposStarredByUser: ["GET /users/{username}/starred"],
- listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
- listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
- listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
- listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
- markNotificationsAsRead: ["PUT /notifications"],
- markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
- markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
- markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
- setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
- setThreadSubscription: [
- "PUT /notifications/threads/{thread_id}/subscription"
- ],
- starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
- unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
- },
- apps: {
- addRepoToInstallation: [
- "PUT /user/installations/{installation_id}/repositories/{repository_id}",
- {},
- { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
- ],
- addRepoToInstallationForAuthenticatedUser: [
- "PUT /user/installations/{installation_id}/repositories/{repository_id}"
- ],
- checkToken: ["POST /applications/{client_id}/token"],
- createFromManifest: ["POST /app-manifests/{code}/conversions"],
- createInstallationAccessToken: [
- "POST /app/installations/{installation_id}/access_tokens"
- ],
- deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
- deleteInstallation: ["DELETE /app/installations/{installation_id}"],
- deleteToken: ["DELETE /applications/{client_id}/token"],
- getAuthenticated: ["GET /app"],
- getBySlug: ["GET /apps/{app_slug}"],
- getInstallation: ["GET /app/installations/{installation_id}"],
- getOrgInstallation: ["GET /orgs/{org}/installation"],
- getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
- getSubscriptionPlanForAccount: [
- "GET /marketplace_listing/accounts/{account_id}"
- ],
- getSubscriptionPlanForAccountStubbed: [
- "GET /marketplace_listing/stubbed/accounts/{account_id}"
- ],
- getUserInstallation: ["GET /users/{username}/installation"],
- getWebhookConfigForApp: ["GET /app/hook/config"],
- getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
- listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
- listAccountsForPlanStubbed: [
- "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
- ],
- listInstallationReposForAuthenticatedUser: [
- "GET /user/installations/{installation_id}/repositories"
- ],
- listInstallationRequestsForAuthenticatedApp: [
- "GET /app/installation-requests"
- ],
- listInstallations: ["GET /app/installations"],
- listInstallationsForAuthenticatedUser: ["GET /user/installations"],
- listPlans: ["GET /marketplace_listing/plans"],
- listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
- listReposAccessibleToInstallation: ["GET /installation/repositories"],
- listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
- listSubscriptionsForAuthenticatedUserStubbed: [
- "GET /user/marketplace_purchases/stubbed"
- ],
- listWebhookDeliveries: ["GET /app/hook/deliveries"],
- redeliverWebhookDelivery: [
- "POST /app/hook/deliveries/{delivery_id}/attempts"
- ],
- removeRepoFromInstallation: [
- "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
- {},
- { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
- ],
- removeRepoFromInstallationForAuthenticatedUser: [
- "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
- ],
- resetToken: ["PATCH /applications/{client_id}/token"],
- revokeInstallationAccessToken: ["DELETE /installation/token"],
- scopeToken: ["POST /applications/{client_id}/token/scoped"],
- suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
- unsuspendInstallation: [
- "DELETE /app/installations/{installation_id}/suspended"
- ],
- updateWebhookConfigForApp: ["PATCH /app/hook/config"]
- },
- billing: {
- getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
- getGithubActionsBillingUser: [
- "GET /users/{username}/settings/billing/actions"
- ],
- getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
- getGithubPackagesBillingUser: [
- "GET /users/{username}/settings/billing/packages"
- ],
- getSharedStorageBillingOrg: [
- "GET /orgs/{org}/settings/billing/shared-storage"
- ],
- getSharedStorageBillingUser: [
- "GET /users/{username}/settings/billing/shared-storage"
- ]
- },
- checks: {
- create: ["POST /repos/{owner}/{repo}/check-runs"],
- createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
- get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
- getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
- listAnnotations: [
- "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
- ],
- listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
- listForSuite: [
- "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
- ],
- listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
- rerequestRun: [
- "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
- ],
- rerequestSuite: [
- "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
- ],
- setSuitesPreferences: [
- "PATCH /repos/{owner}/{repo}/check-suites/preferences"
- ],
- update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
- },
- codeScanning: {
- deleteAnalysis: [
- "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
- ],
- getAlert: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
- {},
- { renamedParameters: { alert_id: "alert_number" } }
- ],
- getAnalysis: [
- "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
- ],
- getCodeqlDatabase: [
- "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
- ],
- getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
- getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
- listAlertInstances: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
- listAlertsInstances: [
- "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
- {},
- { renamed: ["codeScanning", "listAlertInstances"] }
- ],
- listCodeqlDatabases: [
- "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
- ],
- listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
- ],
- updateDefaultSetup: [
- "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
- ],
- uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
- },
- codesOfConduct: {
- getAllCodesOfConduct: ["GET /codes_of_conduct"],
- getConductCode: ["GET /codes_of_conduct/{key}"]
- },
- codespaces: {
- addRepositoryForSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- checkPermissionsForDevcontainer: [
- "GET /repos/{owner}/{repo}/codespaces/permissions_check"
- ],
- codespaceMachinesForAuthenticatedUser: [
- "GET /user/codespaces/{codespace_name}/machines"
- ],
- createForAuthenticatedUser: ["POST /user/codespaces"],
- createOrUpdateOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
- ],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- createOrUpdateSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}"
- ],
- createWithPrForAuthenticatedUser: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
- ],
- createWithRepoForAuthenticatedUser: [
- "POST /repos/{owner}/{repo}/codespaces"
- ],
- deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
- deleteFromOrganization: [
- "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- deleteSecretForAuthenticatedUser: [
- "DELETE /user/codespaces/secrets/{secret_name}"
- ],
- exportForAuthenticatedUser: [
- "POST /user/codespaces/{codespace_name}/exports"
- ],
- getCodespacesForUserInOrg: [
- "GET /orgs/{org}/members/{username}/codespaces"
- ],
- getExportDetailsForAuthenticatedUser: [
- "GET /user/codespaces/{codespace_name}/exports/{export_id}"
- ],
- getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
- getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
- getPublicKeyForAuthenticatedUser: [
- "GET /user/codespaces/secrets/public-key"
- ],
- getRepoPublicKey: [
- "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
- ],
- getRepoSecret: [
- "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
- ],
- getSecretForAuthenticatedUser: [
- "GET /user/codespaces/secrets/{secret_name}"
- ],
- listDevcontainersInRepositoryForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/devcontainers"
- ],
- listForAuthenticatedUser: ["GET /user/codespaces"],
- listInOrganization: [
- "GET /orgs/{org}/codespaces",
- {},
- { renamedParameters: { org_id: "org" } }
- ],
- listInRepositoryForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces"
- ],
- listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
- listRepositoriesForSecretForAuthenticatedUser: [
- "GET /user/codespaces/secrets/{secret_name}/repositories"
- ],
- listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
- ],
- preFlightWithRepoForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/new"
- ],
- publishForAuthenticatedUser: [
- "POST /user/codespaces/{codespace_name}/publish"
- ],
- removeRepositoryForSecretForAuthenticatedUser: [
- "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
- ],
- repoMachinesForAuthenticatedUser: [
- "GET /repos/{owner}/{repo}/codespaces/machines"
- ],
- setRepositoriesForSecretForAuthenticatedUser: [
- "PUT /user/codespaces/secrets/{secret_name}/repositories"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
- ],
- startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
- stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
- stopInOrganization: [
- "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
- ],
- updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
- },
- copilot: {
- addCopilotSeatsForTeams: [
- "POST /orgs/{org}/copilot/billing/selected_teams"
- ],
- addCopilotSeatsForUsers: [
- "POST /orgs/{org}/copilot/billing/selected_users"
- ],
- cancelCopilotSeatAssignmentForTeams: [
- "DELETE /orgs/{org}/copilot/billing/selected_teams"
- ],
- cancelCopilotSeatAssignmentForUsers: [
- "DELETE /orgs/{org}/copilot/billing/selected_users"
- ],
- getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
- getCopilotSeatDetailsForUser: [
- "GET /orgs/{org}/members/{username}/copilot"
- ],
- listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
- },
- dependabot: {
- addSelectedRepoToOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
- ],
- createOrUpdateOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
- ],
- createOrUpdateRepoSecret: [
- "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
- deleteRepoSecret: [
- "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
- getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
- getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
- getRepoPublicKey: [
- "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
- ],
- getRepoSecret: [
- "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
- ],
- listAlertsForEnterprise: [
- "GET /enterprises/{enterprise}/dependabot/alerts"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
- listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
- listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
- listSelectedReposForOrgSecret: [
- "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
- ],
- removeSelectedRepoFromOrgSecret: [
- "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
- ],
- setSelectedReposForOrgSecret: [
- "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
- ],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
- ]
- },
- dependencyGraph: {
- createRepositorySnapshot: [
- "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
- ],
- diffRange: [
- "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
- ],
- exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
- },
- emojis: { get: ["GET /emojis"] },
- gists: {
- checkIsStarred: ["GET /gists/{gist_id}/star"],
- create: ["POST /gists"],
- createComment: ["POST /gists/{gist_id}/comments"],
- delete: ["DELETE /gists/{gist_id}"],
- deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
- fork: ["POST /gists/{gist_id}/forks"],
- get: ["GET /gists/{gist_id}"],
- getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
- getRevision: ["GET /gists/{gist_id}/{sha}"],
- list: ["GET /gists"],
- listComments: ["GET /gists/{gist_id}/comments"],
- listCommits: ["GET /gists/{gist_id}/commits"],
- listForUser: ["GET /users/{username}/gists"],
- listForks: ["GET /gists/{gist_id}/forks"],
- listPublic: ["GET /gists/public"],
- listStarred: ["GET /gists/starred"],
- star: ["PUT /gists/{gist_id}/star"],
- unstar: ["DELETE /gists/{gist_id}/star"],
- update: ["PATCH /gists/{gist_id}"],
- updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
- },
- git: {
- createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
- createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
- createRef: ["POST /repos/{owner}/{repo}/git/refs"],
- createTag: ["POST /repos/{owner}/{repo}/git/tags"],
- createTree: ["POST /repos/{owner}/{repo}/git/trees"],
- deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
- getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
- getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
- getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
- getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
- getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
- listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
- updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
- },
- gitignore: {
- getAllTemplates: ["GET /gitignore/templates"],
- getTemplate: ["GET /gitignore/templates/{name}"]
- },
- interactions: {
- getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
- getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
- getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
- getRestrictionsForYourPublicRepos: [
- "GET /user/interaction-limits",
- {},
- { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
- ],
- removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
- removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
- removeRestrictionsForRepo: [
- "DELETE /repos/{owner}/{repo}/interaction-limits"
- ],
- removeRestrictionsForYourPublicRepos: [
- "DELETE /user/interaction-limits",
- {},
- { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
- ],
- setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
- setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
- setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
- setRestrictionsForYourPublicRepos: [
- "PUT /user/interaction-limits",
- {},
- { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
- ]
- },
- issues: {
- addAssignees: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
- ],
- addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
- checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
- checkUserCanBeAssignedToIssue: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
- ],
- create: ["POST /repos/{owner}/{repo}/issues"],
- createComment: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
- ],
- createLabel: ["POST /repos/{owner}/{repo}/labels"],
- createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
- deleteComment: [
- "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
- ],
- deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
- deleteMilestone: [
- "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
- ],
- get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
- getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
- getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
- getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
- getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
- list: ["GET /issues"],
- listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
- listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
- listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
- listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
- listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
- listEventsForTimeline: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
- ],
- listForAuthenticatedUser: ["GET /user/issues"],
- listForOrg: ["GET /orgs/{org}/issues"],
- listForRepo: ["GET /repos/{owner}/{repo}/issues"],
- listLabelsForMilestone: [
- "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
- ],
- listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
- listLabelsOnIssue: [
- "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
- ],
- listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
- lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
- removeAllLabels: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
- ],
- removeAssignees: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
- ],
- removeLabel: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
- ],
- setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
- unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
- update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
- updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
- updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
- updateMilestone: [
- "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
- ]
- },
- licenses: {
- get: ["GET /licenses/{license}"],
- getAllCommonlyUsed: ["GET /licenses"],
- getForRepo: ["GET /repos/{owner}/{repo}/license"]
- },
- markdown: {
- render: ["POST /markdown"],
- renderRaw: [
- "POST /markdown/raw",
- { headers: { "content-type": "text/plain; charset=utf-8" } }
- ]
- },
- meta: {
- get: ["GET /meta"],
- getAllVersions: ["GET /versions"],
- getOctocat: ["GET /octocat"],
- getZen: ["GET /zen"],
- root: ["GET /"]
- },
- migrations: {
- cancelImport: [
- "DELETE /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
- }
- ],
- deleteArchiveForAuthenticatedUser: [
- "DELETE /user/migrations/{migration_id}/archive"
- ],
- deleteArchiveForOrg: [
- "DELETE /orgs/{org}/migrations/{migration_id}/archive"
- ],
- downloadArchiveForOrg: [
- "GET /orgs/{org}/migrations/{migration_id}/archive"
- ],
- getArchiveForAuthenticatedUser: [
- "GET /user/migrations/{migration_id}/archive"
- ],
- getCommitAuthors: [
- "GET /repos/{owner}/{repo}/import/authors",
- {},
- {
- deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
- }
- ],
- getImportStatus: [
- "GET /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
- }
- ],
- getLargeFiles: [
- "GET /repos/{owner}/{repo}/import/large_files",
- {},
- {
- deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
- }
- ],
- getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
- getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
- listForAuthenticatedUser: ["GET /user/migrations"],
- listForOrg: ["GET /orgs/{org}/migrations"],
- listReposForAuthenticatedUser: [
- "GET /user/migrations/{migration_id}/repositories"
- ],
- listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
- listReposForUser: [
- "GET /user/migrations/{migration_id}/repositories",
- {},
- { renamed: ["migrations", "listReposForAuthenticatedUser"] }
- ],
- mapCommitAuthor: [
- "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
- {},
- {
- deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
- }
- ],
- setLfsPreference: [
- "PATCH /repos/{owner}/{repo}/import/lfs",
- {},
- {
- deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
- }
- ],
- startForAuthenticatedUser: ["POST /user/migrations"],
- startForOrg: ["POST /orgs/{org}/migrations"],
- startImport: [
- "PUT /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
- }
- ],
- unlockRepoForAuthenticatedUser: [
- "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
- ],
- unlockRepoForOrg: [
- "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
- ],
- updateImport: [
- "PATCH /repos/{owner}/{repo}/import",
- {},
- {
- deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
- }
- ]
- },
- oidc: {
- getOidcCustomSubTemplateForOrg: [
- "GET /orgs/{org}/actions/oidc/customization/sub"
- ],
- updateOidcCustomSubTemplateForOrg: [
- "PUT /orgs/{org}/actions/oidc/customization/sub"
- ]
- },
- orgs: {
- addSecurityManagerTeam: [
- "PUT /orgs/{org}/security-managers/teams/{team_slug}"
- ],
- assignTeamToOrgRole: [
- "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
- ],
- assignUserToOrgRole: [
- "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
- ],
- blockUser: ["PUT /orgs/{org}/blocks/{username}"],
- cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
- checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
- checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
- checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
- convertMemberToOutsideCollaborator: [
- "PUT /orgs/{org}/outside_collaborators/{username}"
- ],
- createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
- createInvitation: ["POST /orgs/{org}/invitations"],
- createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
- createOrUpdateCustomPropertiesValuesForRepos: [
- "PATCH /orgs/{org}/properties/values"
- ],
- createOrUpdateCustomProperty: [
- "PUT /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- createWebhook: ["POST /orgs/{org}/hooks"],
- delete: ["DELETE /orgs/{org}"],
- deleteCustomOrganizationRole: [
- "DELETE /orgs/{org}/organization-roles/{role_id}"
- ],
- deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
- enableOrDisableSecurityProductOnAllOrgRepos: [
- "POST /orgs/{org}/{security_product}/{enablement}"
- ],
- get: ["GET /orgs/{org}"],
- getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
- getCustomProperty: [
- "GET /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
- getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
- getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
- getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
- getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
- getWebhookDelivery: [
- "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
- ],
- list: ["GET /organizations"],
- listAppInstallations: ["GET /orgs/{org}/installations"],
- listBlockedUsers: ["GET /orgs/{org}/blocks"],
- listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
- listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
- listForAuthenticatedUser: ["GET /user/orgs"],
- listForUser: ["GET /users/{username}/orgs"],
- listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
- listMembers: ["GET /orgs/{org}/members"],
- listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
- listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
- listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
- listOrgRoles: ["GET /orgs/{org}/organization-roles"],
- listOrganizationFineGrainedPermissions: [
- "GET /orgs/{org}/organization-fine-grained-permissions"
- ],
- listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
- listPatGrantRepositories: [
- "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
- ],
- listPatGrantRequestRepositories: [
- "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
- ],
- listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
- listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
- listPendingInvitations: ["GET /orgs/{org}/invitations"],
- listPublicMembers: ["GET /orgs/{org}/public_members"],
- listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
- listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
- listWebhooks: ["GET /orgs/{org}/hooks"],
- patchCustomOrganizationRole: [
- "PATCH /orgs/{org}/organization-roles/{role_id}"
- ],
- pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
- redeliverWebhookDelivery: [
- "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
- ],
- removeCustomProperty: [
- "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
- ],
- removeMember: ["DELETE /orgs/{org}/members/{username}"],
- removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
- removeOutsideCollaborator: [
- "DELETE /orgs/{org}/outside_collaborators/{username}"
- ],
- removePublicMembershipForAuthenticatedUser: [
- "DELETE /orgs/{org}/public_members/{username}"
- ],
- removeSecurityManagerTeam: [
- "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
- ],
- reviewPatGrantRequest: [
- "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
- ],
- reviewPatGrantRequestsInBulk: [
- "POST /orgs/{org}/personal-access-token-requests"
- ],
- revokeAllOrgRolesTeam: [
- "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
- ],
- revokeAllOrgRolesUser: [
- "DELETE /orgs/{org}/organization-roles/users/{username}"
- ],
- revokeOrgRoleTeam: [
- "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
- ],
- revokeOrgRoleUser: [
- "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
- ],
- setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
- setPublicMembershipForAuthenticatedUser: [
- "PUT /orgs/{org}/public_members/{username}"
- ],
- unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
- update: ["PATCH /orgs/{org}"],
- updateMembershipForAuthenticatedUser: [
- "PATCH /user/memberships/orgs/{org}"
- ],
- updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
- updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
- updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
- updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
- },
- packages: {
- deletePackageForAuthenticatedUser: [
- "DELETE /user/packages/{package_type}/{package_name}"
- ],
- deletePackageForOrg: [
- "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
- ],
- deletePackageForUser: [
- "DELETE /users/{username}/packages/{package_type}/{package_name}"
- ],
- deletePackageVersionForAuthenticatedUser: [
- "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- deletePackageVersionForOrg: [
- "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- deletePackageVersionForUser: [
- "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getAllPackageVersionsForAPackageOwnedByAnOrg: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
- {},
- { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
- ],
- getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions",
- {},
- {
- renamed: [
- "packages",
- "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
- ]
- }
- ],
- getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions"
- ],
- getAllPackageVersionsForPackageOwnedByOrg: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
- ],
- getAllPackageVersionsForPackageOwnedByUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}/versions"
- ],
- getPackageForAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}"
- ],
- getPackageForOrganization: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}"
- ],
- getPackageForUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}"
- ],
- getPackageVersionForAuthenticatedUser: [
- "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getPackageVersionForOrganization: [
- "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- getPackageVersionForUser: [
- "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
- ],
- listDockerMigrationConflictingPackagesForAuthenticatedUser: [
- "GET /user/docker/conflicts"
- ],
- listDockerMigrationConflictingPackagesForOrganization: [
- "GET /orgs/{org}/docker/conflicts"
- ],
- listDockerMigrationConflictingPackagesForUser: [
- "GET /users/{username}/docker/conflicts"
- ],
- listPackagesForAuthenticatedUser: ["GET /user/packages"],
- listPackagesForOrganization: ["GET /orgs/{org}/packages"],
- listPackagesForUser: ["GET /users/{username}/packages"],
- restorePackageForAuthenticatedUser: [
- "POST /user/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageForOrg: [
- "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageForUser: [
- "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
- ],
- restorePackageVersionForAuthenticatedUser: [
- "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ],
- restorePackageVersionForOrg: [
- "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ],
- restorePackageVersionForUser: [
- "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
- ]
- },
- projects: {
- addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
- createCard: ["POST /projects/columns/{column_id}/cards"],
- createColumn: ["POST /projects/{project_id}/columns"],
- createForAuthenticatedUser: ["POST /user/projects"],
- createForOrg: ["POST /orgs/{org}/projects"],
- createForRepo: ["POST /repos/{owner}/{repo}/projects"],
- delete: ["DELETE /projects/{project_id}"],
- deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
- deleteColumn: ["DELETE /projects/columns/{column_id}"],
- get: ["GET /projects/{project_id}"],
- getCard: ["GET /projects/columns/cards/{card_id}"],
- getColumn: ["GET /projects/columns/{column_id}"],
- getPermissionForUser: [
- "GET /projects/{project_id}/collaborators/{username}/permission"
- ],
- listCards: ["GET /projects/columns/{column_id}/cards"],
- listCollaborators: ["GET /projects/{project_id}/collaborators"],
- listColumns: ["GET /projects/{project_id}/columns"],
- listForOrg: ["GET /orgs/{org}/projects"],
- listForRepo: ["GET /repos/{owner}/{repo}/projects"],
- listForUser: ["GET /users/{username}/projects"],
- moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
- moveColumn: ["POST /projects/columns/{column_id}/moves"],
- removeCollaborator: [
- "DELETE /projects/{project_id}/collaborators/{username}"
- ],
- update: ["PATCH /projects/{project_id}"],
- updateCard: ["PATCH /projects/columns/cards/{card_id}"],
- updateColumn: ["PATCH /projects/columns/{column_id}"]
- },
- pulls: {
- checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
- create: ["POST /repos/{owner}/{repo}/pulls"],
- createReplyForReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
- ],
- createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
- createReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
- ],
- deletePendingReview: [
- "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- deleteReviewComment: [
- "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
- ],
- dismissReview: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
- ],
- get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
- getReview: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
- list: ["GET /repos/{owner}/{repo}/pulls"],
- listCommentsForReview: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
- ],
- listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
- listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
- listRequestedReviewers: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- listReviewComments: [
- "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
- ],
- listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
- listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
- merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
- removeRequestedReviewers: [
- "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- requestReviewers: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
- ],
- submitReview: [
- "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
- ],
- update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
- updateBranch: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
- ],
- updateReview: [
- "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
- ],
- updateReviewComment: [
- "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
- ]
- },
- rateLimit: { get: ["GET /rate_limit"] },
- reactions: {
- createForCommitComment: [
- "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
- ],
- createForIssue: [
- "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
- ],
- createForIssueComment: [
- "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
- ],
- createForPullRequestReviewComment: [
- "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
- ],
- createForRelease: [
- "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
- ],
- createForTeamDiscussionCommentInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
- ],
- createForTeamDiscussionInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
- ],
- deleteForCommitComment: [
- "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForIssue: [
- "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
- ],
- deleteForIssueComment: [
- "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForPullRequestComment: [
- "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
- ],
- deleteForRelease: [
- "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
- ],
- deleteForTeamDiscussion: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
- ],
- deleteForTeamDiscussionComment: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
- ],
- listForCommitComment: [
- "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
- ],
- listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
- listForIssueComment: [
- "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
- ],
- listForPullRequestReviewComment: [
- "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
- ],
- listForRelease: [
- "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
- ],
- listForTeamDiscussionCommentInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
- ],
- listForTeamDiscussionInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
- ]
- },
- repos: {
- acceptInvitation: [
- "PATCH /user/repository_invitations/{invitation_id}",
- {},
- { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
- ],
- acceptInvitationForAuthenticatedUser: [
- "PATCH /user/repository_invitations/{invitation_id}"
- ],
- addAppAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
- addStatusCheckContexts: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- addTeamAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- addUserAccessRestrictions: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- cancelPagesDeployment: [
- "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
- ],
- checkAutomatedSecurityFixes: [
- "GET /repos/{owner}/{repo}/automated-security-fixes"
- ],
- checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
- checkVulnerabilityAlerts: [
- "GET /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
- compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
- compareCommitsWithBasehead: [
- "GET /repos/{owner}/{repo}/compare/{basehead}"
- ],
- createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
- createCommitComment: [
- "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
- ],
- createCommitSignatureProtection: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
- createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
- createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
- createDeploymentBranchPolicy: [
- "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
- ],
- createDeploymentProtectionRule: [
- "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
- ],
- createDeploymentStatus: [
- "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
- ],
- createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
- createForAuthenticatedUser: ["POST /user/repos"],
- createFork: ["POST /repos/{owner}/{repo}/forks"],
- createInOrg: ["POST /orgs/{org}/repos"],
- createOrUpdateCustomPropertiesValues: [
- "PATCH /repos/{owner}/{repo}/properties/values"
- ],
- createOrUpdateEnvironment: [
- "PUT /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
- createOrgRuleset: ["POST /orgs/{org}/rulesets"],
- createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
- createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
- createRelease: ["POST /repos/{owner}/{repo}/releases"],
- createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
- createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
- createUsingTemplate: [
- "POST /repos/{template_owner}/{template_repo}/generate"
- ],
- createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
- declineInvitation: [
- "DELETE /user/repository_invitations/{invitation_id}",
- {},
- { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
- ],
- declineInvitationForAuthenticatedUser: [
- "DELETE /user/repository_invitations/{invitation_id}"
- ],
- delete: ["DELETE /repos/{owner}/{repo}"],
- deleteAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
- ],
- deleteAdminBranchProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- deleteAnEnvironment: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
- deleteBranchProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
- deleteCommitSignatureProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
- deleteDeployment: [
- "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
- ],
- deleteDeploymentBranchPolicy: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
- deleteInvitation: [
- "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
- ],
- deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
- deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
- deletePullRequestReviewProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
- deleteReleaseAsset: [
- "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
- ],
- deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- deleteTagProtection: [
- "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
- ],
- deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
- disableAutomatedSecurityFixes: [
- "DELETE /repos/{owner}/{repo}/automated-security-fixes"
- ],
- disableDeploymentProtectionRule: [
- "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
- ],
- disablePrivateVulnerabilityReporting: [
- "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
- ],
- disableVulnerabilityAlerts: [
- "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- downloadArchive: [
- "GET /repos/{owner}/{repo}/zipball/{ref}",
- {},
- { renamed: ["repos", "downloadZipballArchive"] }
- ],
- downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
- downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
- enableAutomatedSecurityFixes: [
- "PUT /repos/{owner}/{repo}/automated-security-fixes"
- ],
- enablePrivateVulnerabilityReporting: [
- "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
- ],
- enableVulnerabilityAlerts: [
- "PUT /repos/{owner}/{repo}/vulnerability-alerts"
- ],
- generateReleaseNotes: [
- "POST /repos/{owner}/{repo}/releases/generate-notes"
- ],
- get: ["GET /repos/{owner}/{repo}"],
- getAccessRestrictions: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
- ],
- getAdminBranchProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- getAllDeploymentProtectionRules: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
- ],
- getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
- getAllStatusCheckContexts: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
- ],
- getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
- getAppsWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
- ],
- getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
- getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
- getBranchProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
- getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
- getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
- getCollaboratorPermissionLevel: [
- "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
- ],
- getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
- getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
- getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
- getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
- getCommitSignatureProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
- ],
- getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
- getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
- getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
- getCustomDeploymentProtectionRule: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
- ],
- getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
- getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
- getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
- getDeploymentBranchPolicy: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- getDeploymentStatus: [
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
- ],
- getEnvironment: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}"
- ],
- getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
- getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
- getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
- getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
- getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
- getOrgRulesets: ["GET /orgs/{org}/rulesets"],
- getPages: ["GET /repos/{owner}/{repo}/pages"],
- getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
- getPagesDeployment: [
- "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
- ],
- getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
- getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
- getPullRequestReviewProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
- getReadme: ["GET /repos/{owner}/{repo}/readme"],
- getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
- getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
- getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
- getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
- getRepoRuleSuite: [
- "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
- ],
- getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
- getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
- getStatusChecksProtection: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- getTeamsWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
- ],
- getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
- getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
- getUsersWithAccessToProtectedBranch: [
- "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
- ],
- getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
- getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
- getWebhookConfigForRepo: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
- ],
- getWebhookDelivery: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
- ],
- listActivities: ["GET /repos/{owner}/{repo}/activity"],
- listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
- listBranches: ["GET /repos/{owner}/{repo}/branches"],
- listBranchesForHeadCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
- ],
- listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
- listCommentsForCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
- ],
- listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
- listCommitStatusesForRef: [
- "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
- ],
- listCommits: ["GET /repos/{owner}/{repo}/commits"],
- listContributors: ["GET /repos/{owner}/{repo}/contributors"],
- listCustomDeploymentRuleIntegrations: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
- ],
- listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
- listDeploymentBranchPolicies: [
- "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
- ],
- listDeploymentStatuses: [
- "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
- ],
- listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
- listForAuthenticatedUser: ["GET /user/repos"],
- listForOrg: ["GET /orgs/{org}/repos"],
- listForUser: ["GET /users/{username}/repos"],
- listForks: ["GET /repos/{owner}/{repo}/forks"],
- listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
- listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
- listLanguages: ["GET /repos/{owner}/{repo}/languages"],
- listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
- listPublic: ["GET /repositories"],
- listPullRequestsAssociatedWithCommit: [
- "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
- ],
- listReleaseAssets: [
- "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
- ],
- listReleases: ["GET /repos/{owner}/{repo}/releases"],
- listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
- listTags: ["GET /repos/{owner}/{repo}/tags"],
- listTeams: ["GET /repos/{owner}/{repo}/teams"],
- listWebhookDeliveries: [
- "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
- ],
- listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
- merge: ["POST /repos/{owner}/{repo}/merges"],
- mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
- pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
- redeliverWebhookDelivery: [
- "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
- ],
- removeAppAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- removeCollaborator: [
- "DELETE /repos/{owner}/{repo}/collaborators/{username}"
- ],
- removeStatusCheckContexts: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- removeStatusCheckProtection: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- removeTeamAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- removeUserAccessRestrictions: [
- "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
- replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
- requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
- setAdminBranchProtection: [
- "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
- ],
- setAppAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
- {},
- { mapToData: "apps" }
- ],
- setStatusCheckContexts: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
- {},
- { mapToData: "contexts" }
- ],
- setTeamAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
- {},
- { mapToData: "teams" }
- ],
- setUserAccessRestrictions: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
- {},
- { mapToData: "users" }
- ],
- testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
- transfer: ["POST /repos/{owner}/{repo}/transfer"],
- update: ["PATCH /repos/{owner}/{repo}"],
- updateBranchProtection: [
- "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
- ],
- updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
- updateDeploymentBranchPolicy: [
- "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
- ],
- updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
- updateInvitation: [
- "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
- ],
- updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
- updatePullRequestReviewProtection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
- ],
- updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
- updateReleaseAsset: [
- "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
- ],
- updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
- updateStatusCheckPotection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
- {},
- { renamed: ["repos", "updateStatusCheckProtection"] }
- ],
- updateStatusCheckProtection: [
- "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
- ],
- updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
- updateWebhookConfigForRepo: [
- "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
- ],
- uploadReleaseAsset: [
- "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
- { baseUrl: "https://uploads.github.com" }
- ]
- },
- search: {
- code: ["GET /search/code"],
- commits: ["GET /search/commits"],
- issuesAndPullRequests: ["GET /search/issues"],
- labels: ["GET /search/labels"],
- repos: ["GET /search/repositories"],
- topics: ["GET /search/topics"],
- users: ["GET /search/users"]
- },
- secretScanning: {
- getAlert: [
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
- ],
- listAlertsForEnterprise: [
- "GET /enterprises/{enterprise}/secret-scanning/alerts"
- ],
- listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
- listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
- listLocationsForAlert: [
- "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
- ],
- updateAlert: [
- "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
- ]
- },
- securityAdvisories: {
- createFork: [
- "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
- ],
- createPrivateVulnerabilityReport: [
- "POST /repos/{owner}/{repo}/security-advisories/reports"
- ],
- createRepositoryAdvisory: [
- "POST /repos/{owner}/{repo}/security-advisories"
- ],
- createRepositoryAdvisoryCveRequest: [
- "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
- ],
- getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
- getRepositoryAdvisory: [
- "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
- ],
- listGlobalAdvisories: ["GET /advisories"],
- listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
- listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
- updateRepositoryAdvisory: [
- "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
- ]
- },
- teams: {
- addOrUpdateMembershipForUserInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- addOrUpdateProjectPermissionsInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- addOrUpdateRepoPermissionsInOrg: [
- "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- checkPermissionsForProjectInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- checkPermissionsForRepoInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- create: ["POST /orgs/{org}/teams"],
- createDiscussionCommentInOrg: [
- "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
- ],
- createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
- deleteDiscussionCommentInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- deleteDiscussionInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
- getByName: ["GET /orgs/{org}/teams/{team_slug}"],
- getDiscussionCommentInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- getDiscussionInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- getMembershipForUserInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- list: ["GET /orgs/{org}/teams"],
- listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
- listDiscussionCommentsInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
- ],
- listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
- listForAuthenticatedUser: ["GET /user/teams"],
- listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
- listPendingInvitationsInOrg: [
- "GET /orgs/{org}/teams/{team_slug}/invitations"
- ],
- listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
- listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
- removeMembershipForUserInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
- ],
- removeProjectInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
- ],
- removeRepoInOrg: [
- "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
- ],
- updateDiscussionCommentInOrg: [
- "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
- ],
- updateDiscussionInOrg: [
- "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
- ],
- updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
- },
- users: {
- addEmailForAuthenticated: [
- "POST /user/emails",
- {},
- { renamed: ["users", "addEmailForAuthenticatedUser"] }
- ],
- addEmailForAuthenticatedUser: ["POST /user/emails"],
- addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
- block: ["PUT /user/blocks/{username}"],
- checkBlocked: ["GET /user/blocks/{username}"],
- checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
- checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
- createGpgKeyForAuthenticated: [
- "POST /user/gpg_keys",
- {},
- { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
- ],
- createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
- createPublicSshKeyForAuthenticated: [
- "POST /user/keys",
- {},
- { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
- ],
- createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
- createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
- deleteEmailForAuthenticated: [
- "DELETE /user/emails",
- {},
- { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
- ],
- deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
- deleteGpgKeyForAuthenticated: [
- "DELETE /user/gpg_keys/{gpg_key_id}",
- {},
- { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
- ],
- deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
- deletePublicSshKeyForAuthenticated: [
- "DELETE /user/keys/{key_id}",
- {},
- { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
- ],
- deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
- deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
- deleteSshSigningKeyForAuthenticatedUser: [
- "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
- ],
- follow: ["PUT /user/following/{username}"],
- getAuthenticated: ["GET /user"],
- getByUsername: ["GET /users/{username}"],
- getContextForUser: ["GET /users/{username}/hovercard"],
- getGpgKeyForAuthenticated: [
- "GET /user/gpg_keys/{gpg_key_id}",
- {},
- { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
- ],
- getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
- getPublicSshKeyForAuthenticated: [
- "GET /user/keys/{key_id}",
- {},
- { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
- ],
- getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
- getSshSigningKeyForAuthenticatedUser: [
- "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
- ],
- list: ["GET /users"],
- listBlockedByAuthenticated: [
- "GET /user/blocks",
- {},
- { renamed: ["users", "listBlockedByAuthenticatedUser"] }
- ],
- listBlockedByAuthenticatedUser: ["GET /user/blocks"],
- listEmailsForAuthenticated: [
- "GET /user/emails",
- {},
- { renamed: ["users", "listEmailsForAuthenticatedUser"] }
- ],
- listEmailsForAuthenticatedUser: ["GET /user/emails"],
- listFollowedByAuthenticated: [
- "GET /user/following",
- {},
- { renamed: ["users", "listFollowedByAuthenticatedUser"] }
- ],
- listFollowedByAuthenticatedUser: ["GET /user/following"],
- listFollowersForAuthenticatedUser: ["GET /user/followers"],
- listFollowersForUser: ["GET /users/{username}/followers"],
- listFollowingForUser: ["GET /users/{username}/following"],
- listGpgKeysForAuthenticated: [
- "GET /user/gpg_keys",
- {},
- { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
- ],
- listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
- listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
- listPublicEmailsForAuthenticated: [
- "GET /user/public_emails",
- {},
- { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
- ],
- listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
- listPublicKeysForUser: ["GET /users/{username}/keys"],
- listPublicSshKeysForAuthenticated: [
- "GET /user/keys",
- {},
- { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
- ],
- listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
- listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
- listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
- listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
- listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
- setPrimaryEmailVisibilityForAuthenticated: [
- "PATCH /user/email/visibility",
- {},
- { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
- ],
- setPrimaryEmailVisibilityForAuthenticatedUser: [
- "PATCH /user/email/visibility"
- ],
- unblock: ["DELETE /user/blocks/{username}"],
- unfollow: ["DELETE /user/following/{username}"],
- updateAuthenticated: ["PATCH /user"]
- }
-};
-var endpoints_default = Endpoints;
-
-// pkg/dist-src/endpoints-to-methods.js
-var endpointMethodsMap = /* @__PURE__ */ new Map();
-for (const [scope, endpoints] of Object.entries(endpoints_default)) {
- for (const [methodName, endpoint] of Object.entries(endpoints)) {
- const [route, defaults, decorations] = endpoint;
- const [method, url] = route.split(/ /);
- const endpointDefaults = Object.assign(
- {
- method,
- url
- },
- defaults
- );
- if (!endpointMethodsMap.has(scope)) {
- endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
- }
- endpointMethodsMap.get(scope).set(methodName, {
- scope,
- methodName,
- endpointDefaults,
- decorations
- });
- }
-}
-var handler = {
- has({ scope }, methodName) {
- return endpointMethodsMap.get(scope).has(methodName);
- },
- getOwnPropertyDescriptor(target, methodName) {
- return {
- value: this.get(target, methodName),
- // ensures method is in the cache
- configurable: true,
- writable: true,
- enumerable: true
- };
- },
- defineProperty(target, methodName, descriptor) {
- Object.defineProperty(target.cache, methodName, descriptor);
- return true;
- },
- deleteProperty(target, methodName) {
- delete target.cache[methodName];
- return true;
- },
- ownKeys({ scope }) {
- return [...endpointMethodsMap.get(scope).keys()];
- },
- set(target, methodName, value) {
- return target.cache[methodName] = value;
- },
- get({ octokit, scope, cache }, methodName) {
- if (cache[methodName]) {
- return cache[methodName];
- }
- const method = endpointMethodsMap.get(scope).get(methodName);
- if (!method) {
- return void 0;
- }
- const { endpointDefaults, decorations } = method;
- if (decorations) {
- cache[methodName] = decorate(
- octokit,
- scope,
- methodName,
- endpointDefaults,
- decorations
- );
- } else {
- cache[methodName] = octokit.request.defaults(endpointDefaults);
- }
- return cache[methodName];
- }
-};
-function endpointsToMethods(octokit) {
- const newMethods = {};
- for (const scope of endpointMethodsMap.keys()) {
- newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
- }
- return newMethods;
-}
-function decorate(octokit, scope, methodName, defaults, decorations) {
- const requestWithDefaults = octokit.request.defaults(defaults);
- function withDecorations(...args) {
- let options = requestWithDefaults.endpoint.merge(...args);
- if (decorations.mapToData) {
- options = Object.assign({}, options, {
- data: options[decorations.mapToData],
- [decorations.mapToData]: void 0
- });
- return requestWithDefaults(options);
- }
- if (decorations.renamed) {
- const [newScope, newMethodName] = decorations.renamed;
- octokit.log.warn(
- `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
- );
- }
- if (decorations.deprecated) {
- octokit.log.warn(decorations.deprecated);
- }
- if (decorations.renamedParameters) {
- const options2 = requestWithDefaults.endpoint.merge(...args);
- for (const [name, alias] of Object.entries(
- decorations.renamedParameters
- )) {
- if (name in options2) {
- octokit.log.warn(
- `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
- );
- if (!(alias in options2)) {
- options2[alias] = options2[name];
- }
- delete options2[name];
- }
- }
- return requestWithDefaults(options2);
- }
- return requestWithDefaults(...args);
- }
- return Object.assign(withDecorations, requestWithDefaults);
-}
-
-// pkg/dist-src/index.js
-function restEndpointMethods(octokit) {
- const api = endpointsToMethods(octokit);
- return {
- rest: api
- };
-}
-restEndpointMethods.VERSION = VERSION;
-function legacyRestEndpointMethods(octokit) {
- const api = endpointsToMethods(octokit);
- return {
- ...api,
- rest: api
- };
-}
-legacyRestEndpointMethods.VERSION = VERSION;
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 537:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
- mod
-));
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- RequestError: () => RequestError
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_deprecation = __nccwpck_require__(8932);
-var import_once = __toESM(__nccwpck_require__(1223));
-var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
-var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
-var RequestError = class extends Error {
- constructor(message, statusCode, options) {
- super(message);
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
- }
- this.name = "HttpError";
- this.status = statusCode;
- let headers;
- if ("headers" in options && typeof options.headers !== "undefined") {
- headers = options.headers;
- }
- if ("response" in options) {
- this.response = options.response;
- headers = options.response.headers;
- }
- const requestCopy = Object.assign({}, options.request);
- if (options.request.headers.authorization) {
- requestCopy.headers = Object.assign({}, options.request.headers, {
- authorization: options.request.headers.authorization.replace(
- / .*$/,
- " [REDACTED]"
- )
- });
- }
- requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
- this.request = requestCopy;
- Object.defineProperty(this, "code", {
- get() {
- logOnceCode(
- new import_deprecation.Deprecation(
- "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
- )
- );
- return statusCode;
- }
- });
- Object.defineProperty(this, "headers", {
- get() {
- logOnceHeaders(
- new import_deprecation.Deprecation(
- "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
- )
- );
- return headers || {};
- }
- });
- }
-};
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 6234:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __export = (target, all) => {
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
-
-// pkg/dist-src/index.js
-var dist_src_exports = {};
-__export(dist_src_exports, {
- request: () => request
-});
-module.exports = __toCommonJS(dist_src_exports);
-var import_endpoint = __nccwpck_require__(9440);
-var import_universal_user_agent = __nccwpck_require__(5030);
-
-// pkg/dist-src/version.js
-var VERSION = "8.4.0";
-
-// pkg/dist-src/is-plain-object.js
-function isPlainObject(value) {
- if (typeof value !== "object" || value === null)
- return false;
- if (Object.prototype.toString.call(value) !== "[object Object]")
- return false;
- const proto = Object.getPrototypeOf(value);
- if (proto === null)
- return true;
- const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
-}
-
-// pkg/dist-src/fetch-wrapper.js
-var import_request_error = __nccwpck_require__(537);
-
-// pkg/dist-src/get-buffer-response.js
-function getBufferResponse(response) {
- return response.arrayBuffer();
-}
-
-// pkg/dist-src/fetch-wrapper.js
-function fetchWrapper(requestOptions) {
- var _a, _b, _c, _d;
- const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
- const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
- if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
- requestOptions.body = JSON.stringify(requestOptions.body);
- }
- let headers = {};
- let status;
- let url;
- let { fetch } = globalThis;
- if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
- fetch = requestOptions.request.fetch;
- }
- if (!fetch) {
- throw new Error(
- "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
- );
- }
- return fetch(requestOptions.url, {
- method: requestOptions.method,
- body: requestOptions.body,
- redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
- headers: requestOptions.headers,
- signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
- // duplex must be set if request.body is ReadableStream or Async Iterables.
- // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
- ...requestOptions.body && { duplex: "half" }
- }).then(async (response) => {
- url = response.url;
- status = response.status;
- for (const keyAndValue of response.headers) {
- headers[keyAndValue[0]] = keyAndValue[1];
- }
- if ("deprecation" in headers) {
- const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
- const deprecationLink = matches && matches.pop();
- log.warn(
- `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
- );
- }
- if (status === 204 || status === 205) {
- return;
- }
- if (requestOptions.method === "HEAD") {
- if (status < 400) {
- return;
- }
- throw new import_request_error.RequestError(response.statusText, status, {
- response: {
- url,
- status,
- headers,
- data: void 0
- },
- request: requestOptions
- });
- }
- if (status === 304) {
- throw new import_request_error.RequestError("Not modified", status, {
- response: {
- url,
- status,
- headers,
- data: await getResponseData(response)
- },
- request: requestOptions
- });
- }
- if (status >= 400) {
- const data = await getResponseData(response);
- const error = new import_request_error.RequestError(toErrorMessage(data), status, {
- response: {
- url,
- status,
- headers,
- data
- },
- request: requestOptions
- });
- throw error;
- }
- return parseSuccessResponseBody ? await getResponseData(response) : response.body;
- }).then((data) => {
- return {
- status,
- url,
- headers,
- data
- };
- }).catch((error) => {
- if (error instanceof import_request_error.RequestError)
- throw error;
- else if (error.name === "AbortError")
- throw error;
- let message = error.message;
- if (error.name === "TypeError" && "cause" in error) {
- if (error.cause instanceof Error) {
- message = error.cause.message;
- } else if (typeof error.cause === "string") {
- message = error.cause;
- }
- }
- throw new import_request_error.RequestError(message, 500, {
- request: requestOptions
- });
- });
-}
-async function getResponseData(response) {
- const contentType = response.headers.get("content-type");
- if (/application\/json/.test(contentType)) {
- return response.json().catch(() => response.text()).catch(() => "");
- }
- if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
- return response.text();
- }
- return getBufferResponse(response);
-}
-function toErrorMessage(data) {
- if (typeof data === "string")
- return data;
- let suffix;
- if ("documentation_url" in data) {
- suffix = ` - ${data.documentation_url}`;
- } else {
- suffix = "";
- }
- if ("message" in data) {
- if (Array.isArray(data.errors)) {
- return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
- }
- return `${data.message}${suffix}`;
- }
- return `Unknown error: ${JSON.stringify(data)}`;
-}
-
-// pkg/dist-src/with-defaults.js
-function withDefaults(oldEndpoint, newDefaults) {
- const endpoint2 = oldEndpoint.defaults(newDefaults);
- const newApi = function(route, parameters) {
- const endpointOptions = endpoint2.merge(route, parameters);
- if (!endpointOptions.request || !endpointOptions.request.hook) {
- return fetchWrapper(endpoint2.parse(endpointOptions));
- }
- const request2 = (route2, parameters2) => {
- return fetchWrapper(
- endpoint2.parse(endpoint2.merge(route2, parameters2))
- );
- };
- Object.assign(request2, {
- endpoint: endpoint2,
- defaults: withDefaults.bind(null, endpoint2)
- });
- return endpointOptions.request.hook(request2, endpointOptions);
- };
- return Object.assign(newApi, {
- endpoint: endpoint2,
- defaults: withDefaults.bind(null, endpoint2)
- });
-}
-
-// pkg/dist-src/index.js
-var request = withDefaults(import_endpoint.endpoint, {
- headers: {
- "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
- }
-});
-// Annotate the CommonJS export names for ESM import in node:
-0 && (0);
-
-
-/***/ }),
-
-/***/ 2704:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-/* eslint-disable no-console */
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.ConsoleLogger = exports.LogLevel = void 0;
-/**
- * Severity levels for log entries
- */
-var LogLevel;
-(function (LogLevel) {
- LogLevel["ERROR"] = "error";
- LogLevel["WARN"] = "warn";
- LogLevel["INFO"] = "info";
- LogLevel["DEBUG"] = "debug";
-})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
-/**
- * Default logger which logs to stdout and stderr
- */
-class ConsoleLogger {
- constructor() {
- this.level = LogLevel.INFO;
- this.name = '';
- }
- getLevel() {
- return this.level;
- }
- /**
- * Sets the instance's log level so that only messages which are equal or more severe are output to the console.
- */
- setLevel(level) {
- this.level = level;
- }
- /**
- * Set the instance's name, which will appear on each log line before the message.
- */
- setName(name) {
- this.name = name;
- }
- /**
- * Log a debug message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- debug(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.DEBUG, this.level)) {
- console.debug(ConsoleLogger.labels.get(LogLevel.DEBUG), this.name, ...msg);
- }
- }
- /**
- * Log an info message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- info(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.INFO, this.level)) {
- console.info(ConsoleLogger.labels.get(LogLevel.INFO), this.name, ...msg);
- }
- }
- /**
- * Log a warning message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- warn(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.WARN, this.level)) {
- console.warn(ConsoleLogger.labels.get(LogLevel.WARN), this.name, ...msg);
- }
- }
- /**
- * Log an error message
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- error(...msg) {
- if (ConsoleLogger.isMoreOrEqualSevere(LogLevel.ERROR, this.level)) {
- console.error(ConsoleLogger.labels.get(LogLevel.ERROR), this.name, ...msg);
- }
- }
- /**
- * Helper to compare two log levels and determine if a is equal or more severe than b
- */
- static isMoreOrEqualSevere(a, b) {
- return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b];
- }
-}
-exports.ConsoleLogger = ConsoleLogger;
-/** Map of labels for each log level */
-ConsoleLogger.labels = (() => {
- const entries = Object.entries(LogLevel);
- const map = entries.map(([key, value]) => [value, `[${key}] `]);
- return new Map(map);
-})();
-/** Map of severity as comparable numbers for each log level */
-ConsoleLogger.severity = {
- [LogLevel.ERROR]: 400,
- [LogLevel.WARN]: 300,
- [LogLevel.INFO]: 200,
- [LogLevel.DEBUG]: 100,
-};
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 1338:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/block-elements
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=block-elements.js.map
-
-/***/ }),
-
-/***/ 5357:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/blocks
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=blocks.js.map
-
-/***/ }),
-
-/***/ 5548:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// This file contains objects documented here: https://api.slack.com/reference/block-kit/composition-objects
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=composition-objects.js.map
-
-/***/ }),
-
-/***/ 8111:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=extensions.js.map
-
-/***/ }),
-
-/***/ 4700:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-// These types represent users in Slack Calls, which is an API for showing 3rd party calls within the Slack client.
-// More information on the API guide for Calls: https://api.slack.com/apis/calls
-// and on User objects for use with Calls: https://api.slack.com/apis/calls#users
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=calls.js.map
-
-/***/ }),
-
-/***/ 9067:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=dialog.js.map
-
-/***/ }),
-
-/***/ 4380:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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 }));
-__exportStar(__nccwpck_require__(4700), exports);
-__exportStar(__nccwpck_require__(9067), exports);
-__exportStar(__nccwpck_require__(4870), exports);
-__exportStar(__nccwpck_require__(8658), exports);
-__exportStar(__nccwpck_require__(9599), exports);
-__exportStar(__nccwpck_require__(5357), exports);
-__exportStar(__nccwpck_require__(5548), exports);
-__exportStar(__nccwpck_require__(1338), exports);
-__exportStar(__nccwpck_require__(8111), exports);
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 8658:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=message-attachments.js.map
-
-/***/ }),
-
-/***/ 4870:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=message-metadata.js.map
-
-/***/ }),
-
-/***/ 9599:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=views.js.map
-
-/***/ }),
-
-/***/ 1424:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
-var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
- function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
- function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
-};
-var __asyncValues = (this && this.__asyncValues) || function (o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
-};
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.buildThreadTsWarningMessage = exports.WebClient = exports.WebClientEvent = void 0;
-const querystring_1 = __nccwpck_require__(3477);
-const path_1 = __nccwpck_require__(1017);
-const zlib_1 = __importDefault(__nccwpck_require__(9796));
-const util_1 = __nccwpck_require__(3837);
-const is_stream_1 = __importDefault(__nccwpck_require__(1554));
-const p_queue_1 = __importDefault(__nccwpck_require__(8983));
-const p_retry_1 = __importStar(__nccwpck_require__(2548));
-const axios_1 = __importDefault(__nccwpck_require__(8757));
-const form_data_1 = __importDefault(__nccwpck_require__(4334));
-const is_electron_1 = __importDefault(__nccwpck_require__(4293));
-const methods_1 = __nccwpck_require__(1571);
-const instrument_1 = __nccwpck_require__(7763);
-const errors_1 = __nccwpck_require__(9781);
-const logger_1 = __nccwpck_require__(1336);
-const retry_policies_1 = __nccwpck_require__(2156);
-const helpers_1 = __importDefault(__nccwpck_require__(2500));
-const file_upload_1 = __nccwpck_require__(2482);
-/*
- * Helpers
- */
-// Props on axios default headers object to ignore when retrieving full list of actual headers sent in any HTTP requests
-const axiosHeaderPropsToIgnore = ['delete', 'common', 'get', 'put', 'head', 'post', 'link', 'patch', 'purge', 'unlink', 'options'];
-const defaultFilename = 'Untitled';
-const defaultPageSize = 200;
-const noopPageReducer = () => undefined;
-var WebClientEvent;
-(function (WebClientEvent) {
- // TODO: safe to rename this to conform to PascalCase enum type naming convention?
- // eslint-disable-next-line @typescript-eslint/naming-convention
- WebClientEvent["RATE_LIMITED"] = "rate_limited";
-})(WebClientEvent || (exports.WebClientEvent = WebClientEvent = {}));
-/**
- * A client for Slack's Web API
- *
- * This client provides an alias for each {@link https://api.slack.com/methods|Web API method}. Each method is
- * a convenience wrapper for calling the {@link WebClient#apiCall} method using the method name as the first parameter.
- */
-class WebClient extends methods_1.Methods {
- /**
- * @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`)
- */
- constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, attachOriginalToWebAPIRequestError = true, } = {}) {
- super();
- this.token = token;
- this.slackApiUrl = slackApiUrl;
- this.retryConfig = retryConfig;
- // eslint-disable-next-line new-cap
- this.requestQueue = new p_queue_1.default({ concurrency: maxRequestConcurrency });
- // NOTE: may want to filter the keys to only those acceptable for TLS options
- this.tlsConfig = tls !== undefined ? tls : {};
- this.rejectRateLimitedCalls = rejectRateLimitedCalls;
- this.teamId = teamId;
- this.attachOriginalToWebAPIRequestError = attachOriginalToWebAPIRequestError;
- // Logging
- if (typeof logger !== 'undefined') {
- this.logger = logger;
- if (typeof logLevel !== 'undefined') {
- this.logger.debug('The logLevel given to WebClient was ignored as you also gave logger');
- }
- }
- else {
- this.logger = (0, logger_1.getLogger)(WebClient.loggerName, logLevel !== null && logLevel !== void 0 ? logLevel : logger_1.LogLevel.INFO, logger);
- }
- // eslint-disable-next-line no-param-reassign
- if (this.token && !headers.Authorization)
- headers.Authorization = `Bearer ${this.token}`;
- this.axios = axios_1.default.create({
- timeout,
- baseURL: slackApiUrl,
- // eslint-disable-next-line @typescript-eslint/naming-convention
- headers: (0, is_electron_1.default)() ? headers : Object.assign({ 'User-Agent': (0, instrument_1.getUserAgent)() }, headers),
- httpAgent: agent,
- httpsAgent: agent,
- transformRequest: [this.serializeApiCallOptions.bind(this)],
- validateStatus: () => true, // all HTTP status codes should result in a resolved promise (as opposed to only 2xx)
- maxRedirects: 0,
- // disabling axios' automatic proxy support:
- // axios would read from envvars to configure a proxy automatically, but it doesn't support TLS destinations.
- // for compatibility with https://api.slack.com, and for a larger set of possible proxies (SOCKS or other
- // protocols), users of this package should use the `agent` option to configure a proxy.
- proxy: false,
- });
- // serializeApiCallOptions will always determine the appropriate content-type
- delete this.axios.defaults.headers.post['Content-Type'];
- this.logger.debug('initialized');
- }
- /**
- * Generic method for calling a Web API method
- * @param method - the Web API method to call {@link https://api.slack.com/methods}
- * @param options - options
- */
- apiCall(method, options = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- this.logger.debug(`apiCall('${method}') start`);
- warnDeprecations(method, this.logger);
- warnIfFallbackIsMissing(method, this.logger, options);
- warnIfThreadTsIsNotString(method, this.logger, options);
- if (typeof options === 'string' || typeof options === 'number' || typeof options === 'boolean') {
- throw new TypeError(`Expected an options argument but instead received a ${typeof options}`);
- }
- (0, file_upload_1.warnIfNotUsingFilesUploadV2)(method, this.logger);
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- if (method === 'files.uploadV2')
- return this.filesUploadV2(options);
- const headers = {};
- if (options.token)
- headers.Authorization = `Bearer ${options.token}`;
- const response = yield this.makeRequest(method, Object.assign({ team_id: this.teamId }, options), headers);
- const result = yield this.buildResult(response);
- this.logger.debug(`http request result: ${JSON.stringify(result)}`);
- // log warnings in response metadata
- if (result.response_metadata !== undefined && result.response_metadata.warnings !== undefined) {
- result.response_metadata.warnings.forEach(this.logger.warn.bind(this.logger));
- }
- // log warnings and errors in response metadata messages
- // related to https://api.slack.com/changelog/2016-09-28-response-metadata-is-on-the-way
- if (result.response_metadata !== undefined && result.response_metadata.messages !== undefined) {
- result.response_metadata.messages.forEach((msg) => {
- const errReg = /\[ERROR\](.*)/;
- const warnReg = /\[WARN\](.*)/;
- if (errReg.test(msg)) {
- const errMatch = msg.match(errReg);
- if (errMatch != null) {
- this.logger.error(errMatch[1].trim());
- }
- }
- else if (warnReg.test(msg)) {
- const warnMatch = msg.match(warnReg);
- if (warnMatch != null) {
- this.logger.warn(warnMatch[1].trim());
- }
- }
- });
- }
- // If result's content is gzip, "ok" property is not returned with successful response
- // TODO: look into simplifying this code block to only check for the second condition
- // if an { ok: false } body applies for all API errors
- if (!result.ok && (response.headers['content-type'] !== 'application/gzip')) {
- throw (0, errors_1.platformErrorFromResult)(result);
- }
- else if ('ok' in result && result.ok === false) {
- throw (0, errors_1.platformErrorFromResult)(result);
- }
- this.logger.debug(`apiCall('${method}') end`);
- return result;
- });
- }
- paginate(method, options, shouldStop, reduce) {
- const pageSize = (() => {
- if (options !== undefined && typeof options.limit === 'number') {
- const { limit } = options;
- // eslint-disable-next-line no-param-reassign
- delete options.limit;
- return limit;
- }
- return defaultPageSize;
- })();
- function generatePages() {
- return __asyncGenerator(this, arguments, function* generatePages_1() {
- // when result is undefined, that signals that the first of potentially many calls has not yet been made
- let result;
- // paginationOptions stores pagination options not already stored in the options argument
- let paginationOptions = {
- limit: pageSize,
- };
- if (options !== undefined && options.cursor !== undefined) {
- paginationOptions.cursor = options.cursor;
- }
- // NOTE: test for the situation where you're resuming a pagination using and existing cursor
- while (result === undefined || paginationOptions !== undefined) {
- // eslint-disable-next-line no-await-in-loop
- result = yield __await(this.apiCall(method, Object.assign(options !== undefined ? options : {}, paginationOptions)));
- yield yield __await(result);
- paginationOptions = paginationOptionsForNextPage(result, pageSize);
- }
- });
- }
- if (shouldStop === undefined) {
- return generatePages.call(this);
- }
- const pageReducer = (reduce !== undefined) ? reduce : noopPageReducer;
- let index = 0;
- return (() => __awaiter(this, void 0, void 0, function* () {
- // Unroll the first iteration of the iterator
- // This is done primarily because in order to satisfy the type system, we need a variable that is typed as A
- // (shown as accumulator before), but before the first iteration all we have is a variable typed A | undefined.
- // Unrolling the first iteration allows us to deal with undefined as a special case.
- var _a, e_1, _b, _c;
- const pageIterator = generatePages.call(this);
- const firstIteratorResult = yield pageIterator.next(undefined);
- // Assumption: there will always be at least one result in a paginated API request
- // if (firstIteratorResult.done) { return; }
- const firstPage = firstIteratorResult.value;
- let accumulator = pageReducer(undefined, firstPage, index);
- index += 1;
- if (shouldStop(firstPage)) {
- return accumulator;
- }
- try {
- // Continue iteration
- // eslint-disable-next-line no-restricted-syntax
- for (var _d = true, pageIterator_1 = __asyncValues(pageIterator), pageIterator_1_1; pageIterator_1_1 = yield pageIterator_1.next(), _a = pageIterator_1_1.done, !_a; _d = true) {
- _c = pageIterator_1_1.value;
- _d = false;
- const page = _c;
- accumulator = pageReducer(accumulator, page, index);
- if (shouldStop(page)) {
- return accumulator;
- }
- index += 1;
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (!_d && !_a && (_b = pageIterator_1.return)) yield _b.call(pageIterator_1);
- }
- finally { if (e_1) throw e_1.error; }
- }
- return accumulator;
- }))();
- }
- /**
- * This wrapper method provides an easy way to upload files using the following endpoints:
- *
- * **#1**: For each file submitted with this method, submit filenames
- * and file metadata to {@link https://api.slack.com/methods/files.getUploadURLExternal files.getUploadURLExternal} to request a URL to
- * which to send the file data to and an id for the file
- *
- * **#2**: for each returned file `upload_url`, upload corresponding file to
- * URLs returned from step 1 (e.g. https://files.slack.com/upload/v1/...\")
- *
- * **#3**: Complete uploads {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal}
- * @param options
- */
- filesUploadV2(options) {
- return __awaiter(this, void 0, void 0, function* () {
- this.logger.debug('files.uploadV2() start');
- // 1
- const fileUploads = yield this.getAllFileUploads(options);
- const fileUploadsURLRes = yield this.fetchAllUploadURLExternal(fileUploads);
- // set the upload_url and file_id returned from Slack
- fileUploadsURLRes.forEach((res, idx) => {
- fileUploads[idx].upload_url = res.upload_url;
- fileUploads[idx].file_id = res.file_id;
- });
- // 2
- yield this.postFileUploadsToExternalURL(fileUploads, options);
- // 3
- const completion = yield this.completeFileUploads(fileUploads);
- return { ok: true, files: completion };
- });
- }
- /**
- * For each file submitted with this method, submits filenames
- * and file metadata to files.getUploadURLExternal to request a URL to
- * which to send the file data to and an id for the file
- * @param fileUploads
- */
- fetchAllUploadURLExternal(fileUploads) {
- return __awaiter(this, void 0, void 0, function* () {
- return Promise.all(fileUploads.map((upload) => {
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
- const options = {
- filename: upload.filename,
- length: upload.length,
- alt_text: upload.alt_text,
- snippet_type: upload.snippet_type,
- };
- if ('token' in upload) {
- options.token = upload.token;
- }
- return this.files.getUploadURLExternal(options);
- }));
- });
- }
- /**
- * Complete uploads.
- * @param fileUploads
- * @returns
- */
- completeFileUploads(fileUploads) {
- return __awaiter(this, void 0, void 0, function* () {
- const toComplete = Object.values((0, file_upload_1.getAllFileUploadsToComplete)(fileUploads));
- return Promise.all(toComplete.map((job) => this.files.completeUploadExternal(job)));
- });
- }
- /**
- * for each returned file upload URL, upload corresponding file
- * @param fileUploads
- * @returns
- */
- postFileUploadsToExternalURL(fileUploads, options) {
- return __awaiter(this, void 0, void 0, function* () {
- return Promise.all(fileUploads.map((upload) => __awaiter(this, void 0, void 0, function* () {
- const { upload_url, file_id, filename, data } = upload;
- // either file or content will be defined
- const body = data;
- // try to post to external url
- if (upload_url) {
- const headers = {};
- if (options.token)
- headers.Authorization = `Bearer ${options.token}`;
- const uploadRes = yield this.makeRequest(upload_url, {
- body,
- }, headers);
- if (uploadRes.status !== 200) {
- return Promise.reject(Error(`Failed to upload file (id:${file_id}, filename: ${filename})`));
- }
- const returnData = { ok: true, body: uploadRes.data };
- return Promise.resolve(returnData);
- }
- return Promise.reject(Error(`No upload url found for file (id: ${file_id}, filename: ${filename}`));
- })));
- });
- }
- /**
- * @param options All file uploads arguments
- * @returns An array of file upload entries
- */
- getAllFileUploads(options) {
- return __awaiter(this, void 0, void 0, function* () {
- let fileUploads = [];
- // add single file data to uploads if file or content exists at the top level
- if ('file' in options || 'content' in options) {
- fileUploads.push(yield (0, file_upload_1.getFileUploadJob)(options, this.logger));
- }
- // add multiple files data when file_uploads is supplied
- if ('file_uploads' in options) {
- fileUploads = fileUploads.concat(yield (0, file_upload_1.getMultipleFileUploadJobs)(options, this.logger));
- }
- return fileUploads;
- });
- }
- /**
- * Low-level function to make a single API request. handles queuing, retries, and http-level errors
- */
- makeRequest(url, body, headers = {}) {
- return __awaiter(this, void 0, void 0, function* () {
- // TODO: better input types - remove any
- const task = () => this.requestQueue.add(() => __awaiter(this, void 0, void 0, function* () {
- const requestURL = (url.startsWith('https' || 0)) ? url : `${this.axios.getUri() + url}`;
- try {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const config = Object.assign({ headers }, this.tlsConfig);
- // admin.analytics.getFile returns a binary response
- // To be able to parse it, it should be read as an ArrayBuffer
- if (url.endsWith('admin.analytics.getFile')) {
- config.responseType = 'arraybuffer';
- }
- // apps.event.authorizations.list will reject HTTP requests that send token in the body
- // TODO: consider applying this change to all methods - though that will require thorough integration testing
- if (url.endsWith('apps.event.authorizations.list')) {
- // eslint-disable-next-line no-param-reassign
- delete body.token;
- }
- this.logger.debug(`http request url: ${requestURL}`);
- this.logger.debug(`http request body: ${JSON.stringify(redact(body))}`);
- // compile all headers - some set by default under the hood by axios - that will be sent along
- let allHeaders = Object.keys(this.axios.defaults.headers)
- .reduce((acc, cur) => {
- if (!axiosHeaderPropsToIgnore.includes(cur)) {
- acc[cur] = this.axios.defaults.headers[cur];
- }
- return acc;
- }, {});
- allHeaders = Object.assign(Object.assign(Object.assign({}, this.axios.defaults.headers.common), allHeaders), headers);
- this.logger.debug(`http request headers: ${JSON.stringify(redact(allHeaders))}`);
- const response = yield this.axios.post(url, body, config);
- this.logger.debug('http response received');
- if (response.status === 429) {
- const retrySec = parseRetryHeaders(response);
- if (retrySec !== undefined) {
- this.emit(WebClientEvent.RATE_LIMITED, retrySec, { url, body });
- if (this.rejectRateLimitedCalls) {
- throw new p_retry_1.AbortError((0, errors_1.rateLimitedErrorWithDelay)(retrySec));
- }
- this.logger.info(`API Call failed due to rate limiting. Will retry in ${retrySec} seconds.`);
- // pause the request queue and then delay the rejection by the amount of time in the retry header
- this.requestQueue.pause();
- // NOTE: if there was a way to introspect the current RetryOperation and know what the next timeout
- // would be, then we could subtract that time from the following delay, knowing that it the next
- // attempt still wouldn't occur until after the rate-limit header has specified. an even better
- // solution would be to subtract the time from only the timeout of this next attempt of the
- // RetryOperation. this would result in the staying paused for the entire duration specified in the
- // header, yet this operation not having to pay the timeout cost in addition to that.
- yield (0, helpers_1.default)(retrySec * 1000);
- // resume the request queue and throw a non-abort error to signal a retry
- this.requestQueue.start();
- // TODO: We may want to have more detailed info such as team_id, params except tokens, and so on.
- throw new Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`);
- }
- else {
- // TODO: turn this into some CodedError
- throw new p_retry_1.AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`));
- }
- }
- // Slack's Web API doesn't use meaningful status codes besides 429 and 200
- if (response.status !== 200) {
- throw (0, errors_1.httpErrorFromResponse)(response);
- }
- return response;
- }
- catch (error) {
- // To make this compatible with tsd, casting here instead of `catch (error: any)`
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const e = error;
- this.logger.warn('http request failed', e.message);
- if (e.request) {
- throw (0, errors_1.requestErrorWithOriginal)(e, this.attachOriginalToWebAPIRequestError);
- }
- throw error;
- }
- }));
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- return (0, p_retry_1.default)(task, this.retryConfig);
- });
- }
- /**
- * Transforms options (a simple key-value object) into an acceptable value for a body. This can be either
- * a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
- * when the options contain a binary (a stream or a buffer) and the upload should be done with content-type
- * multipart/form-data.
- * @param options - arguments for the Web API method
- * @param headers - a mutable object representing the HTTP headers for the outgoing request
- */
- serializeApiCallOptions(options, headers) {
- // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for
- // binary content
- let containsBinaryData = false;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const flattened = Object.entries(options).map(([key, value]) => {
- if (value === undefined || value === null) {
- return [];
- }
- let serializedValue = value;
- if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
- containsBinaryData = true;
- }
- else if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {
- // if value is anything other than string, number, boolean, binary data, a Stream, or a Buffer, then encode it
- // as a JSON string.
- serializedValue = JSON.stringify(value);
- }
- return [key, serializedValue];
- });
- // A body with binary content should be serialized as multipart/form-data
- if (containsBinaryData) {
- this.logger.debug('Request arguments contain binary data');
- const form = flattened.reduce((frm, [key, value]) => {
- if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
- const opts = {};
- opts.filename = (() => {
- // attempt to find filename from `value`. adapted from:
- // https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230
- // formidable and the browser add a name property
- // fs- and request- streams have path property
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const streamOrBuffer = value;
- if (typeof streamOrBuffer.name === 'string') {
- return (0, path_1.basename)(streamOrBuffer.name);
- }
- if (typeof streamOrBuffer.path === 'string') {
- return (0, path_1.basename)(streamOrBuffer.path);
- }
- return defaultFilename;
- })();
- frm.append(key, value, opts);
- }
- else if (key !== undefined && value !== undefined) {
- frm.append(key, value);
- }
- return frm;
- }, new form_data_1.default());
- if (headers) {
- // Copying FormData-generated headers into headers param
- // not reassigning to headers param since it is passed by reference and behaves as an inout param
- Object.entries(form.getHeaders()).forEach(([header, value]) => {
- // eslint-disable-next-line no-param-reassign
- headers[header] = value;
- });
- }
- return form;
- }
- // Otherwise, a simple key-value object is returned
- // eslint-disable-next-line no-param-reassign
- if (headers)
- headers['Content-Type'] = 'application/x-www-form-urlencoded';
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const initialValue = {};
- return (0, querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
- if (key !== undefined && value !== undefined) {
- accumulator[key] = value;
- }
- return accumulator;
- }, initialValue));
- }
- /**
- * Processes an HTTP response into a WebAPICallResult by performing JSON parsing on the body and merging relevant
- * HTTP headers into the object.
- * @param response - an http response
- */
- // eslint-disable-next-line class-methods-use-this
- buildResult(response) {
- return __awaiter(this, void 0, void 0, function* () {
- let { data } = response;
- const isGzipResponse = response.headers['content-type'] === 'application/gzip';
- // Check for GZIP response - if so, it is a successful response from admin.analytics.getFile
- if (isGzipResponse) {
- // admin.analytics.getFile will return a Buffer that can be unzipped
- try {
- const unzippedData = yield new Promise((resolve, reject) => {
- zlib_1.default.unzip(data, (err, buf) => {
- if (err) {
- return reject(err);
- }
- return resolve(buf.toString().split('\n'));
- });
- }).then((res) => res)
- .catch((err) => {
- throw err;
- });
- const fileData = [];
- if (Array.isArray(unzippedData)) {
- unzippedData.forEach((dataset) => {
- if (dataset && dataset.length > 0) {
- fileData.push(JSON.parse(dataset));
- }
- });
- }
- data = { file_data: fileData };
- }
- catch (err) {
- data = { ok: false, error: err };
- }
- }
- else if (!isGzipResponse && response.request.path === '/api/admin.analytics.getFile') {
- // if it isn't a Gzip response but is from the admin.analytics.getFile request,
- // decode the ArrayBuffer to JSON read the error
- data = JSON.parse(new util_1.TextDecoder().decode(data));
- }
- if (typeof data === 'string') {
- // response.data can be a string, not an object for some reason
- try {
- data = JSON.parse(data);
- }
- catch (_) {
- // failed to parse the string value as JSON data
- data = { ok: false, error: data };
- }
- }
- if (data.response_metadata === undefined) {
- data.response_metadata = {};
- }
- // add scopes metadata from headers
- if (response.headers['x-oauth-scopes'] !== undefined) {
- data.response_metadata.scopes = response.headers['x-oauth-scopes'].trim().split(/\s*,\s*/);
- }
- if (response.headers['x-accepted-oauth-scopes'] !== undefined) {
- data.response_metadata.acceptedScopes = response.headers['x-accepted-oauth-scopes'].trim().split(/\s*,\s*/);
- }
- // add retry metadata from headers
- const retrySec = parseRetryHeaders(response);
- if (retrySec !== undefined) {
- data.response_metadata.retryAfter = retrySec;
- }
- return data;
- });
- }
-}
-exports.WebClient = WebClient;
-/**
- * The name used to prefix all logging generated from this object
- */
-WebClient.loggerName = 'WebClient';
-exports["default"] = WebClient;
-/**
- * Determines an appropriate set of cursor pagination options for the next request to a paginated API method.
- * @param previousResult - the result of the last request, where the next cursor might be found.
- * @param pageSize - the maximum number of additional items to fetch in the next request.
- */
-function paginationOptionsForNextPage(previousResult, pageSize) {
- if (previousResult !== undefined &&
- previousResult.response_metadata !== undefined &&
- previousResult.response_metadata.next_cursor !== undefined &&
- previousResult.response_metadata.next_cursor !== '') {
- return {
- limit: pageSize,
- cursor: previousResult.response_metadata.next_cursor,
- };
- }
- return undefined;
-}
-/**
- * Extract the amount of time (in seconds) the platform has recommended this client wait before sending another request
- * from a rate-limited HTTP response (statusCode = 429).
- */
-function parseRetryHeaders(response) {
- if (response.headers['retry-after'] !== undefined) {
- const retryAfter = parseInt(response.headers['retry-after'], 10);
- if (!Number.isNaN(retryAfter)) {
- return retryAfter;
- }
- }
- return undefined;
-}
-/**
- * Log a warning when using a deprecated method
- * @param method api method being called
- * @param logger instance of web clients logger
- */
-function warnDeprecations(method, logger) {
- const deprecatedMethods = ['workflows.'];
- const isDeprecated = deprecatedMethods.some((depMethod) => {
- const re = new RegExp(`^${depMethod}`);
- return re.test(method);
- });
- if (isDeprecated) {
- logger.warn(`${method} is deprecated. Please check on https://api.slack.com/methods for an alternative.`);
- }
-}
-/**
- * Log a warning when using chat.postMessage without text argument or attachments with fallback argument
- * @param method api method being called
- * @param logger instance of we clients logger
- * @param options arguments for the Web API method
- */
-function warnIfFallbackIsMissing(method, logger, options) {
- const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage'];
- const isTargetMethod = targetMethods.includes(method);
- const hasAttachments = (args) => Array.isArray(args.attachments) && args.attachments.length;
- const missingAttachmentFallbackDetected = (args) => Array.isArray(args.attachments) &&
- args.attachments.some((attachment) => !attachment.fallback || attachment.fallback.trim() === '');
- const isEmptyText = (args) => args.text === undefined || args.text === null || args.text === '';
- const buildMissingTextWarning = () => `The top-level \`text\` argument is missing in the request payload for a ${method} call - ` +
- 'It\'s a best practice to always provide a `text` argument when posting a message. ' +
- 'The `text` is used in places where the content cannot be rendered such as: ' +
- 'system push notifications, assistive technology such as screen readers, etc.';
- const buildMissingFallbackWarning = () => `Additionally, the attachment-level \`fallback\` argument is missing in the request payload for a ${method} call - ` +
- 'To avoid this warning, it is recommended to always provide a top-level `text` argument when posting a message. ' +
- 'Alternatively, you can provide an attachment-level `fallback` argument, though this is now considered a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details).';
- if (isTargetMethod && typeof options === 'object') {
- if (hasAttachments(options)) {
- if (missingAttachmentFallbackDetected(options) && isEmptyText(options)) {
- logger.warn(buildMissingTextWarning());
- logger.warn(buildMissingFallbackWarning());
- }
- }
- else if (isEmptyText(options)) {
- logger.warn(buildMissingTextWarning());
- }
- }
-}
-/**
- * Log a warning when thread_ts is not a string
- * @param method api method being called
- * @param logger instance of web clients logger
- * @param options arguments for the Web API method
- */
-function warnIfThreadTsIsNotString(method, logger, options) {
- const targetMethods = ['chat.postEphemeral', 'chat.postMessage', 'chat.scheduleMessage', 'files.upload'];
- const isTargetMethod = targetMethods.includes(method);
- if (isTargetMethod && (options === null || options === void 0 ? void 0 : options.thread_ts) !== undefined && typeof (options === null || options === void 0 ? void 0 : options.thread_ts) !== 'string') {
- logger.warn(buildThreadTsWarningMessage(method));
- }
-}
-function buildThreadTsWarningMessage(method) {
- return `The given thread_ts value in the request payload for a ${method} call is a float value. We highly recommend using a string value instead.`;
-}
-exports.buildThreadTsWarningMessage = buildThreadTsWarningMessage;
-/**
- * Takes an object and redacts specific items
- * @param body
- * @returns
- */
-function redact(body) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const flattened = Object.entries(body).map(([key, value]) => {
- // no value provided
- if (value === undefined || value === null) {
- return [];
- }
- let serializedValue = value;
- // redact possible tokens
- if (key.match(/.*token.*/) !== null || key.match(/[Aa]uthorization/)) {
- serializedValue = '[[REDACTED]]';
- }
- // when value is buffer or stream we can avoid logging it
- if (Buffer.isBuffer(value) || (0, is_stream_1.default)(value)) {
- serializedValue = '[[BINARY VALUE OMITTED]]';
- }
- else if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {
- serializedValue = JSON.stringify(value);
- }
- return [key, serializedValue];
- });
- // return as object
- const initialValue = {};
- return flattened.reduce((accumulator, [key, value]) => {
- if (key !== undefined && value !== undefined) {
- accumulator[key] = value;
- }
- return accumulator;
- }, initialValue);
-}
-//# sourceMappingURL=WebClient.js.map
-
-/***/ }),
-
-/***/ 9781:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.rateLimitedErrorWithDelay = exports.platformErrorFromResult = exports.httpErrorFromResponse = exports.requestErrorWithOriginal = exports.errorWithCode = exports.ErrorCode = void 0;
-/**
- * A dictionary of codes for errors produced by this package
- */
-var ErrorCode;
-(function (ErrorCode) {
- // general error
- ErrorCode["RequestError"] = "slack_webapi_request_error";
- ErrorCode["HTTPError"] = "slack_webapi_http_error";
- ErrorCode["PlatformError"] = "slack_webapi_platform_error";
- ErrorCode["RateLimitedError"] = "slack_webapi_rate_limited_error";
- // file uploads errors
- ErrorCode["FileUploadInvalidArgumentsError"] = "slack_webapi_file_upload_invalid_args_error";
- ErrorCode["FileUploadReadFileDataError"] = "slack_webapi_file_upload_read_file_data_error";
-})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
-/**
- * Factory for producing a {@link CodedError} from a generic error
- */
-function errorWithCode(error, code) {
- // NOTE: might be able to return something more specific than a CodedError with conditional typing
- const codedError = error;
- codedError.code = code;
- return codedError;
-}
-exports.errorWithCode = errorWithCode;
-/**
- * A factory to create WebAPIRequestError objects
- * @param original - original error
- * @param attachOriginal - config indicating if 'original' property should be added on the error object
- */
-function requestErrorWithOriginal(original, attachOriginal) {
- const error = errorWithCode(new Error(`A request error occurred: ${original.message}`), ErrorCode.RequestError);
- if (attachOriginal) {
- error.original = original;
- }
- return error;
-}
-exports.requestErrorWithOriginal = requestErrorWithOriginal;
-/**
- * A factory to create WebAPIHTTPError objects
- * @param response - original error
- */
-function httpErrorFromResponse(response) {
- const error = errorWithCode(new Error(`An HTTP protocol error occurred: statusCode = ${response.status}`), ErrorCode.HTTPError);
- error.statusCode = response.status;
- error.statusMessage = response.statusText;
- const nonNullHeaders = {};
- Object.keys(response.headers).forEach((k) => {
- if (k && response.headers[k]) {
- nonNullHeaders[k] = response.headers[k];
- }
- });
- error.headers = nonNullHeaders;
- error.body = response.data;
- return error;
-}
-exports.httpErrorFromResponse = httpErrorFromResponse;
-/**
- * A factory to create WebAPIPlatformError objects
- * @param result - Web API call result
- */
-function platformErrorFromResult(result) {
- const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError);
- error.data = result;
- return error;
-}
-exports.platformErrorFromResult = platformErrorFromResult;
-/**
- * A factory to create WebAPIRateLimitedError objects
- * @param retrySec - Number of seconds that the request can be retried in
- */
-function rateLimitedErrorWithDelay(retrySec) {
- const error = errorWithCode(new Error(`A rate-limit has been reached, you may retry this request in ${retrySec} seconds`), ErrorCode.RateLimitedError);
- error.retryAfter = retrySec;
- return error;
-}
-exports.rateLimitedErrorWithDelay = rateLimitedErrorWithDelay;
-//# sourceMappingURL=errors.js.map
-
-/***/ }),
-
-/***/ 2482:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.buildInvalidFilesUploadParamError = exports.buildMultipleChannelsErrorMsg = exports.buildChannelsWarning = exports.buildFilesUploadMissingMessage = exports.buildGeneralFilesUploadWarning = exports.buildLegacyMethodWarning = exports.buildMissingExtensionWarning = exports.buildMissingFileNameWarning = exports.buildLegacyFileTypeWarning = exports.buildFileSizeErrorMsg = exports.buildMissingFileIdError = exports.warnIfLegacyFileType = exports.warnIfMissingOrInvalidFileNameAndDefault = exports.errorIfInvalidOrMissingFileData = exports.errorIfChannelsCsv = exports.warnIfChannels = exports.warnIfNotUsingFilesUploadV2 = exports.getAllFileUploadsToComplete = exports.getFileDataAsStream = exports.getFileDataLength = exports.getFileData = exports.getMultipleFileUploadJobs = exports.getFileUploadJob = void 0;
-const fs_1 = __nccwpck_require__(7147);
-const stream_1 = __nccwpck_require__(2781);
-const errors_1 = __nccwpck_require__(9781);
-function getFileUploadJob(options, logger) {
- var _a, _b, _c, _d;
- return __awaiter(this, void 0, void 0, function* () {
- // Validate parameters
- warnIfLegacyFileType(options, logger);
- warnIfChannels(options, logger);
- errorIfChannelsCsv(options);
- const fileName = warnIfMissingOrInvalidFileNameAndDefault(options, logger);
- const fileData = yield getFileData(options);
- const fileDataBytesLength = getFileDataLength(fileData);
- const fileUploadJob = {
- // supplied by user
- alt_text: options.alt_text,
- channel_id: (_a = options.channels) !== null && _a !== void 0 ? _a : options.channel_id,
- filename: (_b = options.filename) !== null && _b !== void 0 ? _b : fileName,
- initial_comment: options.initial_comment,
- snippet_type: options.snippet_type,
- title: (_c = options.title) !== null && _c !== void 0 ? _c : ((_d = options.filename) !== null && _d !== void 0 ? _d : fileName), // default title to filename unless otherwise specified
- // calculated
- data: fileData,
- length: fileDataBytesLength,
- };
- if ('thread_ts' in options) {
- fileUploadJob.thread_ts = options.thread_ts;
- }
- if ('token' in options) {
- fileUploadJob.token = options.token;
- }
- if ('content' in options) {
- return Object.assign({ content: options.content }, fileUploadJob);
- }
- if ('file' in options) {
- return Object.assign({ file: options.file }, fileUploadJob);
- }
- throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You must supply one'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- });
-}
-exports.getFileUploadJob = getFileUploadJob;
-/**
- * Returns an array of files upload entries when `file_uploads` is supplied.
- * **Note**
- * file_uploads should be set when multiple files are intended to be attached to a
- * single message. To support this, we handle options supplied with
- * top level `initial_comment`, `thread_ts`, `channel_id` and `file_uploads` parameters.
- * ```javascript
- * const res = await client.files.uploadV2({
- * initial_comment: 'Here are the files!',
- * thread_ts: '1223313423434.131321',
- * channel_id: 'C12345',
- * file_uploads: [
- * {
- * file: './test/fixtures/test-txt.txt',
- * filename: 'test-txt.txt',
- * },
- * {
- * file: './test/fixtures/test-png.png',
- * filename: 'test-png.png',
- * },
- * ],
- * });
- * ```
- * @param options provided by user
-*/
-function getMultipleFileUploadJobs(options, logger) {
- return __awaiter(this, void 0, void 0, function* () {
- if ('file_uploads' in options) {
- // go through each file_upload and create a job for it
- return Promise.all(options.file_uploads.map((upload) => {
- // ensure no omitted properties included in files_upload entry
- // these properties are valid only at the top-level, not
- // inside file_uploads.
- const { channel_id, channels, initial_comment, thread_ts } = upload;
- if (channel_id || channels || initial_comment || thread_ts) {
- throw (0, errors_1.errorWithCode)(new Error(buildInvalidFilesUploadParamError()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
- // takes any channel_id, initial_comment and thread_ts
- // supplied at the top level.
- const uploadJobArgs = Object.assign(Object.assign({}, upload), { channels: options.channels, channel_id: options.channel_id, initial_comment: options.initial_comment });
- if ('thread_ts' in options) {
- uploadJobArgs.thread_ts = options.thread_ts;
- }
- if ('token' in options) {
- uploadJobArgs.token = options.token;
- }
- if ('content' in upload) {
- return getFileUploadJob(Object.assign({ content: upload.content }, uploadJobArgs), logger);
- }
- if ('file' in upload) {
- return getFileUploadJob(Object.assign({ file: upload.file }, uploadJobArgs), logger);
- }
- throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You must supply one'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }));
- }
- throw new Error(buildFilesUploadMissingMessage());
- });
-}
-exports.getMultipleFileUploadJobs = getMultipleFileUploadJobs;
-// Helpers to build the FileUploadJob
-/**
- * Returns a single file upload's data
- * @param options
- * @returns Binary data representation of file
- */
-function getFileData(options) {
- return __awaiter(this, void 0, void 0, function* () {
- errorIfInvalidOrMissingFileData(options);
- if ('file' in options) {
- const { file } = options;
- // try to handle as buffer
- if (Buffer.isBuffer(file))
- return file;
- // try to handle as filepath
- if (typeof file === 'string') {
- // try to read file as if the string was a file path
- try {
- const dataBuffer = (0, fs_1.readFileSync)(file);
- return dataBuffer;
- }
- catch (error) {
- throw (0, errors_1.errorWithCode)(new Error(`Unable to resolve file data for ${file}. Please supply a filepath string, or binary data Buffer or String directly.`), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
- }
- // try to handle as Readable
- const data = yield getFileDataAsStream(file);
- if (data)
- return data;
- }
- if ('content' in options)
- return Buffer.from(options.content);
- // general catch-all error
- throw (0, errors_1.errorWithCode)(new Error('There was an issue getting the file data for the file or content supplied'), errors_1.ErrorCode.FileUploadReadFileDataError);
- });
-}
-exports.getFileData = getFileData;
-function getFileDataLength(data) {
- if (data) {
- return Buffer.byteLength(data, 'utf8');
- }
- throw (0, errors_1.errorWithCode)(new Error(buildFileSizeErrorMsg()), errors_1.ErrorCode.FileUploadReadFileDataError);
-}
-exports.getFileDataLength = getFileDataLength;
-function getFileDataAsStream(readable) {
- return __awaiter(this, void 0, void 0, function* () {
- const chunks = [];
- return new Promise((resolve, reject) => {
- readable.on('readable', () => {
- let chunk;
- /* eslint-disable no-cond-assign */
- while ((chunk = readable.read()) !== null) {
- chunks.push(chunk);
- }
- });
- readable.on('end', () => {
- if (chunks.length > 0) {
- const content = Buffer.concat(chunks);
- resolve(content);
- }
- else {
- reject(Error('No data in supplied file'));
- }
- });
- });
- });
-}
-exports.getFileDataAsStream = getFileDataAsStream;
-/**
- * Filters through all fileUploads and groups them into jobs for completion
- * based on combination of channel_id, thread_ts, initial_comment.
- * {@link https://api.slack.com/methods/files.completeUploadExternal files.completeUploadExternal} allows for multiple
- * files to be uploaded with a message (`initial_comment`), and as a threaded message (`thread_ts`)
- * In order to be grouped together, file uploads must have like properties.
- * @param fileUploads
- * @returns
- */
-function getAllFileUploadsToComplete(fileUploads) {
- const toComplete = {};
- fileUploads.forEach((upload) => {
- const { channel_id, thread_ts, initial_comment, file_id, title } = upload;
- if (file_id) {
- const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}`;
- if (!Object.prototype.hasOwnProperty.call(toComplete, compareString)) {
- toComplete[compareString] = {
- files: [{ id: file_id, title }],
- channel_id,
- initial_comment,
- };
- if (thread_ts) {
- toComplete[compareString].thread_ts = upload.thread_ts;
- }
- if ('token' in upload) {
- toComplete[compareString].token = upload.token;
- }
- }
- else {
- toComplete[compareString].files.push({
- id: file_id,
- title,
- });
- }
- }
- else {
- throw new Error(buildMissingFileIdError());
- }
- });
- return toComplete;
-}
-exports.getAllFileUploadsToComplete = getAllFileUploadsToComplete;
-// Validation
-/**
- * Advise to use the files.uploadV2 method over legacy files.upload method and over
- * lower-level utilities.
- * @param method
- * @param logger
-*/
-function warnIfNotUsingFilesUploadV2(method, logger) {
- const targetMethods = ['files.upload'];
- const isTargetMethod = targetMethods.includes(method);
- if (method === 'files.upload')
- logger.warn(buildLegacyMethodWarning(method));
- if (isTargetMethod)
- logger.info(buildGeneralFilesUploadWarning());
-}
-exports.warnIfNotUsingFilesUploadV2 = warnIfNotUsingFilesUploadV2;
-/**
- * `channels` param is supported but only when a single channel is specified.
- * @param options
- * @param logger
- */
-function warnIfChannels(options, logger) {
- if (options.channels)
- logger.warn(buildChannelsWarning());
-}
-exports.warnIfChannels = warnIfChannels;
-/**
- * v1 files.upload supported `channels` parameter provided as a comma-separated
- * string of values, e.g. 'C1234,C5678'. V2 no longer supports this csv value.
- * You may still supply `channels` with a single channel string value e.g. 'C1234'
- * but it is highly encouraged to supply `channel_id` instead.
- * @param options
- */
-function errorIfChannelsCsv(options) {
- const channels = options.channels ? options.channels.split(',') : [];
- if (channels.length > 1) {
- throw (0, errors_1.errorWithCode)(new Error(buildMultipleChannelsErrorMsg()), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
-}
-exports.errorIfChannelsCsv = errorIfChannelsCsv;
-/**
- * Checks for either a file or content property and errors if missing
- * @param options
- */
-function errorIfInvalidOrMissingFileData(options) {
- const hasFile = 'file' in options;
- const hasContent = 'content' in options;
- if (!(hasFile || hasContent) || (hasFile && hasContent)) {
- throw (0, errors_1.errorWithCode)(new Error('Either a file or content field is required for valid file upload. You cannot supply both'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
- /* eslint-disable @typescript-eslint/no-explicit-any */
- if ('file' in options) {
- const { file } = options;
- if (file && !(typeof file === 'string' || Buffer.isBuffer(file) || file instanceof stream_1.Readable)) {
- throw (0, errors_1.errorWithCode)(new Error('file must be a valid string path, buffer or Readable'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
- }
- if ('content' in options && options.content && typeof options.content !== 'string') {
- throw (0, errors_1.errorWithCode)(new Error('content must be a string'), errors_1.ErrorCode.FileUploadInvalidArgumentsError);
- }
-}
-exports.errorIfInvalidOrMissingFileData = errorIfInvalidOrMissingFileData;
-/**
- * @param options
- * @param logger
- * @returns filename if it exists
- */
-function warnIfMissingOrInvalidFileNameAndDefault(options, logger) {
- var _a;
- const DEFAULT_FILETYPE = 'txt';
- const DEFAULT_FILENAME = `file.${(_a = options.filetype) !== null && _a !== void 0 ? _a : DEFAULT_FILETYPE}`;
- const { filename } = options;
- if (!filename) {
- // Filename was an optional property in legacy method
- logger.warn(buildMissingFileNameWarning());
- return DEFAULT_FILENAME;
- }
- if (filename.split('.').length < 2) {
- // likely filename is missing extension
- logger.warn(buildMissingExtensionWarning(filename));
- }
- return filename;
-}
-exports.warnIfMissingOrInvalidFileNameAndDefault = warnIfMissingOrInvalidFileNameAndDefault;
-/**
- * `filetype` param is no longer supported and will be ignored
- * @param options
- * @param logger
- */
-function warnIfLegacyFileType(options, logger) {
- if (options.filetype) {
- logger.warn(buildLegacyFileTypeWarning());
- }
-}
-exports.warnIfLegacyFileType = warnIfLegacyFileType;
-// Validation message utilities
-function buildMissingFileIdError() {
- return 'Missing required file id for file upload completion';
-}
-exports.buildMissingFileIdError = buildMissingFileIdError;
-function buildFileSizeErrorMsg() {
- return 'There was an issue calculating the size of your file';
-}
-exports.buildFileSizeErrorMsg = buildFileSizeErrorMsg;
-function buildLegacyFileTypeWarning() {
- return 'filetype is no longer a supported field in files.uploadV2.' +
- ' \nPlease remove this field. To indicate file type, please do so via the required filename property' +
- ' using the appropriate file extension, e.g. image.png, text.txt';
-}
-exports.buildLegacyFileTypeWarning = buildLegacyFileTypeWarning;
-function buildMissingFileNameWarning() {
- return 'filename is a required field for files.uploadV2. \n For backwards compatibility and ease of migration, ' +
- 'defaulting the filename. For best experience and consistent unfurl behavior, you' +
- ' should set the filename property with correct file extension, e.g. image.png, text.txt';
-}
-exports.buildMissingFileNameWarning = buildMissingFileNameWarning;
-function buildMissingExtensionWarning(filename) {
- return `filename supplied '${filename}' may be missing a proper extension. Missing extenions may result in unexpected unfurl behavior when shared`;
-}
-exports.buildMissingExtensionWarning = buildMissingExtensionWarning;
-function buildLegacyMethodWarning(method) {
- return `${method} may cause some issues like timeouts for relatively large files.`;
-}
-exports.buildLegacyMethodWarning = buildLegacyMethodWarning;
-function buildGeneralFilesUploadWarning() {
- return 'Our latest recommendation is to use client.files.uploadV2() method, ' +
- 'which is mostly compatible and much stabler, instead.';
-}
-exports.buildGeneralFilesUploadWarning = buildGeneralFilesUploadWarning;
-function buildFilesUploadMissingMessage() {
- return 'Something went wrong with processing file_uploads';
-}
-exports.buildFilesUploadMissingMessage = buildFilesUploadMissingMessage;
-function buildChannelsWarning() {
- return 'Although the \'channels\' parameter is still supported for smoother migration from legacy files.upload, ' +
- 'we recommend using the new channel_id parameter with a single str value instead (e.g. \'C12345\').';
-}
-exports.buildChannelsWarning = buildChannelsWarning;
-function buildMultipleChannelsErrorMsg() {
- return 'Sharing files with multiple channels is no longer supported in v2. Share files in each channel separately instead.';
-}
-exports.buildMultipleChannelsErrorMsg = buildMultipleChannelsErrorMsg;
-function buildInvalidFilesUploadParamError() {
- return 'You may supply file_uploads only for a single channel, comment, thread respectively. ' +
- 'Therefore, please supply any channel_id, initial_comment, thread_ts in the top-layer.';
-}
-exports.buildInvalidFilesUploadParamError = buildInvalidFilesUploadParamError;
-//# sourceMappingURL=file-upload.js.map
-
-/***/ }),
-
-/***/ 2500:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-/**
- * Build a Promise that will resolve after the specified number of milliseconds.
- * @param ms milliseconds to wait
- * @param value value for eventual resolution
- */
-function delay(ms) {
- return new Promise((resolve) => {
- setTimeout(resolve, ms);
- });
-}
-exports["default"] = delay;
-//# sourceMappingURL=helpers.js.map
-
-/***/ }),
-
-/***/ 431:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-///
-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);
-};
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.addAppMetadata = exports.retryPolicies = exports.ErrorCode = exports.LogLevel = exports.WebClientEvent = exports.WebClient = void 0;
-var WebClient_1 = __nccwpck_require__(1424);
-Object.defineProperty(exports, "WebClient", ({ enumerable: true, get: function () { return WebClient_1.WebClient; } }));
-Object.defineProperty(exports, "WebClientEvent", ({ enumerable: true, get: function () { return WebClient_1.WebClientEvent; } }));
-var logger_1 = __nccwpck_require__(1336);
-Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_1.LogLevel; } }));
-var errors_1 = __nccwpck_require__(9781);
-Object.defineProperty(exports, "ErrorCode", ({ enumerable: true, get: function () { return errors_1.ErrorCode; } }));
-var retry_policies_1 = __nccwpck_require__(2156);
-Object.defineProperty(exports, "retryPolicies", ({ enumerable: true, get: function () { return __importDefault(retry_policies_1).default; } }));
-var instrument_1 = __nccwpck_require__(7763);
-Object.defineProperty(exports, "addAppMetadata", ({ enumerable: true, get: function () { return instrument_1.addAppMetadata; } }));
-__exportStar(__nccwpck_require__(1571), exports);
-__exportStar(__nccwpck_require__(1099), exports);
-__exportStar(__nccwpck_require__(2888), exports);
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 7763:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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;
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getUserAgent = exports.addAppMetadata = void 0;
-const os = __importStar(__nccwpck_require__(2037));
-const path_1 = __nccwpck_require__(1017);
-// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
-const packageJson = __nccwpck_require__(9087);
-/**
- * Replaces occurrences of '/' with ':' in a string, since '/' is meaningful inside User-Agent strings as a separator.
- */
-function replaceSlashes(s) {
- return s.replace('/', ':');
-}
-// TODO: for the deno build (see the `npm run build:deno` npm run script), we could replace the `os-browserify` npm
-// module shim with our own shim leveraging the deno beta compatibility layer for node's `os` module (for more info
-// see https://deno.land/std@0.116.0/node/os.ts). At the time of writing this TODO (2021/11/25), this required deno
-// v1.16.2 and use of the --unstable flag. Once support for this exists without the --unstable flag, we can improve
-// the `os` module deno shim to correctly report operating system from a deno runtime. Until then, the below `os`-
-// based code will report "browser/undefined" from a deno runtime.
-const baseUserAgent = `${replaceSlashes(packageJson.name)}/${packageJson.version} ` +
- `${(0, path_1.basename)(process.title)}/${process.version.replace('v', '')} ` +
- `${os.platform()}/${os.release()}`;
-const appMetadata = {};
-/**
- * Appends the app metadata into the User-Agent value
- * @param appMetadata.name - name of tool to be counted in instrumentation
- * @param appMetadata.version - version of tool to be counted in instrumentation
- */
-function addAppMetadata({ name, version }) {
- appMetadata[replaceSlashes(name)] = version;
-}
-exports.addAppMetadata = addAppMetadata;
-/**
- * Returns the current User-Agent value for instrumentation
- */
-function getUserAgent() {
- const appIdentifier = Object.entries(appMetadata).map(([name, version]) => `${name}/${version}`).join(' ');
- // only prepend the appIdentifier when its not empty
- return ((appIdentifier.length > 0) ? `${appIdentifier} ` : '') + baseUserAgent;
-}
-exports.getUserAgent = getUserAgent;
-//# sourceMappingURL=instrument.js.map
-
-/***/ }),
-
-/***/ 1336:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.getLogger = exports.LogLevel = void 0;
-const logger_1 = __nccwpck_require__(2704);
-var logger_2 = __nccwpck_require__(2704);
-Object.defineProperty(exports, "LogLevel", ({ enumerable: true, get: function () { return logger_2.LogLevel; } }));
-let instanceCount = 0;
-/**
- * INTERNAL interface for getting or creating a named Logger.
- */
-function getLogger(name, level, existingLogger) {
- // Get a unique ID for the logger.
- const instanceId = instanceCount;
- instanceCount += 1;
- // Set up the logger.
- const logger = (() => {
- if (existingLogger !== undefined) {
- return existingLogger;
- }
- return new logger_1.ConsoleLogger();
- })();
- logger.setName(`web-api:${name}:${instanceId}`);
- if (level !== undefined) {
- logger.setLevel(level);
- }
- return logger;
-}
-exports.getLogger = getLogger;
-//# sourceMappingURL=logger.js.map
-
-/***/ }),
-
-/***/ 1571:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-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.Methods = void 0;
-const eventemitter3_1 = __nccwpck_require__(1848);
-const WebClient_1 = __nccwpck_require__(1424);
-/**
- * Binds a certain `method` and its arguments and result types to the `apiCall` method in `WebClient`.
- */
-function bindApiCall(self, method) {
- // We have to 'assert' that the bound method does indeed return the more specific `Result` type instead of just
- // `WebAPICallResult`
- return self.apiCall.bind(self, method);
-}
-function bindFilesUploadV2(self) {
- return self.filesUploadV2.bind(self);
+function bindFilesUploadV2(self) {
+ return self.filesUploadV2.bind(self);
}
/**
* A class that defines all Web API methods, their arguments type, their response type, and binds those methods to the
@@ -7908,7 +3072,7 @@ class Methods extends eventemitter3_1.EventEmitter {
analytics: {
/**
* @description Retrieve analytics data for a given date, presented as a compressed JSON file.
- * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/api.test `api.test` API reference}.
*/
getFile: bindApiCall(this, 'admin.analytics.getFile'),
},
@@ -7916,66 +3080,66 @@ class Methods extends eventemitter3_1.EventEmitter {
activities: {
/**
* @description Get logs for a specified team/org.
- * @see {@link https://api.slack.com/methods/admin.apps.activities.list `admin.apps.activities.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.activities.list `admin.apps.activities.list` API reference}.
*/
- list: bindApiCall(this, 'admin.apps.activities.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.apps.activities.list'),
},
/**
* @description Approve an app for installation on a workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.approve `admin.apps.approve` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.approve `admin.apps.approve` API reference}.
*/
approve: bindApiCall(this, 'admin.apps.approve'),
approved: {
/**
* @description List approved apps for an org or workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.approved.list `admin.apps.approved.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.approved.list `admin.apps.approved.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.approved.list'),
},
/**
* @description Clear an app resolution.
- * @see {@link https://api.slack.com/methods/admin.apps.clearResolution `admin.apps.clearResolution` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.clearResolution `admin.apps.clearResolution` API reference}.
*/
clearResolution: bindApiCall(this, 'admin.apps.clearResolution'),
config: {
/**
* @description Look up the app config for connectors by their IDs.
- * @see {@link https://api.slack.com/methods/admin.apps.config.lookup `admin.apps.config.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.config.lookup `admin.apps.config.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.apps.config.lookup'),
/**
* @description Set the app config for a connector.
- * @see {@link https://api.slack.com/methods/admin.apps.config.set `admin.apps.config.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.config.set `admin.apps.config.set` API reference}.
*/
set: bindApiCall(this, 'admin.apps.config.set'),
},
requests: {
/**
* @description Cancel app request for team.
- * @see {@link https://api.slack.com/methods/admin.apps.requests.cancel `admin.apps.requests.cancel` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.requests.cancel `admin.apps.requests.cancel` API reference}.
*/
cancel: bindApiCall(this, 'admin.apps.requests.cancel'),
/**
* @description List app requests for a team/workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.requests.list `admin.apps.requests.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.requests.list `admin.apps.requests.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.requests.list'),
},
/**
* @description Restrict an app for installation on a workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.restrict `admin.apps.restrict` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.restrict `admin.apps.restrict` API reference}.
*/
restrict: bindApiCall(this, 'admin.apps.restrict'),
restricted: {
/**
* @description List restricted apps for an org or workspace.
- * @see {@link https://api.slack.com/methods/admin.apps.restricted.list `admin.apps.restricted.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.restricted.list `admin.apps.restricted.list` API reference}.
*/
list: bindApiCall(this, 'admin.apps.restricted.list'),
},
/**
* @description Uninstall an app from one or many workspaces, or an entire enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.apps.uninstall `admin.apps.uninstall` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.apps.uninstall `admin.apps.uninstall` API reference}.
*/
uninstall: bindApiCall(this, 'admin.apps.uninstall'),
},
@@ -7983,17 +3147,17 @@ class Methods extends eventemitter3_1.EventEmitter {
policy: {
/**
* @description Assign entities to a particular authentication policy.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.assignEntities `admin.auth.policy.assignEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.assignEntities `admin.auth.policy.assignEntities` API reference}.
*/
assignEntities: bindApiCall(this, 'admin.auth.policy.assignEntities'),
/**
* @description Fetch all the entities assigned to a particular authentication policy by name.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.getEntities `admin.auth.policy.getEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.getEntities `admin.auth.policy.getEntities` API reference}.
*/
getEntities: bindApiCall(this, 'admin.auth.policy.getEntities'),
/**
* @description Remove specified entities from a specified authentication policy.
- * @see {@link https://api.slack.com/methods/admin.auth.policy.removeEntities `admin.auth.policy.removeEntities` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.auth.policy.removeEntities `admin.auth.policy.removeEntities` API reference}.
*/
removeEntities: bindApiCall(this, 'admin.auth.policy.removeEntities'),
},
@@ -8001,202 +3165,202 @@ class Methods extends eventemitter3_1.EventEmitter {
barriers: {
/**
* @description Create an Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.create `admin.barriers.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.create `admin.barriers.create` API reference}.
*/
create: bindApiCall(this, 'admin.barriers.create'),
/**
* @description Delete an existing Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.delete `admin.barriers.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.delete `admin.barriers.delete` API reference}.
*/
delete: bindApiCall(this, 'admin.barriers.delete'),
/**
* @description Get all Information Barriers for your organization.
- * @see {@link https://api.slack.com/methods/admin.barriers.list `admin.barriers.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.list `admin.barriers.list` API reference}.
*/
- list: bindApiCall(this, 'admin.barriers.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.barriers.list'),
/**
* @description Update an existing Information Barrier.
- * @see {@link https://api.slack.com/methods/admin.barriers.update `admin.barriers.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.barriers.update `admin.barriers.update` API reference}.
*/
update: bindApiCall(this, 'admin.barriers.update'),
},
conversations: {
/**
* @description Archive a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.archive `admin.conversations.archive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.archive `admin.conversations.archive` API reference}.
*/
archive: bindApiCall(this, 'admin.conversations.archive'),
/**
* @description Archive public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkArchive `admin.conversations.bulkArchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive `admin.conversations.bulkArchive` API reference}.
*/
bulkArchive: bindApiCall(this, 'admin.conversations.bulkArchive'),
/**
* @description Delete public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkDelet `admin.conversations.bulkDelete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete `admin.conversations.bulkDelete` API reference}.
*/
bulkDelete: bindApiCall(this, 'admin.conversations.bulkDelete'),
/**
* @description Move public or private channels in bulk.
- * @see {@link https://api.slack.com/methods/admin.conversations.bulkMove `admin.conversations.bulkMove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.bulkMove `admin.conversations.bulkMove` API reference}.
*/
bulkMove: bindApiCall(this, 'admin.conversations.bulkMove'),
/**
* @description Convert a public channel to a private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.convertToPrivate `admin.conversations.convertToPrivate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate `admin.conversations.convertToPrivate` API reference}.
*/
convertToPrivate: bindApiCall(this, 'admin.conversations.convertToPrivate'),
/**
* @description Convert a private channel to a public channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.convertToPublic `admin.conversations.convertToPublic` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic `admin.conversations.convertToPublic` API reference}.
*/
convertToPublic: bindApiCall(this, 'admin.conversations.convertToPublic'),
/**
* @description Create a public or private channel-based conversation.
- * @see {@link https://api.slack.com/methods/admin.conversations.create `admin.conversations.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.create `admin.conversations.create` API reference}.
*/
create: bindApiCall(this, 'admin.conversations.create'),
/**
* @description Delete a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.delete `admin.conversations.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.delete `admin.conversations.delete` API reference}.
*/
delete: bindApiCall(this, 'admin.conversations.delete'),
/**
* @description Disconnect a connected channel from one or more workspaces.
- * @see {@link https://api.slack.com/methods/admin.conversations.disconnectShared `admin.conversations.disconnectShared` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared `admin.conversations.disconnectShared` API reference}.
*/
disconnectShared: bindApiCall(this, 'admin.conversations.disconnectShared'),
ekm: {
/**
* @description List all disconnected channels — i.e., channels that were once connected to other workspaces
* and then disconnected — and the corresponding original channel IDs for key revocation with EKM.
- * @see {@link https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo `admin.conversations.ekm.listOriginalConnectedChannelInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo `admin.conversations.ekm.listOriginalConnectedChannelInfo` API reference}.
*/
- listOriginalConnectedChannelInfo: bindApiCall(this, 'admin.conversations.ekm.listOriginalConnectedChannelInfo'),
+ listOriginalConnectedChannelInfo: bindApiCallWithOptionalArgument(this, 'admin.conversations.ekm.listOriginalConnectedChannelInfo'),
},
/**
* @description Get conversation preferences for a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.getConversationPrefs `admin.conversations.getConversationPrefs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs `admin.conversations.getConversationPrefs` API reference}.
*/
getConversationPrefs: bindApiCall(this, 'admin.conversations.getConversationPrefs'),
/**
* @description Get a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.getCustomRetention `admin.conversations.getCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention `admin.conversations.getCustomRetention` API reference}.
*/
getCustomRetention: bindApiCall(this, 'admin.conversations.getCustomRetention'),
/**
* @description Get all the workspaces a given public or private channel is connected to within
* this Enterprise org.
- * @see {@link https://api.slack.com/methods/admin.conversations.getTeams `admin.conversations.getTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.getTeams `admin.conversations.getTeams` API reference}.
*/
getTeams: bindApiCall(this, 'admin.conversations.getTeams'),
/**
* @description Invite a user to a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.invite `admin.conversations.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.invite `admin.conversations.invite` API reference}.
*/
invite: bindApiCall(this, 'admin.conversations.invite'),
/**
* @description Returns channels on the given team using the filters.
- * @see {@link https://api.slack.com/methods/admin.conversations.lookup `admin.conversations.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.lookup `admin.conversations.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.conversations.lookup'),
/**
* @description Remove a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.removeCustomRetention `admin.conversations.removeCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention `admin.conversations.removeCustomRetention` API reference}.
*/
removeCustomRetention: bindApiCall(this, 'admin.conversations.removeCustomRetention'),
/**
* @description Rename a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.rename `admin.conversations.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.rename `admin.conversations.rename` API reference}.
*/
rename: bindApiCall(this, 'admin.conversations.rename'),
restrictAccess: {
/**
* @description Add an allowlist of IDP groups for accessing a channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.addGroup `admin.conversations.restrictAccess.addGroup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup `admin.conversations.restrictAccess.addGroup` API reference}.
*/
addGroup: bindApiCall(this, 'admin.conversations.restrictAccess.addGroup'),
/**
* @description List all IDP Groups linked to a channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.listGroups `admin.conversations.restrictAccess.listGroups` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups `admin.conversations.restrictAccess.listGroups` API reference}.
*/
listGroups: bindApiCall(this, 'admin.conversations.restrictAccess.listGroups'),
/**
* @description Remove a linked IDP group linked from a private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.restrictAccess.removeGroup `admin.conversations.restrictAccess.removeGroup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup `admin.conversations.restrictAccess.removeGroup` API reference}.
*/
removeGroup: bindApiCall(this, 'admin.conversations.restrictAccess.removeGroup'),
},
/**
* @description Search for public or private channels in an Enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.conversations.search `admin.conversations.search` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.search `admin.conversations.search` API reference}.
*/
- search: bindApiCall(this, 'admin.conversations.search'),
+ search: bindApiCallWithOptionalArgument(this, 'admin.conversations.search'),
/**
* @description Set the posting permissions for a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.setConversationPrefs `admin.conversations.setConversationPrefs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs `admin.conversations.setConversationPrefs` API reference}.
*/
setConversationPrefs: bindApiCall(this, 'admin.conversations.setConversationPrefs'),
/**
* @description Set a conversation's retention policy.
- * @see {@link https://api.slack.com/methods/admin.conversations.setCustomRetention `admin.conversations.setCustomRetention` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention `admin.conversations.setCustomRetention` API reference}.
*/
setCustomRetention: bindApiCall(this, 'admin.conversations.setCustomRetention'),
/**
* @description Set the workspaces in an Enterprise grid org that connect to a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.setTeams `admin.conversations.setTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.setTeams `admin.conversations.setTeams` API reference}.
*/
setTeams: bindApiCall(this, 'admin.conversations.setTeams'),
/**
* @description Unarchive a public or private channel.
- * @see {@link https://api.slack.com/methods/admin.conversations.unarchive `admin.conversations.unarchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.conversations.unarchive `admin.conversations.unarchive` API reference}.
*/
unarchive: bindApiCall(this, 'admin.conversations.unarchive'),
},
emoji: {
/**
* @description Add an emoji.
- * @see {@link https://api.slack.com/methods/admin.emoji.add `admin.emoji.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.add `admin.emoji.add` API reference}.
*/
add: bindApiCall(this, 'admin.emoji.add'),
/**
* @description Add an emoji alias.
- * @see {@link https://api.slack.com/methods/admin.emoji.addAlias `admin.emoji.addAlias` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.addAlias `admin.emoji.addAlias` API reference}.
*/
addAlias: bindApiCall(this, 'admin.emoji.addAlias'),
/**
* @description List emoji for an Enterprise Grid organization.
- * @see {@link https://api.slack.com/methods/admin.emoji.list `admin.emoji.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.list `admin.emoji.list` API reference}.
*/
- list: bindApiCall(this, 'admin.emoji.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.emoji.list'),
/**
* @description Remove an emoji across an Enterprise Grid organization.
- * @see {@link https://api.slack.com/methods/admin.emoji.remove `admin.emoji.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.remove `admin.emoji.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.emoji.remove'),
/**
* @description Rename an emoji.
- * @see {@link https://api.slack.com/methods/admin.emoji.rename `admin.emoji.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.emoji.rename `admin.emoji.rename` API reference}.
*/
rename: bindApiCall(this, 'admin.emoji.rename'),
},
functions: {
/**
* @description Look up functions by a set of apps.
- * @see {@link https://api.slack.com/methods/admin.functions.list `admin.functions.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.list `admin.functions.list` API reference}.
*/
list: bindApiCall(this, 'admin.functions.list'),
permissions: {
/**
* @description Lookup the visibility of multiple Slack functions and include the users if
* it is limited to particular named entities.
- * @see {@link https://api.slack.com/methods/admin.functions.permissions.lookup `admin.functions.permissions.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.permissions.lookup `admin.functions.permissions.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.functions.permissions.lookup'),
/**
* @description Set the visibility of a Slack function and define the users or workspaces if
* it is set to named_entities.
- * @see {@link https://api.slack.com/methods/admin.functions.permissions.set `admin.functions.permissions.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.functions.permissions.set `admin.functions.permissions.set` API reference}.
*/
set: bindApiCall(this, 'admin.functions.permissions.set'),
},
@@ -8204,49 +3368,49 @@ class Methods extends eventemitter3_1.EventEmitter {
inviteRequests: {
/**
* @description Approve a workspace invite request.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.approve `admin.inviteRequests.approve` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.approve `admin.inviteRequests.approve` API reference}.
*/
approve: bindApiCall(this, 'admin.inviteRequests.approve'),
approved: {
/**
* @description List all approved workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.approved.list `admin.inviteRequests.approved.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.approved.list `admin.inviteRequests.approved.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.approved.list'),
},
denied: {
/**
* @description List all denied workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.denied.list `admin.inviteRequests.denied.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.denied.list `admin.inviteRequests.denied.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.denied.list'),
},
/**
* @description Deny a workspace invite request.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.deny `admin.inviteRequests.deny` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.deny `admin.inviteRequests.deny` API reference}.
*/
deny: bindApiCall(this, 'admin.inviteRequests.deny'),
/**
* @description List all pending workspace invite requests.
- * @see {@link https://api.slack.com/methods/admin.inviteRequests.list `admin.inviteRequests.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.inviteRequests.list `admin.inviteRequests.list` API reference}.
*/
list: bindApiCall(this, 'admin.inviteRequests.list'),
},
roles: {
/**
* @description Adds members to the specified role with the specified scopes.
- * @see {@link https://api.slack.com/methods/admin.roles.addAssignments `admin.roles.addAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.addAssignments `admin.roles.addAssignments` API reference}.
*/
addAssignments: bindApiCall(this, 'admin.roles.addAssignments'),
/**
* @description Lists assignments for all roles across entities.
* Options to scope results by any combination of roles or entities.
- * @see {@link https://api.slack.com/methods/admin.roles.listAssignments `admin.roles.listAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.listAssignments `admin.roles.listAssignments` API reference}.
*/
- listAssignments: bindApiCall(this, 'admin.roles.listAssignments'),
+ listAssignments: bindApiCallWithOptionalArgument(this, 'admin.roles.listAssignments'),
/**
* @description Removes a set of users from a role for the given scopes and entities.
- * @see {@link https://api.slack.com/methods/admin.roles.removeAssignments `admin.roles.removeAssignments` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.roles.removeAssignments `admin.roles.removeAssignments` API reference}.
*/
removeAssignments: bindApiCall(this, 'admin.roles.removeAssignments'),
},
@@ -8254,56 +3418,56 @@ class Methods extends eventemitter3_1.EventEmitter {
admins: {
/**
* @description List all of the admins on a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.admins.list `admin.teams.admins.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.admins.list `admin.teams.admins.list` API reference}.
*/
list: bindApiCall(this, 'admin.teams.admins.list'),
},
/**
* @description Create an Enterprise team.
- * @see {@link https://api.slack.com/methods/admin.teams.create `admin.teams.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.create `admin.teams.create` API reference}.
*/
create: bindApiCall(this, 'admin.teams.create'),
/**
* @description List all teams on an Enterprise organization.
- * @see {@link https://api.slack.com/methods/admin.teams.list `admin.teams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.list `admin.teams.list` API reference}.
*/
- list: bindApiCall(this, 'admin.teams.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.teams.list'),
owners: {
/**
* @description List all of the owners on a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
*/
list: bindApiCall(this, 'admin.teams.owners.list'),
},
settings: {
/**
* @description Fetch information about settings in a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.owners.list `admin.teams.owners.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.info `admin.teams.settings.info` API reference}.
*/
info: bindApiCall(this, 'admin.teams.settings.info'),
/**
* @description Set the default channels of a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDefaultChannels `admin.teams.settings.setDefaultChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDefaultChannels `admin.teams.settings.setDefaultChannels` API reference}.
*/
setDefaultChannels: bindApiCall(this, 'admin.teams.settings.setDefaultChannels'),
/**
* @description Set the description of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDescription `admin.teams.settings.setDescription` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDescription `admin.teams.settings.setDescription` API reference}.
*/
setDescription: bindApiCall(this, 'admin.teams.settings.setDescription'),
/**
* @description Set the discoverability of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setDiscoverability `admin.teams.settings.setDiscoverability` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setDiscoverability `admin.teams.settings.setDiscoverability` API reference}.
*/
setDiscoverability: bindApiCall(this, 'admin.teams.settings.setDiscoverability'),
/**
* @description Sets the icon of a workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setIcon `admin.teams.settings.setIcon` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setIcon `admin.teams.settings.setIcon` API reference}.
*/
setIcon: bindApiCall(this, 'admin.teams.settings.setIcon'),
/**
* @description Set the name of a given workspace.
- * @see {@link https://api.slack.com/methods/admin.teams.settings.setName `admin.teams.settings.setName` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.teams.settings.setName `admin.teams.settings.setName` API reference}.
*/
setName: bindApiCall(this, 'admin.teams.settings.setName'),
},
@@ -8311,111 +3475,111 @@ class Methods extends eventemitter3_1.EventEmitter {
usergroups: {
/**
* @description Add up to one hundred default channels to an IDP group.
- * @see {@link https://api.slack.com/methods/admin.usergroups.addChannels `admin.teams.usergroups.addChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.addChannels `admin.teams.usergroups.addChannels` API reference}.
*/
addChannels: bindApiCall(this, 'admin.usergroups.addChannels'),
/**
* @description Associate one or more default workspaces with an organization-wide IDP group.
- * @see {@link https://api.slack.com/methods/admin.usergroups.addTeams `admin.teams.usergroups.addTeams` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.addTeams `admin.teams.usergroups.addTeams` API reference}.
*/
addTeams: bindApiCall(this, 'admin.usergroups.addTeams'),
/**
* @description List the channels linked to an org-level IDP group (user group).
- * @see {@link https://api.slack.com/methods/admin.usergroups.listChannels `admin.teams.usergroups.listChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.listChannels `admin.teams.usergroups.listChannels` API reference}.
*/
listChannels: bindApiCall(this, 'admin.usergroups.listChannels'),
/**
* @description Remove one or more default channels from an org-level IDP group (user group).
- * @see {@link https://api.slack.com/methods/admin.usergroups.removeChannels `admin.teams.usergroups.removeChannels` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.usergroups.removeChannels `admin.teams.usergroups.removeChannels` API reference}.
*/
removeChannels: bindApiCall(this, 'admin.usergroups.removeChannels'),
},
users: {
/**
* @description Add an Enterprise user to a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.assign `admin.users.assign` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.assign `admin.users.assign` API reference}.
*/
assign: bindApiCall(this, 'admin.users.assign'),
/**
* @description Invite a user to a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.invite `admin.users.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.invite `admin.users.invite` API reference}.
*/
invite: bindApiCall(this, 'admin.users.invite'),
/**
* @description List users on a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.list `admin.users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.list `admin.users.list` API reference}.
*/
- list: bindApiCall(this, 'admin.users.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.users.list'),
/**
* @description Remove a user from a workspace.
- * @see {@link https://api.slack.com/methods/admin.users.remove `admin.users.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.remove `admin.users.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.users.remove'),
session: {
/**
* @description Clear user-specific session settings—the session duration and what happens when the client
* closes—for a list of users.
- * @see {@link https://api.slack.com/methods/admin.users.session.clearSettings `admin.users.session.clearSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.clearSettings `admin.users.session.clearSettings` API reference}.
*/
clearSettings: bindApiCall(this, 'admin.users.session.clearSettings'),
/**
* @description Get user-specific session settings—the session duration and what happens when the client
* closes—given a list of users.
- * @see {@link https://api.slack.com/methods/admin.users.session.getSettings `admin.users.session.getSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.getSettings `admin.users.session.getSettings` API reference}.
*/
getSettings: bindApiCall(this, 'admin.users.session.getSettings'),
/**
* @description Revoke a single session for a user. The user will be forced to login to Slack.
- * @see {@link https://api.slack.com/methods/admin.users.session.invalidate `admin.users.session.invalidate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.invalidate `admin.users.session.invalidate` API reference}.
*/
invalidate: bindApiCall(this, 'admin.users.session.invalidate'),
/**
* @description List active user sessions for an organization.
- * @see {@link https://api.slack.com/methods/admin.users.session.list `admin.users.session.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.list `admin.users.session.list` API reference}.
*/
- list: bindApiCall(this, 'admin.users.session.list'),
+ list: bindApiCallWithOptionalArgument(this, 'admin.users.session.list'),
/**
* @description Wipes all valid sessions on all devices for a given user.
- * @see {@link https://api.slack.com/methods/admin.users.session.reset `admin.users.session.reset` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.reset `admin.users.session.reset` API reference}.
*/
reset: bindApiCall(this, 'admin.users.session.reset'),
/**
* @description Enqueues an asynchronous job to wipe all valid sessions on all devices for a given user list.
- * @see {@link https://api.slack.com/methods/admin.users.session.resetBulk `admin.users.session.resetBulk` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.resetBulk `admin.users.session.resetBulk` API reference}.
*/
resetBulk: bindApiCall(this, 'admin.users.session.resetBulk'),
/**
* @description Configure the user-level session settings—the session duration and what happens when the client
* closes—for one or more users.
- * @see {@link https://api.slack.com/methods/admin.users.session.setSettings `admin.users.session.setSettings` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.session.setSettings `admin.users.session.setSettings` API reference}.
*/
setSettings: bindApiCall(this, 'admin.users.session.setSettings'),
},
/**
* @description Set an existing guest, regular user, or owner to be an admin user.
- * @see {@link https://api.slack.com/methods/admin.users.setAdmin `admin.users.setAdmin` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setAdmin `admin.users.setAdmin` API reference}.
*/
setAdmin: bindApiCall(this, 'admin.users.setAdmin'),
/**
* @description Set an expiration for a guest user.
- * @see {@link https://api.slack.com/methods/admin.users.setExpiration `admin.users.setExpiration` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setExpiration `admin.users.setExpiration` API reference}.
*/
setExpiration: bindApiCall(this, 'admin.users.setExpiration'),
/**
* @description Set an existing guest, regular user, or admin user to be a workspace owner.
- * @see {@link https://api.slack.com/methods/admin.users.setOwner `admin.users.setOwner` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setOwner `admin.users.setOwner` API reference}.
*/
setOwner: bindApiCall(this, 'admin.users.setOwner'),
/**
* @description Set an existing guest user, admin user, or owner to be a regular user.
- * @see {@link https://api.slack.com/methods/admin.users.setRegular `admin.users.setRegular` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.setRegular `admin.users.setRegular` API reference}.
*/
setRegular: bindApiCall(this, 'admin.users.setRegular'),
unsupportedVersions: {
/**
* @description Ask Slackbot to send you an export listing all workspace members using unsupported software,
* presented as a zipped CSV file.
- * @see {@link https://api.slack.com/methods/admin.users.unsupportedVersions.export `admin.users.unsupportedVersions.export` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.users.unsupportedVersions.export `admin.users.unsupportedVersions.export` API reference}.
*/
export: bindApiCall(this, 'admin.users.unsupportedVersions.export'),
},
@@ -8424,30 +3588,30 @@ class Methods extends eventemitter3_1.EventEmitter {
collaborators: {
/**
* @description Add collaborators to workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.add `admin.workflows.collaborators.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add `admin.workflows.collaborators.add` API reference}.
*/
add: bindApiCall(this, 'admin.workflows.collaborators.add'),
/**
* @description Remove collaborators from workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.collaborators.remove `admin.workflows.collaborators.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove `admin.workflows.collaborators.remove` API reference}.
*/
remove: bindApiCall(this, 'admin.workflows.collaborators.remove'),
},
permissions: {
/**
* @description Look up the permissions for a set of workflows.
- * @see {@link https://api.slack.com/methods/admin.workflows.permissions.lookup `admin.workflows.permissions.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup `admin.workflows.permissions.lookup` API reference}.
*/
lookup: bindApiCall(this, 'admin.workflows.permissions.lookup'),
},
/**
* @description Search workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.search `admin.workflows.search` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.search `admin.workflows.search` API reference}.
*/
- search: bindApiCall(this, 'admin.workflows.search'),
+ search: bindApiCallWithOptionalArgument(this, 'admin.workflows.search'),
/**
* @description Unpublish workflows within the team or enterprise.
- * @see {@link https://api.slack.com/methods/admin.workflows.unpublish `admin.workflows.unpublish` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/admin.workflows.unpublish `admin.workflows.unpublish` API reference}.
*/
unpublish: bindApiCall(this, 'admin.workflows.unpublish'),
},
@@ -8455,25 +3619,44 @@ class Methods extends eventemitter3_1.EventEmitter {
this.api = {
/**
* @description Checks API calling code.
- * @see {@link https://api.slack.com/methods/api.test `api.test` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/api.test `api.test` API reference}.
*/
- test: bindApiCall(this, 'api.test'),
+ test: bindApiCallWithOptionalArgument(this, 'api.test'),
+ };
+ this.assistant = {
+ threads: {
+ /**
+ * @description Set loading status to indicate that the app is building a response.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setStatus `assistant.threads.setStatus` API reference}.
+ */
+ setStatus: bindApiCall(this, 'assistant.threads.setStatus'),
+ /**
+ * @description Set suggested prompts for the user. Can suggest up to four prompts.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts `assistant.threads.setSuggestedPrompts` API reference}.
+ */
+ setSuggestedPrompts: bindApiCall(this, 'assistant.threads.setSuggestedPrompts'),
+ /**
+ * @description Set the title of the thread. This is shown when a user views the app's chat history.
+ * @see {@link https://docs.slack.dev/reference/methods/assistant.threads.setTitle `assistant.threads.setTitle` API reference}.
+ */
+ setTitle: bindApiCall(this, 'assistant.threads.setTitle'),
+ },
};
this.apps = {
connections: {
/**
* @description Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive
* events and interactive payloads over.
- * @see {@link https://api.slack.com/methods/apps.connections.open `apps.connections.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.connections.open `apps.connections.open` API reference}.
*/
- open: bindApiCall(this, 'apps.connections.open'),
+ open: bindApiCallWithOptionalArgument(this, 'apps.connections.open'),
},
event: {
authorizations: {
/**
* @description Get a list of authorizations for the given event context.
* Each authorization represents an app installation that the event is visible to.
- * @see {@link https://api.slack.com/methods/apps.event.authorizations.list `apps.event.authorizations.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.event.authorizations.list `apps.event.authorizations.list` API reference}.
*/
list: bindApiCall(this, 'apps.event.authorizations.list'),
},
@@ -8481,105 +3664,105 @@ class Methods extends eventemitter3_1.EventEmitter {
manifest: {
/**
* @description Create an app from an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.create `apps.manifest.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.create `apps.manifest.create` API reference}.
*/
create: bindApiCall(this, 'apps.manifest.create'),
/**
* @description Permanently deletes an app created through app manifests.
- * @see {@link https://api.slack.com/methods/apps.manifest.delete `apps.manifest.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.delete `apps.manifest.delete` API reference}.
*/
delete: bindApiCall(this, 'apps.manifest.delete'),
/**
* @description Export an app manifest from an existing app.
- * @see {@link https://api.slack.com/methods/apps.manifest.export `apps.manifest.export` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.export `apps.manifest.export` API reference}.
*/
export: bindApiCall(this, 'apps.manifest.export'),
/**
* @description Update an app from an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.update `apps.manifest.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.update `apps.manifest.update` API reference}.
*/
update: bindApiCall(this, 'apps.manifest.update'),
/**
* @description Validate an app manifest.
- * @see {@link https://api.slack.com/methods/apps.manifest.validate `apps.manifest.validate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.manifest.validate `apps.manifest.validate` API reference}.
*/
validate: bindApiCall(this, 'apps.manifest.validate'),
},
/**
* @description Uninstalls your app from a workspace.
- * @see {@link https://api.slack.com/methods/apps.uninstall `apps.uninstall` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/apps.uninstall `apps.uninstall` API reference}.
*/
uninstall: bindApiCall(this, 'apps.uninstall'),
};
this.auth = {
/**
* @description Revokes a token.
- * @see {@link https://api.slack.com/methods/auth.revoke `auth.revoke` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/auth.revoke `auth.revoke` API reference}.
*/
- revoke: bindApiCall(this, 'auth.revoke'),
+ revoke: bindApiCallWithOptionalArgument(this, 'auth.revoke'),
teams: {
/**
* @description Obtain a full list of workspaces your org-wide app has been approved for.
- * @see {@link https://api.slack.com/methods/auth.teams.list `auth.teams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/auth.teams.list `auth.teams.list` API reference}.
*/
- list: bindApiCall(this, 'auth.teams.list'),
+ list: bindApiCallWithOptionalArgument(this, 'auth.teams.list'),
},
- test: bindApiCall(this, 'auth.test'),
+ test: bindApiCallWithOptionalArgument(this, 'auth.test'),
};
this.bookmarks = {
/**
* @description Add bookmark to a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.add `bookmarks.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.add `bookmarks.add` API reference}.
*/
add: bindApiCall(this, 'bookmarks.add'),
/**
* @description Edit bookmark.
- * @see {@link https://api.slack.com/methods/bookmarks.edit `bookmarks.edit` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.edit `bookmarks.edit` API reference}.
*/
edit: bindApiCall(this, 'bookmarks.edit'),
/**
* @description List bookmarks for a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.list `bookmarks.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.list `bookmarks.list` API reference}.
*/
list: bindApiCall(this, 'bookmarks.list'),
/**
* @description Remove bookmark from a channel.
- * @see {@link https://api.slack.com/methods/bookmarks.remove `bookmarks.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bookmarks.remove `bookmarks.remove` API reference}.
*/
remove: bindApiCall(this, 'bookmarks.remove'),
};
this.bots = {
/**
* @description Gets information about a bot user.
- * @see {@link https://api.slack.com/methods/bots.info `bots.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/bots.info `bots.info` API reference}.
*/
- info: bindApiCall(this, 'bots.info'),
+ info: bindApiCallWithOptionalArgument(this, 'bots.info'),
};
this.calls = {
/**
* @description Registers a new Call.
- * @see {@link https://api.slack.com/methods/calls.add `calls.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.add `calls.add` API reference}.
*/
add: bindApiCall(this, 'calls.add'),
/**
* @description Ends a Call.
- * @see {@link https://api.slack.com/methods/calls.end `calls.end` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.end `calls.end` API reference}.
*/
end: bindApiCall(this, 'calls.end'),
/**
* @description Returns information about a Call.
- * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.info `calls.info` API reference}.
*/
info: bindApiCall(this, 'calls.info'),
/**
* @description Updates information about a Call.
- * @see {@link https://api.slack.com/methods/calls.info `calls.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.update `calls.update` API reference}.
*/
update: bindApiCall(this, 'calls.update'),
participants: {
/**
* @description Registers new participants added to a Call.
- * @see {@link https://api.slack.com/methods/calls.participants.add `calls.participants.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/calls.participants.add `calls.participants.add` API reference}.
*/
add: bindApiCall(this, 'calls.participants.add'),
remove: bindApiCall(this, 'calls.participants.remove'),
@@ -8589,298 +3772,345 @@ class Methods extends eventemitter3_1.EventEmitter {
access: {
/**
* @description Remove access to a canvas for specified entities.
- * @see {@link https://api.slack.com/methods/canvases.access.delete `canvases.access.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.access.delete `canvases.access.delete` API reference}.
*/
delete: bindApiCall(this, 'canvases.access.delete'),
/**
* @description Sets the access level to a canvas for specified entities.
- * @see {@link https://api.slack.com/methods/canvases.access.set `canvases.access.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.access.set `canvases.access.set` API reference}.
*/
set: bindApiCall(this, 'canvases.access.set'),
},
/**
* @description Create Canvas for a user.
- * @see {@link https://api.slack.com/methods/canvases.create `canvases.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.create `canvases.create` API reference}.
*/
- create: bindApiCall(this, 'canvases.create'),
+ create: bindApiCallWithOptionalArgument(this, 'canvases.create'),
/**
* @description Deletes a canvas.
- * @see {@link https://api.slack.com/methods/canvases.delete `canvases.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.delete `canvases.delete` API reference}.
*/
delete: bindApiCall(this, 'canvases.delete'),
/**
* @description Update an existing canvas.
- * @see {@link https://api.slack.com/methods/canvases.edit `canvases.edit` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.edit `canvases.edit` API reference}.
*/
edit: bindApiCall(this, 'canvases.edit'),
sections: {
/**
* @description Find sections matching the provided criteria.
- * @see {@link https://api.slack.com/methods/canvases.sections.lookup `canvases.sections.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/canvases.sections.lookup `canvases.sections.lookup` API reference}.
*/
lookup: bindApiCall(this, 'canvases.sections.lookup'),
},
};
this.chat = {
+ /**
+ * @description Appends text to an existing streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.appendStream `chat.appendStream` API reference}.
+ */
+ appendStream: bindApiCall(this, 'chat.appendStream'),
/**
* @description Deletes a message.
- * @see {@link https://api.slack.com/methods/chat.delete `chat.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.delete `chat.delete` API reference}.
*/
delete: bindApiCall(this, 'chat.delete'),
/**
* @description Deletes a pending scheduled message from the queue.
- * @see {@link https://api.slack.com/methods/chat.deleteScheduledMessage `chat.deleteScheduledMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage `chat.deleteScheduledMessage` API reference}.
*/
deleteScheduledMessage: bindApiCall(this, 'chat.deleteScheduledMessage'),
/**
* @description Retrieve a permalink URL for a specific extant message.
- * @see {@link https://api.slack.com/methods/chat.getPermalink `chat.getPermalink` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.getPermalink `chat.getPermalink` API reference}.
*/
getPermalink: bindApiCall(this, 'chat.getPermalink'),
/**
* @description Share a me message into a channel.
- * @see {@link https://api.slack.com/methods/chat.meMessage `chat.meMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.meMessage `chat.meMessage` API reference}.
*/
meMessage: bindApiCall(this, 'chat.meMessage'),
/**
* @description Sends an ephemeral message to a user in a channel.
- * @see {@link https://api.slack.com/methods/chat.postEphemeral `chat.postEphemeral` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.postEphemeral `chat.postEphemeral` API reference}.
*/
postEphemeral: bindApiCall(this, 'chat.postEphemeral'),
/**
* @description Sends a message to a channel.
- * @see {@link https://api.slack.com/methods/chat.postMessage `chat.postMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.postMessage `chat.postMessage` API reference}.
*/
postMessage: bindApiCall(this, 'chat.postMessage'),
/**
* @description Schedules a message to be sent to a channel.
- * @see {@link https://api.slack.com/methods/chat.scheduleMessage `chat.scheduleMessage` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.scheduleMessage `chat.scheduleMessage` API reference}.
*/
scheduleMessage: bindApiCall(this, 'chat.scheduleMessage'),
scheduledMessages: {
/**
* @description Returns a list of scheduled messages.
- * @see {@link https://api.slack.com/methods/chat.scheduledMessages.list `chat.scheduledMessages.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.scheduledMessages.list `chat.scheduledMessages.list` API reference}.
*/
- list: bindApiCall(this, 'chat.scheduledMessages.list'),
+ list: bindApiCallWithOptionalArgument(this, 'chat.scheduledMessages.list'),
},
+ /**
+ * @description Starts a new streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.startStream `chat.startStream` API reference}.
+ */
+ startStream: bindApiCall(this, 'chat.startStream'),
+ /**
+ * @description Stops a streaming conversation.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.stopStream `chat.stopStream` API reference}.
+ */
+ stopStream: bindApiCall(this, 'chat.stopStream'),
/**
* @description Provide custom unfurl behavior for user-posted URLs.
- * @see {@link https://api.slack.com/methods/chat.unfurl `chat.unfurl` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.unfurl `chat.unfurl` API reference}.
*/
unfurl: bindApiCall(this, 'chat.unfurl'),
/**
* @description Updates a message.
- * @see {@link https://api.slack.com/methods/chat.update `chat.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/chat.update `chat.update` API reference}.
*/
update: bindApiCall(this, 'chat.update'),
};
this.conversations = {
/**
* @description Accepts an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.acceptSharedInvite `conversations.acceptSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite `conversations.acceptSharedInvite` API reference}.
*/
acceptSharedInvite: bindApiCall(this, 'conversations.acceptSharedInvite'),
/**
* @description Approves an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.approveSharedInvite `conversations.approveSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.approveSharedInvite `conversations.approveSharedInvite` API reference}.
*/
approveSharedInvite: bindApiCall(this, 'conversations.approveSharedInvite'),
/**
* @description Archives a conversation.
- * @see {@link https://api.slack.com/methods/conversations.archive `conversations.archive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.archive `conversations.archive` API reference}.
*/
archive: bindApiCall(this, 'conversations.archive'),
canvases: {
/**
* @description Create a Channel Canvas for a channel.
- * @see {@link https://api.slack.com/methods/conversations.canvases.create `conversations.canvases.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.canvases.create `conversations.canvases.create` API reference}.
*/
create: bindApiCall(this, 'conversations.canvases.create'),
},
/**
* @description Closes a direct message or multi-person direct message.
- * @see {@link https://api.slack.com/methods/conversations.close `conversations.close` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.close `conversations.close` API reference}.
*/
close: bindApiCall(this, 'conversations.close'),
/**
* @description Initiates a public or private channel-based conversation.
- * @see {@link https://api.slack.com/methods/conversations.create `conversations.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.create `conversations.create` API reference}.
*/
create: bindApiCall(this, 'conversations.create'),
/**
* @description Declines an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.declineSharedInvite `conversations.declineSharedInvite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.declineSharedInvite `conversations.declineSharedInvite` API reference}.
*/
declineSharedInvite: bindApiCall(this, 'conversations.declineSharedInvite'),
+ externalInvitePermissions: {
+ /**
+ * @description Convert a team in a shared channel from an External Limited channel to a fully shared Slack
+ * Connect channel or vice versa.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set `conversations.externalInvitePermissions.set` API reference}.
+ */
+ set: bindApiCall(this, 'conversations.externalInvitePermissions.set'),
+ },
/**
* @description Fetches a conversation's history of messages and events.
- * @see {@link https://api.slack.com/methods/conversations.history `conversations.history` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.history `conversations.history` API reference}.
*/
history: bindApiCall(this, 'conversations.history'),
/**
* @description Retrieve information about a conversation.
- * @see {@link https://api.slack.com/methods/conversations.info `conversations.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.info `conversations.info` API reference}.
*/
info: bindApiCall(this, 'conversations.info'),
/**
* @description Invites users to a channel.
- * @see {@link https://api.slack.com/methods/conversations.invite `conversations.invite` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.invite `conversations.invite` API reference}.
*/
invite: bindApiCall(this, 'conversations.invite'),
/**
* @description Sends an invitation to a Slack Connect channel.
- * @see {@link https://api.slack.com/methods/conversations.inviteShared `conversations.inviteShared` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.inviteShared `conversations.inviteShared` API reference}.
*/
inviteShared: bindApiCall(this, 'conversations.inviteShared'),
/**
* @description Joins an existing conversation.
- * @see {@link https://api.slack.com/methods/conversations.join `conversations.join` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.join `conversations.join` API reference}.
*/
join: bindApiCall(this, 'conversations.join'),
/**
* @description Removes a user from a conversation.
- * @see {@link https://api.slack.com/methods/conversations.kick `conversations.kick` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.kick `conversations.kick` API reference}.
*/
kick: bindApiCall(this, 'conversations.kick'),
/**
* @description Leaves a conversation.
- * @see {@link https://api.slack.com/methods/conversations.leave `conversations.leave` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.leave `conversations.leave` API reference}.
*/
leave: bindApiCall(this, 'conversations.leave'),
/**
* @description List all channels in a Slack team.
- * @see {@link https://api.slack.com/methods/conversations.list `conversations.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.list `conversations.list` API reference}.
*/
- list: bindApiCall(this, 'conversations.list'),
+ list: bindApiCallWithOptionalArgument(this, 'conversations.list'),
/**
* @description Lists shared channel invites that have been generated or received but have not been approved by
* all parties.
- * @see {@link https://api.slack.com/methods/conversations.listConnectInvites `conversations.listConnectInvites` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.listConnectInvites `conversations.listConnectInvites` API reference}.
*/
- listConnectInvites: bindApiCall(this, 'conversations.listConnectInvites'),
+ listConnectInvites: bindApiCallWithOptionalArgument(this, 'conversations.listConnectInvites'),
/**
* @description Sets the read cursor in a channel.
- * @see {@link https://api.slack.com/methods/conversations.mark `conversations.mark` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.mark `conversations.mark` API reference}.
*/
mark: bindApiCall(this, 'conversations.mark'),
/**
* @description Retrieve members of a conversation.
- * @see {@link https://api.slack.com/methods/conversations.members `conversations.members` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.members `conversations.members` API reference}.
*/
members: bindApiCall(this, 'conversations.members'),
/**
* @description Opens or resumes a direct message or multi-person direct message.
- * @see {@link https://api.slack.com/methods/conversations.open `conversations.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.open `conversations.open` API reference}.
*/
open: bindApiCall(this, 'conversations.open'),
/**
* @description Renames a conversation.
- * @see {@link https://api.slack.com/methods/conversations.rename `conversations.rename` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.rename `conversations.rename` API reference}.
*/
rename: bindApiCall(this, 'conversations.rename'),
/**
* @description Retrieve a thread of messages posted to a conversation.
- * @see {@link https://api.slack.com/methods/conversations.replies `conversations.replies` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.replies `conversations.replies` API reference}.
*/
replies: bindApiCall(this, 'conversations.replies'),
+ requestSharedInvite: {
+ /**
+ * @description Approves a request to add an external user to a channel and sends them a Slack Connect invite.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve `conversations.requestSharedInvite.approve` API reference}.
+ */
+ approve: bindApiCall(this, 'conversations.requestSharedInvite.approve'),
+ /**
+ * @description Denies a request to invite an external user to a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny `conversations.requestSharedInvite.deny` API reference}.
+ */
+ deny: bindApiCall(this, 'conversations.requestSharedInvite.deny'),
+ /**
+ * @description Lists requests to add external users to channels with ability to filter.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list `conversations.requestSharedInvite.list` API reference}.
+ */
+ list: bindApiCallWithOptionalArgument(this, 'conversations.requestSharedInvite.list'),
+ },
/**
* @description Sets the purpose for a conversation.
- * @see {@link https://api.slack.com/methods/conversations.setPurpose `conversations.setPurpose` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.setPurpose `conversations.setPurpose` API reference}.
*/
setPurpose: bindApiCall(this, 'conversations.setPurpose'),
/**
* @description Sets the topic for a conversation.
- * @see {@link https://api.slack.com/methods/conversations.setTopic `conversations.setTopic` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.setTopic `conversations.setTopic` API reference}.
*/
setTopic: bindApiCall(this, 'conversations.setTopic'),
/**
* @description Reverses conversation archival.
- * @see {@link https://api.slack.com/methods/conversations.unarchive `conversations.unarchive` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/conversations.unarchive `conversations.unarchive` API reference}.
*/
unarchive: bindApiCall(this, 'conversations.unarchive'),
};
this.dialog = {
/**
* @description Open a dialog with a user.
- * @see {@link https://api.slack.com/methods/dialog.open `dialog.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dialog.open `dialog.open` API reference}.
*/
open: bindApiCall(this, 'dialog.open'),
};
this.dnd = {
/**
* @description Ends the current user's Do Not Disturb session immediately.
- * @see {@link https://api.slack.com/methods/dnd.endDnd `dnd.endDnd` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.endDnd `dnd.endDnd` API reference}.
*/
- endDnd: bindApiCall(this, 'dnd.endDnd'),
+ endDnd: bindApiCallWithOptionalArgument(this, 'dnd.endDnd'),
/**
* @description Ends the current user's snooze mode immediately.
- * @see {@link https://api.slack.com/methods/dnd.endSnooze `dnd.endSnooze` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.endSnooze `dnd.endSnooze` API reference}.
*/
- endSnooze: bindApiCall(this, 'dnd.endSnooze'),
+ endSnooze: bindApiCallWithOptionalArgument(this, 'dnd.endSnooze'),
/**
* @description Retrieves a user's current Do Not Disturb status.
- * @see {@link https://api.slack.com/methods/dnd.info `dnd.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.info `dnd.info` API reference}.
*/
- info: bindApiCall(this, 'dnd.info'),
+ info: bindApiCallWithOptionalArgument(this, 'dnd.info'),
/**
* @description Turns on Do Not Disturb mode for the current user, or changes its duration.
- * @see {@link https://api.slack.com/methods/dnd.setSnooze `dnd.setSnooze` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.setSnooze `dnd.setSnooze` API reference}.
*/
setSnooze: bindApiCall(this, 'dnd.setSnooze'),
/**
* @description Retrieves the Do Not Disturb status for up to 50 users on a team.
- * @see {@link https://api.slack.com/methods/dnd.teamInfo `dnd.teamInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/dnd.teamInfo `dnd.teamInfo` API reference}.
*/
teamInfo: bindApiCall(this, 'dnd.teamInfo'),
};
this.emoji = {
/**
* @description Lists custom emoji for a team.
- * @see {@link https://api.slack.com/methods/emoji.list `emoji.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/emoji.list `emoji.list` API reference}.
+ */
+ list: bindApiCallWithOptionalArgument(this, 'emoji.list'),
+ };
+ this.entity = {
+ /**
+ * @description Provide information about the entity to be displayed in the flexpane.
+ * @see {@link https://docs.slack.dev/reference/methods/entity.presentDetails}
*/
- list: bindApiCall(this, 'emoji.list'),
+ presentDetails: bindApiCall(this, 'entity.presentDetails'),
};
this.files = {
/**
- * @description Finishes an upload started with {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal`}.
- * @see {@link https://api.slack.com/methods/files.completeUploadExternal `files.completeUploadExternal` API reference}.
+ * @description Finishes an upload started with {@link https://docs.slack.dev/reference/methods/files.getUploadURLExternal `files.getUploadURLExternal`}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.completeUploadExternal `files.completeUploadExternal` API reference}.
*/
completeUploadExternal: bindApiCall(this, 'files.completeUploadExternal'),
/**
* @description Deletes a file.
- * @see {@link https://api.slack.com/methods/files.delete `files.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.delete `files.delete` API reference}.
*/
delete: bindApiCall(this, 'files.delete'),
/**
* @description Gets a URL for an edge external file upload.
- * @see {@link https://api.slack.com/methods/files.getUploadURLExternal `files.getUploadURLExternal` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.getUploadURLExternal `files.getUploadURLExternal` API reference}.
*/
getUploadURLExternal: bindApiCall(this, 'files.getUploadURLExternal'),
/**
* @description Gets information about a file.
- * @see {@link https://api.slack.com/methods/files.info `files.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.info `files.info` API reference}.
*/
info: bindApiCall(this, 'files.info'),
/**
* @description List files for a team, in a channel, or from a user with applied filters.
- * @see {@link https://api.slack.com/methods/files.list `files.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.list `files.list` API reference}.
*/
list: bindApiCall(this, 'files.list'),
/**
* @description Revokes public/external sharing access for a file.
- * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
*/
revokePublicURL: bindApiCall(this, 'files.revokePublicURL'),
/**
* @description Enables a file for public/external sharing.
- * @see {@link https://api.slack.com/methods/files.revokePublicURL `files.revokePublicURL` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.sharedPublicURL `files.sharedPublicURL` API reference}.
*/
sharedPublicURL: bindApiCall(this, 'files.sharedPublicURL'),
/**
* @description Uploads or creates a file.
- * @deprecated Use `uploadV2` instead. See {@link https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay our post on retiring `files.upload`}.
- * @see {@link https://api.slack.com/methods/files.upload `files.upload` API reference}.
+ * @deprecated Use `uploadV2` instead. See {@link https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay our post on retiring `files.upload`}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.upload `files.upload` API reference}.
*/
upload: bindApiCall(this, 'files.upload'),
/**
@@ -8894,45 +4124,45 @@ class Methods extends eventemitter3_1.EventEmitter {
* - multiple upload_files
* Will try to honor both single file or content data supplied as well
* as multiple file uploads property.
- * @see {@link https://slack.dev/node-slack-sdk/web-api#upload-a-file `@slack/web-api` Upload a file documentation}.
- */
+ * @see {@link https://docs.slack.dev/tools/node-slack-sdk/web-api/#upload-a-file `@slack/web-api` Upload a file documentation}.
+ */
uploadV2: bindFilesUploadV2(this),
comments: {
/**
* @description Deletes an existing comment on a file.
- * @see {@link https://api.slack.com/methods/files.comments.delete `files.comments.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.comments.delete `files.comments.delete` API reference}.
*/
delete: bindApiCall(this, 'files.comments.delete'),
},
remote: {
/**
* @description Adds a file from a remote service.
- * @see {@link https://api.slack.com/methods/files.remote.add `files.remote.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.add `files.remote.add` API reference}.
*/
add: bindApiCall(this, 'files.remote.add'),
/**
* @description Retrieve information about a remote file added to Slack.
- * @see {@link https://api.slack.com/methods/files.remote.info `files.remote.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.info `files.remote.info` API reference}.
*/
info: bindApiCall(this, 'files.remote.info'),
/**
* @description List remote files added to Slack.
- * @see {@link https://api.slack.com/methods/files.remote.list `files.remote.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.list `files.remote.list` API reference}.
*/
list: bindApiCall(this, 'files.remote.list'),
/**
* @description Remove a remote file.
- * @see {@link https://api.slack.com/methods/files.remote.remove `files.remote.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.remove `files.remote.remove` API reference}.
*/
remove: bindApiCall(this, 'files.remote.remove'),
/**
* @description Share a remote file into a channel.
- * @see {@link https://api.slack.com/methods/files.remote.share `files.remote.share` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.share `files.remote.share` API reference}.
*/
share: bindApiCall(this, 'files.remote.share'),
/**
* @description Updates an existing remote file.
- * @see {@link https://api.slack.com/methods/files.remote.update `files.remote.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/files.remote.update `files.remote.update` API reference}.
*/
update: bindApiCall(this, 'files.remote.update'),
},
@@ -8940,19 +4170,19 @@ class Methods extends eventemitter3_1.EventEmitter {
this.functions = {
/**
* @description Signal the failure to execute a Custom Function.
- * @see {@link https://api.slack.com/methods/functions.completeError `functions.completeError` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/functions.completeError `functions.completeError` API reference}.
*/
completeError: bindApiCall(this, 'functions.completeError'),
/**
* @description Signal the successful completion of a Custom Function.
- * @see {@link https://api.slack.com/methods/functions.completeSuccess `functions.completeSuccess` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/functions.completeSuccess `functions.completeSuccess` API reference}.
*/
completeSuccess: bindApiCall(this, 'functions.completeSuccess'),
};
this.migration = {
/**
* @description For Enterprise Grid workspaces, map local user IDs to global user IDs.
- * @see {@link https://api.slack.com/methods/migration.exchange `migration.exchange` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/migration.exchange `migration.exchange` API reference}.
*/
exchange: bindApiCall(this, 'migration.exchange'),
};
@@ -8960,18 +4190,18 @@ class Methods extends eventemitter3_1.EventEmitter {
/**
* @description Exchanges a temporary OAuth verifier code for an access token.
* @deprecated This is a legacy method only used by classic Slack apps. Use `oauth.v2.access` for new Slack apps.
- * @see {@link https://api.slack.com/methods/oauth.access `oauth.access` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.access `oauth.access` API reference}.
*/
access: bindApiCall(this, 'oauth.access'),
v2: {
/**
* @description Exchanges a temporary OAuth verifier code for an access token.
- * @see {@link https://api.slack.com/methods/oauth.v2.access `oauth.v2.access` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.v2.access `oauth.v2.access` API reference}.
*/
access: bindApiCall(this, 'oauth.v2.access'),
/**
* @description Exchanges a legacy access token for a new expiring access token and refresh token.
- * @see {@link https://api.slack.com/methods/oauth.v2.exchange `oauth.v2.exchange` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/oauth.v2.exchange `oauth.v2.exchange` API reference}.
*/
exchange: bindApiCall(this, 'oauth.v2.exchange'),
},
@@ -8979,170 +4209,243 @@ class Methods extends eventemitter3_1.EventEmitter {
this.openid = {
connect: {
/**
- * @description Exchanges a temporary OAuth verifier code for an access token for {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}.
- * @see {@link https://api.slack.com/methods/openid.connect.token `openid.connect.token` API reference}.
+ * @description Exchanges a temporary OAuth verifier code for an access token for {@link https://docs.slack.dev/authentication/sign-in-with-slack Sign in with Slack}.
+ * @see {@link https://docs.slack.dev/reference/methods/openid.connect.token `openid.connect.token` API reference}.
*/
token: bindApiCall(this, 'openid.connect.token'),
/**
- * @description Get the identity of a user who has authorized {@link https://api.slack.com/authentication/sign-in-with-slack Sign in with Slack}.
- * @see {@link https://api.slack.com/methods/openid.connect.userInfo `openid.connect.userInfo` API reference}.
+ * @description Get the identity of a user who has authorized {@link https://docs.slack.dev/authentication/sign-in-with-slack Sign in with Slack}.
+ * @see {@link https://docs.slack.dev/reference/methods/openid.connect.userInfo `openid.connect.userInfo` API reference}.
*/
- userInfo: bindApiCall(this, 'openid.connect.userInfo'),
+ userInfo: bindApiCallWithOptionalArgument(this, 'openid.connect.userInfo'),
},
};
this.pins = {
/**
* @description Pins an item to a channel.
- * @see {@link https://api.slack.com/methods/pins.add `pins.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.add `pins.add` API reference}.
*/
add: bindApiCall(this, 'pins.add'),
/**
* @description Lists items pinned to a channel.
- * @see {@link https://api.slack.com/methods/pins.list `pins.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.list `pins.list` API reference}.
*/
list: bindApiCall(this, 'pins.list'),
/**
* @description Un-pins an item from a channel.
- * @see {@link https://api.slack.com/methods/pins.remove `pins.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/pins.remove `pins.remove` API reference}.
*/
remove: bindApiCall(this, 'pins.remove'),
};
this.reactions = {
/**
* @description Adds a reaction to an item.
- * @see {@link https://api.slack.com/methods/reactions.add `reactions.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.add `reactions.add` API reference}.
*/
add: bindApiCall(this, 'reactions.add'),
/**
* @description Gets reactions for an item.
- * @see {@link https://api.slack.com/methods/reactions.get `reactions.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.get `reactions.get` API reference}.
*/
get: bindApiCall(this, 'reactions.get'),
/**
* @description List reactions made by a user.
- * @see {@link https://api.slack.com/methods/reactions.list `reactions.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.list `reactions.list` API reference}.
*/
- list: bindApiCall(this, 'reactions.list'),
+ list: bindApiCallWithOptionalArgument(this, 'reactions.list'),
/**
* @description Removes a reaction from an item.
- * @see {@link https://api.slack.com/methods/reactions.remove `reactions.remove` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reactions.remove `reactions.remove` API reference}.
*/
remove: bindApiCall(this, 'reactions.remove'),
};
// TODO: keep tabs on reminders APIs, may be deprecated once Later list APIs land
- // See: https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders
+ // See: https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
this.reminders = {
/**
* @description Creates a reminder.
- * @see {@link https://api.slack.com/methods/reminders.add `reminders.add` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.add `reminders.add` API reference}.
*/
add: bindApiCall(this, 'reminders.add'),
/**
* @description Marks a reminder as complete.
- * @see {@link https://api.slack.com/methods/reminders.complete `reminders.complete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.complete `reminders.complete` API reference}.
*/
complete: bindApiCall(this, 'reminders.complete'),
/**
* @description Deletes a reminder.
- * @see {@link https://api.slack.com/methods/reminders.delete `reminders.delete` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.delete `reminders.delete` API reference}.
*/
delete: bindApiCall(this, 'reminders.delete'),
/**
* @description Gets information about a reminder.
- * @see {@link https://api.slack.com/methods/reminders.info `reminders.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.info `reminders.info` API reference}.
*/
info: bindApiCall(this, 'reminders.info'),
/**
* @description Lists all reminders created by or for a given user.
- * @see {@link https://api.slack.com/methods/reminders.list `reminders.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/reminders.list `reminders.list` API reference}.
*/
- list: bindApiCall(this, 'reminders.list'),
+ list: bindApiCallWithOptionalArgument(this, 'reminders.list'),
};
this.rtm = {
/**
* @description Starts a Real Time Messaging session.
- * @see {@link https://api.slack.com/methods/rtm.connect `rtm.connect` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/rtm.connect `rtm.connect` API reference}.
*/
- connect: bindApiCall(this, 'rtm.connect'),
+ connect: bindApiCallWithOptionalArgument(this, 'rtm.connect'),
/**
* @description Starts a Real Time Messaging session.
- * @deprecated Use `rtm.connect` instead. See {@link https://api.slack.com/changelog/2021-10-rtm-start-to-stop our post on retiring `rtm.start`}.
- * @see {@link https://api.slack.com/methods/rtm.start `rtm.start` API reference}.
+ * @deprecated Use `rtm.connect` instead. See {@link https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop our post on retiring `rtm.start`}.
+ * @see {@link https://docs.slack.dev/reference/methods/rtm.start `rtm.start` API reference}.
*/
- start: bindApiCall(this, 'rtm.start'),
+ start: bindApiCallWithOptionalArgument(this, 'rtm.start'),
};
this.search = {
/**
* @description Searches for messages and files matching a query.
- * @see {@link https://api.slack.com/methods/search.all search.all` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.all search.all` API reference}.
*/
all: bindApiCall(this, 'search.all'),
/**
* @description Searches for files matching a query.
- * @see {@link https://api.slack.com/methods/search.files search.files` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.files search.files` API reference}.
*/
files: bindApiCall(this, 'search.files'),
/**
* @description Searches for messages matching a query.
- * @see {@link https://api.slack.com/methods/search.messages search.messages` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/search.messages search.messages` API reference}.
*/
messages: bindApiCall(this, 'search.messages'),
};
+ this.slackLists = {
+ access: {
+ /**
+ * @description Delete access for specified entities.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.access.delete `slackLists.access.delete` API reference}.
+ */
+ delete: bindApiCall(this, 'slackLists.access.delete'),
+ /**
+ * @description Set access level for specified entities.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.access.set `slackLists.access.set` API reference}.
+ */
+ set: bindApiCall(this, 'slackLists.access.set'),
+ },
+ /**
+ * @description Create a List.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.create `slackLists.create` API reference}.
+ */
+ create: bindApiCall(this, 'slackLists.create'),
+ download: {
+ /**
+ * @description Get download job status.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.download.get `slackLists.download.get` API reference}.
+ */
+ get: bindApiCall(this, 'slackLists.download.get'),
+ /**
+ * @description Start a download job for a list.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.download.start `slackLists.download.start` API reference}.
+ */
+ start: bindApiCall(this, 'slackLists.download.start'),
+ },
+ items: {
+ /**
+ * @description Create a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.create `slackLists.items.create` API reference}.
+ */
+ create: bindApiCall(this, 'slackLists.items.create'),
+ /**
+ * @description Delete a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.delete `slackLists.items.delete` API reference}.
+ */
+ delete: bindApiCall(this, 'slackLists.items.delete'),
+ /**
+ * @description Delete multiple list items.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.deleteMultiple `slackLists.items.deleteMultiple` API reference}.
+ */
+ deleteMultiple: bindApiCall(this, 'slackLists.items.deleteMultiple'),
+ /**
+ * @description Get info about a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.info `slackLists.items.info` API reference}.
+ */
+ info: bindApiCall(this, 'slackLists.items.info'),
+ /**
+ * @description Get records from a List.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.list `slackLists.items.list` API reference}.
+ */
+ list: bindApiCall(this, 'slackLists.items.list'),
+ /**
+ * @description Update a list item.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.items.update `slackLists.items.update` API reference}.
+ */
+ update: bindApiCall(this, 'slackLists.items.update'),
+ },
+ /**
+ * @description Update a list.
+ * @see {@link https://docs.slack.dev/reference/methods/slackLists.update `slackLists.update` API reference}.
+ */
+ update: bindApiCall(this, 'slackLists.update'),
+ };
this.team = {
/**
* @description Gets the access logs for the current team.
- * @see {@link https://api.slack.com/methods/team.accessLogs `team.accessLogs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.accessLogs `team.accessLogs` API reference}.
*/
- accessLogs: bindApiCall(this, 'team.accessLogs'),
+ accessLogs: bindApiCallWithOptionalArgument(this, 'team.accessLogs'),
/**
* @description Gets billable users information for the current team.
- * @see {@link https://api.slack.com/methods/team.billableInfo `team.billableInfo` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.billableInfo `team.billableInfo` API reference}.
*/
- billableInfo: bindApiCall(this, 'team.billableInfo'),
+ billableInfo: bindApiCallWithOptionalArgument(this, 'team.billableInfo'),
billing: {
/**
* @description Reads a workspace's billing plan information.
- * @see {@link https://api.slack.com/methods/team.billing.info `team.billing.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.billing.info `team.billing.info` API reference}.
*/
info: bindApiCall(this, 'team.billing.info'),
},
externalTeams: {
+ /**
+ * @description Disconnect an external organization.
+ * @see {@link https://docs.slack.dev/reference/methods/team.externalTeams.disconnect `team.externalTeams.disconnect` API reference}.
+ */
+ disconnect: bindApiCall(this, 'team.externalTeams.disconnect'),
/**
* @description Returns a list of all the external teams connected and details about the connection.
- * @see {@link https://api.slack.com/methods/team.externalTeams.list `team.externalTeams.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.externalTeams.list `team.externalTeams.list` API reference}.
*/
- lookup: bindApiCall(this, 'team.externalTeams.list'),
+ list: bindApiCall(this, 'team.externalTeams.list'),
},
/**
* @description Gets information about the current team.
- * @see {@link https://api.slack.com/methods/team.info `team.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.info `team.info` API reference}.
*/
- info: bindApiCall(this, 'team.info'),
+ info: bindApiCallWithOptionalArgument(this, 'team.info'),
/**
* @description Gets the integration logs for the current team.
- * @see {@link https://api.slack.com/methods/team.integrationLogs `team.integrationLogs` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.integrationLogs `team.integrationLogs` API reference}.
*/
- integrationLogs: bindApiCall(this, 'team.integrationLogs'),
+ integrationLogs: bindApiCallWithOptionalArgument(this, 'team.integrationLogs'),
preferences: {
/**
* @description Retrieve a list of a workspace's team preferences.
- * @see {@link https://api.slack.com/methods/team.preferences.list `team.preferences.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.preferences.list `team.preferences.list` API reference}.
*/
- list: bindApiCall(this, 'team.preferences.list'),
+ list: bindApiCallWithOptionalArgument(this, 'team.preferences.list'),
},
profile: {
/**
* @description Retrieve a team's profile.
- * @see {@link https://api.slack.com/methods/team.profile.get `team.profile.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/team.profile.get `team.profile.get` API reference}.
*/
- get: bindApiCall(this, 'team.profile.get'),
+ get: bindApiCallWithOptionalArgument(this, 'team.profile.get'),
},
};
this.tooling = {
tokens: {
/**
* @description Exchanges a refresh token for a new app configuration token.
- * @see {@link https://api.slack.com/methods/tooling.tokens.rotate `tooling.tokens.rotate` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/tooling.tokens.rotate `tooling.tokens.rotate` API reference}.
*/
rotate: bindApiCall(this, 'tooling.tokens.rotate'),
},
@@ -9150,38 +4453,38 @@ class Methods extends eventemitter3_1.EventEmitter {
this.usergroups = {
/**
* @description Create a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.create `usergroups.create` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.create `usergroups.create` API reference}.
*/
create: bindApiCall(this, 'usergroups.create'),
/**
* @description Disable an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.disable `usergroups.disable` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.disable `usergroups.disable` API reference}.
*/
disable: bindApiCall(this, 'usergroups.disable'),
/**
* @description Enable an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.enable `usergroups.enable` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.enable `usergroups.enable` API reference}.
*/
enable: bindApiCall(this, 'usergroups.enable'),
/**
* @description List all User Groups for a team.
- * @see {@link https://api.slack.com/methods/usergroups.list `usergroups.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.list `usergroups.list` API reference}.
*/
- list: bindApiCall(this, 'usergroups.list'),
+ list: bindApiCallWithOptionalArgument(this, 'usergroups.list'),
/**
* @description Update an existing User Group.
- * @see {@link https://api.slack.com/methods/usergroups.update `usergroups.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.update `usergroups.update` API reference}.
*/
update: bindApiCall(this, 'usergroups.update'),
users: {
/**
* @description List all users in a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.users.list `usergroups.users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.users.list `usergroups.users.list` API reference}.
*/
list: bindApiCall(this, 'usergroups.users.list'),
/**
* @description Update the list of users in a User Group.
- * @see {@link https://api.slack.com/methods/usergroups.users.update `usergroups.users.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/usergroups.users.update `usergroups.users.update` API reference}.
*/
update: bindApiCall(this, 'usergroups.users.update'),
},
@@ -9189,65 +4492,65 @@ class Methods extends eventemitter3_1.EventEmitter {
this.users = {
/**
* @description List conversations the calling user may access.
- * @see {@link https://api.slack.com/methods/users.conversations `users.conversations` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.conversations `users.conversations` API reference}.
*/
conversations: bindApiCall(this, 'users.conversations'),
/**
* @description Delete the user profile photo.
- * @see {@link https://api.slack.com/methods/users.deletePhoto `users.deletePhoto` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.deletePhoto `users.deletePhoto` API reference}.
*/
deletePhoto: bindApiCall(this, 'users.deletePhoto'),
discoverableContacts: {
/**
* @description Lookup an email address to see if someone is on Slack.
- * @see {@link https://api.slack.com/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}.
*/
lookup: bindApiCall(this, 'users.discoverableContacts.lookup'),
},
/**
* @description Gets user presence information.
- * @see {@link https://api.slack.com/methods/users.getPresence `users.getPresence` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.getPresence `users.getPresence` API reference}.
*/
getPresence: bindApiCall(this, 'users.getPresence'),
/**
* @description Get a user's identity.
- * @see {@link https://api.slack.com/methods/users.identity `users.identity` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.identity `users.identity` API reference}.
*/
identity: bindApiCall(this, 'users.identity'),
/**
* @description Gets information about a user.
- * @see {@link https://api.slack.com/methods/users.info `users.info` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.info `users.info` API reference}.
*/
info: bindApiCall(this, 'users.info'),
/**
* @description Lists all users in a Slack team.
- * @see {@link https://api.slack.com/methods/users.list `users.list` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.list `users.list` API reference}.
*/
list: bindApiCall(this, 'users.list'),
/**
* @description Find a user with an email address.
- * @see {@link https://api.slack.com/methods/users.lookupByEmail `users.lookupByEmail` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.lookupByEmail `users.lookupByEmail` API reference}.
*/
lookupByEmail: bindApiCall(this, 'users.lookupByEmail'),
/**
* @description Set the user profile photo.
- * @see {@link https://api.slack.com/methods/users.setPhoto `users.setPhoto` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.setPhoto `users.setPhoto` API reference}.
*/
setPhoto: bindApiCall(this, 'users.setPhoto'),
/**
* @description Manually sets user presence.
- * @see {@link https://api.slack.com/methods/users.setPresence `users.setPresence` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.setPresence `users.setPresence` API reference}.
*/
setPresence: bindApiCall(this, 'users.setPresence'),
profile: {
/**
* @description Retrieve a user's profile information, including their custom status.
- * @see {@link https://api.slack.com/methods/users.profile.get `users.profile.get` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.profile.get `users.profile.get` API reference}.
*/
get: bindApiCall(this, 'users.profile.get'),
/**
* @description Set a user's profile information, including custom status.
- * @see {@link https://api.slack.com/methods/users.profile.set `users.profile.set` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/users.profile.set `users.profile.set` API reference}.
*/
set: bindApiCall(this, 'users.profile.set'),
},
@@ -9255,22 +4558,22 @@ class Methods extends eventemitter3_1.EventEmitter {
this.views = {
/**
* @description Open a view for a user.
- * @see {@link https://api.slack.com/methods/views.open `views.open` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.open `views.open` API reference}.
*/
open: bindApiCall(this, 'views.open'),
/**
* @description Publish a static view for a user.
- * @see {@link https://api.slack.com/methods/views.publish `views.publish` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.publish `views.publish` API reference}.
*/
publish: bindApiCall(this, 'views.publish'),
/**
* @description Push a view onto the stack of a root view.
- * @see {@link https://api.slack.com/methods/views.push `views.push` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.push `views.push` API reference}.
*/
push: bindApiCall(this, 'views.push'),
/**
* @description Update an existing view.
- * @see {@link https://api.slack.com/methods/views.update `views.update` API reference}.
+ * @see {@link https://docs.slack.dev/reference/methods/views.update `views.update` API reference}.
*/
update: bindApiCall(this, 'views.update'),
};
@@ -9279,13807 +4582,21517 @@ class Methods extends eventemitter3_1.EventEmitter {
// ------------------
// TODO: breaking changes for future majors:
// - stars.* methods are marked as deprecated; once Later has APIs, these will see an official sunsetting timeline
- // - workflows.* methods, Sep 12 2024: https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back
+ // - workflows.* methods, Sep 12 2024: https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back
this.stars = {
/**
* @description Save an item for later. Formerly known as adding a star.
* @deprecated Stars can still be added but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.add `stars.add` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.add `stars.add` API reference}.
*/
add: bindApiCall(this, 'stars.add'),
/**
* @description List a user's saved items, formerly known as stars.
* @deprecated Stars can still be listed but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.list `stars.list` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.list `stars.list` API reference}.
*/
list: bindApiCall(this, 'stars.list'),
/**
* @description Remove a saved item from a user's saved items, formerly known as stars.
* @deprecated Stars can still be removed but they can no longer be viewed or interacted with by end-users.
- * See {@link https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
- * @see {@link https://api.slack.com/methods/stars.remove `stars.remove` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders our post on stars and the Later list}.
+ * @see {@link https://docs.slack.dev/reference/methods/stars.remove `stars.remove` API reference}.
*/
remove: bindApiCall(this, 'stars.remove'),
};
this.workflows = {
+ featured: {
+ /**
+ * @description Add featured workflows to a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.add `workflows.featured.add` API reference}.
+ */
+ add: bindApiCall(this, 'workflows.featured.add'),
+ /**
+ * @description List the featured workflows for specified channels.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.list `workflows.featured.list` API reference}.
+ */
+ list: bindApiCall(this, 'workflows.featured.list'),
+ /**
+ * @description Remove featured workflows from a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.remove `workflows.featured.remove` API reference}.
+ */
+ remove: bindApiCall(this, 'workflows.featured.remove'),
+ /**
+ * @description Set featured workflows for a channel.
+ * @see {@link https://docs.slack.dev/reference/methods/workflows.featured.set `workflows.featured.set` API reference}.
+ */
+ set: bindApiCall(this, 'workflows.featured.set'),
+ },
/**
* @description Indicate that an app's step in a workflow completed execution.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.stepCompleted `workflows.stepCompleted` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.stepCompleted` API reference}.
*/
stepCompleted: bindApiCall(this, 'workflows.stepCompleted'),
/**
* @description Indicate that an app's step in a workflow failed to execute.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.stepFailed `workflows.stepFailed` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.stepFailed` API reference}.
*/
stepFailed: bindApiCall(this, 'workflows.stepFailed'),
/**
* @description Update the configuration for a workflow step.
* @deprecated Steps from Apps is deprecated.
* We're retiring all Slack app functionality around Steps from Apps in September 2024.
- * See {@link https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
- * @see {@link https://api.slack.com/methods/workflows.updateStep `workflows.updateStep` API reference}.
+ * See {@link https://docs.slack.dev/changelog/2023-08-workflow-steps-from-apps-step-back our post on deprecating Steps from Apps}.
+ * @see {@link https://docs.slack.dev/legacy/legacy-steps-from-apps/legacy-steps-from-apps-workflow_step-object `workflows.updateStep` API reference}.
*/
updateStep: bindApiCall(this, 'workflows.updateStep'),
};
- // Check that the class being created extends from `WebClient` rather than this class
- if (new.target !== WebClient_1.WebClient && !(new.target.prototype instanceof WebClient_1.WebClient)) {
- throw new Error('Attempt to inherit from WebClient methods without inheriting from WebClient');
+ // Check that the class being created extends from `WebClient` rather than this class
+ if (new.target !== WebClient_1.WebClient && !(new.target.prototype instanceof WebClient_1.WebClient)) {
+ throw new Error('Attempt to inherit from WebClient methods without inheriting from WebClient');
+ }
+ }
+}
+exports.Methods = Methods;
+__exportStar(__nccwpck_require__(4775), exports);
+//# sourceMappingURL=methods.js.map
+
+/***/ }),
+
+/***/ 1766:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.rapidRetryPolicy = exports.fiveRetriesInFiveMinutes = exports.tenRetriesInAboutThirtyMinutes = void 0;
+/**
+ * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because
+ * randomization has been added to prevent a stampeding herd problem (if all instances in your application are retrying
+ * a request at the exact same intervals, they are more likely to cause failures for each other).
+ */
+exports.tenRetriesInAboutThirtyMinutes = {
+ retries: 10,
+ factor: 1.96821,
+ randomize: true,
+};
+/**
+ * Short & sweet, five retries in five minutes and then bail.
+ */
+exports.fiveRetriesInFiveMinutes = {
+ retries: 5,
+ factor: 3.86,
+};
+/**
+ * This policy is just to keep the tests running fast.
+ */
+exports.rapidRetryPolicy = {
+ minTimeout: 0,
+ maxTimeout: 1,
+};
+const policies = {
+ tenRetriesInAboutThirtyMinutes: exports.tenRetriesInAboutThirtyMinutes,
+ fiveRetriesInFiveMinutes: exports.fiveRetriesInFiveMinutes,
+ rapidRetryPolicy: exports.rapidRetryPolicy,
+};
+exports["default"] = policies;
+//# sourceMappingURL=retry-policies.js.map
+
+/***/ }),
+
+/***/ 381:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 5591:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 8207:
+/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+const events_1 = __nccwpck_require__(4434);
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const promisify_1 = __importDefault(__nccwpck_require__(8067));
+const debug = debug_1.default('agent-base');
+function isAgent(v) {
+ return Boolean(v) && typeof v.addRequest === 'function';
+}
+function isSecureEndpoint() {
+ const { stack } = new Error();
+ if (typeof stack !== 'string')
+ return false;
+ return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
+}
+function createAgent(callback, opts) {
+ return new createAgent.Agent(callback, opts);
+}
+(function (createAgent) {
+ /**
+ * Base `http.Agent` implementation.
+ * No pooling/keep-alive is implemented by default.
+ *
+ * @param {Function} callback
+ * @api public
+ */
+ class Agent extends events_1.EventEmitter {
+ constructor(callback, _opts) {
+ super();
+ let opts = _opts;
+ if (typeof callback === 'function') {
+ this.callback = callback;
+ }
+ else if (callback) {
+ opts = callback;
+ }
+ // Timeout for the socket to be returned from the callback
+ this.timeout = null;
+ if (opts && typeof opts.timeout === 'number') {
+ this.timeout = opts.timeout;
+ }
+ // These aren't actually used by `agent-base`, but are required
+ // for the TypeScript definition files in `@types/node` :/
+ this.maxFreeSockets = 1;
+ this.maxSockets = 1;
+ this.maxTotalSockets = Infinity;
+ this.sockets = {};
+ this.freeSockets = {};
+ this.requests = {};
+ this.options = {};
+ }
+ get defaultPort() {
+ if (typeof this.explicitDefaultPort === 'number') {
+ return this.explicitDefaultPort;
+ }
+ return isSecureEndpoint() ? 443 : 80;
+ }
+ set defaultPort(v) {
+ this.explicitDefaultPort = v;
+ }
+ get protocol() {
+ if (typeof this.explicitProtocol === 'string') {
+ return this.explicitProtocol;
+ }
+ return isSecureEndpoint() ? 'https:' : 'http:';
+ }
+ set protocol(v) {
+ this.explicitProtocol = v;
+ }
+ callback(req, opts, fn) {
+ throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
+ }
+ /**
+ * Called by node-core's "_http_client.js" module when creating
+ * a new HTTP request with this Agent instance.
+ *
+ * @api public
+ */
+ addRequest(req, _opts) {
+ const opts = Object.assign({}, _opts);
+ if (typeof opts.secureEndpoint !== 'boolean') {
+ opts.secureEndpoint = isSecureEndpoint();
+ }
+ if (opts.host == null) {
+ opts.host = 'localhost';
+ }
+ if (opts.port == null) {
+ opts.port = opts.secureEndpoint ? 443 : 80;
+ }
+ if (opts.protocol == null) {
+ opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
+ }
+ if (opts.host && opts.path) {
+ // If both a `host` and `path` are specified then it's most
+ // likely the result of a `url.parse()` call... we need to
+ // remove the `path` portion so that `net.connect()` doesn't
+ // attempt to open that as a unix socket file.
+ delete opts.path;
+ }
+ delete opts.agent;
+ delete opts.hostname;
+ delete opts._defaultAgent;
+ delete opts.defaultPort;
+ delete opts.createConnection;
+ // Hint to use "Connection: close"
+ // XXX: non-documented `http` module API :(
+ req._last = true;
+ req.shouldKeepAlive = false;
+ let timedOut = false;
+ let timeoutId = null;
+ const timeoutMs = opts.timeout || this.timeout;
+ const onerror = (err) => {
+ if (req._hadError)
+ return;
+ req.emit('error', err);
+ // For Safety. Some additional errors might fire later on
+ // and we need to make sure we don't double-fire the error event.
+ req._hadError = true;
+ };
+ const ontimeout = () => {
+ timeoutId = null;
+ timedOut = true;
+ const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
+ err.code = 'ETIMEOUT';
+ onerror(err);
+ };
+ const callbackError = (err) => {
+ if (timedOut)
+ return;
+ if (timeoutId !== null) {
+ clearTimeout(timeoutId);
+ timeoutId = null;
+ }
+ onerror(err);
+ };
+ const onsocket = (socket) => {
+ if (timedOut)
+ return;
+ if (timeoutId != null) {
+ clearTimeout(timeoutId);
+ timeoutId = null;
+ }
+ if (isAgent(socket)) {
+ // `socket` is actually an `http.Agent` instance, so
+ // relinquish responsibility for this `req` to the Agent
+ // from here on
+ debug('Callback returned another Agent instance %o', socket.constructor.name);
+ socket.addRequest(req, opts);
+ return;
+ }
+ if (socket) {
+ socket.once('free', () => {
+ this.freeSocket(socket, opts);
+ });
+ req.onSocket(socket);
+ return;
+ }
+ const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
+ onerror(err);
+ };
+ if (typeof this.callback !== 'function') {
+ onerror(new Error('`callback` is not defined'));
+ return;
+ }
+ if (!this.promisifiedCallback) {
+ if (this.callback.length >= 3) {
+ debug('Converting legacy callback function to promise');
+ this.promisifiedCallback = promisify_1.default(this.callback);
+ }
+ else {
+ this.promisifiedCallback = this.callback;
+ }
+ }
+ if (typeof timeoutMs === 'number' && timeoutMs > 0) {
+ timeoutId = setTimeout(ontimeout, timeoutMs);
+ }
+ if ('port' in opts && typeof opts.port !== 'number') {
+ opts.port = Number(opts.port);
+ }
+ try {
+ debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
+ Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
+ }
+ catch (err) {
+ Promise.reject(err).catch(callbackError);
+ }
+ }
+ freeSocket(socket, opts) {
+ debug('Freeing socket %o %o', socket.constructor.name, opts);
+ socket.destroy();
+ }
+ destroy() {
+ debug('Destroying agent %o', this.constructor.name);
+ }
+ }
+ createAgent.Agent = Agent;
+ // So that `instanceof` works correctly
+ createAgent.prototype = createAgent.Agent.prototype;
+})(createAgent || (createAgent = {}));
+module.exports = createAgent;
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 8067:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+function promisify(fn) {
+ return function (req, opts) {
+ return new Promise((resolve, reject) => {
+ fn.call(this, req, opts, (err, rtn) => {
+ if (err) {
+ reject(err);
+ }
+ else {
+ resolve(rtn);
+ }
+ });
+ });
+ };
+}
+exports["default"] = promisify;
+//# sourceMappingURL=promisify.js.map
+
+/***/ }),
+
+/***/ 1324:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+module.exports =
+{
+ parallel : __nccwpck_require__(3857),
+ serial : __nccwpck_require__(1054),
+ serialOrdered : __nccwpck_require__(3961)
+};
+
+
+/***/ }),
+
+/***/ 4818:
+/***/ ((module) => {
+
+// API
+module.exports = abort;
+
+/**
+ * Aborts leftover active jobs
+ *
+ * @param {object} state - current state object
+ */
+function abort(state)
+{
+ Object.keys(state.jobs).forEach(clean.bind(state));
+
+ // reset leftover jobs
+ state.jobs = {};
+}
+
+/**
+ * Cleans up leftover job by invoking abort function for the provided job id
+ *
+ * @this state
+ * @param {string|number} key - job id to abort
+ */
+function clean(key)
+{
+ if (typeof this.jobs[key] == 'function')
+ {
+ this.jobs[key]();
+ }
+}
+
+
+/***/ }),
+
+/***/ 8452:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var defer = __nccwpck_require__(9200);
+
+// API
+module.exports = async;
+
+/**
+ * Runs provided callback asynchronously
+ * even if callback itself is not
+ *
+ * @param {function} callback - callback to invoke
+ * @returns {function} - augmented callback
+ */
+function async(callback)
+{
+ var isAsync = false;
+
+ // check if async happened
+ defer(function() { isAsync = true; });
+
+ return function async_callback(err, result)
+ {
+ if (isAsync)
+ {
+ callback(err, result);
+ }
+ else
+ {
+ defer(function nextTick_callback()
+ {
+ callback(err, result);
+ });
+ }
+ };
+}
+
+
+/***/ }),
+
+/***/ 9200:
+/***/ ((module) => {
+
+module.exports = defer;
+
+/**
+ * Runs provided function on next iteration of the event loop
+ *
+ * @param {function} fn - function to run
+ */
+function defer(fn)
+{
+ var nextTick = typeof setImmediate == 'function'
+ ? setImmediate
+ : (
+ typeof process == 'object' && typeof process.nextTick == 'function'
+ ? process.nextTick
+ : null
+ );
+
+ if (nextTick)
+ {
+ nextTick(fn);
+ }
+ else
+ {
+ setTimeout(fn, 0);
+ }
+}
+
+
+/***/ }),
+
+/***/ 4902:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var async = __nccwpck_require__(8452)
+ , abort = __nccwpck_require__(4818)
+ ;
+
+// API
+module.exports = iterate;
+
+/**
+ * Iterates over each job object
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {object} state - current job status
+ * @param {function} callback - invoked when all elements processed
+ */
+function iterate(list, iterator, state, callback)
+{
+ // store current index
+ var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
+ {
+ // don't repeat yourself
+ // skip secondary callbacks
+ if (!(key in state.jobs))
+ {
+ return;
+ }
+
+ // clean up jobs
+ delete state.jobs[key];
+
+ if (error)
+ {
+ // don't process rest of the results
+ // stop still active jobs
+ // and reset the list
+ abort(state);
+ }
+ else
+ {
+ state.results[key] = output;
+ }
+
+ // return salvaged results
+ callback(error, state.results);
+ });
+}
+
+/**
+ * Runs iterator over provided job element
+ *
+ * @param {function} iterator - iterator to invoke
+ * @param {string|number} key - key/index of the element in the list of jobs
+ * @param {mixed} item - job description
+ * @param {function} callback - invoked after iterator is done with the job
+ * @returns {function|mixed} - job abort function or something else
+ */
+function runJob(iterator, key, item, callback)
+{
+ var aborter;
+
+ // allow shortcut if iterator expects only two arguments
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, async(callback));
+ }
+ // otherwise go with full three arguments
+ else
+ {
+ aborter = iterator(item, key, async(callback));
+ }
+
+ return aborter;
+}
+
+
+/***/ }),
+
+/***/ 1721:
+/***/ ((module) => {
+
+// API
+module.exports = state;
+
+/**
+ * Creates initial state object
+ * for iteration over list
+ *
+ * @param {array|object} list - list to iterate over
+ * @param {function|null} sortMethod - function to use for keys sort,
+ * or `null` to keep them as is
+ * @returns {object} - initial state object
+ */
+function state(list, sortMethod)
+{
+ var isNamedList = !Array.isArray(list)
+ , initState =
+ {
+ index : 0,
+ keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
+ jobs : {},
+ results : isNamedList ? {} : [],
+ size : isNamedList ? Object.keys(list).length : list.length
+ }
+ ;
+
+ if (sortMethod)
+ {
+ // sort array keys based on it's values
+ // sort object's keys just on own merit
+ initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
+ {
+ return sortMethod(list[a], list[b]);
+ });
+ }
+
+ return initState;
+}
+
+
+/***/ }),
+
+/***/ 3351:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var abort = __nccwpck_require__(4818)
+ , async = __nccwpck_require__(8452)
+ ;
+
+// API
+module.exports = terminator;
+
+/**
+ * Terminates jobs in the attached state context
+ *
+ * @this AsyncKitState#
+ * @param {function} callback - final callback to invoke after termination
+ */
+function terminator(callback)
+{
+ if (!Object.keys(this.jobs).length)
+ {
+ return;
+ }
+
+ // fast forward iteration index
+ this.index = this.size;
+
+ // abort jobs
+ abort(this);
+
+ // send back results we have so far
+ async(callback)(null, this.results);
+}
+
+
+/***/ }),
+
+/***/ 3857:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var iterate = __nccwpck_require__(4902)
+ , initState = __nccwpck_require__(1721)
+ , terminator = __nccwpck_require__(3351)
+ ;
+
+// Public API
+module.exports = parallel;
+
+/**
+ * Runs iterator over provided array elements in parallel
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function parallel(list, iterator, callback)
+{
+ var state = initState(list);
+
+ while (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, function(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ // looks like it's the last one
+ if (Object.keys(state.jobs).length === 0)
+ {
+ callback(null, state.results);
+ return;
+ }
+ });
+
+ state.index++;
+ }
+
+ return terminator.bind(state, callback);
+}
+
+
+/***/ }),
+
+/***/ 1054:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var serialOrdered = __nccwpck_require__(3961);
+
+// Public API
+module.exports = serial;
+
+/**
+ * Runs iterator over provided array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serial(list, iterator, callback)
+{
+ return serialOrdered(list, iterator, null, callback);
+}
+
+
+/***/ }),
+
+/***/ 3961:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var iterate = __nccwpck_require__(4902)
+ , initState = __nccwpck_require__(1721)
+ , terminator = __nccwpck_require__(3351)
+ ;
+
+// Public API
+module.exports = serialOrdered;
+// sorting helpers
+module.exports.ascending = ascending;
+module.exports.descending = descending;
+
+/**
+ * Runs iterator over provided sorted array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serialOrdered(list, iterator, sortMethod, callback)
+{
+ var state = initState(list, sortMethod);
+
+ iterate(list, iterator, state, function iteratorHandler(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ state.index++;
+
+ // are we there yet?
+ if (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, iteratorHandler);
+ return;
+ }
+
+ // done here
+ callback(null, state.results);
+ });
+
+ return terminator.bind(state, callback);
+}
+
+/*
+ * -- Sort methods
+ */
+
+/**
+ * sort helper to sort array elements in ascending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function ascending(a, b)
+{
+ return a < b ? -1 : a > b ? 1 : 0;
+}
+
+/**
+ * sort helper to sort array elements in descending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function descending(a, b)
+{
+ return -1 * ascending(a, b);
+}
+
+
+/***/ }),
+
+/***/ 2639:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(7564);
+
+var $apply = __nccwpck_require__(3945);
+var $call = __nccwpck_require__(8093);
+var $reflectApply = __nccwpck_require__(1330);
+
+/** @type {import('./actualApply')} */
+module.exports = $reflectApply || bind.call($call, $apply);
+
+
+/***/ }),
+
+/***/ 3945:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionApply')} */
+module.exports = Function.prototype.apply;
+
+
+/***/ }),
+
+/***/ 8093:
+/***/ ((module) => {
+
+
+
+/** @type {import('./functionCall')} */
+module.exports = Function.prototype.call;
+
+
+/***/ }),
+
+/***/ 8705:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var bind = __nccwpck_require__(7564);
+var $TypeError = __nccwpck_require__(3314);
+
+var $call = __nccwpck_require__(8093);
+var $actualApply = __nccwpck_require__(2639);
+
+/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
+module.exports = function callBindBasic(args) {
+ if (args.length < 1 || typeof args[0] !== 'function') {
+ throw new $TypeError('a function is required');
+ }
+ return $actualApply(bind, $call, args);
+};
+
+
+/***/ }),
+
+/***/ 1330:
+/***/ ((module) => {
+
+
+
+/** @type {import('./reflectApply')} */
+module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
+
+
+/***/ }),
+
+/***/ 5630:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var util = __nccwpck_require__(9023);
+var Stream = (__nccwpck_require__(2203).Stream);
+var DelayedStream = __nccwpck_require__(2710);
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+ this._insideLoop = false;
+ this._pendingNext = false;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+
+ if (this._insideLoop) {
+ this._pendingNext = true;
+ return; // defer call
+ }
+
+ this._insideLoop = true;
+ try {
+ do {
+ this._pendingNext = false;
+ this._realGetNext();
+ } while (this._pendingNext);
+ } finally {
+ this._insideLoop = false;
+ }
+};
+
+CombinedStream.prototype._realGetNext = function() {
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
+
+
+/***/ }),
+
+/***/ 6110:
+/***/ ((module, exports, __nccwpck_require__) => {
+
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ let m;
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ // eslint-disable-next-line no-return-assign
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = __nccwpck_require__(897)(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
+
+
+/***/ }),
+
+/***/ 897:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = __nccwpck_require__(744);
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ const split = (typeof namespaces === 'string' ? namespaces : '')
+ .trim()
+ .replace(/\s+/g, ',')
+ .split(',')
+ .filter(Boolean);
+
+ for (const ns of split) {
+ if (ns[0] === '-') {
+ createDebug.skips.push(ns.slice(1));
+ } else {
+ createDebug.names.push(ns);
+ }
+ }
+ }
+
+ /**
+ * Checks if the given string matches a namespace template, honoring
+ * asterisks as wildcards.
+ *
+ * @param {String} search
+ * @param {String} template
+ * @return {Boolean}
+ */
+ function matchesTemplate(search, template) {
+ let searchIndex = 0;
+ let templateIndex = 0;
+ let starIndex = -1;
+ let matchIndex = 0;
+
+ while (searchIndex < search.length) {
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
+ // Match character or proceed with wildcard
+ if (template[templateIndex] === '*') {
+ starIndex = templateIndex;
+ matchIndex = searchIndex;
+ templateIndex++; // Skip the '*'
+ } else {
+ searchIndex++;
+ templateIndex++;
+ }
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
+ // Backtrack to the last '*' and try to match more characters
+ templateIndex = starIndex + 1;
+ matchIndex++;
+ searchIndex = matchIndex;
+ } else {
+ return false; // No match
+ }
+ }
+
+ // Handle trailing '*' in template
+ while (templateIndex < template.length && template[templateIndex] === '*') {
+ templateIndex++;
+ }
+
+ return templateIndex === template.length;
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names,
+ ...createDebug.skips.map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ for (const skip of createDebug.skips) {
+ if (matchesTemplate(name, skip)) {
+ return false;
+ }
+ }
+
+ for (const ns of createDebug.names) {
+ if (matchesTemplate(name, ns)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
+
+
+/***/ }),
+
+/***/ 2830:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+ module.exports = __nccwpck_require__(6110);
+} else {
+ module.exports = __nccwpck_require__(5108);
+}
+
+
+/***/ }),
+
+/***/ 5108:
+/***/ ((module, exports, __nccwpck_require__) => {
+
+/**
+ * Module dependencies.
+ */
+
+const tty = __nccwpck_require__(2018);
+const util = __nccwpck_require__(9023);
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+);
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = __nccwpck_require__(1450);
+
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+} catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+}).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
+ }
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ const {namespace: name, useColors} = this;
+
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
+ }
+}
+
+function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
+ }
+ return new Date().toISOString() + ' ';
+}
+
+/**
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+ */
+
+function log(...args) {
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+module.exports = __nccwpck_require__(897)(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+};
+
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
+
+
+/***/ }),
+
+/***/ 2710:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var Stream = (__nccwpck_require__(2203).Stream);
+var util = __nccwpck_require__(9023);
+
+module.exports = DelayedStream;
+function DelayedStream() {
+ this.source = null;
+ this.dataSize = 0;
+ this.maxDataSize = 1024 * 1024;
+ this.pauseStream = true;
+
+ this._maxDataSizeExceeded = false;
+ this._released = false;
+ this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+ var delayedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ delayedStream[option] = options[option];
+ }
+
+ delayedStream.source = source;
+
+ var realEmit = source.emit;
+ source.emit = function() {
+ delayedStream._handleEmit(arguments);
+ return realEmit.apply(source, arguments);
+ };
+
+ source.on('error', function() {});
+ if (delayedStream.pauseStream) {
+ source.pause();
+ }
+
+ return delayedStream;
+};
+
+Object.defineProperty(DelayedStream.prototype, 'readable', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return this.source.readable;
+ }
+});
+
+DelayedStream.prototype.setEncoding = function() {
+ return this.source.setEncoding.apply(this.source, arguments);
+};
+
+DelayedStream.prototype.resume = function() {
+ if (!this._released) {
+ this.release();
+ }
+
+ this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+ this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+ this._released = true;
+
+ this._bufferedEvents.forEach(function(args) {
+ this.emit.apply(this, args);
+ }.bind(this));
+ this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+ var r = Stream.prototype.pipe.apply(this, arguments);
+ this.resume();
+ return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+ if (this._released) {
+ this.emit.apply(this, args);
+ return;
+ }
+
+ if (args[0] === 'data') {
+ this.dataSize += args[1].length;
+ this._checkIfMaxDataSizeExceeded();
+ }
+
+ this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+ if (this._maxDataSizeExceeded) {
+ return;
+ }
+
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ this._maxDataSizeExceeded = true;
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ this.emit('error', new Error(message));
+};
+
+
+/***/ }),
+
+/***/ 6669:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var callBind = __nccwpck_require__(8705);
+var gOPD = __nccwpck_require__(3170);
+
+var hasProtoAccessor;
+try {
+ // eslint-disable-next-line no-extra-parens, no-proto
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
+} catch (e) {
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
+ throw e;
+ }
+}
+
+// eslint-disable-next-line no-extra-parens
+var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
+
+var $Object = Object;
+var $getPrototypeOf = $Object.getPrototypeOf;
+
+/** @type {import('./get')} */
+module.exports = desc && typeof desc.get === 'function'
+ ? callBind([desc.get])
+ : typeof $getPrototypeOf === 'function'
+ ? /** @type {import('./get')} */ function getDunder(value) {
+ // eslint-disable-next-line eqeqeq
+ return $getPrototypeOf(value == null ? value : $Object(value));
+ }
+ : false;
+
+
+/***/ }),
+
+/***/ 9094:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+var $defineProperty = Object.defineProperty || false;
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = false;
+ }
+}
+
+module.exports = $defineProperty;
+
+
+/***/ }),
+
+/***/ 3056:
+/***/ ((module) => {
+
+
+
+/** @type {import('./eval')} */
+module.exports = EvalError;
+
+
+/***/ }),
+
+/***/ 1620:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+module.exports = Error;
+
+
+/***/ }),
+
+/***/ 4585:
+/***/ ((module) => {
+
+
+
+/** @type {import('./range')} */
+module.exports = RangeError;
+
+
+/***/ }),
+
+/***/ 6905:
+/***/ ((module) => {
+
+
+
+/** @type {import('./ref')} */
+module.exports = ReferenceError;
+
+
+/***/ }),
+
+/***/ 105:
+/***/ ((module) => {
+
+
+
+/** @type {import('./syntax')} */
+module.exports = SyntaxError;
+
+
+/***/ }),
+
+/***/ 3314:
+/***/ ((module) => {
+
+
+
+/** @type {import('./type')} */
+module.exports = TypeError;
+
+
+/***/ }),
+
+/***/ 2578:
+/***/ ((module) => {
+
+
+
+/** @type {import('./uri')} */
+module.exports = URIError;
+
+
+/***/ }),
+
+/***/ 5399:
+/***/ ((module) => {
+
+
+
+/** @type {import('.')} */
+module.exports = Object;
+
+
+/***/ }),
+
+/***/ 8700:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var GetIntrinsic = __nccwpck_require__(470);
+
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+
+var hasToStringTag = __nccwpck_require__(5479)();
+var hasOwn = __nccwpck_require__(4076);
+var $TypeError = __nccwpck_require__(3314);
+
+var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
+
+/** @type {import('.')} */
+module.exports = function setToStringTag(object, value) {
+ var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
+ var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
+ if (
+ (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
+ || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
+ ) {
+ throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
+ }
+ if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
+ if ($defineProperty) {
+ $defineProperty(object, toStringTag, {
+ configurable: !nonConfigurable,
+ enumerable: false,
+ value: value,
+ writable: false
+ });
+ } else {
+ object[toStringTag] = value; // eslint-disable-line no-param-reassign
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ 2415:
+/***/ ((module) => {
+
+
+
+var has = Object.prototype.hasOwnProperty
+ , prefix = '~';
+
+/**
+ * Constructor to create a storage for our `EE` objects.
+ * An `Events` instance is a plain object whose properties are event names.
+ *
+ * @constructor
+ * @private
+ */
+function Events() {}
+
+//
+// We try to not inherit from `Object.prototype`. In some engines creating an
+// instance in this way is faster than calling `Object.create(null)` directly.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// character to make sure that the built-in object properties are not
+// overridden or used as an attack vector.
+//
+if (Object.create) {
+ Events.prototype = Object.create(null);
+
+ //
+ // This hack is needed because the `__proto__` property is still inherited in
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
+ //
+ if (!new Events().__proto__) prefix = false;
+}
+
+/**
+ * Representation of a single event listener.
+ *
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
+ * @constructor
+ * @private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} once Specify if the listener is a one-time listener.
+ * @returns {EventEmitter}
+ * @private
+ */
+function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== 'function') {
+ throw new TypeError('The listener must be a function');
+ }
+
+ var listener = new EE(fn, context || emitter, once)
+ , evt = prefix ? prefix + event : event;
+
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
+ else emitter._events[evt] = [emitter._events[evt], listener];
+
+ return emitter;
+}
+
+/**
+ * Clear event by name.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} evt The Event name.
+ * @private
+ */
+function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
+ else delete emitter._events[evt];
+}
+
+/**
+ * Minimal `EventEmitter` interface that is molded against the Node.js
+ * `EventEmitter` interface.
+ *
+ * @constructor
+ * @public
+ */
+function EventEmitter() {
+ this._events = new Events();
+ this._eventsCount = 0;
+}
+
+/**
+ * Return an array listing the events for which the emitter has registered
+ * listeners.
+ *
+ * @returns {Array}
+ * @public
+ */
+EventEmitter.prototype.eventNames = function eventNames() {
+ var names = []
+ , events
+ , name;
+
+ if (this._eventsCount === 0) return names;
+
+ for (name in (events = this._events)) {
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ }
+
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+
+ return names;
+};
+
+/**
+ * Return the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Array} The registered listeners.
+ * @public
+ */
+EventEmitter.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event
+ , handlers = this._events[evt];
+
+ if (!handlers) return [];
+ if (handlers.fn) return [handlers.fn];
+
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Return the number of listeners listening to a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Number} The number of listeners.
+ * @public
+ */
+EventEmitter.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event
+ , listeners = this._events[evt];
+
+ if (!listeners) return 0;
+ if (listeners.fn) return 1;
+ return listeners.length;
+};
+
+/**
+ * Calls each of the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
+ * @public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if (listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+};
+
+/**
+ * Add a one-time listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+};
+
+/**
+ * Remove the listeners of a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn Only remove the listeners that match this function.
+ * @param {*} context Only remove the listeners that have this context.
+ * @param {Boolean} once Only remove one-time listeners.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+
+ var listeners = this._events[evt];
+
+ if (listeners.fn) {
+ if (
+ listeners.fn === fn &&
+ (!once || listeners.once) &&
+ (!context || listeners.context === context)
+ ) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn ||
+ (once && !listeners[i].once) ||
+ (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
+ else clearEvent(this, evt);
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners, or those of the specified event.
+ *
+ * @param {(String|Symbol)} [event] The event name.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt]) clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Allow `EventEmitter` to be imported as module namespace.
+//
+EventEmitter.EventEmitter = EventEmitter;
+
+//
+// Expose the module.
+//
+if (true) {
+ module.exports = EventEmitter;
+}
+
+
+/***/ }),
+
+/***/ 4778:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var debug;
+
+module.exports = function () {
+ if (!debug) {
+ try {
+ /* eslint global-require: off */
+ debug = __nccwpck_require__(2830)("follow-redirects");
+ }
+ catch (error) { /* */ }
+ if (typeof debug !== "function") {
+ debug = function () { /* */ };
+ }
+ }
+ debug.apply(null, arguments);
+};
+
+
+/***/ }),
+
+/***/ 1573:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+var url = __nccwpck_require__(7016);
+var URL = url.URL;
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var Writable = (__nccwpck_require__(2203).Writable);
+var assert = __nccwpck_require__(2613);
+var debug = __nccwpck_require__(4778);
+
+// Preventive platform detection
+// istanbul ignore next
+(function detectUnsupportedEnvironment() {
+ var looksLikeNode = typeof process !== "undefined";
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
+ console.warn("The follow-redirects package should be excluded from browser builds.");
+ }
+}());
+
+// Whether to use the native URL object or the legacy url module
+var useNativeURL = false;
+try {
+ assert(new URL(""));
+}
+catch (error) {
+ useNativeURL = error.code === "ERR_INVALID_URL";
+}
+
+// HTTP headers to drop across HTTP/HTTPS and domain boundaries
+var sensitiveHeaders = [
+ "Authorization",
+ "Proxy-Authorization",
+ "Cookie",
+];
+
+// URL fields to preserve in copy operations
+var preservedUrlFields = [
+ "auth",
+ "host",
+ "hostname",
+ "href",
+ "path",
+ "pathname",
+ "port",
+ "protocol",
+ "query",
+ "search",
+ "hash",
+];
+
+// Create handlers that pass events from native requests
+var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
+var eventHandlers = Object.create(null);
+events.forEach(function (event) {
+ eventHandlers[event] = function (arg1, arg2, arg3) {
+ this._redirectable.emit(event, arg1, arg2, arg3);
+ };
+});
+
+// Error types with codes
+var InvalidUrlError = createErrorType(
+ "ERR_INVALID_URL",
+ "Invalid URL",
+ TypeError
+);
+var RedirectionError = createErrorType(
+ "ERR_FR_REDIRECTION_FAILURE",
+ "Redirected request failed"
+);
+var TooManyRedirectsError = createErrorType(
+ "ERR_FR_TOO_MANY_REDIRECTS",
+ "Maximum number of redirects exceeded",
+ RedirectionError
+);
+var MaxBodyLengthExceededError = createErrorType(
+ "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
+ "Request body larger than maxBodyLength limit"
+);
+var WriteAfterEndError = createErrorType(
+ "ERR_STREAM_WRITE_AFTER_END",
+ "write after end"
+);
+
+// istanbul ignore next
+var destroy = Writable.prototype.destroy || noop;
+
+// An HTTP(S) request that can be redirected
+function RedirectableRequest(options, responseCallback) {
+ // Initialize the request
+ Writable.call(this);
+ this._sanitizeOptions(options);
+ this._options = options;
+ this._ended = false;
+ this._ending = false;
+ this._redirectCount = 0;
+ this._redirects = [];
+ this._requestBodyLength = 0;
+ this._requestBodyBuffers = [];
+
+ // Attach a callback if passed
+ if (responseCallback) {
+ this.on("response", responseCallback);
+ }
+
+ // React to responses of native requests
+ var self = this;
+ this._onNativeResponse = function (response) {
+ try {
+ self._processResponse(response);
+ }
+ catch (cause) {
+ self.emit("error", cause instanceof RedirectionError ?
+ cause : new RedirectionError({ cause: cause }));
+ }
+ };
+
+ // Create filter for sensitive HTTP headers
+ this._headerFilter = new RegExp("^(?:" +
+ sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") +
+ ")$", "i");
+
+ // Perform the first request
+ this._performRequest();
+}
+RedirectableRequest.prototype = Object.create(Writable.prototype);
+
+RedirectableRequest.prototype.abort = function () {
+ destroyRequest(this._currentRequest);
+ this._currentRequest.abort();
+ this.emit("abort");
+};
+
+RedirectableRequest.prototype.destroy = function (error) {
+ destroyRequest(this._currentRequest, error);
+ destroy.call(this, error);
+ return this;
+};
+
+// Writes buffered data to the current native request
+RedirectableRequest.prototype.write = function (data, encoding, callback) {
+ // Writing is not allowed if end has been called
+ if (this._ending) {
+ throw new WriteAfterEndError();
+ }
+
+ // Validate input and shift parameters if necessary
+ if (!isString(data) && !isBuffer(data)) {
+ throw new TypeError("data should be a string, Buffer or Uint8Array");
+ }
+ if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Ignore empty buffers, since writing them doesn't invoke the callback
+ // https://github.com/nodejs/node/issues/22066
+ if (data.length === 0) {
+ if (callback) {
+ callback();
+ }
+ return;
+ }
+ // Only write when we don't exceed the maximum body length
+ if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
+ this._requestBodyLength += data.length;
+ this._requestBodyBuffers.push({ data: data, encoding: encoding });
+ this._currentRequest.write(data, encoding, callback);
+ }
+ // Error when we exceed the maximum body length
+ else {
+ this.emit("error", new MaxBodyLengthExceededError());
+ this.abort();
+ }
+};
+
+// Ends the current native request
+RedirectableRequest.prototype.end = function (data, encoding, callback) {
+ // Shift parameters if necessary
+ if (isFunction(data)) {
+ callback = data;
+ data = encoding = null;
+ }
+ else if (isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ // Write data if needed and end
+ if (!data) {
+ this._ended = this._ending = true;
+ this._currentRequest.end(null, null, callback);
+ }
+ else {
+ var self = this;
+ var currentRequest = this._currentRequest;
+ this.write(data, encoding, function () {
+ self._ended = true;
+ currentRequest.end(null, null, callback);
+ });
+ this._ending = true;
+ }
+};
+
+// Sets a header value on the current native request
+RedirectableRequest.prototype.setHeader = function (name, value) {
+ this._options.headers[name] = value;
+ this._currentRequest.setHeader(name, value);
+};
+
+// Clears a header value on the current native request
+RedirectableRequest.prototype.removeHeader = function (name) {
+ delete this._options.headers[name];
+ this._currentRequest.removeHeader(name);
+};
+
+// Global timeout for all underlying requests
+RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
+ var self = this;
+
+ // Destroys the socket on timeout
+ function destroyOnTimeout(socket) {
+ socket.setTimeout(msecs);
+ socket.removeListener("timeout", socket.destroy);
+ socket.addListener("timeout", socket.destroy);
+ }
+
+ // Sets up a timer to trigger a timeout event
+ function startTimer(socket) {
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ }
+ self._timeout = setTimeout(function () {
+ self.emit("timeout");
+ clearTimer();
+ }, msecs);
+ destroyOnTimeout(socket);
+ }
+
+ // Stops a timeout from triggering
+ function clearTimer() {
+ // Clear the timeout
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ self._timeout = null;
+ }
+
+ // Clean up all attached listeners
+ self.removeListener("abort", clearTimer);
+ self.removeListener("error", clearTimer);
+ self.removeListener("response", clearTimer);
+ self.removeListener("close", clearTimer);
+ if (callback) {
+ self.removeListener("timeout", callback);
+ }
+ if (!self.socket) {
+ self._currentRequest.removeListener("socket", startTimer);
+ }
+ }
+
+ // Attach callback if passed
+ if (callback) {
+ this.on("timeout", callback);
+ }
+
+ // Start the timer if or when the socket is opened
+ if (this.socket) {
+ startTimer(this.socket);
+ }
+ else {
+ this._currentRequest.once("socket", startTimer);
+ }
+
+ // Clean up on events
+ this.on("socket", destroyOnTimeout);
+ this.on("abort", clearTimer);
+ this.on("error", clearTimer);
+ this.on("response", clearTimer);
+ this.on("close", clearTimer);
+
+ return this;
+};
+
+// Proxy all other public ClientRequest methods
+[
+ "flushHeaders", "getHeader",
+ "setNoDelay", "setSocketKeepAlive",
+].forEach(function (method) {
+ RedirectableRequest.prototype[method] = function (a, b) {
+ return this._currentRequest[method](a, b);
+ };
+});
+
+// Proxy all public ClientRequest properties
+["aborted", "connection", "socket"].forEach(function (property) {
+ Object.defineProperty(RedirectableRequest.prototype, property, {
+ get: function () { return this._currentRequest[property]; },
+ });
+});
+
+RedirectableRequest.prototype._sanitizeOptions = function (options) {
+ // Ensure headers are always present
+ if (!options.headers) {
+ options.headers = {};
+ }
+ if (!isArray(options.sensitiveHeaders)) {
+ options.sensitiveHeaders = [];
+ }
+
+ // Since http.request treats host as an alias of hostname,
+ // but the url module interprets host as hostname plus port,
+ // eliminate the host property to avoid confusion.
+ if (options.host) {
+ // Use hostname if set, because it has precedence
+ if (!options.hostname) {
+ options.hostname = options.host;
+ }
+ delete options.host;
+ }
+
+ // Complete the URL object when necessary
+ if (!options.pathname && options.path) {
+ var searchPos = options.path.indexOf("?");
+ if (searchPos < 0) {
+ options.pathname = options.path;
+ }
+ else {
+ options.pathname = options.path.substring(0, searchPos);
+ options.search = options.path.substring(searchPos);
+ }
+ }
+};
+
+
+// Executes the next native request (initial or redirect)
+RedirectableRequest.prototype._performRequest = function () {
+ // Load the native protocol
+ var protocol = this._options.protocol;
+ var nativeProtocol = this._options.nativeProtocols[protocol];
+ if (!nativeProtocol) {
+ throw new TypeError("Unsupported protocol " + protocol);
+ }
+
+ // If specified, use the agent corresponding to the protocol
+ // (HTTP and HTTPS use different types of agents)
+ if (this._options.agents) {
+ var scheme = protocol.slice(0, -1);
+ this._options.agent = this._options.agents[scheme];
+ }
+
+ // Create the native request and set up its event handlers
+ var request = this._currentRequest =
+ nativeProtocol.request(this._options, this._onNativeResponse);
+ request._redirectable = this;
+ for (var event of events) {
+ request.on(event, eventHandlers[event]);
+ }
+
+ // RFC7230§5.3.1: When making a request directly to an origin server, […]
+ // a client MUST send only the absolute path […] as the request-target.
+ this._currentUrl = /^\//.test(this._options.path) ?
+ url.format(this._options) :
+ // When making a request to a proxy, […]
+ // a client MUST send the target URI in absolute-form […].
+ this._options.path;
+
+ // End a redirected request
+ // (The first request must be ended explicitly with RedirectableRequest#end)
+ if (this._isRedirect) {
+ // Write the request entity and end
+ var i = 0;
+ var self = this;
+ var buffers = this._requestBodyBuffers;
+ (function writeNext(error) {
+ // Only write if this request has not been redirected yet
+ // istanbul ignore else
+ if (request === self._currentRequest) {
+ // Report any write errors
+ // istanbul ignore if
+ if (error) {
+ self.emit("error", error);
+ }
+ // Write the next buffer if there are still left
+ else if (i < buffers.length) {
+ var buffer = buffers[i++];
+ // istanbul ignore else
+ if (!request.finished) {
+ request.write(buffer.data, buffer.encoding, writeNext);
+ }
+ }
+ // End the request if `end` has been called on us
+ else if (self._ended) {
+ request.end();
+ }
+ }
+ }());
+ }
+};
+
+// Processes a response from the current native request
+RedirectableRequest.prototype._processResponse = function (response) {
+ // Store the redirected response
+ var statusCode = response.statusCode;
+ if (this._options.trackRedirects) {
+ this._redirects.push({
+ url: this._currentUrl,
+ headers: response.headers,
+ statusCode: statusCode,
+ });
+ }
+
+ // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
+ // that further action needs to be taken by the user agent in order to
+ // fulfill the request. If a Location header field is provided,
+ // the user agent MAY automatically redirect its request to the URI
+ // referenced by the Location field value,
+ // even if the specific status code is not understood.
+
+ // If the response is not a redirect; return it as-is
+ var location = response.headers.location;
+ if (!location || this._options.followRedirects === false ||
+ statusCode < 300 || statusCode >= 400) {
+ response.responseUrl = this._currentUrl;
+ response.redirects = this._redirects;
+ this.emit("response", response);
+
+ // Clean up
+ this._requestBodyBuffers = [];
+ return;
+ }
+
+ // The response is a redirect, so abort the current request
+ destroyRequest(this._currentRequest);
+ // Discard the remainder of the response to avoid waiting for data
+ response.destroy();
+
+ // RFC7231§6.4: A client SHOULD detect and intervene
+ // in cyclical redirections (i.e., "infinite" redirection loops).
+ if (++this._redirectCount > this._options.maxRedirects) {
+ throw new TooManyRedirectsError();
+ }
+
+ // Store the request headers if applicable
+ var requestHeaders;
+ var beforeRedirect = this._options.beforeRedirect;
+ if (beforeRedirect) {
+ requestHeaders = Object.assign({
+ // The Host header was set by nativeProtocol.request
+ Host: response.req.getHeader("host"),
+ }, this._options.headers);
+ }
+
+ // RFC7231§6.4: Automatic redirection needs to done with
+ // care for methods not known to be safe, […]
+ // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
+ // the request method from POST to GET for the subsequent request.
+ var method = this._options.method;
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
+ // RFC7231§6.4.4: The 303 (See Other) status code indicates that
+ // the server is redirecting the user agent to a different resource […]
+ // A user agent can perform a retrieval request targeting that URI
+ // (a GET or HEAD request if using HTTP) […]
+ (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
+ this._options.method = "GET";
+ // Drop a possible entity and headers related to it
+ this._requestBodyBuffers = [];
+ removeMatchingHeaders(/^content-/i, this._options.headers);
+ }
+
+ // Drop the Host header, as the redirect might lead to a different host
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+
+ // If the redirect is relative, carry over the host of the last request
+ var currentUrlParts = parseUrl(this._currentUrl);
+ var currentHost = currentHostHeader || currentUrlParts.host;
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
+ url.format(Object.assign(currentUrlParts, { host: currentHost }));
+
+ // Create the redirected request
+ var redirectUrl = resolveUrl(location, currentUrl);
+ debug("redirecting to", redirectUrl.href);
+ this._isRedirect = true;
+ spreadUrlObject(redirectUrl, this._options);
+
+ // Drop confidential headers when redirecting to a less secure protocol
+ // or to a different domain that is not a superdomain
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
+ redirectUrl.protocol !== "https:" ||
+ redirectUrl.host !== currentHost &&
+ !isSubdomain(redirectUrl.host, currentHost)) {
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
+ }
+
+ // Evaluate the beforeRedirect callback
+ if (isFunction(beforeRedirect)) {
+ var responseDetails = {
+ headers: response.headers,
+ statusCode: statusCode,
+ };
+ var requestDetails = {
+ url: currentUrl,
+ method: method,
+ headers: requestHeaders,
+ };
+ beforeRedirect(this._options, responseDetails, requestDetails);
+ this._sanitizeOptions(this._options);
+ }
+
+ // Perform the redirected request
+ this._performRequest();
+};
+
+// Wraps the key/value object of protocols with redirect functionality
+function wrap(protocols) {
+ // Default settings
+ var exports = {
+ maxRedirects: 21,
+ maxBodyLength: 10 * 1024 * 1024,
+ };
+
+ // Wrap each protocol
+ var nativeProtocols = {};
+ Object.keys(protocols).forEach(function (scheme) {
+ var protocol = scheme + ":";
+ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
+ var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+
+ // Executes a request, following redirects
+ function request(input, options, callback) {
+ // Parse parameters, ensuring that input is an object
+ if (isURL(input)) {
+ input = spreadUrlObject(input);
+ }
+ else if (isString(input)) {
+ input = spreadUrlObject(parseUrl(input));
+ }
+ else {
+ callback = options;
+ options = validateUrl(input);
+ input = { protocol: protocol };
+ }
+ if (isFunction(options)) {
+ callback = options;
+ options = null;
+ }
+
+ // Set defaults
+ options = Object.assign({
+ maxRedirects: exports.maxRedirects,
+ maxBodyLength: exports.maxBodyLength,
+ }, input, options);
+ options.nativeProtocols = nativeProtocols;
+ if (!isString(options.host) && !isString(options.hostname)) {
+ options.hostname = "::1";
+ }
+
+ assert.equal(options.protocol, protocol, "protocol mismatch");
+ debug("options", options);
+ return new RedirectableRequest(options, callback);
+ }
+
+ // Executes a GET request, following redirects
+ function get(input, options, callback) {
+ var wrappedRequest = wrappedProtocol.request(input, options, callback);
+ wrappedRequest.end();
+ return wrappedRequest;
+ }
+
+ // Expose the properties on the wrapped protocol
+ Object.defineProperties(wrappedProtocol, {
+ request: { value: request, configurable: true, enumerable: true, writable: true },
+ get: { value: get, configurable: true, enumerable: true, writable: true },
+ });
+ });
+ return exports;
+}
+
+function noop() { /* empty */ }
+
+function parseUrl(input) {
+ var parsed;
+ // istanbul ignore else
+ if (useNativeURL) {
+ parsed = new URL(input);
+ }
+ else {
+ // Ensure the URL is valid and absolute
+ parsed = validateUrl(url.parse(input));
+ if (!isString(parsed.protocol)) {
+ throw new InvalidUrlError({ input });
+ }
+ }
+ return parsed;
+}
+
+function resolveUrl(relative, base) {
+ // istanbul ignore next
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
+}
+
+function validateUrl(input) {
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
+ throw new InvalidUrlError({ input: input.href || input });
+ }
+ return input;
+}
+
+function spreadUrlObject(urlObject, target) {
+ var spread = target || {};
+ for (var key of preservedUrlFields) {
+ spread[key] = urlObject[key];
+ }
+
+ // Fix IPv6 hostname
+ if (spread.hostname.startsWith("[")) {
+ spread.hostname = spread.hostname.slice(1, -1);
+ }
+ // Ensure port is a number
+ if (spread.port !== "") {
+ spread.port = Number(spread.port);
+ }
+ // Concatenate path
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
+
+ return spread;
+}
+
+function removeMatchingHeaders(regex, headers) {
+ var lastValue;
+ for (var header in headers) {
+ if (regex.test(header)) {
+ lastValue = headers[header];
+ delete headers[header];
+ }
+ }
+ return (lastValue === null || typeof lastValue === "undefined") ?
+ undefined : String(lastValue).trim();
+}
+
+function createErrorType(code, message, baseClass) {
+ // Create constructor
+ function CustomError(properties) {
+ // istanbul ignore else
+ if (isFunction(Error.captureStackTrace)) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+ Object.assign(this, properties || {});
+ this.code = code;
+ this.message = this.cause ? message + ": " + this.cause.message : message;
+ }
+
+ // Attach constructor and set default properties
+ CustomError.prototype = new (baseClass || Error)();
+ Object.defineProperties(CustomError.prototype, {
+ constructor: {
+ value: CustomError,
+ enumerable: false,
+ },
+ name: {
+ value: "Error [" + code + "]",
+ enumerable: false,
+ },
+ });
+ return CustomError;
+}
+
+function destroyRequest(request, error) {
+ for (var event of events) {
+ request.removeListener(event, eventHandlers[event]);
+ }
+ request.on("error", noop);
+ request.destroy(error);
+}
+
+function isSubdomain(subdomain, domain) {
+ assert(isString(subdomain) && isString(domain));
+ var dot = subdomain.length - domain.length - 1;
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
+}
+
+function isArray(value) {
+ return value instanceof Array;
+}
+
+function isString(value) {
+ return typeof value === "string" || value instanceof String;
+}
+
+function isFunction(value) {
+ return typeof value === "function";
+}
+
+function isBuffer(value) {
+ return typeof value === "object" && ("length" in value);
+}
+
+function isURL(value) {
+ return URL && value instanceof URL;
+}
+
+function escapeRegex(regex) {
+ return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
+}
+
+// Exports
+module.exports = wrap({ http: http, https: https });
+module.exports.wrap = wrap;
+
+
+/***/ }),
+
+/***/ 6454:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var CombinedStream = __nccwpck_require__(5630);
+var util = __nccwpck_require__(9023);
+var path = __nccwpck_require__(6928);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var parseUrl = (__nccwpck_require__(7016).parse);
+var fs = __nccwpck_require__(9896);
+var Stream = (__nccwpck_require__(2203).Stream);
+var crypto = __nccwpck_require__(6982);
+var mime = __nccwpck_require__(4096);
+var asynckit = __nccwpck_require__(1324);
+var setToStringTag = __nccwpck_require__(8700);
+var hasOwn = __nccwpck_require__(4076);
+var populate = __nccwpck_require__(1835);
+
+/**
+ * Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field
+ * name or filename can not break out of its header line to inject headers or
+ * smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding.
+ *
+ * @param {string} str - the parameter value to escape
+ * @returns {string} the escaped value
+ */
+function escapeHeaderParam(str) {
+ return String(str).replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/"/g, '%22');
+}
+
+/**
+ * Create readable "multipart/form-data" streams.
+ * Can be used to submit forms
+ * and file uploads to other web applications.
+ *
+ * @constructor
+ * @param {object} options - Properties to be added/overriden for FormData and CombinedStream
+ */
+function FormData(options) {
+ if (!(this instanceof FormData)) {
+ return new FormData(options);
+ }
+
+ this._overheadLength = 0;
+ this._valueLength = 0;
+ this._valuesToMeasure = [];
+
+ CombinedStream.call(this);
+
+ options = options || {}; // eslint-disable-line no-param-reassign
+ for (var option in options) { // eslint-disable-line no-restricted-syntax
+ this[option] = options[option];
+ }
+}
+
+// make it a Stream
+util.inherits(FormData, CombinedStream);
+
+FormData.LINE_BREAK = '\r\n';
+FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+
+FormData.prototype.append = function (field, value, options) {
+ options = options || {}; // eslint-disable-line no-param-reassign
+
+ // allow filename as single option
+ if (typeof options === 'string') {
+ options = { filename: options }; // eslint-disable-line no-param-reassign
+ }
+
+ var append = CombinedStream.prototype.append.bind(this);
+
+ // all that streamy business can't handle numbers
+ if (typeof value === 'number' || value == null) {
+ value = String(value); // eslint-disable-line no-param-reassign
+ }
+
+ // https://github.com/felixge/node-form-data/issues/38
+ if (Array.isArray(value)) {
+ /*
+ * Please convert your array into string
+ * the way web server expects it
+ */
+ this._error(new Error('Arrays are not supported.'));
+ return;
+ }
+
+ var header = this._multiPartHeader(field, value, options);
+ var footer = this._multiPartFooter();
+
+ append(header);
+ append(value);
+ append(footer);
+
+ // pass along options.knownLength
+ this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function (header, value, options) {
+ var valueLength = 0;
+
+ /*
+ * used w/ getLengthSync(), when length is known.
+ * e.g. for streaming directly from a remote server,
+ * w/ a known file a size, and not wanting to wait for
+ * incoming file to finish to get its size.
+ */
+ if (options.knownLength != null) {
+ valueLength += Number(options.knownLength);
+ } else if (Buffer.isBuffer(value)) {
+ valueLength = value.length;
+ } else if (typeof value === 'string') {
+ valueLength = Buffer.byteLength(value);
+ }
+
+ this._valueLength += valueLength;
+
+ // @check why add CRLF? does this account for custom/multiple CRLFs?
+ this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
+
+ // empty or either doesn't have path or not an http response or not a stream
+ if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
+ return;
+ }
+
+ // no need to bother with the length
+ if (!options.knownLength) {
+ this._valuesToMeasure.push(value);
+ }
+};
+
+FormData.prototype._lengthRetriever = function (value, callback) {
+ if (hasOwn(value, 'fd')) {
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function (err, stat) {
+ if (err) {
+ callback(err);
+ return;
+ }
+
+ // update final size based on the range options
+ var fileSize = stat.size - (value.start ? value.start : 0);
+ callback(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (hasOwn(value, 'httpVersion')) {
+ callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
+
+ // or request stream http://github.com/mikeal/request
+ } else if (hasOwn(value, 'httpModule')) {
+ // wait till response come back
+ value.on('response', function (response) {
+ value.pause();
+ callback(null, Number(response.headers['content-length']));
+ });
+ value.resume();
+
+ // something else
+ } else {
+ callback('Unknown stream'); // eslint-disable-line callback-return
+ }
+};
+
+FormData.prototype._multiPartHeader = function (field, value, options) {
+ /*
+ * custom header specified (as string)?
+ * it becomes responsible for boundary
+ * (e.g. to handle extra CRLFs on .NET servers)
+ */
+ if (typeof options.header === 'string') {
+ return options.header;
+ }
+
+ var contentDisposition = this._getContentDisposition(value, options);
+ var contentType = this._getContentType(value, options);
+
+ var contents = '';
+ var headers = {
+ // add custom disposition as third element or keep it two elements if not
+ 'Content-Disposition': ['form-data', 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
+ // if no content type. allow it to be empty array
+ 'Content-Type': [].concat(contentType || [])
+ };
+
+ // allow custom headers.
+ if (typeof options.header === 'object') {
+ populate(headers, options.header);
+ }
+
+ var header;
+ for (var prop in headers) { // eslint-disable-line no-restricted-syntax
+ if (hasOwn(headers, prop)) {
+ header = headers[prop];
+
+ // skip nullish headers.
+ if (header == null) {
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ }
+
+ // convert all headers to arrays.
+ if (!Array.isArray(header)) {
+ header = [header];
+ }
+
+ // add non-empty headers.
+ if (header.length) {
+ contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
+ }
+ }
+ }
+
+ return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
+};
+
+FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
+ var filename;
+
+ if (typeof options.filepath === 'string') {
+ // custom filepath for relative paths
+ filename = path.normalize(options.filepath).replace(/\\/g, '/');
+ } else if (options.filename || (value && (value.name || value.path))) {
+ /*
+ * custom filename take precedence
+ * formidable and the browser add a name property
+ * fs- and request- streams have path property
+ */
+ filename = path.basename(options.filename || (value && (value.name || value.path)));
+ } else if (value && value.readable && hasOwn(value, 'httpVersion')) {
+ // or try http response
+ filename = path.basename(value.client._httpMessage.path || '');
+ }
+
+ if (filename) {
+ return 'filename="' + escapeHeaderParam(filename) + '"';
+ }
+};
+
+FormData.prototype._getContentType = function (value, options) {
+ // use custom content-type above all
+ var contentType = options.contentType;
+
+ // or try `name` from formidable, browser
+ if (!contentType && value && value.name) {
+ contentType = mime.lookup(value.name);
+ }
+
+ // or try `path` from fs-, request- streams
+ if (!contentType && value && value.path) {
+ contentType = mime.lookup(value.path);
+ }
+
+ // or if it's http-reponse
+ if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
+ contentType = value.headers['content-type'];
+ }
+
+ // or guess it from the filepath or filename
+ if (!contentType && (options.filepath || options.filename)) {
+ contentType = mime.lookup(options.filepath || options.filename);
+ }
+
+ // fallback to the default content type if `value` is not simple value
+ if (!contentType && value && typeof value === 'object') {
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
+ }
+
+ return contentType;
+};
+
+FormData.prototype._multiPartFooter = function () {
+ return function (next) {
+ var footer = FormData.LINE_BREAK;
+
+ var lastPart = this._streams.length === 0;
+ if (lastPart) {
+ footer += this._lastBoundary();
+ }
+
+ next(footer);
+ }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function () {
+ return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
+};
+
+FormData.prototype.getHeaders = function (userHeaders) {
+ var header;
+ var formHeaders = {
+ 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+ };
+
+ for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
+ if (hasOwn(userHeaders, header)) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
+ }
+
+ return formHeaders;
+};
+
+FormData.prototype.setBoundary = function (boundary) {
+ if (typeof boundary !== 'string') {
+ throw new TypeError('FormData boundary must be a string');
+ }
+ this._boundary = boundary;
+};
+
+FormData.prototype.getBoundary = function () {
+ if (!this._boundary) {
+ this._generateBoundary();
+ }
+
+ return this._boundary;
+};
+
+FormData.prototype.getBuffer = function () {
+ var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
+ var boundary = this.getBoundary();
+
+ // Create the form content. Add Line breaks to the end of data.
+ for (var i = 0, len = this._streams.length; i < len; i++) {
+ if (typeof this._streams[i] !== 'function') {
+ // Add content to the buffer.
+ if (Buffer.isBuffer(this._streams[i])) {
+ dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
+ } else {
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
+ }
+
+ // Add break after content.
+ if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
+ }
+ }
+ }
+
+ // Add the footer and return the Buffer object.
+ return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
+};
+
+FormData.prototype._generateBoundary = function () {
+ // This generates a 50 character boundary similar to those used by Firefox.
+
+ // They are optimized for boyer-moore parsing.
+ this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually and add it as knownLength option
+FormData.prototype.getLengthSync = function () {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ // https://github.com/form-data/form-data/issues/40
+ if (!this.hasKnownLength()) {
+ /*
+ * Some async length retrievers are present
+ * therefore synchronous length calculation is false.
+ * Please use getLength(callback) to get proper length
+ */
+ this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ }
+
+ return knownLength;
+};
+
+// Public API to check if length of added values is known
+// https://github.com/form-data/form-data/issues/196
+// https://github.com/form-data/form-data/issues/262
+FormData.prototype.hasKnownLength = function () {
+ var hasKnownLength = true;
+
+ if (this._valuesToMeasure.length) {
+ hasKnownLength = false;
+ }
+
+ return hasKnownLength;
+};
+
+FormData.prototype.getLength = function (cb) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ if (!this._valuesToMeasure.length) {
+ process.nextTick(cb.bind(this, null, knownLength));
+ return;
+ }
+
+ asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
+ if (err) {
+ cb(err);
+ return;
+ }
+
+ values.forEach(function (length) {
+ knownLength += length;
+ });
+
+ cb(null, knownLength);
+ });
+};
+
+FormData.prototype.submit = function (params, cb) {
+ var request;
+ var options;
+ var defaults = { method: 'post' };
+
+ // parse provided url if it's string or treat it as options object
+ if (typeof params === 'string') {
+ params = parseUrl(params); // eslint-disable-line no-param-reassign
+ /* eslint sort-keys: 0 */
+ options = populate({
+ port: params.port,
+ path: params.pathname,
+ host: params.hostname,
+ protocol: params.protocol
+ }, defaults);
+ } else { // use custom params
+ options = populate(params, defaults);
+ // if no port provided use default one
+ if (!options.port) {
+ options.port = options.protocol === 'https:' ? 443 : 80;
+ }
+ }
+
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
+ // https if specified, fallback to http in any other case
+ if (options.protocol === 'https:') {
+ request = https.request(options);
+ } else {
+ request = http.request(options);
+ }
+
+ // get content length and fire away
+ this.getLength(function (err, length) {
+ if (err && err !== 'Unknown stream') {
+ this._error(err);
+ return;
+ }
+
+ // add content length
+ if (length) {
+ request.setHeader('Content-Length', length);
+ }
+
+ this.pipe(request);
+ if (cb) {
+ var onResponse;
+
+ var callback = function (error, responce) {
+ request.removeListener('error', callback);
+ request.removeListener('response', onResponse);
+
+ return cb.call(this, error, responce);
+ };
+
+ onResponse = callback.bind(this, null);
+
+ request.on('error', callback);
+ request.on('response', onResponse);
+ }
+ }.bind(this));
+
+ return request;
+};
+
+FormData.prototype._error = function (err) {
+ if (!this.error) {
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
+ }
+};
+
+FormData.prototype.toString = function () {
+ return '[object FormData]';
+};
+setToStringTag(FormData.prototype, 'FormData');
+
+// Public API
+module.exports = FormData;
+
+
+/***/ }),
+
+/***/ 1835:
+/***/ ((module) => {
+
+
+
+// populates missing values
+module.exports = function (dst, src) {
+ Object.keys(src).forEach(function (prop) {
+ dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
+ });
+
+ return dst;
+};
+
+
+/***/ }),
+
+/***/ 9808:
+/***/ ((module) => {
+
+
+
+/* eslint no-invalid-this: 1 */
+
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var toStr = Object.prototype.toString;
+var max = Math.max;
+var funcType = '[object Function]';
+
+var concatty = function concatty(a, b) {
+ var arr = [];
+
+ for (var i = 0; i < a.length; i += 1) {
+ arr[i] = a[i];
+ }
+ for (var j = 0; j < b.length; j += 1) {
+ arr[j + a.length] = b[j];
+ }
+
+ return arr;
+};
+
+var slicy = function slicy(arrLike, offset) {
+ var arr = [];
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
+ arr[j] = arrLike[i];
+ }
+ return arr;
+};
+
+var joiny = function (arr, joiner) {
+ var str = '';
+ for (var i = 0; i < arr.length; i += 1) {
+ str += arr[i];
+ if (i + 1 < arr.length) {
+ str += joiner;
+ }
+ }
+ return str;
+};
+
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slicy(arguments, 1);
+
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ concatty(args, arguments)
+ );
+ if (Object(result) === result) {
+ return result;
+ }
+ return this;
+ }
+ return target.apply(
+ that,
+ concatty(args, arguments)
+ );
+
+ };
+
+ var boundLength = max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs[i] = '$' + i;
+ }
+
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
+
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
+
+ return bound;
+};
+
+
+/***/ }),
+
+/***/ 7564:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var implementation = __nccwpck_require__(9808);
+
+module.exports = Function.prototype.bind || implementation;
+
+
+/***/ }),
+
+/***/ 470:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var undefined;
+
+var $Object = __nccwpck_require__(5399);
+
+var $Error = __nccwpck_require__(1620);
+var $EvalError = __nccwpck_require__(3056);
+var $RangeError = __nccwpck_require__(4585);
+var $ReferenceError = __nccwpck_require__(6905);
+var $SyntaxError = __nccwpck_require__(105);
+var $TypeError = __nccwpck_require__(3314);
+var $URIError = __nccwpck_require__(2578);
+
+var abs = __nccwpck_require__(5641);
+var floor = __nccwpck_require__(6171);
+var max = __nccwpck_require__(7147);
+var min = __nccwpck_require__(1017);
+var pow = __nccwpck_require__(6947);
+var round = __nccwpck_require__(2621);
+var sign = __nccwpck_require__(156);
+
+var $Function = Function;
+
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
+
+var $gOPD = __nccwpck_require__(3170);
+var $defineProperty = __nccwpck_require__(9094);
+
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
+
+var hasSymbols = __nccwpck_require__(3336)();
+
+var getProto = __nccwpck_require__(1967);
+var $ObjectGPO = __nccwpck_require__(1311);
+var $ReflectGPO = __nccwpck_require__(8681);
+
+var $apply = __nccwpck_require__(3945);
+var $call = __nccwpck_require__(8093);
+
+var needsEval = {};
+
+var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
+
+var INTRINSICS = {
+ __proto__: null,
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': $Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': $EvalError,
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': $Object,
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': $RangeError,
+ '%ReferenceError%': $ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': $URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
+
+ '%Function.prototype.call%': $call,
+ '%Function.prototype.apply%': $apply,
+ '%Object.defineProperty%': $defineProperty,
+ '%Object.getPrototypeOf%': $ObjectGPO,
+ '%Math.abs%': abs,
+ '%Math.floor%': floor,
+ '%Math.max%': max,
+ '%Math.min%': min,
+ '%Math.pow%': pow,
+ '%Math.round%': round,
+ '%Math.sign%': sign,
+ '%Reflect.getPrototypeOf%': $ReflectGPO
+};
+
+if (getProto) {
+ try {
+ null.error; // eslint-disable-line no-unused-expressions
+ } catch (e) {
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
+ var errorProto = getProto(getProto(e));
+ INTRINSICS['%Error.prototype%'] = errorProto;
+ }
+}
+
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen && getProto) {
+ value = getProto(gen.prototype);
+ }
+ }
+
+ INTRINSICS[name] = value;
+
+ return value;
+};
+
+var LEGACY_ALIASES = {
+ __proto__: null,
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
+
+var bind = __nccwpck_require__(7564);
+var hasOwn = __nccwpck_require__(4076);
+var $concat = bind.call($call, Array.prototype.concat);
+var $spliceApply = bind.call($apply, Array.prototype.splice);
+var $replace = bind.call($call, String.prototype.replace);
+var $strSlice = bind.call($call, String.prototype.slice);
+var $exec = bind.call($call, RegExp.prototype.exec);
+
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
+
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
+
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
+
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
+
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
+
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
+
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
+
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
+
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
+
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
+
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
+
+
+/***/ }),
+
+/***/ 1311:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var $Object = __nccwpck_require__(5399);
+
+/** @type {import('./Object.getPrototypeOf')} */
+module.exports = $Object.getPrototypeOf || null;
+
+
+/***/ }),
+
+/***/ 8681:
+/***/ ((module) => {
+
+
+
+/** @type {import('./Reflect.getPrototypeOf')} */
+module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
+
+
+/***/ }),
+
+/***/ 1967:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var reflectGetProto = __nccwpck_require__(8681);
+var originalGetProto = __nccwpck_require__(1311);
+
+var getDunderProto = __nccwpck_require__(6669);
+
+/** @type {import('.')} */
+module.exports = reflectGetProto
+ ? function getProto(O) {
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return reflectGetProto(O);
+ }
+ : originalGetProto
+ ? function getProto(O) {
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
+ throw new TypeError('getProto: not an object');
+ }
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return originalGetProto(O);
+ }
+ : getDunderProto
+ ? function getProto(O) {
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
+ return getDunderProto(O);
+ }
+ : null;
+
+
+/***/ }),
+
+/***/ 1174:
+/***/ ((module) => {
+
+
+
+/** @type {import('./gOPD')} */
+module.exports = Object.getOwnPropertyDescriptor;
+
+
+/***/ }),
+
+/***/ 3170:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+/** @type {import('.')} */
+var $gOPD = __nccwpck_require__(1174);
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
+}
+
+module.exports = $gOPD;
+
+
+/***/ }),
+
+/***/ 3813:
+/***/ ((module) => {
+
+
+
+module.exports = (flag, argv = process.argv) => {
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
+ const position = argv.indexOf(prefix + flag);
+ const terminatorPosition = argv.indexOf('--');
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
+};
+
+
+/***/ }),
+
+/***/ 3336:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = __nccwpck_require__(1114);
+
+/** @type {import('.')} */
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
+
+ return hasSymbolSham();
+};
+
+
+/***/ }),
+
+/***/ 1114:
+/***/ ((module) => {
+
+
+
+/** @type {import('./shams')} */
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
+
+ /** @type {{ [k in symbol]?: unknown }} */
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
+
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
+
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
+
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
+
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
+
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
+
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
+
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
+
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ // eslint-disable-next-line no-extra-parens
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
+
+ return true;
+};
+
+
+/***/ }),
+
+/***/ 5479:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var hasSymbols = __nccwpck_require__(1114);
+
+/** @type {import('.')} */
+module.exports = function hasToStringTagShams() {
+ return hasSymbols() && !!Symbol.toStringTag;
+};
+
+
+/***/ }),
+
+/***/ 4076:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var call = Function.prototype.call;
+var $hasOwn = Object.prototype.hasOwnProperty;
+var bind = __nccwpck_require__(7564);
+
+/** @type {import('.')} */
+module.exports = bind.call(call, $hasOwn);
+
+
+/***/ }),
+
+/***/ 6904:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const net_1 = __importDefault(__nccwpck_require__(9278));
+const tls_1 = __importDefault(__nccwpck_require__(4756));
+const url_1 = __importDefault(__nccwpck_require__(7016));
+const assert_1 = __importDefault(__nccwpck_require__(2613));
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const agent_base_1 = __nccwpck_require__(8207);
+const parse_proxy_response_1 = __importDefault(__nccwpck_require__(7943));
+const debug = debug_1.default('https-proxy-agent:agent');
+/**
+ * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
+ * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
+ *
+ * Outgoing HTTP requests are first tunneled through the proxy server using the
+ * `CONNECT` HTTP request method to establish a connection to the proxy server,
+ * and then the proxy server connects to the destination target and issues the
+ * HTTP request from the proxy server.
+ *
+ * `https:` requests have their socket connection upgraded to TLS once
+ * the connection to the proxy server has been established.
+ *
+ * @api public
+ */
+class HttpsProxyAgent extends agent_base_1.Agent {
+ constructor(_opts) {
+ let opts;
+ if (typeof _opts === 'string') {
+ opts = url_1.default.parse(_opts);
+ }
+ else {
+ opts = _opts;
+ }
+ if (!opts) {
+ throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
+ }
+ debug('creating new HttpsProxyAgent instance: %o', opts);
+ super(opts);
+ const proxy = Object.assign({}, opts);
+ // If `true`, then connect to the proxy server over TLS.
+ // Defaults to `false`.
+ this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
+ // Prefer `hostname` over `host`, and set the `port` if needed.
+ proxy.host = proxy.hostname || proxy.host;
+ if (typeof proxy.port === 'string') {
+ proxy.port = parseInt(proxy.port, 10);
+ }
+ if (!proxy.port && proxy.host) {
+ proxy.port = this.secureProxy ? 443 : 80;
+ }
+ // ALPN is supported by Node.js >= v5.
+ // attempt to negotiate http/1.1 for proxy servers that support http/2
+ if (this.secureProxy && !('ALPNProtocols' in proxy)) {
+ proxy.ALPNProtocols = ['http 1.1'];
+ }
+ if (proxy.host && proxy.path) {
+ // If both a `host` and `path` are specified then it's most likely
+ // the result of a `url.parse()` call... we need to remove the
+ // `path` portion so that `net.connect()` doesn't attempt to open
+ // that as a Unix socket file.
+ delete proxy.path;
+ delete proxy.pathname;
+ }
+ this.proxy = proxy;
+ }
+ /**
+ * Called when the node-core HTTP client library is creating a
+ * new HTTP request.
+ *
+ * @api protected
+ */
+ callback(req, opts) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { proxy, secureProxy } = this;
+ // Create a socket connection to the proxy server.
+ let socket;
+ if (secureProxy) {
+ debug('Creating `tls.Socket`: %o', proxy);
+ socket = tls_1.default.connect(proxy);
+ }
+ else {
+ debug('Creating `net.Socket`: %o', proxy);
+ socket = net_1.default.connect(proxy);
+ }
+ const headers = Object.assign({}, proxy.headers);
+ const hostname = `${opts.host}:${opts.port}`;
+ let payload = `CONNECT ${hostname} HTTP/1.1\r\n`;
+ // Inject the `Proxy-Authorization` header if necessary.
+ if (proxy.auth) {
+ headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;
+ }
+ // The `Host` header should only include the port
+ // number when it is not the default port.
+ let { host, port, secureEndpoint } = opts;
+ if (!isDefaultPort(port, secureEndpoint)) {
+ host += `:${port}`;
+ }
+ headers.Host = host;
+ headers.Connection = 'close';
+ for (const name of Object.keys(headers)) {
+ payload += `${name}: ${headers[name]}\r\n`;
+ }
+ const proxyResponsePromise = parse_proxy_response_1.default(socket);
+ socket.write(`${payload}\r\n`);
+ const { statusCode, buffered } = yield proxyResponsePromise;
+ if (statusCode === 200) {
+ req.once('socket', resume);
+ if (opts.secureEndpoint) {
+ // The proxy is connecting to a TLS server, so upgrade
+ // this socket connection to a TLS connection.
+ debug('Upgrading socket connection to TLS');
+ const servername = opts.servername || opts.host;
+ return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
+ servername }));
+ }
+ return socket;
+ }
+ // Some other status code that's not 200... need to re-play the HTTP
+ // header "data" events onto the socket once the HTTP machinery is
+ // attached so that the node core `http` can parse and handle the
+ // error status code.
+ // Close the original socket, and a new "fake" socket is returned
+ // instead, so that the proxy doesn't get the HTTP request
+ // written to it (which may contain `Authorization` headers or other
+ // sensitive data).
+ //
+ // See: https://hackerone.com/reports/541502
+ socket.destroy();
+ const fakeSocket = new net_1.default.Socket({ writable: false });
+ fakeSocket.readable = true;
+ // Need to wait for the "socket" event to re-play the "data" events.
+ req.once('socket', (s) => {
+ debug('replaying proxy buffer for failed request');
+ assert_1.default(s.listenerCount('data') > 0);
+ // Replay the "buffered" Buffer onto the fake `socket`, since at
+ // this point the HTTP module machinery has been hooked up for
+ // the user.
+ s.push(buffered);
+ s.push(null);
+ });
+ return fakeSocket;
+ });
+ }
+}
+exports["default"] = HttpsProxyAgent;
+function resume(socket) {
+ socket.resume();
+}
+function isDefaultPort(port, secure) {
+ return Boolean((!secure && port === 80) || (secure && port === 443));
+}
+function isHTTPS(protocol) {
+ return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
+}
+function omit(obj, ...keys) {
+ const ret = {};
+ let key;
+ for (key in obj) {
+ if (!keys.includes(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+}
+//# sourceMappingURL=agent.js.map
+
+/***/ }),
+
+/***/ 3669:
+/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+const agent_1 = __importDefault(__nccwpck_require__(6904));
+function createHttpsProxyAgent(opts) {
+ return new agent_1.default(opts);
+}
+(function (createHttpsProxyAgent) {
+ createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
+ createHttpsProxyAgent.prototype = agent_1.default.prototype;
+})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
+module.exports = createHttpsProxyAgent;
+//# sourceMappingURL=index.js.map
+
+/***/ }),
+
+/***/ 7943:
+/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
+
+
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const debug_1 = __importDefault(__nccwpck_require__(2830));
+const debug = debug_1.default('https-proxy-agent:parse-proxy-response');
+function parseProxyResponse(socket) {
+ return new Promise((resolve, reject) => {
+ // we need to buffer any HTTP traffic that happens with the proxy before we get
+ // the CONNECT response, so that if the response is anything other than an "200"
+ // response code, then we can re-play the "data" events on the socket once the
+ // HTTP parser is hooked up...
+ let buffersLength = 0;
+ const buffers = [];
+ function read() {
+ const b = socket.read();
+ if (b)
+ ondata(b);
+ else
+ socket.once('readable', read);
+ }
+ function cleanup() {
+ socket.removeListener('end', onend);
+ socket.removeListener('error', onerror);
+ socket.removeListener('close', onclose);
+ socket.removeListener('readable', read);
+ }
+ function onclose(err) {
+ debug('onclose had error %o', err);
+ }
+ function onend() {
+ debug('onend');
+ }
+ function onerror(err) {
+ cleanup();
+ debug('onerror %o', err);
+ reject(err);
+ }
+ function ondata(b) {
+ buffers.push(b);
+ buffersLength += b.length;
+ const buffered = Buffer.concat(buffers, buffersLength);
+ const endOfHeaders = buffered.indexOf('\r\n\r\n');
+ if (endOfHeaders === -1) {
+ // keep buffering
+ debug('have not received end of HTTP headers yet...');
+ read();
+ return;
+ }
+ const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
+ const statusCode = +firstLine.split(' ')[1];
+ debug('got proxy server response: %o', firstLine);
+ resolve({
+ statusCode,
+ buffered
+ });
+ }
+ socket.on('error', onerror);
+ socket.on('close', onclose);
+ socket.on('end', onend);
+ read();
+ });
+}
+exports["default"] = parseProxyResponse;
+//# sourceMappingURL=parse-proxy-response.js.map
+
+/***/ }),
+
+/***/ 201:
+/***/ ((module) => {
+
+// https://github.com/electron/electron/issues/2288
+function isElectron() {
+ // Renderer process
+ if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
+ return true;
+ }
+
+ // Main process
+ if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
+ return true;
+ }
+
+ // Detect the user agent when the `nodeIntegration` option is set to false
+ if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
+ return true;
+ }
+
+ return false;
+}
+
+module.exports = isElectron;
+
+
+/***/ }),
+
+/***/ 6543:
+/***/ ((module) => {
+
+
+
+const isStream = stream =>
+ stream !== null &&
+ typeof stream === 'object' &&
+ typeof stream.pipe === 'function';
+
+isStream.writable = stream =>
+ isStream(stream) &&
+ stream.writable !== false &&
+ typeof stream._write === 'function' &&
+ typeof stream._writableState === 'object';
+
+isStream.readable = stream =>
+ isStream(stream) &&
+ stream.readable !== false &&
+ typeof stream._read === 'function' &&
+ typeof stream._readableState === 'object';
+
+isStream.duplex = stream =>
+ isStream.writable(stream) &&
+ isStream.readable(stream);
+
+isStream.transform = stream =>
+ isStream.duplex(stream) &&
+ typeof stream._transform === 'function';
+
+module.exports = isStream;
+
+
+/***/ }),
+
+/***/ 5641:
+/***/ ((module) => {
+
+
+
+/** @type {import('./abs')} */
+module.exports = Math.abs;
+
+
+/***/ }),
+
+/***/ 6171:
+/***/ ((module) => {
+
+
+
+/** @type {import('./floor')} */
+module.exports = Math.floor;
+
+
+/***/ }),
+
+/***/ 7044:
+/***/ ((module) => {
+
+
+
+/** @type {import('./isNaN')} */
+module.exports = Number.isNaN || function isNaN(a) {
+ return a !== a;
+};
+
+
+/***/ }),
+
+/***/ 7147:
+/***/ ((module) => {
+
+
+
+/** @type {import('./max')} */
+module.exports = Math.max;
+
+
+/***/ }),
+
+/***/ 1017:
+/***/ ((module) => {
+
+
+
+/** @type {import('./min')} */
+module.exports = Math.min;
+
+
+/***/ }),
+
+/***/ 6947:
+/***/ ((module) => {
+
+
+
+/** @type {import('./pow')} */
+module.exports = Math.pow;
+
+
+/***/ }),
+
+/***/ 2621:
+/***/ ((module) => {
+
+
+
+/** @type {import('./round')} */
+module.exports = Math.round;
+
+
+/***/ }),
+
+/***/ 156:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+var $isNaN = __nccwpck_require__(7044);
+
+/** @type {import('./sign')} */
+module.exports = function sign(number) {
+ if ($isNaN(number) || number === 0) {
+ return number;
+ }
+ return number < 0 ? -1 : +1;
+};
+
+
+/***/ }),
+
+/***/ 9829:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = __nccwpck_require__(1813)
+
+
+/***/ }),
+
+/***/ 4096:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = __nccwpck_require__(9829)
+var extname = (__nccwpck_require__(6928).extname)
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
+var TEXT_TYPE_REGEXP = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
+
+ if (mime && mime.charset) {
+ return mime.charset
+ }
+
+ // default text/* to utf-8
+ if (match && TEXT_TYPE_REGEXP.test(match[1])) {
+ return 'UTF-8'
+ }
+
+ return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType (str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
+ }
+
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
+
+ if (!mime) {
+ return false
+ }
+
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
+ }
+
+ return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension (type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
+ }
+
+ return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup (path) {
+ if (!path || typeof path !== 'string') {
+ return false
+ }
+
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
+
+ if (!extension) {
+ return false
+ }
+
+ return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps (extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
+
+ Object.keys(db).forEach(function forEachMimeType (type) {
+ var mime = db[type]
+ var exts = mime.extensions
+
+ if (!exts || !exts.length) {
+ return
+ }
+
+ // mime -> extensions
+ extensions[type] = exts
+
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
+
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
+
+ if (types[extension] !== 'application/octet-stream' &&
+ (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
+ // skip the remapping
+ continue
+ }
+ }
+
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
+
+
+/***/ }),
+
+/***/ 744:
+/***/ ((module) => {
+
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function (val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isFinite(val)) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'weeks':
+ case 'week':
+ case 'w':
+ return n * w;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (msAbs >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (msAbs >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (msAbs >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return plural(ms, msAbs, d, 'day');
+ }
+ if (msAbs >= h) {
+ return plural(ms, msAbs, h, 'hour');
+ }
+ if (msAbs >= m) {
+ return plural(ms, msAbs, m, 'minute');
+ }
+ if (msAbs >= s) {
+ return plural(ms, msAbs, s, 'second');
+ }
+ return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+ var isPlural = msAbs >= n * 1.5;
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
+
+
+/***/ }),
+
+/***/ 2766:
+/***/ ((module) => {
+
+
+module.exports = (promise, onFinally) => {
+ onFinally = onFinally || (() => {});
+
+ return promise.then(
+ val => new Promise(resolve => {
+ resolve(onFinally());
+ }).then(() => val),
+ err => new Promise(resolve => {
+ resolve(onFinally());
+ }).then(() => {
+ throw err;
+ })
+ );
+};
+
+
+/***/ }),
+
+/***/ 6459:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const EventEmitter = __nccwpck_require__(301);
+const p_timeout_1 = __nccwpck_require__(4802);
+const priority_queue_1 = __nccwpck_require__(5905);
+// eslint-disable-next-line @typescript-eslint/no-empty-function
+const empty = () => { };
+const timeoutError = new p_timeout_1.TimeoutError();
+/**
+Promise queue with concurrency control.
+*/
+class PQueue extends EventEmitter {
+ constructor(options) {
+ var _a, _b, _c, _d;
+ super();
+ this._intervalCount = 0;
+ this._intervalEnd = 0;
+ this._pendingCount = 0;
+ this._resolveEmpty = empty;
+ this._resolveIdle = empty;
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+ options = Object.assign({ carryoverConcurrencyCount: false, intervalCap: Infinity, interval: 0, concurrency: Infinity, autoStart: true, queueClass: priority_queue_1.default }, options);
+ if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`);
+ }
+ if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`);
+ }
+ this._carryoverConcurrencyCount = options.carryoverConcurrencyCount;
+ this._isIntervalIgnored = options.intervalCap === Infinity || options.interval === 0;
+ this._intervalCap = options.intervalCap;
+ this._interval = options.interval;
+ this._queue = new options.queueClass();
+ this._queueClass = options.queueClass;
+ this.concurrency = options.concurrency;
+ this._timeout = options.timeout;
+ this._throwOnTimeout = options.throwOnTimeout === true;
+ this._isPaused = options.autoStart === false;
+ }
+ get _doesIntervalAllowAnother() {
+ return this._isIntervalIgnored || this._intervalCount < this._intervalCap;
+ }
+ get _doesConcurrentAllowAnother() {
+ return this._pendingCount < this._concurrency;
+ }
+ _next() {
+ this._pendingCount--;
+ this._tryToStartAnother();
+ this.emit('next');
+ }
+ _resolvePromises() {
+ this._resolveEmpty();
+ this._resolveEmpty = empty;
+ if (this._pendingCount === 0) {
+ this._resolveIdle();
+ this._resolveIdle = empty;
+ this.emit('idle');
+ }
+ }
+ _onResumeInterval() {
+ this._onInterval();
+ this._initializeIntervalIfNeeded();
+ this._timeoutId = undefined;
+ }
+ _isIntervalPaused() {
+ const now = Date.now();
+ if (this._intervalId === undefined) {
+ const delay = this._intervalEnd - now;
+ if (delay < 0) {
+ // Act as the interval was done
+ // We don't need to resume it here because it will be resumed on line 160
+ this._intervalCount = (this._carryoverConcurrencyCount) ? this._pendingCount : 0;
+ }
+ else {
+ // Act as the interval is pending
+ if (this._timeoutId === undefined) {
+ this._timeoutId = setTimeout(() => {
+ this._onResumeInterval();
+ }, delay);
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ _tryToStartAnother() {
+ if (this._queue.size === 0) {
+ // We can clear the interval ("pause")
+ // Because we can redo it later ("resume")
+ if (this._intervalId) {
+ clearInterval(this._intervalId);
+ }
+ this._intervalId = undefined;
+ this._resolvePromises();
+ return false;
+ }
+ if (!this._isPaused) {
+ const canInitializeInterval = !this._isIntervalPaused();
+ if (this._doesIntervalAllowAnother && this._doesConcurrentAllowAnother) {
+ const job = this._queue.dequeue();
+ if (!job) {
+ return false;
+ }
+ this.emit('active');
+ job();
+ if (canInitializeInterval) {
+ this._initializeIntervalIfNeeded();
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ _initializeIntervalIfNeeded() {
+ if (this._isIntervalIgnored || this._intervalId !== undefined) {
+ return;
+ }
+ this._intervalId = setInterval(() => {
+ this._onInterval();
+ }, this._interval);
+ this._intervalEnd = Date.now() + this._interval;
+ }
+ _onInterval() {
+ if (this._intervalCount === 0 && this._pendingCount === 0 && this._intervalId) {
+ clearInterval(this._intervalId);
+ this._intervalId = undefined;
+ }
+ this._intervalCount = this._carryoverConcurrencyCount ? this._pendingCount : 0;
+ this._processQueue();
+ }
+ /**
+ Executes all queued functions until it reaches the limit.
+ */
+ _processQueue() {
+ // eslint-disable-next-line no-empty
+ while (this._tryToStartAnother()) { }
+ }
+ get concurrency() {
+ return this._concurrency;
+ }
+ set concurrency(newConcurrency) {
+ if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {
+ throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
+ }
+ this._concurrency = newConcurrency;
+ this._processQueue();
+ }
+ /**
+ Adds a sync or async task to the queue. Always returns a promise.
+ */
+ async add(fn, options = {}) {
+ return new Promise((resolve, reject) => {
+ const run = async () => {
+ this._pendingCount++;
+ this._intervalCount++;
+ try {
+ const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {
+ if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {
+ reject(timeoutError);
+ }
+ return undefined;
+ });
+ resolve(await operation);
+ }
+ catch (error) {
+ reject(error);
+ }
+ this._next();
+ };
+ this._queue.enqueue(run, options);
+ this._tryToStartAnother();
+ this.emit('add');
+ });
+ }
+ /**
+ Same as `.add()`, but accepts an array of sync or async functions.
+
+ @returns A promise that resolves when all functions are resolved.
+ */
+ async addAll(functions, options) {
+ return Promise.all(functions.map(async (function_) => this.add(function_, options)));
+ }
+ /**
+ Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
+ */
+ start() {
+ if (!this._isPaused) {
+ return this;
+ }
+ this._isPaused = false;
+ this._processQueue();
+ return this;
+ }
+ /**
+ Put queue execution on hold.
+ */
+ pause() {
+ this._isPaused = true;
+ }
+ /**
+ Clear the queue.
+ */
+ clear() {
+ this._queue = new this._queueClass();
+ }
+ /**
+ Can be called multiple times. Useful if you for example add additional items at a later time.
+
+ @returns A promise that settles when the queue becomes empty.
+ */
+ async onEmpty() {
+ // Instantly resolve if the queue is empty
+ if (this._queue.size === 0) {
+ return;
+ }
+ return new Promise(resolve => {
+ const existingResolve = this._resolveEmpty;
+ this._resolveEmpty = () => {
+ existingResolve();
+ resolve();
+ };
+ });
+ }
+ /**
+ The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
+
+ @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
+ */
+ async onIdle() {
+ // Instantly resolve if none pending and if nothing else is queued
+ if (this._pendingCount === 0 && this._queue.size === 0) {
+ return;
+ }
+ return new Promise(resolve => {
+ const existingResolve = this._resolveIdle;
+ this._resolveIdle = () => {
+ existingResolve();
+ resolve();
+ };
+ });
+ }
+ /**
+ Size of the queue.
+ */
+ get size() {
+ return this._queue.size;
+ }
+ /**
+ Size of the queue, filtered by the given options.
+
+ For example, this can be used to find the number of items remaining in the queue with a specific priority level.
+ */
+ sizeBy(options) {
+ // eslint-disable-next-line unicorn/no-fn-reference-in-iterator
+ return this._queue.filter(options).length;
+ }
+ /**
+ Number of pending promises.
+ */
+ get pending() {
+ return this._pendingCount;
+ }
+ /**
+ Whether the queue is currently paused.
+ */
+ get isPaused() {
+ return this._isPaused;
+ }
+ get timeout() {
+ return this._timeout;
+ }
+ /**
+ Set the timeout for future operations.
+ */
+ set timeout(milliseconds) {
+ this._timeout = milliseconds;
+ }
+}
+exports["default"] = PQueue;
+
+
+/***/ }),
+
+/***/ 9015:
+/***/ ((__unused_webpack_module, exports) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
+// Used to compute insertion index to keep queue sorted after insertion
+function lowerBound(array, value, comparator) {
+ let first = 0;
+ let count = array.length;
+ while (count > 0) {
+ const step = (count / 2) | 0;
+ let it = first + step;
+ if (comparator(array[it], value) <= 0) {
+ first = ++it;
+ count -= step + 1;
+ }
+ else {
+ count = step;
+ }
+ }
+ return first;
+}
+exports["default"] = lowerBound;
+
+
+/***/ }),
+
+/***/ 5905:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+const lower_bound_1 = __nccwpck_require__(9015);
+class PriorityQueue {
+ constructor() {
+ this._queue = [];
+ }
+ enqueue(run, options) {
+ options = Object.assign({ priority: 0 }, options);
+ const element = {
+ priority: options.priority,
+ run
+ };
+ if (this.size && this._queue[this.size - 1].priority >= options.priority) {
+ this._queue.push(element);
+ return;
+ }
+ const index = lower_bound_1.default(this._queue, element, (a, b) => b.priority - a.priority);
+ this._queue.splice(index, 0, element);
+ }
+ dequeue() {
+ const item = this._queue.shift();
+ return item === null || item === void 0 ? void 0 : item.run;
+ }
+ filter(options) {
+ return this._queue.filter((element) => element.priority === options.priority).map((element) => element.run);
+ }
+ get size() {
+ return this._queue.length;
+ }
+}
+exports["default"] = PriorityQueue;
+
+
+/***/ }),
+
+/***/ 301:
+/***/ ((module) => {
+
+
+
+var has = Object.prototype.hasOwnProperty
+ , prefix = '~';
+
+/**
+ * Constructor to create a storage for our `EE` objects.
+ * An `Events` instance is a plain object whose properties are event names.
+ *
+ * @constructor
+ * @private
+ */
+function Events() {}
+
+//
+// We try to not inherit from `Object.prototype`. In some engines creating an
+// instance in this way is faster than calling `Object.create(null)` directly.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// character to make sure that the built-in object properties are not
+// overridden or used as an attack vector.
+//
+if (Object.create) {
+ Events.prototype = Object.create(null);
+
+ //
+ // This hack is needed because the `__proto__` property is still inherited in
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
+ //
+ if (!new Events().__proto__) prefix = false;
+}
+
+/**
+ * Representation of a single event listener.
+ *
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
+ * @constructor
+ * @private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} context The context to invoke the listener with.
+ * @param {Boolean} once Specify if the listener is a one-time listener.
+ * @returns {EventEmitter}
+ * @private
+ */
+function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== 'function') {
+ throw new TypeError('The listener must be a function');
+ }
+
+ var listener = new EE(fn, context || emitter, once)
+ , evt = prefix ? prefix + event : event;
+
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
+ else emitter._events[evt] = [emitter._events[evt], listener];
+
+ return emitter;
+}
+
+/**
+ * Clear event by name.
+ *
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
+ * @param {(String|Symbol)} evt The Event name.
+ * @private
+ */
+function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
+ else delete emitter._events[evt];
+}
+
+/**
+ * Minimal `EventEmitter` interface that is molded against the Node.js
+ * `EventEmitter` interface.
+ *
+ * @constructor
+ * @public
+ */
+function EventEmitter() {
+ this._events = new Events();
+ this._eventsCount = 0;
+}
+
+/**
+ * Return an array listing the events for which the emitter has registered
+ * listeners.
+ *
+ * @returns {Array}
+ * @public
+ */
+EventEmitter.prototype.eventNames = function eventNames() {
+ var names = []
+ , events
+ , name;
+
+ if (this._eventsCount === 0) return names;
+
+ for (name in (events = this._events)) {
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ }
+
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+
+ return names;
+};
+
+/**
+ * Return the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Array} The registered listeners.
+ * @public
+ */
+EventEmitter.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event
+ , handlers = this._events[evt];
+
+ if (!handlers) return [];
+ if (handlers.fn) return [handlers.fn];
+
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Return the number of listeners listening to a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Number} The number of listeners.
+ * @public
+ */
+EventEmitter.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event
+ , listeners = this._events[evt];
+
+ if (!listeners) return 0;
+ if (listeners.fn) return 1;
+ return listeners.length;
+};
+
+/**
+ * Calls each of the listeners registered for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
+ * @public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if (listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Add a listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+};
+
+/**
+ * Add a one-time listener for a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn The listener function.
+ * @param {*} [context=this] The context to invoke the listener with.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+};
+
+/**
+ * Remove the listeners of a given event.
+ *
+ * @param {(String|Symbol)} event The event name.
+ * @param {Function} fn Only remove the listeners that match this function.
+ * @param {*} context Only remove the listeners that have this context.
+ * @param {Boolean} once Only remove one-time listeners.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events[evt]) return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+
+ var listeners = this._events[evt];
+
+ if (listeners.fn) {
+ if (
+ listeners.fn === fn &&
+ (!once || listeners.once) &&
+ (!context || listeners.context === context)
+ ) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn ||
+ (once && !listeners[i].once) ||
+ (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
+ else clearEvent(this, evt);
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners, or those of the specified event.
+ *
+ * @param {(String|Symbol)} [event] The event name.
+ * @returns {EventEmitter} `this`.
+ * @public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt]) clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Allow `EventEmitter` to be imported as module namespace.
+//
+EventEmitter.EventEmitter = EventEmitter;
+
+//
+// Expose the module.
+//
+if (true) {
+ module.exports = EventEmitter;
+}
+
+
+/***/ }),
+
+/***/ 2103:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+const retry = __nccwpck_require__(5546);
+
+const networkErrorMsgs = [
+ 'Failed to fetch', // Chrome
+ 'NetworkError when attempting to fetch resource.', // Firefox
+ 'The Internet connection appears to be offline.', // Safari
+ 'Network request failed' // `cross-fetch`
+];
+
+class AbortError extends Error {
+ constructor(message) {
+ super();
+
+ if (message instanceof Error) {
+ this.originalError = message;
+ ({message} = message);
+ } else {
+ this.originalError = new Error(message);
+ this.originalError.stack = this.stack;
+ }
+
+ this.name = 'AbortError';
+ this.message = message;
+ }
+}
+
+const decorateErrorWithCounts = (error, attemptNumber, options) => {
+ // Minus 1 from attemptNumber because the first attempt does not count as a retry
+ const retriesLeft = options.retries - (attemptNumber - 1);
+
+ error.attemptNumber = attemptNumber;
+ error.retriesLeft = retriesLeft;
+ return error;
+};
+
+const isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);
+
+const pRetry = (input, options) => new Promise((resolve, reject) => {
+ options = {
+ onFailedAttempt: () => {},
+ retries: 10,
+ ...options
+ };
+
+ const operation = retry.operation(options);
+
+ operation.attempt(async attemptNumber => {
+ try {
+ resolve(await input(attemptNumber));
+ } catch (error) {
+ if (!(error instanceof Error)) {
+ reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
+ return;
+ }
+
+ if (error instanceof AbortError) {
+ operation.stop();
+ reject(error.originalError);
+ } else if (error instanceof TypeError && !isNetworkError(error.message)) {
+ operation.stop();
+ reject(error);
+ } else {
+ decorateErrorWithCounts(error, attemptNumber, options);
+
+ try {
+ await options.onFailedAttempt(error);
+ } catch (error) {
+ reject(error);
+ return;
+ }
+
+ if (!operation.retry(error)) {
+ reject(operation.mainError());
+ }
+ }
+ }
+ });
+});
+
+module.exports = pRetry;
+// TODO: remove this in the next major version
+module.exports["default"] = pRetry;
+
+module.exports.AbortError = AbortError;
+
+
+/***/ }),
+
+/***/ 4802:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const pFinally = __nccwpck_require__(2766);
+
+class TimeoutError extends Error {
+ constructor(message) {
+ super(message);
+ this.name = 'TimeoutError';
+ }
+}
+
+const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => {
+ if (typeof milliseconds !== 'number' || milliseconds < 0) {
+ throw new TypeError('Expected `milliseconds` to be a positive number');
+ }
+
+ if (milliseconds === Infinity) {
+ resolve(promise);
+ return;
+ }
+
+ const timer = setTimeout(() => {
+ if (typeof fallback === 'function') {
+ try {
+ resolve(fallback());
+ } catch (error) {
+ reject(error);
+ }
+
+ return;
+ }
+
+ const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
+ const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
+
+ if (typeof promise.cancel === 'function') {
+ promise.cancel();
+ }
+
+ reject(timeoutError);
+ }, milliseconds);
+
+ // TODO: Use native `finally` keyword when targeting Node.js 10
+ pFinally(
+ // eslint-disable-next-line promise/prefer-await-to-then
+ promise.then(resolve, reject),
+ () => {
+ clearTimeout(timer);
+ }
+ );
+});
+
+module.exports = pTimeout;
+// TODO: Remove this for the next major release
+module.exports["default"] = pTimeout;
+
+module.exports.TimeoutError = TimeoutError;
+
+
+/***/ }),
+
+/***/ 5546:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+module.exports = __nccwpck_require__(7084);
+
+/***/ }),
+
+/***/ 7084:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+var RetryOperation = __nccwpck_require__(9538);
+
+exports.operation = function(options) {
+ var timeouts = exports.timeouts(options);
+ return new RetryOperation(timeouts, {
+ forever: options && (options.forever || options.retries === Infinity),
+ unref: options && options.unref,
+ maxRetryTime: options && options.maxRetryTime
+ });
+};
+
+exports.timeouts = function(options) {
+ if (options instanceof Array) {
+ return [].concat(options);
+ }
+
+ var opts = {
+ retries: 10,
+ factor: 2,
+ minTimeout: 1 * 1000,
+ maxTimeout: Infinity,
+ randomize: false
+ };
+ for (var key in options) {
+ opts[key] = options[key];
+ }
+
+ if (opts.minTimeout > opts.maxTimeout) {
+ throw new Error('minTimeout is greater than maxTimeout');
+ }
+
+ var timeouts = [];
+ for (var i = 0; i < opts.retries; i++) {
+ timeouts.push(this.createTimeout(i, opts));
+ }
+
+ if (options && options.forever && !timeouts.length) {
+ timeouts.push(this.createTimeout(i, opts));
+ }
+
+ // sort the array numerically ascending
+ timeouts.sort(function(a,b) {
+ return a - b;
+ });
+
+ return timeouts;
+};
+
+exports.createTimeout = function(attempt, opts) {
+ var random = (opts.randomize)
+ ? (Math.random() + 1)
+ : 1;
+
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
+ timeout = Math.min(timeout, opts.maxTimeout);
+
+ return timeout;
+};
+
+exports.wrap = function(obj, options, methods) {
+ if (options instanceof Array) {
+ methods = options;
+ options = null;
+ }
+
+ if (!methods) {
+ methods = [];
+ for (var key in obj) {
+ if (typeof obj[key] === 'function') {
+ methods.push(key);
+ }
+ }
+ }
+
+ for (var i = 0; i < methods.length; i++) {
+ var method = methods[i];
+ var original = obj[method];
+
+ obj[method] = function retryWrapper(original) {
+ var op = exports.operation(options);
+ var args = Array.prototype.slice.call(arguments, 1);
+ var callback = args.pop();
+
+ args.push(function(err) {
+ if (op.retry(err)) {
+ return;
+ }
+ if (err) {
+ arguments[0] = op.mainError();
}
+ callback.apply(this, arguments);
+ });
+
+ op.attempt(function() {
+ original.apply(obj, args);
+ });
+ }.bind(obj, original);
+ obj[method].options = options;
+ }
+};
+
+
+/***/ }),
+
+/***/ 9538:
+/***/ ((module) => {
+
+function RetryOperation(timeouts, options) {
+ // Compatibility for the old (timeouts, retryForever) signature
+ if (typeof options === 'boolean') {
+ options = { forever: options };
+ }
+
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
+ this._timeouts = timeouts;
+ this._options = options || {};
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
+ this._fn = null;
+ this._errors = [];
+ this._attempts = 1;
+ this._operationTimeout = null;
+ this._operationTimeoutCb = null;
+ this._timeout = null;
+ this._operationStart = null;
+ this._timer = null;
+
+ if (this._options.forever) {
+ this._cachedTimeouts = this._timeouts.slice(0);
+ }
+}
+module.exports = RetryOperation;
+
+RetryOperation.prototype.reset = function() {
+ this._attempts = 1;
+ this._timeouts = this._originalTimeouts.slice(0);
+}
+
+RetryOperation.prototype.stop = function() {
+ if (this._timeout) {
+ clearTimeout(this._timeout);
+ }
+ if (this._timer) {
+ clearTimeout(this._timer);
+ }
+
+ this._timeouts = [];
+ this._cachedTimeouts = null;
+};
+
+RetryOperation.prototype.retry = function(err) {
+ if (this._timeout) {
+ clearTimeout(this._timeout);
+ }
+
+ if (!err) {
+ return false;
+ }
+ var currentTime = new Date().getTime();
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
+ this._errors.push(err);
+ this._errors.unshift(new Error('RetryOperation timeout occurred'));
+ return false;
+ }
+
+ this._errors.push(err);
+
+ var timeout = this._timeouts.shift();
+ if (timeout === undefined) {
+ if (this._cachedTimeouts) {
+ // retry forever, only keep last error
+ this._errors.splice(0, this._errors.length - 1);
+ timeout = this._cachedTimeouts.slice(-1);
+ } else {
+ return false;
+ }
+ }
+
+ var self = this;
+ this._timer = setTimeout(function() {
+ self._attempts++;
+
+ if (self._operationTimeoutCb) {
+ self._timeout = setTimeout(function() {
+ self._operationTimeoutCb(self._attempts);
+ }, self._operationTimeout);
+
+ if (self._options.unref) {
+ self._timeout.unref();
+ }
+ }
+
+ self._fn(self._attempts);
+ }, timeout);
+
+ if (this._options.unref) {
+ this._timer.unref();
+ }
+
+ return true;
+};
+
+RetryOperation.prototype.attempt = function(fn, timeoutOps) {
+ this._fn = fn;
+
+ if (timeoutOps) {
+ if (timeoutOps.timeout) {
+ this._operationTimeout = timeoutOps.timeout;
+ }
+ if (timeoutOps.cb) {
+ this._operationTimeoutCb = timeoutOps.cb;
+ }
+ }
+
+ var self = this;
+ if (this._operationTimeoutCb) {
+ this._timeout = setTimeout(function() {
+ self._operationTimeoutCb();
+ }, self._operationTimeout);
+ }
+
+ this._operationStart = new Date().getTime();
+
+ this._fn(this._attempts);
+};
+
+RetryOperation.prototype.try = function(fn) {
+ console.log('Using RetryOperation.try() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = function(fn) {
+ console.log('Using RetryOperation.start() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = RetryOperation.prototype.try;
+
+RetryOperation.prototype.errors = function() {
+ return this._errors;
+};
+
+RetryOperation.prototype.attempts = function() {
+ return this._attempts;
+};
+
+RetryOperation.prototype.mainError = function() {
+ if (this._errors.length === 0) {
+ return null;
+ }
+
+ var counts = {};
+ var mainError = null;
+ var mainErrorCount = 0;
+
+ for (var i = 0; i < this._errors.length; i++) {
+ var error = this._errors[i];
+ var message = error.message;
+ var count = (counts[message] || 0) + 1;
+
+ counts[message] = count;
+
+ if (count >= mainErrorCount) {
+ mainError = error;
+ mainErrorCount = count;
+ }
+ }
+
+ return mainError;
+};
+
+
+/***/ }),
+
+/***/ 1450:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+const os = __nccwpck_require__(857);
+const tty = __nccwpck_require__(2018);
+const hasFlag = __nccwpck_require__(3813);
+
+const {env} = process;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false') ||
+ hasFlag('color=never')) {
+ forceColor = 0;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = 1;
+}
+
+if ('FORCE_COLOR' in env) {
+ if (env.FORCE_COLOR === 'true') {
+ forceColor = 1;
+ } else if (env.FORCE_COLOR === 'false') {
+ forceColor = 0;
+ } else {
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
+ }
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(haveStream, streamIsTTY) {
+ if (forceColor === 0) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
+ return 0;
+ }
+
+ const min = forceColor || 0;
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ if (process.platform === 'win32') {
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
+ const osRelease = os.release().split('.');
+ if (
+ Number(osRelease[0]) >= 10 &&
+ Number(osRelease[2]) >= 10586
+ ) {
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
+ }
+
+ return 1;
+ }
+
+ if ('CI' in env) {
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+ return 1;
+ }
+
+ return min;
+ }
+
+ if ('TEAMCITY_VERSION' in env) {
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+ }
+
+ if (env.COLORTERM === 'truecolor') {
+ return 3;
+ }
+
+ if ('TERM_PROGRAM' in env) {
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+ switch (env.TERM_PROGRAM) {
+ case 'iTerm.app':
+ return version >= 3 ? 3 : 2;
+ case 'Apple_Terminal':
+ return 2;
+ // No default
+ }
+ }
+
+ if (/-256(color)?$/i.test(env.TERM)) {
+ return 2;
+ }
+
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
+ return 1;
+ }
+
+ if ('COLORTERM' in env) {
+ return 1;
+ }
+
+ return min;
+}
+
+function getSupportLevel(stream) {
+ const level = supportsColor(stream, stream && stream.isTTY);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
+};
+
+
+/***/ }),
+
+/***/ 770:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+module.exports = __nccwpck_require__(218);
+
+
+/***/ }),
+
+/***/ 218:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+
+var net = __nccwpck_require__(9278);
+var tls = __nccwpck_require__(4756);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var events = __nccwpck_require__(4434);
+var assert = __nccwpck_require__(2613);
+var util = __nccwpck_require__(9023);
+
+
+exports.httpOverHttp = httpOverHttp;
+exports.httpsOverHttp = httpsOverHttp;
+exports.httpOverHttps = httpOverHttps;
+exports.httpsOverHttps = httpsOverHttps;
+
+
+function httpOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ return agent;
+}
+
+function httpsOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
+
+function httpOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ return agent;
+}
+
+function httpsOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
+
+
+function TunnelingAgent(options) {
+ var self = this;
+ self.options = options || {};
+ self.proxyOptions = self.options.proxy || {};
+ self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
+ self.requests = [];
+ self.sockets = [];
+
+ self.on('free', function onFree(socket, host, port, localAddress) {
+ var options = toOptions(host, port, localAddress);
+ for (var i = 0, len = self.requests.length; i < len; ++i) {
+ var pending = self.requests[i];
+ if (pending.host === options.host && pending.port === options.port) {
+ // Detect the request to connect same origin server,
+ // reuse the connection.
+ self.requests.splice(i, 1);
+ pending.request.onSocket(socket);
+ return;
+ }
}
+ socket.destroy();
+ self.removeSocket(socket);
+ });
}
-exports.Methods = Methods;
-__exportStar(__nccwpck_require__(4380), exports);
-//# sourceMappingURL=methods.js.map
+util.inherits(TunnelingAgent, events.EventEmitter);
+
+TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
+ var self = this;
+ var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
+
+ if (self.sockets.length >= this.maxSockets) {
+ // We are over limit so we'll add it to the queue.
+ self.requests.push(options);
+ return;
+ }
+
+ // If we are under maxSockets create a new one.
+ self.createSocket(options, function(socket) {
+ socket.on('free', onFree);
+ socket.on('close', onCloseOrRemove);
+ socket.on('agentRemove', onCloseOrRemove);
+ req.onSocket(socket);
+
+ function onFree() {
+ self.emit('free', socket, options);
+ }
+
+ function onCloseOrRemove(err) {
+ self.removeSocket(socket);
+ socket.removeListener('free', onFree);
+ socket.removeListener('close', onCloseOrRemove);
+ socket.removeListener('agentRemove', onCloseOrRemove);
+ }
+ });
+};
+
+TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
+ var self = this;
+ var placeholder = {};
+ self.sockets.push(placeholder);
+
+ var connectOptions = mergeOptions({}, self.proxyOptions, {
+ method: 'CONNECT',
+ path: options.host + ':' + options.port,
+ agent: false,
+ headers: {
+ host: options.host + ':' + options.port
+ }
+ });
+ if (options.localAddress) {
+ connectOptions.localAddress = options.localAddress;
+ }
+ if (connectOptions.proxyAuth) {
+ connectOptions.headers = connectOptions.headers || {};
+ connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
+ new Buffer(connectOptions.proxyAuth).toString('base64');
+ }
+
+ debug('making CONNECT request');
+ var connectReq = self.request(connectOptions);
+ connectReq.useChunkedEncodingByDefault = false; // for v0.6
+ connectReq.once('response', onResponse); // for v0.6
+ connectReq.once('upgrade', onUpgrade); // for v0.6
+ connectReq.once('connect', onConnect); // for v0.7 or later
+ connectReq.once('error', onError);
+ connectReq.end();
+
+ function onResponse(res) {
+ // Very hacky. This is necessary to avoid http-parser leaks.
+ res.upgrade = true;
+ }
+
+ function onUpgrade(res, socket, head) {
+ // Hacky.
+ process.nextTick(function() {
+ onConnect(res, socket, head);
+ });
+ }
-/***/ }),
+ function onConnect(res, socket, head) {
+ connectReq.removeAllListeners();
+ socket.removeAllListeners();
-/***/ 2156:
-/***/ ((__unused_webpack_module, exports) => {
+ if (res.statusCode !== 200) {
+ debug('tunneling socket could not be established, statusCode=%d',
+ res.statusCode);
+ socket.destroy();
+ var error = new Error('tunneling socket could not be established, ' +
+ 'statusCode=' + res.statusCode);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
+ }
+ if (head.length > 0) {
+ debug('got illegal response body from proxy');
+ socket.destroy();
+ var error = new Error('got illegal response body from proxy');
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
+ }
+ debug('tunneling connection has established');
+ self.sockets[self.sockets.indexOf(placeholder)] = socket;
+ return cb(socket);
+ }
-"use strict";
+ function onError(cause) {
+ connectReq.removeAllListeners();
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.rapidRetryPolicy = exports.fiveRetriesInFiveMinutes = exports.tenRetriesInAboutThirtyMinutes = void 0;
-/**
- * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because
- * randomization has been added to prevent a stampeding herd problem (if all instances in your application are retrying
- * a request at the exact same intervals, they are more likely to cause failures for each other).
- */
-exports.tenRetriesInAboutThirtyMinutes = {
- retries: 10,
- factor: 1.96821,
- randomize: true,
-};
-/**
- * Short & sweet, five retries in five minutes and then bail.
- */
-exports.fiveRetriesInFiveMinutes = {
- retries: 5,
- factor: 3.86,
-};
-/**
- * This policy is just to keep the tests running fast.
- */
-exports.rapidRetryPolicy = {
- minTimeout: 0,
- maxTimeout: 1,
+ debug('tunneling socket could not be established, cause=%s\n',
+ cause.message, cause.stack);
+ var error = new Error('tunneling socket could not be established, ' +
+ 'cause=' + cause.message);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ }
};
-const policies = {
- tenRetriesInAboutThirtyMinutes: exports.tenRetriesInAboutThirtyMinutes,
- fiveRetriesInFiveMinutes: exports.fiveRetriesInFiveMinutes,
- rapidRetryPolicy: exports.rapidRetryPolicy,
+
+TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
+ var pos = this.sockets.indexOf(socket)
+ if (pos === -1) {
+ return;
+ }
+ this.sockets.splice(pos, 1);
+
+ var pending = this.requests.shift();
+ if (pending) {
+ // If we have pending requests and a socket gets closed a new one
+ // needs to be created to take over in the pool for the one that closed.
+ this.createSocket(pending, function(socket) {
+ pending.request.onSocket(socket);
+ });
+ }
};
-exports["default"] = policies;
-//# sourceMappingURL=retry-policies.js.map
-/***/ }),
+function createSecureSocket(options, cb) {
+ var self = this;
+ TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
+ var hostHeader = options.request.getHeader('host');
+ var tlsOptions = mergeOptions({}, self.options, {
+ socket: socket,
+ servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
+ });
-/***/ 1099:
-/***/ ((__unused_webpack_module, exports) => {
+ // 0 is dummy port for v0.6
+ var secureSocket = tls.connect(0, tlsOptions);
+ self.sockets[self.sockets.indexOf(socket)] = secureSocket;
+ cb(secureSocket);
+ });
+}
-"use strict";
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=index.js.map
+function toOptions(host, port, localAddress) {
+ if (typeof host === 'string') { // since v0.10
+ return {
+ host: host,
+ port: port,
+ localAddress: localAddress
+ };
+ }
+ return host; // for v0.11 or later
+}
-/***/ }),
+function mergeOptions(target) {
+ for (var i = 1, len = arguments.length; i < len; ++i) {
+ var overrides = arguments[i];
+ if (typeof overrides === 'object') {
+ var keys = Object.keys(overrides);
+ for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
+ var k = keys[j];
+ if (overrides[k] !== undefined) {
+ target[k] = overrides[k];
+ }
+ }
+ }
+ }
+ return target;
+}
-/***/ 2888:
-/***/ ((__unused_webpack_module, exports) => {
-"use strict";
+var debug;
+if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
+ debug = function() {
+ var args = Array.prototype.slice.call(arguments);
+ if (typeof args[0] === 'string') {
+ args[0] = 'TUNNEL: ' + args[0];
+ } else {
+ args.unshift('TUNNEL:');
+ }
+ console.error.apply(console, args);
+ }
+} else {
+ debug = function() {};
+}
+exports.debug = debug; // for test
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 4812:
+/***/ 6752:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports =
-{
- parallel : __nccwpck_require__(8210),
- serial : __nccwpck_require__(445),
- serialOrdered : __nccwpck_require__(3578)
-};
-
-/***/ }),
-/***/ 1700:
-/***/ ((module) => {
+const Client = __nccwpck_require__(3701)
+const Dispatcher = __nccwpck_require__(883)
+const Pool = __nccwpck_require__(628)
+const BalancedPool = __nccwpck_require__(837)
+const Agent = __nccwpck_require__(7405)
+const ProxyAgent = __nccwpck_require__(6672)
+const EnvHttpProxyAgent = __nccwpck_require__(3137)
+const RetryAgent = __nccwpck_require__(50)
+const errors = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError } = errors
+const api = __nccwpck_require__(6615)
+const buildConnector = __nccwpck_require__(9136)
+const MockClient = __nccwpck_require__(7365)
+const MockAgent = __nccwpck_require__(7501)
+const MockPool = __nccwpck_require__(4004)
+const mockErrors = __nccwpck_require__(2429)
+const RetryHandler = __nccwpck_require__(7816)
+const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(2581)
+const DecoratorHandler = __nccwpck_require__(8155)
+const RedirectHandler = __nccwpck_require__(8754)
+const createRedirectInterceptor = __nccwpck_require__(5092)
-// API
-module.exports = abort;
+Object.assign(Dispatcher.prototype, api)
-/**
- * Aborts leftover active jobs
- *
- * @param {object} state - current state object
- */
-function abort(state)
-{
- Object.keys(state.jobs).forEach(clean.bind(state));
+module.exports.Dispatcher = Dispatcher
+module.exports.Client = Client
+module.exports.Pool = Pool
+module.exports.BalancedPool = BalancedPool
+module.exports.Agent = Agent
+module.exports.ProxyAgent = ProxyAgent
+module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent
+module.exports.RetryAgent = RetryAgent
+module.exports.RetryHandler = RetryHandler
- // reset leftover jobs
- state.jobs = {};
+module.exports.DecoratorHandler = DecoratorHandler
+module.exports.RedirectHandler = RedirectHandler
+module.exports.createRedirectInterceptor = createRedirectInterceptor
+module.exports.interceptors = {
+ redirect: __nccwpck_require__(1514),
+ retry: __nccwpck_require__(2026),
+ dump: __nccwpck_require__(8060),
+ dns: __nccwpck_require__(379)
}
-/**
- * Cleans up leftover job by invoking abort function for the provided job id
- *
- * @this state
- * @param {string|number} key - job id to abort
- */
-function clean(key)
-{
- if (typeof this.jobs[key] == 'function')
- {
- this.jobs[key]();
- }
+module.exports.buildConnector = buildConnector
+module.exports.errors = errors
+module.exports.util = {
+ parseHeaders: util.parseHeaders,
+ headerNameToString: util.headerNameToString
}
+function makeDispatcher (fn) {
+ return (url, opts, handler) => {
+ if (typeof opts === 'function') {
+ handler = opts
+ opts = null
+ }
-/***/ }),
+ if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
+ throw new InvalidArgumentError('invalid url')
+ }
-/***/ 2794:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (opts != null && typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
-var defer = __nccwpck_require__(5295);
+ if (opts && opts.path != null) {
+ if (typeof opts.path !== 'string') {
+ throw new InvalidArgumentError('invalid opts.path')
+ }
-// API
-module.exports = async;
+ let path = opts.path
+ if (!opts.path.startsWith('/')) {
+ path = `/${path}`
+ }
-/**
- * Runs provided callback asynchronously
- * even if callback itself is not
- *
- * @param {function} callback - callback to invoke
- * @returns {function} - augmented callback
- */
-function async(callback)
-{
- var isAsync = false;
+ url = new URL(util.parseOrigin(url).origin + path)
+ } else {
+ if (!opts) {
+ opts = typeof url === 'object' ? url : {}
+ }
- // check if async happened
- defer(function() { isAsync = true; });
+ url = util.parseURL(url)
+ }
- return function async_callback(err, result)
- {
- if (isAsync)
- {
- callback(err, result);
+ const { agent, dispatcher = getGlobalDispatcher() } = opts
+
+ if (agent) {
+ throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
}
- else
- {
- defer(function nextTick_callback()
- {
- callback(err, result);
- });
+
+ return fn.call(dispatcher, {
+ ...opts,
+ origin: url.origin,
+ path: url.search ? `${url.pathname}${url.search}` : url.pathname,
+ method: opts.method || (opts.body ? 'PUT' : 'GET')
+ }, handler)
+ }
+}
+
+module.exports.setGlobalDispatcher = setGlobalDispatcher
+module.exports.getGlobalDispatcher = getGlobalDispatcher
+
+const fetchImpl = (__nccwpck_require__(4398).fetch)
+module.exports.fetch = async function fetch (init, options = undefined) {
+ try {
+ return await fetchImpl(init, options)
+ } catch (err) {
+ if (err && typeof err === 'object') {
+ Error.captureStackTrace(err)
}
- };
+
+ throw err
+ }
}
+module.exports.Headers = __nccwpck_require__(660).Headers
+module.exports.Response = __nccwpck_require__(9051).Response
+module.exports.Request = __nccwpck_require__(9967).Request
+module.exports.FormData = __nccwpck_require__(5910).FormData
+module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File)
+module.exports.FileReader = __nccwpck_require__(8355).FileReader
+
+const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1059)
+
+module.exports.setGlobalOrigin = setGlobalOrigin
+module.exports.getGlobalOrigin = getGlobalOrigin
+
+const { CacheStorage } = __nccwpck_require__(3245)
+const { kConstruct } = __nccwpck_require__(109)
+
+// Cache & CacheStorage are tightly coupled with fetch. Even if it may run
+// in an older version of Node, it doesn't have any use without fetch.
+module.exports.caches = new CacheStorage(kConstruct)
+
+const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(9061)
+
+module.exports.deleteCookie = deleteCookie
+module.exports.getCookies = getCookies
+module.exports.getSetCookies = getSetCookies
+module.exports.setCookie = setCookie
+
+const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(1900)
+
+module.exports.parseMIMEType = parseMIMEType
+module.exports.serializeAMimeType = serializeAMimeType
+
+const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(5188)
+module.exports.WebSocket = __nccwpck_require__(3726).WebSocket
+module.exports.CloseEvent = CloseEvent
+module.exports.ErrorEvent = ErrorEvent
+module.exports.MessageEvent = MessageEvent
+
+module.exports.request = makeDispatcher(api.request)
+module.exports.stream = makeDispatcher(api.stream)
+module.exports.pipeline = makeDispatcher(api.pipeline)
+module.exports.connect = makeDispatcher(api.connect)
+module.exports.upgrade = makeDispatcher(api.upgrade)
+
+module.exports.MockClient = MockClient
+module.exports.MockPool = MockPool
+module.exports.MockAgent = MockAgent
+module.exports.mockErrors = mockErrors
+
+const { EventSource } = __nccwpck_require__(1238)
+
+module.exports.EventSource = EventSource
/***/ }),
-/***/ 5295:
-/***/ ((module) => {
+/***/ 158:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = defer;
+const { addAbortListener } = __nccwpck_require__(3440)
+const { RequestAbortedError } = __nccwpck_require__(8707)
-/**
- * Runs provided function on next iteration of the event loop
- *
- * @param {function} fn - function to run
- */
-function defer(fn)
-{
- var nextTick = typeof setImmediate == 'function'
- ? setImmediate
- : (
- typeof process == 'object' && typeof process.nextTick == 'function'
- ? process.nextTick
- : null
- );
+const kListener = Symbol('kListener')
+const kSignal = Symbol('kSignal')
- if (nextTick)
- {
- nextTick(fn);
+function abort (self) {
+ if (self.abort) {
+ self.abort(self[kSignal]?.reason)
+ } else {
+ self.reason = self[kSignal]?.reason ?? new RequestAbortedError()
}
- else
- {
- setTimeout(fn, 0);
+ removeSignal(self)
+}
+
+function addSignal (self, signal) {
+ self.reason = null
+
+ self[kSignal] = null
+ self[kListener] = null
+
+ if (!signal) {
+ return
+ }
+
+ if (signal.aborted) {
+ abort(self)
+ return
+ }
+
+ self[kSignal] = signal
+ self[kListener] = () => {
+ abort(self)
+ }
+
+ addAbortListener(self[kSignal], self[kListener])
+}
+
+function removeSignal (self) {
+ if (!self[kSignal]) {
+ return
+ }
+
+ if ('removeEventListener' in self[kSignal]) {
+ self[kSignal].removeEventListener('abort', self[kListener])
+ } else {
+ self[kSignal].removeListener('abort', self[kListener])
}
+
+ self[kSignal] = null
+ self[kListener] = null
+}
+
+module.exports = {
+ addSignal,
+ removeSignal
}
/***/ }),
-/***/ 9023:
+/***/ 2279:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var async = __nccwpck_require__(2794)
- , abort = __nccwpck_require__(1700)
- ;
-// API
-module.exports = iterate;
-/**
- * Iterates over each job object
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {object} state - current job status
- * @param {function} callback - invoked when all elements processed
- */
-function iterate(list, iterator, state, callback)
-{
- // store current index
- var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+const assert = __nccwpck_require__(4589)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
- {
- // don't repeat yourself
- // skip secondary callbacks
- if (!(key in state.jobs))
- {
- return;
+class ConnectHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
}
- // clean up jobs
- delete state.jobs[key];
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- if (error)
- {
- // don't process rest of the results
- // stop still active jobs
- // and reset the list
- abort(state);
+ const { signal, opaque, responseHeaders } = opts
+
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
- else
- {
- state.results[key] = output;
+
+ super('UNDICI_CONNECT')
+
+ this.opaque = opaque || null
+ this.responseHeaders = responseHeaders || null
+ this.callback = callback
+ this.abort = null
+
+ addSignal(this, signal)
+ }
+
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
}
- // return salvaged results
- callback(error, state.results);
- });
+ assert(this.callback)
+
+ this.abort = abort
+ this.context = context
+ }
+
+ onHeaders () {
+ throw new SocketError('bad connect', null)
+ }
+
+ onUpgrade (statusCode, rawHeaders, socket) {
+ const { callback, opaque, context } = this
+
+ removeSignal(this)
+
+ this.callback = null
+
+ let headers = rawHeaders
+ // Indicates is an HTTP2Session
+ if (headers != null) {
+ headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ }
+
+ this.runInAsyncScope(callback, null, null, {
+ statusCode,
+ headers,
+ socket,
+ opaque,
+ context
+ })
+ }
+
+ onError (err) {
+ const { callback, opaque } = this
+
+ removeSignal(this)
+
+ if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
+ }
}
-/**
- * Runs iterator over provided job element
- *
- * @param {function} iterator - iterator to invoke
- * @param {string|number} key - key/index of the element in the list of jobs
- * @param {mixed} item - job description
- * @param {function} callback - invoked after iterator is done with the job
- * @returns {function|mixed} - job abort function or something else
- */
-function runJob(iterator, key, item, callback)
-{
- var aborter;
+function connect (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ connect.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
+
+ try {
+ const connectHandler = new ConnectHandler(opts, callback)
+ this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
+}
+
+module.exports = connect
+
+
+/***/ }),
+
+/***/ 6862:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const {
+ Readable,
+ Duplex,
+ PassThrough
+} = __nccwpck_require__(7075)
+const {
+ InvalidArgumentError,
+ InvalidReturnValueError,
+ RequestAbortedError
+} = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
+const assert = __nccwpck_require__(4589)
- // allow shortcut if iterator expects only two arguments
- if (iterator.length == 2)
- {
- aborter = iterator(item, async(callback));
- }
- // otherwise go with full three arguments
- else
- {
- aborter = iterator(item, key, async(callback));
+const kResume = Symbol('resume')
+
+class PipelineRequest extends Readable {
+ constructor () {
+ super({ autoDestroy: true })
+
+ this[kResume] = null
}
- return aborter;
-}
+ _read () {
+ const { [kResume]: resume } = this
+ if (resume) {
+ this[kResume] = null
+ resume()
+ }
+ }
-/***/ }),
+ _destroy (err, callback) {
+ this._read()
-/***/ 2474:
-/***/ ((module) => {
+ callback(err)
+ }
+}
-// API
-module.exports = state;
+class PipelineResponse extends Readable {
+ constructor (resume) {
+ super({ autoDestroy: true })
+ this[kResume] = resume
+ }
-/**
- * Creates initial state object
- * for iteration over list
- *
- * @param {array|object} list - list to iterate over
- * @param {function|null} sortMethod - function to use for keys sort,
- * or `null` to keep them as is
- * @returns {object} - initial state object
- */
-function state(list, sortMethod)
-{
- var isNamedList = !Array.isArray(list)
- , initState =
- {
- index : 0,
- keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
- jobs : {},
- results : isNamedList ? {} : [],
- size : isNamedList ? Object.keys(list).length : list.length
+ _read () {
+ this[kResume]()
+ }
+
+ _destroy (err, callback) {
+ if (!err && !this._readableState.endEmitted) {
+ err = new RequestAbortedError()
}
- ;
- if (sortMethod)
- {
- // sort array keys based on it's values
- // sort object's keys just on own merit
- initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
- {
- return sortMethod(list[a], list[b]);
- });
+ callback(err)
}
-
- return initState;
}
+class PipelineHandler extends AsyncResource {
+ constructor (opts, handler) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
-/***/ }),
+ if (typeof handler !== 'function') {
+ throw new InvalidArgumentError('invalid handler')
+ }
-/***/ 7942:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const { signal, method, opaque, onInfo, responseHeaders } = opts
-var abort = __nccwpck_require__(1700)
- , async = __nccwpck_require__(2794)
- ;
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
-// API
-module.exports = terminator;
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
-/**
- * Terminates jobs in the attached state context
- *
- * @this AsyncKitState#
- * @param {function} callback - final callback to invoke after termination
- */
-function terminator(callback)
-{
- if (!Object.keys(this.jobs).length)
- {
- return;
- }
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
- // fast forward iteration index
- this.index = this.size;
+ super('UNDICI_PIPELINE')
- // abort jobs
- abort(this);
+ this.opaque = opaque || null
+ this.responseHeaders = responseHeaders || null
+ this.handler = handler
+ this.abort = null
+ this.context = null
+ this.onInfo = onInfo || null
- // send back results we have so far
- async(callback)(null, this.results);
-}
+ this.req = new PipelineRequest().on('error', util.nop)
+ this.ret = new Duplex({
+ readableObjectMode: opts.objectMode,
+ autoDestroy: true,
+ read: () => {
+ const { body } = this
-/***/ }),
+ if (body?.resume) {
+ body.resume()
+ }
+ },
+ write: (chunk, encoding, callback) => {
+ const { req } = this
-/***/ 8210:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (req.push(chunk, encoding) || req._readableState.destroyed) {
+ callback()
+ } else {
+ req[kResume] = callback
+ }
+ },
+ destroy: (err, callback) => {
+ const { body, req, res, ret, abort } = this
-var iterate = __nccwpck_require__(9023)
- , initState = __nccwpck_require__(2474)
- , terminator = __nccwpck_require__(7942)
- ;
+ if (!err && !ret._readableState.endEmitted) {
+ err = new RequestAbortedError()
+ }
-// Public API
-module.exports = parallel;
+ if (abort && err) {
+ abort()
+ }
-/**
- * Runs iterator over provided array elements in parallel
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function parallel(list, iterator, callback)
-{
- var state = initState(list);
+ util.destroy(body, err)
+ util.destroy(req, err)
+ util.destroy(res, err)
- while (state.index < (state['keyedList'] || list).length)
- {
- iterate(list, iterator, state, function(error, result)
- {
- if (error)
- {
- callback(error, result);
- return;
- }
+ removeSignal(this)
- // looks like it's the last one
- if (Object.keys(state.jobs).length === 0)
- {
- callback(null, state.results);
- return;
+ callback(err)
}
- });
+ }).on('prefinish', () => {
+ const { req } = this
- state.index++;
- }
+ // Node < 15 does not call _final in same tick.
+ req.push(null)
+ })
- return terminator.bind(state, callback);
-}
+ this.res = null
+ addSignal(this, signal)
+ }
-/***/ }),
+ onConnect (abort, context) {
+ const { ret, res } = this
-/***/ 445:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
-var serialOrdered = __nccwpck_require__(3578);
+ assert(!res, 'pipeline cannot be retried')
+ assert(!ret.destroyed)
-// Public API
-module.exports = serial;
+ this.abort = abort
+ this.context = context
+ }
-/**
- * Runs iterator over provided array elements in series
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function serial(list, iterator, callback)
-{
- return serialOrdered(list, iterator, null, callback);
-}
+ onHeaders (statusCode, rawHeaders, resume) {
+ const { opaque, handler, context } = this
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ this.onInfo({ statusCode, headers })
+ }
+ return
+ }
-/***/ }),
+ this.res = new PipelineResponse(resume)
-/***/ 3578:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ let body
+ try {
+ this.handler = null
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ body = this.runInAsyncScope(handler, null, {
+ statusCode,
+ headers,
+ opaque,
+ body: this.res,
+ context
+ })
+ } catch (err) {
+ this.res.on('error', util.nop)
+ throw err
+ }
-var iterate = __nccwpck_require__(9023)
- , initState = __nccwpck_require__(2474)
- , terminator = __nccwpck_require__(7942)
- ;
+ if (!body || typeof body.on !== 'function') {
+ throw new InvalidReturnValueError('expected Readable')
+ }
-// Public API
-module.exports = serialOrdered;
-// sorting helpers
-module.exports.ascending = ascending;
-module.exports.descending = descending;
+ body
+ .on('data', (chunk) => {
+ const { ret, body } = this
-/**
- * Runs iterator over provided sorted array elements in series
- *
- * @param {array|object} list - array or object (named list) to iterate over
- * @param {function} iterator - iterator to run
- * @param {function} sortMethod - custom sort function
- * @param {function} callback - invoked when all elements processed
- * @returns {function} - jobs terminator
- */
-function serialOrdered(list, iterator, sortMethod, callback)
-{
- var state = initState(list, sortMethod);
+ if (!ret.push(chunk) && body.pause) {
+ body.pause()
+ }
+ })
+ .on('error', (err) => {
+ const { ret } = this
- iterate(list, iterator, state, function iteratorHandler(error, result)
- {
- if (error)
- {
- callback(error, result);
- return;
- }
+ util.destroy(ret, err)
+ })
+ .on('end', () => {
+ const { ret } = this
- state.index++;
+ ret.push(null)
+ })
+ .on('close', () => {
+ const { ret } = this
- // are we there yet?
- if (state.index < (state['keyedList'] || list).length)
- {
- iterate(list, iterator, state, iteratorHandler);
- return;
- }
+ if (!ret._readableState.ended) {
+ util.destroy(ret, new RequestAbortedError())
+ }
+ })
- // done here
- callback(null, state.results);
- });
+ this.body = body
+ }
- return terminator.bind(state, callback);
-}
+ onData (chunk) {
+ const { res } = this
+ return res.push(chunk)
+ }
-/*
- * -- Sort methods
- */
+ onComplete (trailers) {
+ const { res } = this
+ res.push(null)
+ }
-/**
- * sort helper to sort array elements in ascending order
- *
- * @param {mixed} a - an item to compare
- * @param {mixed} b - an item to compare
- * @returns {number} - comparison result
- */
-function ascending(a, b)
-{
- return a < b ? -1 : a > b ? 1 : 0;
+ onError (err) {
+ const { ret } = this
+ this.handler = null
+ util.destroy(ret, err)
+ }
}
-/**
- * sort helper to sort array elements in descending order
- *
- * @param {mixed} a - an item to compare
- * @param {mixed} b - an item to compare
- * @returns {number} - comparison result
- */
-function descending(a, b)
-{
- return -1 * ascending(a, b);
+function pipeline (opts, handler) {
+ try {
+ const pipelineHandler = new PipelineHandler(opts, handler)
+ this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
+ return pipelineHandler.ret
+ } catch (err) {
+ return new PassThrough().destroy(err)
+ }
}
+module.exports = pipeline
+
/***/ }),
-/***/ 3682:
+/***/ 4043:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var register = __nccwpck_require__(4670);
-var addHook = __nccwpck_require__(5549);
-var removeHook = __nccwpck_require__(6819);
-// bind with array of arguments: https://stackoverflow.com/a/21792913
-var bind = Function.bind;
-var bindable = bind.bind(bind);
-function bindApi(hook, state, name) {
- var removeHookRef = bindable(removeHook, null).apply(
- null,
- name ? [state, name] : [state]
- );
- hook.api = { remove: removeHookRef };
- hook.remove = removeHookRef;
- ["before", "error", "after", "wrap"].forEach(function (kind) {
- var args = name ? [state, kind, name] : [state, kind];
- hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
- });
-}
+const assert = __nccwpck_require__(4589)
+const { Readable } = __nccwpck_require__(9927)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(7655)
+const { AsyncResource } = __nccwpck_require__(6698)
-function HookSingular() {
- var singularHookName = "h";
- var singularHookState = {
- registry: {},
- };
- var singularHook = register.bind(null, singularHookState, singularHookName);
- bindApi(singularHook, singularHookState, singularHookName);
- return singularHook;
-}
+class RequestHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
-function HookCollection() {
- var state = {
- registry: {},
- };
+ const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
- var hook = register.bind(null, state);
- bindApi(hook, state);
+ try {
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
- return hook;
-}
+ if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
+ throw new InvalidArgumentError('invalid highWaterMark')
+ }
-var collectionHookDeprecationMessageDisplayed = false;
-function Hook() {
- if (!collectionHookDeprecationMessageDisplayed) {
- console.warn(
- '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
- );
- collectionHookDeprecationMessageDisplayed = true;
- }
- return HookCollection();
-}
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
-Hook.Singular = HookSingular.bind();
-Hook.Collection = HookCollection.bind();
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
-module.exports = Hook;
-// expose constructors as a named property for TypeScript
-module.exports.Hook = Hook;
-module.exports.Singular = Hook.Singular;
-module.exports.Collection = Hook.Collection;
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
+ super('UNDICI_REQUEST')
+ } catch (err) {
+ if (util.isStream(body)) {
+ util.destroy(body.on('error', util.nop), err)
+ }
+ throw err
+ }
-/***/ }),
+ this.method = method
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.callback = callback
+ this.res = null
+ this.abort = null
+ this.body = body
+ this.trailers = {}
+ this.context = null
+ this.onInfo = onInfo || null
+ this.throwOnError = throwOnError
+ this.highWaterMark = highWaterMark
+ this.signal = signal
+ this.reason = null
+ this.removeAbortListener = null
-/***/ 5549:
-/***/ ((module) => {
+ if (util.isStream(body)) {
+ body.on('error', (err) => {
+ this.onError(err)
+ })
+ }
-module.exports = addHook;
+ if (this.signal) {
+ if (this.signal.aborted) {
+ this.reason = this.signal.reason ?? new RequestAbortedError()
+ } else {
+ this.removeAbortListener = util.addAbortListener(this.signal, () => {
+ this.reason = this.signal.reason ?? new RequestAbortedError()
+ if (this.res) {
+ util.destroy(this.res.on('error', util.nop), this.reason)
+ } else if (this.abort) {
+ this.abort(this.reason)
+ }
-function addHook(state, kind, name, hook) {
- var orig = hook;
- if (!state.registry[name]) {
- state.registry[name] = [];
+ if (this.removeAbortListener) {
+ this.res?.off('close', this.removeAbortListener)
+ this.removeAbortListener()
+ this.removeAbortListener = null
+ }
+ })
+ }
+ }
}
- if (kind === "before") {
- hook = function (method, options) {
- return Promise.resolve()
- .then(orig.bind(null, options))
- .then(method.bind(null, options));
- };
- }
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
- if (kind === "after") {
- hook = function (method, options) {
- var result;
- return Promise.resolve()
- .then(method.bind(null, options))
- .then(function (result_) {
- result = result_;
- return orig(result, options);
- })
- .then(function () {
- return result;
- });
- };
- }
+ assert(this.callback)
- if (kind === "error") {
- hook = function (method, options) {
- return Promise.resolve()
- .then(method.bind(null, options))
- .catch(function (error) {
- return orig(error, options);
- });
- };
+ this.abort = abort
+ this.context = context
}
- state.registry[name].push({
- hook: hook,
- orig: orig,
- });
-}
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
+ const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
-/***/ }),
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ this.onInfo({ statusCode, headers })
+ }
+ return
+ }
-/***/ 4670:
-/***/ ((module) => {
+ const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
+ const contentType = parsedHeaders['content-type']
+ const contentLength = parsedHeaders['content-length']
+ const res = new Readable({
+ resume,
+ abort,
+ contentType,
+ contentLength: this.method !== 'HEAD' && contentLength
+ ? Number(contentLength)
+ : null,
+ highWaterMark
+ })
-module.exports = register;
+ if (this.removeAbortListener) {
+ res.on('close', this.removeAbortListener)
+ }
-function register(state, name, method, options) {
- if (typeof method !== "function") {
- throw new Error("method for before hook must be a function");
+ this.callback = null
+ this.res = res
+ if (callback !== null) {
+ if (this.throwOnError && statusCode >= 400) {
+ this.runInAsyncScope(getResolveErrorBodyCallback, null,
+ { callback, body: res, contentType, statusCode, statusMessage, headers }
+ )
+ } else {
+ this.runInAsyncScope(callback, null, null, {
+ statusCode,
+ headers,
+ trailers: this.trailers,
+ opaque,
+ body: res,
+ context
+ })
+ }
+ }
}
- if (!options) {
- options = {};
+ onData (chunk) {
+ return this.res.push(chunk)
}
- if (Array.isArray(name)) {
- return name.reverse().reduce(function (callback, name) {
- return register.bind(null, state, name, callback, options);
- }, method)();
+ onComplete (trailers) {
+ util.parseHeaders(trailers, this.trailers)
+ this.res.push(null)
}
- return Promise.resolve().then(function () {
- if (!state.registry[name]) {
- return method(options);
- }
-
- return state.registry[name].reduce(function (method, registered) {
- return registered.hook.bind(null, method, options);
- }, method)();
- });
-}
-
+ onError (err) {
+ const { res, callback, body, opaque } = this
-/***/ }),
+ if (callback) {
+ // TODO: Does this need queueMicrotask?
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
-/***/ 6819:
-/***/ ((module) => {
+ if (res) {
+ this.res = null
+ // Ensure all queued handlers are invoked before destroying res.
+ queueMicrotask(() => {
+ util.destroy(res, err)
+ })
+ }
-module.exports = removeHook;
+ if (body) {
+ this.body = null
+ util.destroy(body, err)
+ }
-function removeHook(state, name, method) {
- if (!state.registry[name]) {
- return;
+ if (this.removeAbortListener) {
+ res?.off('close', this.removeAbortListener)
+ this.removeAbortListener()
+ this.removeAbortListener = null
+ }
}
+}
- var index = state.registry[name]
- .map(function (registered) {
- return registered.orig;
+function request (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ request.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
})
- .indexOf(method);
-
- if (index === -1) {
- return;
}
- state.registry[name].splice(index, 1);
+ try {
+ this.dispatch(opts, new RequestHandler(opts, callback))
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
}
+module.exports = request
+module.exports.RequestHandler = RequestHandler
+
/***/ }),
-/***/ 5443:
+/***/ 3560:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var util = __nccwpck_require__(3837);
-var Stream = (__nccwpck_require__(2781).Stream);
-var DelayedStream = __nccwpck_require__(8611);
-
-module.exports = CombinedStream;
-function CombinedStream() {
- this.writable = false;
- this.readable = true;
- this.dataSize = 0;
- this.maxDataSize = 2 * 1024 * 1024;
- this.pauseStreams = true;
-
- this._released = false;
- this._streams = [];
- this._currentStream = null;
- this._insideLoop = false;
- this._pendingNext = false;
-}
-util.inherits(CombinedStream, Stream);
-
-CombinedStream.create = function(options) {
- var combinedStream = new this();
-
- options = options || {};
- for (var option in options) {
- combinedStream[option] = options[option];
- }
-
- return combinedStream;
-};
-CombinedStream.isStreamLike = function(stream) {
- return (typeof stream !== 'function')
- && (typeof stream !== 'string')
- && (typeof stream !== 'boolean')
- && (typeof stream !== 'number')
- && (!Buffer.isBuffer(stream));
-};
-CombinedStream.prototype.append = function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
+const assert = __nccwpck_require__(4589)
+const { finished, PassThrough } = __nccwpck_require__(7075)
+const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { getResolveErrorBodyCallback } = __nccwpck_require__(7655)
+const { AsyncResource } = __nccwpck_require__(6698)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
- if (isStreamLike) {
- if (!(stream instanceof DelayedStream)) {
- var newStream = DelayedStream.create(stream, {
- maxDataSize: Infinity,
- pauseStream: this.pauseStreams,
- });
- stream.on('data', this._checkDataSize.bind(this));
- stream = newStream;
+class StreamHandler extends AsyncResource {
+ constructor (opts, factory, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
}
- this._handleErrors(stream);
-
- if (this.pauseStreams) {
- stream.pause();
- }
- }
+ const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
- this._streams.push(stream);
- return this;
-};
+ try {
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
-CombinedStream.prototype.pipe = function(dest, options) {
- Stream.prototype.pipe.call(this, dest, options);
- this.resume();
- return dest;
-};
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('invalid factory')
+ }
-CombinedStream.prototype._getNext = function() {
- this._currentStream = null;
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
- if (this._insideLoop) {
- this._pendingNext = true;
- return; // defer call
- }
+ if (method === 'CONNECT') {
+ throw new InvalidArgumentError('invalid method')
+ }
- this._insideLoop = true;
- try {
- do {
- this._pendingNext = false;
- this._realGetNext();
- } while (this._pendingNext);
- } finally {
- this._insideLoop = false;
- }
-};
+ if (onInfo && typeof onInfo !== 'function') {
+ throw new InvalidArgumentError('invalid onInfo callback')
+ }
-CombinedStream.prototype._realGetNext = function() {
- var stream = this._streams.shift();
+ super('UNDICI_STREAM')
+ } catch (err) {
+ if (util.isStream(body)) {
+ util.destroy(body.on('error', util.nop), err)
+ }
+ throw err
+ }
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.factory = factory
+ this.callback = callback
+ this.res = null
+ this.abort = null
+ this.context = null
+ this.trailers = null
+ this.body = body
+ this.onInfo = onInfo || null
+ this.throwOnError = throwOnError || false
- if (typeof stream == 'undefined') {
- this.end();
- return;
- }
+ if (util.isStream(body)) {
+ body.on('error', (err) => {
+ this.onError(err)
+ })
+ }
- if (typeof stream !== 'function') {
- this._pipeNext(stream);
- return;
+ addSignal(this, signal)
}
- var getStream = stream;
- getStream(function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('data', this._checkDataSize.bind(this));
- this._handleErrors(stream);
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
}
- this._pipeNext(stream);
- }.bind(this));
-};
-
-CombinedStream.prototype._pipeNext = function(stream) {
- this._currentStream = stream;
+ assert(this.callback)
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('end', this._getNext.bind(this));
- stream.pipe(this, {end: false});
- return;
+ this.abort = abort
+ this.context = context
}
- var value = stream;
- this.write(value);
- this._getNext();
-};
-
-CombinedStream.prototype._handleErrors = function(stream) {
- var self = this;
- stream.on('error', function(err) {
- self._emitError(err);
- });
-};
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const { factory, opaque, context, callback, responseHeaders } = this
-CombinedStream.prototype.write = function(data) {
- this.emit('data', data);
-};
+ const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
-CombinedStream.prototype.pause = function() {
- if (!this.pauseStreams) {
- return;
- }
+ if (statusCode < 200) {
+ if (this.onInfo) {
+ this.onInfo({ statusCode, headers })
+ }
+ return
+ }
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
- this.emit('pause');
-};
+ this.factory = null
-CombinedStream.prototype.resume = function() {
- if (!this._released) {
- this._released = true;
- this.writable = true;
- this._getNext();
- }
+ let res
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
- this.emit('resume');
-};
+ if (this.throwOnError && statusCode >= 400) {
+ const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
+ const contentType = parsedHeaders['content-type']
+ res = new PassThrough()
-CombinedStream.prototype.end = function() {
- this._reset();
- this.emit('end');
-};
+ this.callback = null
+ this.runInAsyncScope(getResolveErrorBodyCallback, null,
+ { callback, body: res, contentType, statusCode, statusMessage, headers }
+ )
+ } else {
+ if (factory === null) {
+ return
+ }
-CombinedStream.prototype.destroy = function() {
- this._reset();
- this.emit('close');
-};
+ res = this.runInAsyncScope(factory, null, {
+ statusCode,
+ headers,
+ opaque,
+ context
+ })
-CombinedStream.prototype._reset = function() {
- this.writable = false;
- this._streams = [];
- this._currentStream = null;
-};
+ if (
+ !res ||
+ typeof res.write !== 'function' ||
+ typeof res.end !== 'function' ||
+ typeof res.on !== 'function'
+ ) {
+ throw new InvalidReturnValueError('expected Writable')
+ }
-CombinedStream.prototype._checkDataSize = function() {
- this._updateDataSize();
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
+ // TODO: Avoid finished. It registers an unnecessary amount of listeners.
+ finished(res, { readable: false }, (err) => {
+ const { callback, res, opaque, trailers, abort } = this
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
- this._emitError(new Error(message));
-};
+ this.res = null
+ if (err || !res.readable) {
+ util.destroy(res, err)
+ }
-CombinedStream.prototype._updateDataSize = function() {
- this.dataSize = 0;
+ this.callback = null
+ this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
- var self = this;
- this._streams.forEach(function(stream) {
- if (!stream.dataSize) {
- return;
+ if (err) {
+ abort()
+ }
+ })
}
- self.dataSize += stream.dataSize;
- });
-
- if (this._currentStream && this._currentStream.dataSize) {
- this.dataSize += this._currentStream.dataSize;
- }
-};
-
-CombinedStream.prototype._emitError = function(err) {
- this._reset();
- this.emit('error', err);
-};
-
-
-/***/ }),
-
-/***/ 8222:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-/* eslint-env browser */
-
-/**
- * This is the web browser implementation of `debug()`.
- */
+ res.on('drain', resume)
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.storage = localstorage();
-exports.destroy = (() => {
- let warned = false;
+ this.res = res
- return () => {
- if (!warned) {
- warned = true;
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
- };
-})();
+ const needDrain = res.writableNeedDrain !== undefined
+ ? res.writableNeedDrain
+ : res._writableState?.needDrain
-/**
- * Colors.
- */
+ return needDrain !== true
+ }
-exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
-];
+ onData (chunk) {
+ const { res } = this
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
+ return res ? res.write(chunk) : true
+ }
-// eslint-disable-next-line complexity
-function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
+ onComplete (trailers) {
+ const { res } = this
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
+ removeSignal(this)
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
-}
+ if (!res) {
+ return
+ }
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
+ this.trailers = util.parseHeaders(trailers)
-function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
+ res.end()
+ }
- if (!this.useColors) {
- return;
- }
+ onError (err) {
+ const { res, callback, opaque, body } = this
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
+ removeSignal(this)
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
+ this.factory = null
- args.splice(lastC, 0, c);
+ if (res) {
+ this.res = null
+ util.destroy(res, err)
+ } else if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
+
+ if (body) {
+ this.body = null
+ util.destroy(body, err)
+ }
+ }
}
-/**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
-exports.log = console.debug || console.log || (() => {});
+function stream (opts, factory, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ stream.call(this, opts, factory, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
+ try {
+ this.dispatch(opts, new StreamHandler(opts, factory, callback))
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
}
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
+module.exports = stream
- return r;
-}
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
+/***/ }),
-function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-}
+/***/ 1882:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = __nccwpck_require__(6243)(exports);
-const {formatters} = module.exports;
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
+const { InvalidArgumentError, SocketError } = __nccwpck_require__(8707)
+const { AsyncResource } = __nccwpck_require__(6698)
+const util = __nccwpck_require__(3440)
+const { addSignal, removeSignal } = __nccwpck_require__(158)
+const assert = __nccwpck_require__(4589)
-formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
-};
+class UpgradeHandler extends AsyncResource {
+ constructor (opts, callback) {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('invalid opts')
+ }
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
-/***/ }),
+ const { signal, opaque, responseHeaders } = opts
-/***/ 6243:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
+ throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ }
+ super('UNDICI_UPGRADE')
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- */
+ this.responseHeaders = responseHeaders || null
+ this.opaque = opaque || null
+ this.callback = callback
+ this.abort = null
+ this.context = null
-function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = __nccwpck_require__(900);
- createDebug.destroy = destroy;
+ addSignal(this, signal)
+ }
- Object.keys(env).forEach(key => {
- createDebug[key] = env[key];
- });
+ onConnect (abort, context) {
+ if (this.reason) {
+ abort(this.reason)
+ return
+ }
- /**
- * The currently active debug mode names, and names to skip.
- */
+ assert(this.callback)
- createDebug.names = [];
- createDebug.skips = [];
+ this.abort = abort
+ this.context = null
+ }
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
- createDebug.formatters = {};
+ onHeaders () {
+ throw new SocketError('bad upgrade', null)
+ }
- /**
- * Selects a color for a debug namespace
- * @param {String} namespace The namespace string for the debug instance to be colored
- * @return {Number|String} An ANSI color code for the given namespace
- * @api private
- */
- function selectColor(namespace) {
- let hash = 0;
+ onUpgrade (statusCode, rawHeaders, socket) {
+ assert(statusCode === 101)
- for (let i = 0; i < namespace.length; i++) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
+ const { callback, opaque, context } = this
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
+ removeSignal(this)
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
- function createDebug(namespace) {
- let prevTime;
- let enableOverride = null;
- let namespacesCache;
- let enabledCache;
+ this.callback = null
+ const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ this.runInAsyncScope(callback, null, null, {
+ headers,
+ socket,
+ opaque,
+ context
+ })
+ }
- function debug(...args) {
- // Disabled?
- if (!debug.enabled) {
- return;
- }
+ onError (err) {
+ const { callback, opaque } = this
- const self = debug;
+ removeSignal(this)
- // Set `diff` timestamp
- const curr = Number(new Date());
- const ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
+ if (callback) {
+ this.callback = null
+ queueMicrotask(() => {
+ this.runInAsyncScope(callback, null, err, { opaque })
+ })
+ }
+ }
+}
- args[0] = createDebug.coerce(args[0]);
+function upgrade (opts, callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ upgrade.call(this, opts, (err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
- if (typeof args[0] !== 'string') {
- // Anything else let's inspect with %O
- args.unshift('%O');
- }
+ try {
+ const upgradeHandler = new UpgradeHandler(opts, callback)
+ this.dispatch({
+ ...opts,
+ method: opts.method || 'GET',
+ upgrade: opts.protocol || 'Websocket'
+ }, upgradeHandler)
+ } catch (err) {
+ if (typeof callback !== 'function') {
+ throw err
+ }
+ const opaque = opts?.opaque
+ queueMicrotask(() => callback(err, { opaque }))
+ }
+}
- // Apply any `formatters` transformations
- let index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
- // If we encounter an escaped % then don't increase the array index
- if (match === '%%') {
- return '%';
- }
- index++;
- const formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- const val = args[index];
- match = formatter.call(self, val);
+module.exports = upgrade
- // Now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- // Apply env-specific formatting (colors, etc.)
- createDebug.formatArgs.call(self, args);
+/***/ }),
- const logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
+/***/ 6615:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- debug.namespace = namespace;
- debug.useColors = createDebug.useColors();
- debug.color = createDebug.selectColor(namespace);
- debug.extend = extend;
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
- Object.defineProperty(debug, 'enabled', {
- enumerable: true,
- configurable: false,
- get: () => {
- if (enableOverride !== null) {
- return enableOverride;
- }
- if (namespacesCache !== createDebug.namespaces) {
- namespacesCache = createDebug.namespaces;
- enabledCache = createDebug.enabled(namespace);
- }
- return enabledCache;
- },
- set: v => {
- enableOverride = v;
- }
- });
+module.exports.request = __nccwpck_require__(4043)
+module.exports.stream = __nccwpck_require__(3560)
+module.exports.pipeline = __nccwpck_require__(6862)
+module.exports.upgrade = __nccwpck_require__(1882)
+module.exports.connect = __nccwpck_require__(2279)
- // Env-specific initialization logic for debug instances
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
- return debug;
- }
+/***/ }),
- function extend(namespace, delimiter) {
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
+/***/ 9927:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.namespaces = namespaces;
+// Ported from https://github.com/nodejs/undici/pull/907
- createDebug.names = [];
- createDebug.skips = [];
- let i;
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- const len = split.length;
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- // ignore empty strings
- continue;
- }
+const assert = __nccwpck_require__(4589)
+const { Readable } = __nccwpck_require__(7075)
+const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { ReadableStreamFrom } = __nccwpck_require__(3440)
- namespaces = split[i].replace(/\*/g, '.*?');
+const kConsume = Symbol('kConsume')
+const kReading = Symbol('kReading')
+const kBody = Symbol('kBody')
+const kAbort = Symbol('kAbort')
+const kContentType = Symbol('kContentType')
+const kContentLength = Symbol('kContentLength')
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
+const noop = () => {}
- /**
- * Disable debug output.
- *
- * @return {String} namespaces
- * @api public
- */
- function disable() {
- const namespaces = [
- ...createDebug.names.map(toNamespace),
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
- ].join(',');
- createDebug.enable('');
- return namespaces;
- }
+class BodyReadable extends Readable {
+ constructor ({
+ resume,
+ abort,
+ contentType = '',
+ contentLength,
+ highWaterMark = 64 * 1024 // Same as nodejs fs streams.
+ }) {
+ super({
+ autoDestroy: true,
+ read: resume,
+ highWaterMark
+ })
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
+ this._readableState.dataEmitted = false
- let i;
- let len;
+ this[kAbort] = abort
+ this[kConsume] = null
+ this[kBody] = null
+ this[kContentType] = contentType
+ this[kContentLength] = contentLength
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
+ // Is stream being consumed through Readable API?
+ // This is an optimization so that we avoid checking
+ // for 'data' and 'readable' listeners in the hot path
+ // inside push().
+ this[kReading] = false
+ }
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
+ destroy (err) {
+ if (!err && !this._readableState.endEmitted) {
+ err = new RequestAbortedError()
+ }
- return false;
- }
+ if (err) {
+ this[kAbort]()
+ }
- /**
- * Convert regexp to namespace
- *
- * @param {RegExp} regxep
- * @return {String} namespace
- * @api private
- */
- function toNamespace(regexp) {
- return regexp.toString()
- .substring(2, regexp.toString().length - 2)
- .replace(/\.\*\?$/, '*');
- }
+ return super.destroy(err)
+ }
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
+ _destroy (err, callback) {
+ // Workaround for Node "bug". If the stream is destroyed in same
+ // tick as it is created, then a user who is waiting for a
+ // promise (i.e micro tick) for installing a 'error' listener will
+ // never get a chance and will always encounter an unhandled exception.
+ if (!this[kReading]) {
+ setImmediate(() => {
+ callback(err)
+ })
+ } else {
+ callback(err)
+ }
+ }
- /**
- * XXX DO NOT USE. This is a temporary stub function.
- * XXX It WILL be removed in the next major release.
- */
- function destroy() {
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
+ on (ev, ...args) {
+ if (ev === 'data' || ev === 'readable') {
+ this[kReading] = true
+ }
+ return super.on(ev, ...args)
+ }
- createDebug.enable(createDebug.load());
+ addListener (ev, ...args) {
+ return this.on(ev, ...args)
+ }
- return createDebug;
-}
+ off (ev, ...args) {
+ const ret = super.off(ev, ...args)
+ if (ev === 'data' || ev === 'readable') {
+ this[kReading] = (
+ this.listenerCount('data') > 0 ||
+ this.listenerCount('readable') > 0
+ )
+ }
+ return ret
+ }
-module.exports = setup;
+ removeListener (ev, ...args) {
+ return this.off(ev, ...args)
+ }
+ push (chunk) {
+ if (this[kConsume] && chunk !== null) {
+ consumePush(this[kConsume], chunk)
+ return this[kReading] ? super.push(chunk) : true
+ }
+ return super.push(chunk)
+ }
-/***/ }),
+ // https://fetch.spec.whatwg.org/#dom-body-text
+ async text () {
+ return consume(this, 'text')
+ }
-/***/ 8237:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // https://fetch.spec.whatwg.org/#dom-body-json
+ async json () {
+ return consume(this, 'json')
+ }
-/**
- * Detect Electron renderer / nwjs process, which is node, but we should
- * treat as a browser.
- */
+ // https://fetch.spec.whatwg.org/#dom-body-blob
+ async blob () {
+ return consume(this, 'blob')
+ }
-if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
- module.exports = __nccwpck_require__(8222);
-} else {
- module.exports = __nccwpck_require__(5332);
-}
+ // https://fetch.spec.whatwg.org/#dom-body-bytes
+ async bytes () {
+ return consume(this, 'bytes')
+ }
+ // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
+ async arrayBuffer () {
+ return consume(this, 'arrayBuffer')
+ }
-/***/ }),
+ // https://fetch.spec.whatwg.org/#dom-body-formdata
+ async formData () {
+ // TODO: Implement.
+ throw new NotSupportedError()
+ }
-/***/ 5332:
-/***/ ((module, exports, __nccwpck_require__) => {
+ // https://fetch.spec.whatwg.org/#dom-body-bodyused
+ get bodyUsed () {
+ return util.isDisturbed(this)
+ }
-/**
- * Module dependencies.
- */
+ // https://fetch.spec.whatwg.org/#dom-body-body
+ get body () {
+ if (!this[kBody]) {
+ this[kBody] = ReadableStreamFrom(this)
+ if (this[kConsume]) {
+ // TODO: Is this the best way to force a lock?
+ this[kBody].getReader() // Ensure stream is locked.
+ assert(this[kBody].locked)
+ }
+ }
+ return this[kBody]
+ }
-const tty = __nccwpck_require__(6224);
-const util = __nccwpck_require__(3837);
+ async dump (opts) {
+ let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024
+ const signal = opts?.signal
-/**
- * This is the Node.js implementation of `debug()`.
- */
+ if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) {
+ throw new InvalidArgumentError('signal must be an AbortSignal')
+ }
-exports.init = init;
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.destroy = util.deprecate(
- () => {},
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
-);
+ signal?.throwIfAborted()
-/**
- * Colors.
- */
+ if (this._readableState.closeEmitted) {
+ return null
+ }
-exports.colors = [6, 2, 3, 4, 5, 1];
+ return await new Promise((resolve, reject) => {
+ if (this[kContentLength] > limit) {
+ this.destroy(new AbortError())
+ }
-try {
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
- // eslint-disable-next-line import/no-extraneous-dependencies
- const supportsColor = __nccwpck_require__(9318);
+ const onAbort = () => {
+ this.destroy(signal.reason ?? new AbortError())
+ }
+ signal?.addEventListener('abort', onAbort)
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
-} catch (error) {
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+ this
+ .on('close', function () {
+ signal?.removeEventListener('abort', onAbort)
+ if (signal?.aborted) {
+ reject(signal.reason ?? new AbortError())
+ } else {
+ resolve(null)
+ }
+ })
+ .on('error', noop)
+ .on('data', function (chunk) {
+ limit -= chunk.length
+ if (limit <= 0) {
+ this.destroy()
+ }
+ })
+ .resume()
+ })
+ }
}
-/**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
+// https://streams.spec.whatwg.org/#readablestream-locked
+function isLocked (self) {
+ // Consume is an implicit lock.
+ return (self[kBody] && self[kBody].locked === true) || self[kConsume]
+}
-exports.inspectOpts = Object.keys(process.env).filter(key => {
- return /^debug_/i.test(key);
-}).reduce((obj, key) => {
- // Camel-case
- const prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
+// https://fetch.spec.whatwg.org/#body-unusable
+function isUnusable (self) {
+ return util.isDisturbed(self) || isLocked(self)
+}
- // Coerce string value into JS value
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === 'null') {
- val = null;
- } else {
- val = Number(val);
- }
+async function consume (stream, type) {
+ assert(!stream[kConsume])
- obj[prop] = val;
- return obj;
-}, {});
+ return new Promise((resolve, reject) => {
+ if (isUnusable(stream)) {
+ const rState = stream._readableState
+ if (rState.destroyed && rState.closeEmitted === false) {
+ stream
+ .on('error', err => {
+ reject(err)
+ })
+ .on('close', () => {
+ reject(new TypeError('unusable'))
+ })
+ } else {
+ reject(rState.errored ?? new TypeError('unusable'))
+ }
+ } else {
+ queueMicrotask(() => {
+ stream[kConsume] = {
+ type,
+ stream,
+ resolve,
+ reject,
+ length: 0,
+ body: []
+ }
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
+ stream
+ .on('error', function (err) {
+ consumeFinish(this[kConsume], err)
+ })
+ .on('close', function () {
+ if (this[kConsume].body !== null) {
+ consumeFinish(this[kConsume], new RequestAbortedError())
+ }
+ })
-function useColors() {
- return 'colors' in exports.inspectOpts ?
- Boolean(exports.inspectOpts.colors) :
- tty.isatty(process.stderr.fd);
+ consumeStart(stream[kConsume])
+ })
+ }
+ })
}
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
+function consumeStart (consume) {
+ if (consume.body === null) {
+ return
+ }
-function formatArgs(args) {
- const {namespace: name, useColors} = this;
+ const { _readableState: state } = consume.stream
- if (useColors) {
- const c = this.color;
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+ if (state.bufferIndex) {
+ const start = state.bufferIndex
+ const end = state.buffer.length
+ for (let n = start; n < end; n++) {
+ consumePush(consume, state.buffer[n])
+ }
+ } else {
+ for (const chunk of state.buffer) {
+ consumePush(consume, chunk)
+ }
+ }
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
-}
+ if (state.endEmitted) {
+ consumeEnd(this[kConsume])
+ } else {
+ consume.stream.on('end', function () {
+ consumeEnd(this[kConsume])
+ })
+ }
-function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- }
- return new Date().toISOString() + ' ';
+ consume.stream.resume()
+
+ while (consume.stream.read() != null) {
+ // Loop
+ }
}
/**
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+ * @param {Buffer[]} chunks
+ * @param {number} length
*/
+function chunksDecode (chunks, length) {
+ if (chunks.length === 0 || length === 0) {
+ return ''
+ }
+ const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length)
+ const bufferLength = buffer.length
-function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+ // Skip BOM.
+ const start =
+ bufferLength > 2 &&
+ buffer[0] === 0xef &&
+ buffer[1] === 0xbb &&
+ buffer[2] === 0xbf
+ ? 3
+ : 0
+ return buffer.utf8Slice(start, bufferLength)
}
/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
+ * @param {Buffer[]} chunks
+ * @param {number} length
+ * @returns {Uint8Array}
*/
-function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- }
-}
+function chunksConcat (chunks, length) {
+ if (chunks.length === 0 || length === 0) {
+ return new Uint8Array(0)
+ }
+ if (chunks.length === 1) {
+ // fast-path
+ return new Uint8Array(chunks[0])
+ }
+ const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer)
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
+ let offset = 0
+ for (let i = 0; i < chunks.length; ++i) {
+ const chunk = chunks[i]
+ buffer.set(chunk, offset)
+ offset += chunk.length
+ }
-function load() {
- return process.env.DEBUG;
+ return buffer
}
-/**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
+function consumeEnd (consume) {
+ const { type, body, resolve, stream, length } = consume
-function init(debug) {
- debug.inspectOpts = {};
+ try {
+ if (type === 'text') {
+ resolve(chunksDecode(body, length))
+ } else if (type === 'json') {
+ resolve(JSON.parse(chunksDecode(body, length)))
+ } else if (type === 'arrayBuffer') {
+ resolve(chunksConcat(body, length).buffer)
+ } else if (type === 'blob') {
+ resolve(new Blob(body, { type: stream[kContentType] }))
+ } else if (type === 'bytes') {
+ resolve(chunksConcat(body, length))
+ }
- const keys = Object.keys(exports.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
+ consumeFinish(consume)
+ } catch (err) {
+ stream.destroy(err)
+ }
}
-module.exports = __nccwpck_require__(6243)(exports);
-
-const {formatters} = module.exports;
+function consumePush (consume, chunk) {
+ consume.length += chunk.length
+ consume.body.push(chunk)
+}
-/**
- * Map %o to `util.inspect()`, all on a single line.
- */
+function consumeFinish (consume, err) {
+ if (consume.body === null) {
+ return
+ }
-formatters.o = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n')
- .map(str => str.trim())
- .join(' ');
-};
+ if (err) {
+ consume.reject(err)
+ } else {
+ consume.resolve()
+ }
-/**
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
- */
+ consume.type = null
+ consume.stream = null
+ consume.resolve = null
+ consume.reject = null
+ consume.length = 0
+ consume.body = null
+}
-formatters.O = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
-};
+module.exports = { Readable: BodyReadable, chunksDecode }
/***/ }),
-/***/ 8611:
+/***/ 7655:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var Stream = (__nccwpck_require__(2781).Stream);
-var util = __nccwpck_require__(3837);
+const assert = __nccwpck_require__(4589)
+const {
+ ResponseStatusCodeError
+} = __nccwpck_require__(8707)
-module.exports = DelayedStream;
-function DelayedStream() {
- this.source = null;
- this.dataSize = 0;
- this.maxDataSize = 1024 * 1024;
- this.pauseStream = true;
+const { chunksDecode } = __nccwpck_require__(9927)
+const CHUNK_LIMIT = 128 * 1024
- this._maxDataSizeExceeded = false;
- this._released = false;
- this._bufferedEvents = [];
-}
-util.inherits(DelayedStream, Stream);
+async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
+ assert(body)
-DelayedStream.create = function(source, options) {
- var delayedStream = new this();
+ let chunks = []
+ let length = 0
- options = options || {};
- for (var option in options) {
- delayedStream[option] = options[option];
+ try {
+ for await (const chunk of body) {
+ chunks.push(chunk)
+ length += chunk.length
+ if (length > CHUNK_LIMIT) {
+ chunks = []
+ length = 0
+ break
+ }
+ }
+ } catch {
+ chunks = []
+ length = 0
+ // Do nothing....
}
- delayedStream.source = source;
-
- var realEmit = source.emit;
- source.emit = function() {
- delayedStream._handleEmit(arguments);
- return realEmit.apply(source, arguments);
- };
+ const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`
- source.on('error', function() {});
- if (delayedStream.pauseStream) {
- source.pause();
+ if (statusCode === 204 || !contentType || !length) {
+ queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))
+ return
}
- return delayedStream;
-};
+ const stackTraceLimit = Error.stackTraceLimit
+ Error.stackTraceLimit = 0
+ let payload
-Object.defineProperty(DelayedStream.prototype, 'readable', {
- configurable: true,
- enumerable: true,
- get: function() {
- return this.source.readable;
+ try {
+ if (isContentTypeApplicationJson(contentType)) {
+ payload = JSON.parse(chunksDecode(chunks, length))
+ } else if (isContentTypeText(contentType)) {
+ payload = chunksDecode(chunks, length)
+ }
+ } catch {
+ // process in a callback to avoid throwing in the microtask queue
+ } finally {
+ Error.stackTraceLimit = stackTraceLimit
}
-});
-
-DelayedStream.prototype.setEncoding = function() {
- return this.source.setEncoding.apply(this.source, arguments);
-};
+ queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))
+}
-DelayedStream.prototype.resume = function() {
- if (!this._released) {
- this.release();
- }
+const isContentTypeApplicationJson = (contentType) => {
+ return (
+ contentType.length > 15 &&
+ contentType[11] === '/' &&
+ contentType[0] === 'a' &&
+ contentType[1] === 'p' &&
+ contentType[2] === 'p' &&
+ contentType[3] === 'l' &&
+ contentType[4] === 'i' &&
+ contentType[5] === 'c' &&
+ contentType[6] === 'a' &&
+ contentType[7] === 't' &&
+ contentType[8] === 'i' &&
+ contentType[9] === 'o' &&
+ contentType[10] === 'n' &&
+ contentType[12] === 'j' &&
+ contentType[13] === 's' &&
+ contentType[14] === 'o' &&
+ contentType[15] === 'n'
+ )
+}
- this.source.resume();
-};
+const isContentTypeText = (contentType) => {
+ return (
+ contentType.length > 4 &&
+ contentType[4] === '/' &&
+ contentType[0] === 't' &&
+ contentType[1] === 'e' &&
+ contentType[2] === 'x' &&
+ contentType[3] === 't'
+ )
+}
-DelayedStream.prototype.pause = function() {
- this.source.pause();
-};
+module.exports = {
+ getResolveErrorBodyCallback,
+ isContentTypeApplicationJson,
+ isContentTypeText
+}
-DelayedStream.prototype.release = function() {
- this._released = true;
- this._bufferedEvents.forEach(function(args) {
- this.emit.apply(this, args);
- }.bind(this));
- this._bufferedEvents = [];
-};
+/***/ }),
-DelayedStream.prototype.pipe = function() {
- var r = Stream.prototype.pipe.apply(this, arguments);
- this.resume();
- return r;
-};
+/***/ 9136:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-DelayedStream.prototype._handleEmit = function(args) {
- if (this._released) {
- this.emit.apply(this, args);
- return;
- }
- if (args[0] === 'data') {
- this.dataSize += args[1].length;
- this._checkIfMaxDataSizeExceeded();
- }
- this._bufferedEvents.push(args);
-};
+const net = __nccwpck_require__(7030)
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8707)
+const timers = __nccwpck_require__(6603)
-DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
- if (this._maxDataSizeExceeded) {
- return;
- }
+function noop () {}
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
+let tls // include tls conditionally since it is not always available
- this._maxDataSizeExceeded = true;
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
- this.emit('error', new Error(message));
-};
+// TODO: session re-use does not wait for the first
+// connection to resolve the session and might therefore
+// resolve the same servername multiple times even when
+// re-use is enabled.
+let SessionCache
+// FIXME: remove workaround when the Node bug is fixed
+// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
+if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) {
+ SessionCache = class WeakSessionCache {
+ constructor (maxCachedSessions) {
+ this._maxCachedSessions = maxCachedSessions
+ this._sessionCache = new Map()
+ this._sessionRegistry = new global.FinalizationRegistry((key) => {
+ if (this._sessionCache.size < this._maxCachedSessions) {
+ return
+ }
-/***/ }),
+ const ref = this._sessionCache.get(key)
+ if (ref !== undefined && ref.deref() === undefined) {
+ this._sessionCache.delete(key)
+ }
+ })
+ }
-/***/ 8932:
-/***/ ((__unused_webpack_module, exports) => {
+ get (sessionKey) {
+ const ref = this._sessionCache.get(sessionKey)
+ return ref ? ref.deref() : null
+ }
-"use strict";
+ set (sessionKey, session) {
+ if (this._maxCachedSessions === 0) {
+ return
+ }
+ this._sessionCache.set(sessionKey, new WeakRef(session))
+ this._sessionRegistry.register(session, sessionKey)
+ }
+ }
+} else {
+ SessionCache = class SimpleSessionCache {
+ constructor (maxCachedSessions) {
+ this._maxCachedSessions = maxCachedSessions
+ this._sessionCache = new Map()
+ }
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+ get (sessionKey) {
+ return this._sessionCache.get(sessionKey)
+ }
-class Deprecation extends Error {
- constructor(message) {
- super(message); // Maintains proper stack trace (only available on V8)
+ set (sessionKey, session) {
+ if (this._maxCachedSessions === 0) {
+ return
+ }
- /* istanbul ignore next */
+ if (this._sessionCache.size >= this._maxCachedSessions) {
+ // remove the oldest session
+ const { value: oldestKey } = this._sessionCache.keys().next()
+ this._sessionCache.delete(oldestKey)
+ }
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, this.constructor);
+ this._sessionCache.set(sessionKey, session)
}
-
- this.name = 'Deprecation';
}
-
}
-exports.Deprecation = Deprecation;
-
-
-/***/ }),
+function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
+ if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
+ throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
+ }
-/***/ 1848:
-/***/ ((module) => {
+ const options = { path: socketPath, ...opts }
+ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
+ timeout = timeout == null ? 10e3 : timeout
+ allowH2 = allowH2 != null ? allowH2 : false
+ return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
+ let socket
+ if (protocol === 'https:') {
+ if (!tls) {
+ tls = __nccwpck_require__(1692)
+ }
+ servername = servername || options.servername || util.getServerName(host) || null
-"use strict";
+ const sessionKey = servername || hostname
+ assert(sessionKey)
+ const session = customSession || sessionCache.get(sessionKey) || null
-var has = Object.prototype.hasOwnProperty
- , prefix = '~';
+ port = port || 443
-/**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
-function Events() {}
+ socket = tls.connect({
+ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
+ ...options,
+ servername,
+ session,
+ localAddress,
+ // TODO(HTTP/2): Add support for h2c
+ ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
+ socket: httpSocket, // upgrade socket connection
+ port,
+ host: hostname
+ })
-//
-// We try to not inherit from `Object.prototype`. In some engines creating an
-// instance in this way is faster than calling `Object.create(null)` directly.
-// If `Object.create(null)` is not supported we prefix the event names with a
-// character to make sure that the built-in object properties are not
-// overridden or used as an attack vector.
-//
-if (Object.create) {
- Events.prototype = Object.create(null);
+ socket
+ .on('session', function (session) {
+ // TODO (fix): Can a session become invalid once established? Don't think so?
+ sessionCache.set(sessionKey, session)
+ })
+ } else {
+ assert(!httpSocket, 'httpSocket can only be sent on TLS update')
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
-}
+ port = port || 80
-/**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
-function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
-}
+ socket = net.connect({
+ highWaterMark: 64 * 1024, // Same as nodejs fs streams.
+ ...options,
+ localAddress,
+ port,
+ host: hostname
+ })
+ }
-/**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
-function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
- }
+ // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
+ if (options.keepAlive == null || options.keepAlive) {
+ const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
+ socket.setKeepAlive(true, keepAliveInitialDelay)
+ }
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
+ const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port })
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
+ socket
+ .setNoDelay(true)
+ .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
+ queueMicrotask(clearConnectTimeout)
- return emitter;
-}
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb(null, this)
+ }
+ })
+ .on('error', function (err) {
+ queueMicrotask(clearConnectTimeout)
-/**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
-function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
-}
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb(err)
+ }
+ })
-/**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
-function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
+ return socket
+ }
}
/**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
+ * @param {WeakRef} socketWeakRef
+ * @param {object} opts
+ * @param {number} opts.timeout
+ * @param {string} opts.hostname
+ * @param {number} opts.port
+ * @returns {() => void}
*/
-EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
+const setupConnectTimeout = process.platform === 'win32'
+ ? (socketWeakRef, opts) => {
+ if (!opts.timeout) {
+ return noop
+ }
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
+ let s1 = null
+ let s2 = null
+ const fastTimer = timers.setFastTimeout(() => {
+ // setImmediate is added to make sure that we prioritize socket error events over timeouts
+ s1 = setImmediate(() => {
+ // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
+ s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))
+ })
+ }, opts.timeout)
+ return () => {
+ timers.clearFastTimeout(fastTimer)
+ clearImmediate(s1)
+ clearImmediate(s2)
+ }
+ }
+ : (socketWeakRef, opts) => {
+ if (!opts.timeout) {
+ return noop
+ }
- return names;
-};
+ let s1 = null
+ const fastTimer = timers.setFastTimeout(() => {
+ // setImmediate is added to make sure that we prioritize socket error events over timeouts
+ s1 = setImmediate(() => {
+ onConnectTimeout(socketWeakRef.deref(), opts)
+ })
+ }, opts.timeout)
+ return () => {
+ timers.clearFastTimeout(fastTimer)
+ clearImmediate(s1)
+ }
+ }
/**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
+ * @param {net.Socket} socket
+ * @param {object} opts
+ * @param {number} opts.timeout
+ * @param {string} opts.hostname
+ * @param {number} opts.port
*/
-EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
-
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
-
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
+function onConnectTimeout (socket, opts) {
+ // The socket could be already garbage collected
+ if (socket == null) {
+ return
}
- return ee;
-};
-
-/**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
-EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
-
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
-};
-
-/**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
-EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
+ let message = 'Connect Timeout Error'
+ if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
+ message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`
+ } else {
+ message += ` (attempted address: ${opts.hostname}:${opts.port},`
+ }
- if (!this._events[evt]) return false;
+ message += ` timeout: ${opts.timeout}ms)`
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
+ util.destroy(socket, new ConnectTimeoutError(message))
+}
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+module.exports = buildConnector
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
+/***/ }),
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
+/***/ 735:
+/***/ ((module) => {
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
+/** @type {Record} */
+const headerNameLowerCasedRecord = {}
- return true;
-};
+// https://developer.mozilla.org/docs/Web/HTTP/Headers
+const wellknownHeaderNames = [
+ 'Accept',
+ 'Accept-Encoding',
+ 'Accept-Language',
+ 'Accept-Ranges',
+ 'Access-Control-Allow-Credentials',
+ 'Access-Control-Allow-Headers',
+ 'Access-Control-Allow-Methods',
+ 'Access-Control-Allow-Origin',
+ 'Access-Control-Expose-Headers',
+ 'Access-Control-Max-Age',
+ 'Access-Control-Request-Headers',
+ 'Access-Control-Request-Method',
+ 'Age',
+ 'Allow',
+ 'Alt-Svc',
+ 'Alt-Used',
+ 'Authorization',
+ 'Cache-Control',
+ 'Clear-Site-Data',
+ 'Connection',
+ 'Content-Disposition',
+ 'Content-Encoding',
+ 'Content-Language',
+ 'Content-Length',
+ 'Content-Location',
+ 'Content-Range',
+ 'Content-Security-Policy',
+ 'Content-Security-Policy-Report-Only',
+ 'Content-Type',
+ 'Cookie',
+ 'Cross-Origin-Embedder-Policy',
+ 'Cross-Origin-Opener-Policy',
+ 'Cross-Origin-Resource-Policy',
+ 'Date',
+ 'Device-Memory',
+ 'Downlink',
+ 'ECT',
+ 'ETag',
+ 'Expect',
+ 'Expect-CT',
+ 'Expires',
+ 'Forwarded',
+ 'From',
+ 'Host',
+ 'If-Match',
+ 'If-Modified-Since',
+ 'If-None-Match',
+ 'If-Range',
+ 'If-Unmodified-Since',
+ 'Keep-Alive',
+ 'Last-Modified',
+ 'Link',
+ 'Location',
+ 'Max-Forwards',
+ 'Origin',
+ 'Permissions-Policy',
+ 'Pragma',
+ 'Proxy-Authenticate',
+ 'Proxy-Authorization',
+ 'RTT',
+ 'Range',
+ 'Referer',
+ 'Referrer-Policy',
+ 'Refresh',
+ 'Retry-After',
+ 'Sec-WebSocket-Accept',
+ 'Sec-WebSocket-Extensions',
+ 'Sec-WebSocket-Key',
+ 'Sec-WebSocket-Protocol',
+ 'Sec-WebSocket-Version',
+ 'Server',
+ 'Server-Timing',
+ 'Service-Worker-Allowed',
+ 'Service-Worker-Navigation-Preload',
+ 'Set-Cookie',
+ 'SourceMap',
+ 'Strict-Transport-Security',
+ 'Supports-Loading-Mode',
+ 'TE',
+ 'Timing-Allow-Origin',
+ 'Trailer',
+ 'Transfer-Encoding',
+ 'Upgrade',
+ 'Upgrade-Insecure-Requests',
+ 'User-Agent',
+ 'Vary',
+ 'Via',
+ 'WWW-Authenticate',
+ 'X-Content-Type-Options',
+ 'X-DNS-Prefetch-Control',
+ 'X-Frame-Options',
+ 'X-Permitted-Cross-Domain-Policies',
+ 'X-Powered-By',
+ 'X-Requested-With',
+ 'X-XSS-Protection'
+]
-/**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
-};
+for (let i = 0; i < wellknownHeaderNames.length; ++i) {
+ const key = wellknownHeaderNames[i]
+ const lowerCasedKey = key.toLowerCase()
+ headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
+ lowerCasedKey
+}
-/**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
-};
+// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
+Object.setPrototypeOf(headerNameLowerCasedRecord, null)
-/**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
+module.exports = {
+ wellknownHeaderNames,
+ headerNameLowerCasedRecord
+}
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
- var listeners = this._events[evt];
+/***/ }),
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
+/***/ 2414:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
- return this;
-};
+const diagnosticsChannel = __nccwpck_require__(3053)
+const util = __nccwpck_require__(7975)
+
+const undiciDebugLog = util.debuglog('undici')
+const fetchDebuglog = util.debuglog('fetch')
+const websocketDebuglog = util.debuglog('websocket')
+let isClientSet = false
+const channels = {
+ // Client
+ beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),
+ connected: diagnosticsChannel.channel('undici:client:connected'),
+ connectError: diagnosticsChannel.channel('undici:client:connectError'),
+ sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),
+ // Request
+ create: diagnosticsChannel.channel('undici:request:create'),
+ bodySent: diagnosticsChannel.channel('undici:request:bodySent'),
+ headers: diagnosticsChannel.channel('undici:request:headers'),
+ trailers: diagnosticsChannel.channel('undici:request:trailers'),
+ error: diagnosticsChannel.channel('undici:request:error'),
+ // WebSocket
+ open: diagnosticsChannel.channel('undici:websocket:open'),
+ close: diagnosticsChannel.channel('undici:websocket:close'),
+ socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),
+ ping: diagnosticsChannel.channel('undici:websocket:ping'),
+ pong: diagnosticsChannel.channel('undici:websocket:pong')
+}
+
+if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
+ const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog
+
+ // Track all Client events
+ diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connecting to %s using %s%s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version
+ )
+ })
-/**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
+ diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connected to %s using %s%s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version
+ )
+ })
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
+ diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host },
+ error
+ } = evt
+ debuglog(
+ 'connection to %s using %s%s errored - %s',
+ `${host}${port ? `:${port}` : ''}`,
+ protocol,
+ version,
+ error.message
+ )
+ })
- return this;
-};
+ diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('sending request to %s %s/%s', method, origin, path)
+ })
-//
-// Alias methods names because people roll like that.
-//
-EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+ // Track Request events
+ diagnosticsChannel.channel('undici:request:headers').subscribe(evt => {
+ const {
+ request: { method, path, origin },
+ response: { statusCode }
+ } = evt
+ debuglog(
+ 'received response to %s %s/%s - HTTP %d',
+ method,
+ origin,
+ path,
+ statusCode
+ )
+ })
-//
-// Expose the prefix.
-//
-EventEmitter.prefixed = prefix;
+ diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('trailers received from %s %s/%s', method, origin, path)
+ })
-//
-// Allow `EventEmitter` to be imported as module namespace.
-//
-EventEmitter.EventEmitter = EventEmitter;
+ diagnosticsChannel.channel('undici:request:error').subscribe(evt => {
+ const {
+ request: { method, path, origin },
+ error
+ } = evt
+ debuglog(
+ 'request to %s %s/%s errored - %s',
+ method,
+ origin,
+ path,
+ error.message
+ )
+ })
-//
-// Expose the module.
-//
-if (true) {
- module.exports = EventEmitter;
+ isClientSet = true
}
+if (websocketDebuglog.enabled) {
+ if (!isClientSet) {
+ const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog
+ diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connecting to %s%s using %s%s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version
+ )
+ })
-/***/ }),
-
-/***/ 1133:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ diagnosticsChannel.channel('undici:client:connected').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host }
+ } = evt
+ debuglog(
+ 'connected to %s%s using %s%s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version
+ )
+ })
-var debug;
+ diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => {
+ const {
+ connectParams: { version, protocol, port, host },
+ error
+ } = evt
+ debuglog(
+ 'connection to %s%s using %s%s errored - %s',
+ host,
+ port ? `:${port}` : '',
+ protocol,
+ version,
+ error.message
+ )
+ })
-module.exports = function () {
- if (!debug) {
- try {
- /* eslint global-require: off */
- debug = __nccwpck_require__(8237)("follow-redirects");
- }
- catch (error) { /* */ }
- if (typeof debug !== "function") {
- debug = function () { /* */ };
- }
+ diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => {
+ const {
+ request: { method, path, origin }
+ } = evt
+ debuglog('sending request to %s %s/%s', method, origin, path)
+ })
}
- debug.apply(null, arguments);
-};
+ // Track all WebSocket events
+ diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => {
+ const {
+ address: { address, port }
+ } = evt
+ websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '')
+ })
-/***/ }),
+ diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => {
+ const { websocket, code, reason } = evt
+ websocketDebuglog(
+ 'closed connection to %s - %s %s',
+ websocket.url,
+ code,
+ reason
+ )
+ })
-/***/ 7707:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => {
+ websocketDebuglog('connection errored - %s', err.message)
+ })
-var url = __nccwpck_require__(7310);
-var URL = url.URL;
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var Writable = (__nccwpck_require__(2781).Writable);
-var assert = __nccwpck_require__(9491);
-var debug = __nccwpck_require__(1133);
+ diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => {
+ websocketDebuglog('ping received')
+ })
-// Whether to use the native URL object or the legacy url module
-var useNativeURL = false;
-try {
- assert(new URL());
+ diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => {
+ websocketDebuglog('pong received')
+ })
}
-catch (error) {
- useNativeURL = error.code === "ERR_INVALID_URL";
+
+module.exports = {
+ channels
}
-// URL fields to preserve in copy operations
-var preservedUrlFields = [
- "auth",
- "host",
- "hostname",
- "href",
- "path",
- "pathname",
- "port",
- "protocol",
- "query",
- "search",
- "hash",
-];
-// Create handlers that pass events from native requests
-var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
-var eventHandlers = Object.create(null);
-events.forEach(function (event) {
- eventHandlers[event] = function (arg1, arg2, arg3) {
- this._redirectable.emit(event, arg1, arg2, arg3);
- };
-});
+/***/ }),
-// Error types with codes
-var InvalidUrlError = createErrorType(
- "ERR_INVALID_URL",
- "Invalid URL",
- TypeError
-);
-var RedirectionError = createErrorType(
- "ERR_FR_REDIRECTION_FAILURE",
- "Redirected request failed"
-);
-var TooManyRedirectsError = createErrorType(
- "ERR_FR_TOO_MANY_REDIRECTS",
- "Maximum number of redirects exceeded",
- RedirectionError
-);
-var MaxBodyLengthExceededError = createErrorType(
- "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
- "Request body larger than maxBodyLength limit"
-);
-var WriteAfterEndError = createErrorType(
- "ERR_STREAM_WRITE_AFTER_END",
- "write after end"
-);
+/***/ 8707:
+/***/ ((module) => {
-// istanbul ignore next
-var destroy = Writable.prototype.destroy || noop;
-// An HTTP(S) request that can be redirected
-function RedirectableRequest(options, responseCallback) {
- // Initialize the request
- Writable.call(this);
- this._sanitizeOptions(options);
- this._options = options;
- this._ended = false;
- this._ending = false;
- this._redirectCount = 0;
- this._redirects = [];
- this._requestBodyLength = 0;
- this._requestBodyBuffers = [];
- // Attach a callback if passed
- if (responseCallback) {
- this.on("response", responseCallback);
+const kUndiciError = Symbol.for('undici.error.UND_ERR')
+class UndiciError extends Error {
+ constructor (message) {
+ super(message)
+ this.name = 'UndiciError'
+ this.code = 'UND_ERR'
}
- // React to responses of native requests
- var self = this;
- this._onNativeResponse = function (response) {
- try {
- self._processResponse(response);
- }
- catch (cause) {
- self.emit("error", cause instanceof RedirectionError ?
- cause : new RedirectionError({ cause: cause }));
- }
- };
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kUndiciError] === true
+ }
- // Perform the first request
- this._performRequest();
+ [kUndiciError] = true
}
-RedirectableRequest.prototype = Object.create(Writable.prototype);
-
-RedirectableRequest.prototype.abort = function () {
- destroyRequest(this._currentRequest);
- this._currentRequest.abort();
- this.emit("abort");
-};
-
-RedirectableRequest.prototype.destroy = function (error) {
- destroyRequest(this._currentRequest, error);
- destroy.call(this, error);
- return this;
-};
-// Writes buffered data to the current native request
-RedirectableRequest.prototype.write = function (data, encoding, callback) {
- // Writing is not allowed if end has been called
- if (this._ending) {
- throw new WriteAfterEndError();
+const kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT')
+class ConnectTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ConnectTimeoutError'
+ this.message = message || 'Connect Timeout Error'
+ this.code = 'UND_ERR_CONNECT_TIMEOUT'
}
- // Validate input and shift parameters if necessary
- if (!isString(data) && !isBuffer(data)) {
- throw new TypeError("data should be a string, Buffer or Uint8Array");
- }
- if (isFunction(encoding)) {
- callback = encoding;
- encoding = null;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kConnectTimeoutError] === true
}
- // Ignore empty buffers, since writing them doesn't invoke the callback
- // https://github.com/nodejs/node/issues/22066
- if (data.length === 0) {
- if (callback) {
- callback();
- }
- return;
- }
- // Only write when we don't exceed the maximum body length
- if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
- this._requestBodyLength += data.length;
- this._requestBodyBuffers.push({ data: data, encoding: encoding });
- this._currentRequest.write(data, encoding, callback);
- }
- // Error when we exceed the maximum body length
- else {
- this.emit("error", new MaxBodyLengthExceededError());
- this.abort();
- }
-};
+ [kConnectTimeoutError] = true
+}
-// Ends the current native request
-RedirectableRequest.prototype.end = function (data, encoding, callback) {
- // Shift parameters if necessary
- if (isFunction(data)) {
- callback = data;
- data = encoding = null;
- }
- else if (isFunction(encoding)) {
- callback = encoding;
- encoding = null;
+const kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT')
+class HeadersTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'HeadersTimeoutError'
+ this.message = message || 'Headers Timeout Error'
+ this.code = 'UND_ERR_HEADERS_TIMEOUT'
}
- // Write data if needed and end
- if (!data) {
- this._ended = this._ending = true;
- this._currentRequest.end(null, null, callback);
- }
- else {
- var self = this;
- var currentRequest = this._currentRequest;
- this.write(data, encoding, function () {
- self._ended = true;
- currentRequest.end(null, null, callback);
- });
- this._ending = true;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHeadersTimeoutError] === true
}
-};
-
-// Sets a header value on the current native request
-RedirectableRequest.prototype.setHeader = function (name, value) {
- this._options.headers[name] = value;
- this._currentRequest.setHeader(name, value);
-};
-
-// Clears a header value on the current native request
-RedirectableRequest.prototype.removeHeader = function (name) {
- delete this._options.headers[name];
- this._currentRequest.removeHeader(name);
-};
-// Global timeout for all underlying requests
-RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
- var self = this;
+ [kHeadersTimeoutError] = true
+}
- // Destroys the socket on timeout
- function destroyOnTimeout(socket) {
- socket.setTimeout(msecs);
- socket.removeListener("timeout", socket.destroy);
- socket.addListener("timeout", socket.destroy);
+const kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW')
+class HeadersOverflowError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'HeadersOverflowError'
+ this.message = message || 'Headers Overflow Error'
+ this.code = 'UND_ERR_HEADERS_OVERFLOW'
}
- // Sets up a timer to trigger a timeout event
- function startTimer(socket) {
- if (self._timeout) {
- clearTimeout(self._timeout);
- }
- self._timeout = setTimeout(function () {
- self.emit("timeout");
- clearTimer();
- }, msecs);
- destroyOnTimeout(socket);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHeadersOverflowError] === true
}
- // Stops a timeout from triggering
- function clearTimer() {
- // Clear the timeout
- if (self._timeout) {
- clearTimeout(self._timeout);
- self._timeout = null;
- }
+ [kHeadersOverflowError] = true
+}
- // Clean up all attached listeners
- self.removeListener("abort", clearTimer);
- self.removeListener("error", clearTimer);
- self.removeListener("response", clearTimer);
- self.removeListener("close", clearTimer);
- if (callback) {
- self.removeListener("timeout", callback);
- }
- if (!self.socket) {
- self._currentRequest.removeListener("socket", startTimer);
- }
+const kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT')
+class BodyTimeoutError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'BodyTimeoutError'
+ this.message = message || 'Body Timeout Error'
+ this.code = 'UND_ERR_BODY_TIMEOUT'
}
- // Attach callback if passed
- if (callback) {
- this.on("timeout", callback);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kBodyTimeoutError] === true
}
- // Start the timer if or when the socket is opened
- if (this.socket) {
- startTimer(this.socket);
+ [kBodyTimeoutError] = true
+}
+
+const kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE')
+class ResponseStatusCodeError extends UndiciError {
+ constructor (message, statusCode, headers, body) {
+ super(message)
+ this.name = 'ResponseStatusCodeError'
+ this.message = message || 'Response Status Code Error'
+ this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
+ this.body = body
+ this.status = statusCode
+ this.statusCode = statusCode
+ this.headers = headers
}
- else {
- this._currentRequest.once("socket", startTimer);
+
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseStatusCodeError] === true
}
- // Clean up on events
- this.on("socket", destroyOnTimeout);
- this.on("abort", clearTimer);
- this.on("error", clearTimer);
- this.on("response", clearTimer);
- this.on("close", clearTimer);
+ [kResponseStatusCodeError] = true
+}
- return this;
-};
+const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG')
+class InvalidArgumentError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InvalidArgumentError'
+ this.message = message || 'Invalid Argument Error'
+ this.code = 'UND_ERR_INVALID_ARG'
+ }
-// Proxy all other public ClientRequest methods
-[
- "flushHeaders", "getHeader",
- "setNoDelay", "setSocketKeepAlive",
-].forEach(function (method) {
- RedirectableRequest.prototype[method] = function (a, b) {
- return this._currentRequest[method](a, b);
- };
-});
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInvalidArgumentError] === true
+ }
-// Proxy all public ClientRequest properties
-["aborted", "connection", "socket"].forEach(function (property) {
- Object.defineProperty(RedirectableRequest.prototype, property, {
- get: function () { return this._currentRequest[property]; },
- });
-});
+ [kInvalidArgumentError] = true
+}
-RedirectableRequest.prototype._sanitizeOptions = function (options) {
- // Ensure headers are always present
- if (!options.headers) {
- options.headers = {};
+const kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE')
+class InvalidReturnValueError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InvalidReturnValueError'
+ this.message = message || 'Invalid Return Value Error'
+ this.code = 'UND_ERR_INVALID_RETURN_VALUE'
}
- // Since http.request treats host as an alias of hostname,
- // but the url module interprets host as hostname plus port,
- // eliminate the host property to avoid confusion.
- if (options.host) {
- // Use hostname if set, because it has precedence
- if (!options.hostname) {
- options.hostname = options.host;
- }
- delete options.host;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInvalidReturnValueError] === true
}
- // Complete the URL object when necessary
- if (!options.pathname && options.path) {
- var searchPos = options.path.indexOf("?");
- if (searchPos < 0) {
- options.pathname = options.path;
- }
- else {
- options.pathname = options.path.substring(0, searchPos);
- options.search = options.path.substring(searchPos);
- }
- }
-};
+ [kInvalidReturnValueError] = true
+}
+const kAbortError = Symbol.for('undici.error.UND_ERR_ABORT')
+class AbortError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'AbortError'
+ this.message = message || 'The operation was aborted'
+ this.code = 'UND_ERR_ABORT'
+ }
-// Executes the next native request (initial or redirect)
-RedirectableRequest.prototype._performRequest = function () {
- // Load the native protocol
- var protocol = this._options.protocol;
- var nativeProtocol = this._options.nativeProtocols[protocol];
- if (!nativeProtocol) {
- throw new TypeError("Unsupported protocol " + protocol);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kAbortError] === true
}
- // If specified, use the agent corresponding to the protocol
- // (HTTP and HTTPS use different types of agents)
- if (this._options.agents) {
- var scheme = protocol.slice(0, -1);
- this._options.agent = this._options.agents[scheme];
+ [kAbortError] = true
+}
+
+const kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED')
+class RequestAbortedError extends AbortError {
+ constructor (message) {
+ super(message)
+ this.name = 'AbortError'
+ this.message = message || 'Request aborted'
+ this.code = 'UND_ERR_ABORTED'
}
- // Create the native request and set up its event handlers
- var request = this._currentRequest =
- nativeProtocol.request(this._options, this._onNativeResponse);
- request._redirectable = this;
- for (var event of events) {
- request.on(event, eventHandlers[event]);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestAbortedError] === true
}
- // RFC7230§5.3.1: When making a request directly to an origin server, […]
- // a client MUST send only the absolute path […] as the request-target.
- this._currentUrl = /^\//.test(this._options.path) ?
- url.format(this._options) :
- // When making a request to a proxy, […]
- // a client MUST send the target URI in absolute-form […].
- this._options.path;
+ [kRequestAbortedError] = true
+}
- // End a redirected request
- // (The first request must be ended explicitly with RedirectableRequest#end)
- if (this._isRedirect) {
- // Write the request entity and end
- var i = 0;
- var self = this;
- var buffers = this._requestBodyBuffers;
- (function writeNext(error) {
- // Only write if this request has not been redirected yet
- /* istanbul ignore else */
- if (request === self._currentRequest) {
- // Report any write errors
- /* istanbul ignore if */
- if (error) {
- self.emit("error", error);
- }
- // Write the next buffer if there are still left
- else if (i < buffers.length) {
- var buffer = buffers[i++];
- /* istanbul ignore else */
- if (!request.finished) {
- request.write(buffer.data, buffer.encoding, writeNext);
- }
- }
- // End the request if `end` has been called on us
- else if (self._ended) {
- request.end();
- }
- }
- }());
+const kInformationalError = Symbol.for('undici.error.UND_ERR_INFO')
+class InformationalError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'InformationalError'
+ this.message = message || 'Request information'
+ this.code = 'UND_ERR_INFO'
}
-};
-// Processes a response from the current native request
-RedirectableRequest.prototype._processResponse = function (response) {
- // Store the redirected response
- var statusCode = response.statusCode;
- if (this._options.trackRedirects) {
- this._redirects.push({
- url: this._currentUrl,
- headers: response.headers,
- statusCode: statusCode,
- });
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kInformationalError] === true
}
- // RFC7231§6.4: The 3xx (Redirection) class of status code indicates
- // that further action needs to be taken by the user agent in order to
- // fulfill the request. If a Location header field is provided,
- // the user agent MAY automatically redirect its request to the URI
- // referenced by the Location field value,
- // even if the specific status code is not understood.
+ [kInformationalError] = true
+}
- // If the response is not a redirect; return it as-is
- var location = response.headers.location;
- if (!location || this._options.followRedirects === false ||
- statusCode < 300 || statusCode >= 400) {
- response.responseUrl = this._currentUrl;
- response.redirects = this._redirects;
- this.emit("response", response);
+const kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH')
+class RequestContentLengthMismatchError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'RequestContentLengthMismatchError'
+ this.message = message || 'Request body length does not match content-length header'
+ this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
+ }
- // Clean up
- this._requestBodyBuffers = [];
- return;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestContentLengthMismatchError] === true
}
- // The response is a redirect, so abort the current request
- destroyRequest(this._currentRequest);
- // Discard the remainder of the response to avoid waiting for data
- response.destroy();
+ [kRequestContentLengthMismatchError] = true
+}
- // RFC7231§6.4: A client SHOULD detect and intervene
- // in cyclical redirections (i.e., "infinite" redirection loops).
- if (++this._redirectCount > this._options.maxRedirects) {
- throw new TooManyRedirectsError();
+const kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH')
+class ResponseContentLengthMismatchError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ResponseContentLengthMismatchError'
+ this.message = message || 'Response body length does not match content-length header'
+ this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
}
- // Store the request headers if applicable
- var requestHeaders;
- var beforeRedirect = this._options.beforeRedirect;
- if (beforeRedirect) {
- requestHeaders = Object.assign({
- // The Host header was set by nativeProtocol.request
- Host: response.req.getHeader("host"),
- }, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseContentLengthMismatchError] === true
}
- // RFC7231§6.4: Automatic redirection needs to done with
- // care for methods not known to be safe, […]
- // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
- // the request method from POST to GET for the subsequent request.
- var method = this._options.method;
- if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
- // RFC7231§6.4.4: The 303 (See Other) status code indicates that
- // the server is redirecting the user agent to a different resource […]
- // A user agent can perform a retrieval request targeting that URI
- // (a GET or HEAD request if using HTTP) […]
- (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
- this._options.method = "GET";
- // Drop a possible entity and headers related to it
- this._requestBodyBuffers = [];
- removeMatchingHeaders(/^content-/i, this._options.headers);
+ [kResponseContentLengthMismatchError] = true
+}
+
+const kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED')
+class ClientDestroyedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ClientDestroyedError'
+ this.message = message || 'The client is destroyed'
+ this.code = 'UND_ERR_DESTROYED'
}
- // Drop the Host header, as the redirect might lead to a different host
- var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kClientDestroyedError] === true
+ }
- // If the redirect is relative, carry over the host of the last request
- var currentUrlParts = parseUrl(this._currentUrl);
- var currentHost = currentHostHeader || currentUrlParts.host;
- var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
- url.format(Object.assign(currentUrlParts, { host: currentHost }));
+ [kClientDestroyedError] = true
+}
- // Create the redirected request
- var redirectUrl = resolveUrl(location, currentUrl);
- debug("redirecting to", redirectUrl.href);
- this._isRedirect = true;
- spreadUrlObject(redirectUrl, this._options);
+const kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED')
+class ClientClosedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ClientClosedError'
+ this.message = message || 'The client is closed'
+ this.code = 'UND_ERR_CLOSED'
+ }
- // Drop confidential headers when redirecting to a less secure protocol
- // or to a different domain that is not a superdomain
- if (redirectUrl.protocol !== currentUrlParts.protocol &&
- redirectUrl.protocol !== "https:" ||
- redirectUrl.host !== currentHost &&
- !isSubdomain(redirectUrl.host, currentHost)) {
- removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kClientClosedError] === true
}
- // Evaluate the beforeRedirect callback
- if (isFunction(beforeRedirect)) {
- var responseDetails = {
- headers: response.headers,
- statusCode: statusCode,
- };
- var requestDetails = {
- url: currentUrl,
- method: method,
- headers: requestHeaders,
- };
- beforeRedirect(this._options, responseDetails, requestDetails);
- this._sanitizeOptions(this._options);
+ [kClientClosedError] = true
+}
+
+const kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET')
+class SocketError extends UndiciError {
+ constructor (message, socket) {
+ super(message)
+ this.name = 'SocketError'
+ this.message = message || 'Socket error'
+ this.code = 'UND_ERR_SOCKET'
+ this.socket = socket
}
- // Perform the redirected request
- this._performRequest();
-};
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kSocketError] === true
+ }
-// Wraps the key/value object of protocols with redirect functionality
-function wrap(protocols) {
- // Default settings
- var exports = {
- maxRedirects: 21,
- maxBodyLength: 10 * 1024 * 1024,
- };
+ [kSocketError] = true
+}
- // Wrap each protocol
- var nativeProtocols = {};
- Object.keys(protocols).forEach(function (scheme) {
- var protocol = scheme + ":";
- var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
- var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
+const kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED')
+class NotSupportedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'NotSupportedError'
+ this.message = message || 'Not supported error'
+ this.code = 'UND_ERR_NOT_SUPPORTED'
+ }
- // Executes a request, following redirects
- function request(input, options, callback) {
- // Parse parameters, ensuring that input is an object
- if (isURL(input)) {
- input = spreadUrlObject(input);
- }
- else if (isString(input)) {
- input = spreadUrlObject(parseUrl(input));
- }
- else {
- callback = options;
- options = validateUrl(input);
- input = { protocol: protocol };
- }
- if (isFunction(options)) {
- callback = options;
- options = null;
- }
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kNotSupportedError] === true
+ }
- // Set defaults
- options = Object.assign({
- maxRedirects: exports.maxRedirects,
- maxBodyLength: exports.maxBodyLength,
- }, input, options);
- options.nativeProtocols = nativeProtocols;
- if (!isString(options.host) && !isString(options.hostname)) {
- options.hostname = "::1";
- }
+ [kNotSupportedError] = true
+}
- assert.equal(options.protocol, protocol, "protocol mismatch");
- debug("options", options);
- return new RedirectableRequest(options, callback);
- }
+const kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM')
+class BalancedPoolMissingUpstreamError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'MissingUpstreamError'
+ this.message = message || 'No upstream has been added to the BalancedPool'
+ this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
+ }
- // Executes a GET request, following redirects
- function get(input, options, callback) {
- var wrappedRequest = wrappedProtocol.request(input, options, callback);
- wrappedRequest.end();
- return wrappedRequest;
- }
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kBalancedPoolMissingUpstreamError] === true
+ }
- // Expose the properties on the wrapped protocol
- Object.defineProperties(wrappedProtocol, {
- request: { value: request, configurable: true, enumerable: true, writable: true },
- get: { value: get, configurable: true, enumerable: true, writable: true },
- });
- });
- return exports;
+ [kBalancedPoolMissingUpstreamError] = true
}
-function noop() { /* empty */ }
-
-function parseUrl(input) {
- var parsed;
- /* istanbul ignore else */
- if (useNativeURL) {
- parsed = new URL(input);
+const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')
+class HTTPParserError extends Error {
+ constructor (message, code, data) {
+ super(message)
+ this.name = 'HTTPParserError'
+ this.code = code ? `HPE_${code}` : undefined
+ this.data = data ? data.toString() : undefined
}
- else {
- // Ensure the URL is valid and absolute
- parsed = validateUrl(url.parse(input));
- if (!isString(parsed.protocol)) {
- throw new InvalidUrlError({ input });
- }
+
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kHTTPParserError] === true
}
- return parsed;
-}
-function resolveUrl(relative, base) {
- /* istanbul ignore next */
- return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
+ [kHTTPParserError] = true
}
-function validateUrl(input) {
- if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
- throw new InvalidUrlError({ input: input.href || input });
+const kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE')
+class ResponseExceededMaxSizeError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'ResponseExceededMaxSizeError'
+ this.message = message || 'Response content exceeded max size'
+ this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
}
- if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
- throw new InvalidUrlError({ input: input.href || input });
+
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseExceededMaxSizeError] === true
}
- return input;
+
+ [kResponseExceededMaxSizeError] = true
}
-function spreadUrlObject(urlObject, target) {
- var spread = target || {};
- for (var key of preservedUrlFields) {
- spread[key] = urlObject[key];
+const kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY')
+class RequestRetryError extends UndiciError {
+ constructor (message, code, { headers, data }) {
+ super(message)
+ this.name = 'RequestRetryError'
+ this.message = message || 'Request retry error'
+ this.code = 'UND_ERR_REQ_RETRY'
+ this.statusCode = code
+ this.data = data
+ this.headers = headers
}
- // Fix IPv6 hostname
- if (spread.hostname.startsWith("[")) {
- spread.hostname = spread.hostname.slice(1, -1);
- }
- // Ensure port is a number
- if (spread.port !== "") {
- spread.port = Number(spread.port);
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kRequestRetryError] === true
}
- // Concatenate path
- spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
- return spread;
+ [kRequestRetryError] = true
}
-function removeMatchingHeaders(regex, headers) {
- var lastValue;
- for (var header in headers) {
- if (regex.test(header)) {
- lastValue = headers[header];
- delete headers[header];
- }
+const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')
+class ResponseError extends UndiciError {
+ constructor (message, code, { headers, data }) {
+ super(message)
+ this.name = 'ResponseError'
+ this.message = message || 'Response error'
+ this.code = 'UND_ERR_RESPONSE'
+ this.statusCode = code
+ this.data = data
+ this.headers = headers
}
- return (lastValue === null || typeof lastValue === "undefined") ?
- undefined : String(lastValue).trim();
-}
-function createErrorType(code, message, baseClass) {
- // Create constructor
- function CustomError(properties) {
- Error.captureStackTrace(this, this.constructor);
- Object.assign(this, properties || {});
- this.code = code;
- this.message = this.cause ? message + ": " + this.cause.message : message;
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kResponseError] === true
}
- // Attach constructor and set default properties
- CustomError.prototype = new (baseClass || Error)();
- Object.defineProperties(CustomError.prototype, {
- constructor: {
- value: CustomError,
- enumerable: false,
- },
- name: {
- value: "Error [" + code + "]",
- enumerable: false,
- },
- });
- return CustomError;
+ [kResponseError] = true
}
-function destroyRequest(request, error) {
- for (var event of events) {
- request.removeListener(event, eventHandlers[event]);
+const kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS')
+class SecureProxyConnectionError extends UndiciError {
+ constructor (cause, message, options) {
+ super(message, { cause, ...(options ?? {}) })
+ this.name = 'SecureProxyConnectionError'
+ this.message = message || 'Secure Proxy Connection failed'
+ this.code = 'UND_ERR_PRX_TLS'
+ this.cause = cause
}
- request.on("error", noop);
- request.destroy(error);
-}
-function isSubdomain(subdomain, domain) {
- assert(isString(subdomain) && isString(domain));
- var dot = subdomain.length - domain.length - 1;
- return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
-}
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kSecureProxyConnectionError] === true
+ }
-function isString(value) {
- return typeof value === "string" || value instanceof String;
+ [kSecureProxyConnectionError] = true
}
-function isFunction(value) {
- return typeof value === "function";
-}
+const kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED')
+class MessageSizeExceededError extends UndiciError {
+ constructor (message) {
+ super(message)
+ this.name = 'MessageSizeExceededError'
+ this.message = message || 'Max decompressed message size exceeded'
+ this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'
+ }
-function isBuffer(value) {
- return typeof value === "object" && ("length" in value);
-}
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kMessageSizeExceededError] === true
+ }
-function isURL(value) {
- return URL && value instanceof URL;
+ get [kMessageSizeExceededError] () {
+ return true
+ }
}
-// Exports
-module.exports = wrap({ http: http, https: https });
-module.exports.wrap = wrap;
+module.exports = {
+ AbortError,
+ HTTPParserError,
+ UndiciError,
+ HeadersTimeoutError,
+ HeadersOverflowError,
+ BodyTimeoutError,
+ RequestContentLengthMismatchError,
+ ConnectTimeoutError,
+ ResponseStatusCodeError,
+ InvalidArgumentError,
+ InvalidReturnValueError,
+ RequestAbortedError,
+ ClientDestroyedError,
+ ClientClosedError,
+ InformationalError,
+ SocketError,
+ NotSupportedError,
+ ResponseContentLengthMismatchError,
+ BalancedPoolMissingUpstreamError,
+ ResponseExceededMaxSizeError,
+ RequestRetryError,
+ ResponseError,
+ SecureProxyConnectionError,
+ MessageSizeExceededError
+}
/***/ }),
-/***/ 4334:
+/***/ 4655:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var CombinedStream = __nccwpck_require__(5443);
-var util = __nccwpck_require__(3837);
-var path = __nccwpck_require__(1017);
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var parseUrl = (__nccwpck_require__(7310).parse);
-var fs = __nccwpck_require__(7147);
-var Stream = (__nccwpck_require__(2781).Stream);
-var mime = __nccwpck_require__(3583);
-var asynckit = __nccwpck_require__(4812);
-var populate = __nccwpck_require__(7142);
-
-// Public API
-module.exports = FormData;
-
-// make it a Stream
-util.inherits(FormData, CombinedStream);
-/**
- * Create readable "multipart/form-data" streams.
- * Can be used to submit forms
- * and file uploads to other web applications.
- *
- * @constructor
- * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
- */
-function FormData(options) {
- if (!(this instanceof FormData)) {
- return new FormData(options);
- }
- this._overheadLength = 0;
- this._valueLength = 0;
- this._valuesToMeasure = [];
+const {
+ InvalidArgumentError,
+ NotSupportedError
+} = __nccwpck_require__(8707)
+const assert = __nccwpck_require__(4589)
+const {
+ isValidHTTPToken,
+ isValidHeaderValue,
+ isStream,
+ destroy,
+ isBuffer,
+ isFormDataLike,
+ isIterable,
+ isBlobLike,
+ buildURL,
+ validateHandler,
+ getServerName,
+ normalizedMethodRecords
+} = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(735)
- CombinedStream.call(this);
+// Verifies that a given path is valid does not contain control chars \x00 to \x20
+const invalidPathRegex = /[^\u0021-\u00ff]/
- options = options || {};
- for (var option in options) {
- this[option] = options[option];
- }
-}
+const kHandler = Symbol('handler')
-FormData.LINE_BREAK = '\r\n';
-FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+class Request {
+ constructor (origin, {
+ path,
+ method,
+ body,
+ headers,
+ query,
+ idempotent,
+ blocking,
+ upgrade,
+ headersTimeout,
+ bodyTimeout,
+ reset,
+ throwOnError,
+ expectContinue,
+ servername
+ }, handler) {
+ if (typeof path !== 'string') {
+ throw new InvalidArgumentError('path must be a string')
+ } else if (
+ path[0] !== '/' &&
+ !(path.startsWith('http://') || path.startsWith('https://')) &&
+ method !== 'CONNECT'
+ ) {
+ throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
+ } else if (invalidPathRegex.test(path)) {
+ throw new InvalidArgumentError('invalid request path')
+ }
-FormData.prototype.append = function(field, value, options) {
+ if (typeof method !== 'string') {
+ throw new InvalidArgumentError('method must be a string')
+ } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {
+ throw new InvalidArgumentError('invalid request method')
+ }
- options = options || {};
+ if (upgrade && typeof upgrade !== 'string') {
+ throw new InvalidArgumentError('upgrade must be a string')
+ }
- // allow filename as single option
- if (typeof options == 'string') {
- options = {filename: options};
- }
+ if (upgrade && !isValidHeaderValue(upgrade)) {
+ throw new InvalidArgumentError('invalid upgrade header')
+ }
- var append = CombinedStream.prototype.append.bind(this);
+ if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
+ throw new InvalidArgumentError('invalid headersTimeout')
+ }
- // all that streamy business can't handle numbers
- if (typeof value == 'number') {
- value = '' + value;
- }
+ if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
+ throw new InvalidArgumentError('invalid bodyTimeout')
+ }
- // https://github.com/felixge/node-form-data/issues/38
- if (util.isArray(value)) {
- // Please convert your array into string
- // the way web server expects it
- this._error(new Error('Arrays are not supported.'));
- return;
- }
+ if (reset != null && typeof reset !== 'boolean') {
+ throw new InvalidArgumentError('invalid reset')
+ }
- var header = this._multiPartHeader(field, value, options);
- var footer = this._multiPartFooter();
+ if (expectContinue != null && typeof expectContinue !== 'boolean') {
+ throw new InvalidArgumentError('invalid expectContinue')
+ }
- append(header);
- append(value);
- append(footer);
+ this.headersTimeout = headersTimeout
- // pass along options.knownLength
- this._trackLength(header, value, options);
-};
+ this.bodyTimeout = bodyTimeout
-FormData.prototype._trackLength = function(header, value, options) {
- var valueLength = 0;
+ this.throwOnError = throwOnError === true
- // used w/ getLengthSync(), when length is known.
- // e.g. for streaming directly from a remote server,
- // w/ a known file a size, and not wanting to wait for
- // incoming file to finish to get its size.
- if (options.knownLength != null) {
- valueLength += +options.knownLength;
- } else if (Buffer.isBuffer(value)) {
- valueLength = value.length;
- } else if (typeof value === 'string') {
- valueLength = Buffer.byteLength(value);
- }
+ this.method = method
- this._valueLength += valueLength;
+ this.abort = null
- // @check why add CRLF? does this account for custom/multiple CRLFs?
- this._overheadLength +=
- Buffer.byteLength(header) +
- FormData.LINE_BREAK.length;
+ if (body == null) {
+ this.body = null
+ } else if (isStream(body)) {
+ this.body = body
- // empty or either doesn't have path or not an http response or not a stream
- if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {
- return;
- }
+ const rState = this.body._readableState
+ if (!rState || !rState.autoDestroy) {
+ this.endHandler = function autoDestroy () {
+ destroy(this)
+ }
+ this.body.on('end', this.endHandler)
+ }
- // no need to bother with the length
- if (!options.knownLength) {
- this._valuesToMeasure.push(value);
- }
-};
+ this.errorHandler = err => {
+ if (this.abort) {
+ this.abort(err)
+ } else {
+ this.error = err
+ }
+ }
+ this.body.on('error', this.errorHandler)
+ } else if (isBuffer(body)) {
+ this.body = body.byteLength ? body : null
+ } else if (ArrayBuffer.isView(body)) {
+ this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
+ } else if (body instanceof ArrayBuffer) {
+ this.body = body.byteLength ? Buffer.from(body) : null
+ } else if (typeof body === 'string') {
+ this.body = body.length ? Buffer.from(body) : null
+ } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {
+ this.body = body
+ } else {
+ throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
+ }
-FormData.prototype._lengthRetriever = function(value, callback) {
+ this.completed = false
- if (value.hasOwnProperty('fd')) {
+ this.aborted = false
- // take read range into a account
- // `end` = Infinity –> read file till the end
- //
- // TODO: Looks like there is bug in Node fs.createReadStream
- // it doesn't respect `end` options without `start` options
- // Fix it when node fixes it.
- // https://github.com/joyent/node/issues/7819
- if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+ this.upgrade = upgrade || null
- // when end specified
- // no need to calculate range
- // inclusive, starts with 0
- callback(null, value.end + 1 - (value.start ? value.start : 0));
+ this.path = query ? buildURL(path, query) : path
- // not that fast snoopy
- } else {
- // still need to fetch file size from fs
- fs.stat(value.path, function(err, stat) {
+ this.origin = origin
- var fileSize;
+ this.idempotent = idempotent == null
+ ? method === 'HEAD' || method === 'GET'
+ : idempotent
- if (err) {
- callback(err);
- return;
- }
+ this.blocking = blocking == null ? false : blocking
- // update final size based on the range options
- fileSize = stat.size - (value.start ? value.start : 0);
- callback(null, fileSize);
- });
- }
+ this.reset = reset == null ? null : reset
- // or http response
- } else if (value.hasOwnProperty('httpVersion')) {
- callback(null, +value.headers['content-length']);
+ this.host = null
- // or request stream http://github.com/mikeal/request
- } else if (value.hasOwnProperty('httpModule')) {
- // wait till response come back
- value.on('response', function(response) {
- value.pause();
- callback(null, +response.headers['content-length']);
- });
- value.resume();
+ this.contentLength = null
- // something else
- } else {
- callback('Unknown stream');
- }
-};
+ this.contentType = null
-FormData.prototype._multiPartHeader = function(field, value, options) {
- // custom header specified (as string)?
- // it becomes responsible for boundary
- // (e.g. to handle extra CRLFs on .NET servers)
- if (typeof options.header == 'string') {
- return options.header;
- }
+ this.headers = []
- var contentDisposition = this._getContentDisposition(value, options);
- var contentType = this._getContentType(value, options);
+ // Only for H2
+ this.expectContinue = expectContinue != null ? expectContinue : false
- var contents = '';
- var headers = {
- // add custom disposition as third element or keep it two elements if not
- 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
- // if no content type. allow it to be empty array
- 'Content-Type': [].concat(contentType || [])
- };
+ if (Array.isArray(headers)) {
+ if (headers.length % 2 !== 0) {
+ throw new InvalidArgumentError('headers array must be even')
+ }
+ for (let i = 0; i < headers.length; i += 2) {
+ processHeader(this, headers[i], headers[i + 1])
+ }
+ } else if (headers && typeof headers === 'object') {
+ if (headers[Symbol.iterator]) {
+ for (const header of headers) {
+ if (!Array.isArray(header) || header.length !== 2) {
+ throw new InvalidArgumentError('headers must be in key-value pair format')
+ }
+ processHeader(this, header[0], header[1])
+ }
+ } else {
+ const keys = Object.keys(headers)
+ for (let i = 0; i < keys.length; ++i) {
+ processHeader(this, keys[i], headers[keys[i]])
+ }
+ }
+ } else if (headers != null) {
+ throw new InvalidArgumentError('headers must be an object or an array')
+ }
- // allow custom headers.
- if (typeof options.header == 'object') {
- populate(headers, options.header);
- }
+ validateHandler(handler, method, upgrade)
- var header;
- for (var prop in headers) {
- if (!headers.hasOwnProperty(prop)) continue;
- header = headers[prop];
+ this.servername = servername || getServerName(this.host)
- // skip nullish headers.
- if (header == null) {
- continue;
- }
+ this[kHandler] = handler
- // convert all headers to arrays.
- if (!Array.isArray(header)) {
- header = [header];
+ if (channels.create.hasSubscribers) {
+ channels.create.publish({ request: this })
}
+ }
- // add non-empty headers.
- if (header.length) {
- contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
+ onBodySent (chunk) {
+ if (this[kHandler].onBodySent) {
+ try {
+ return this[kHandler].onBodySent(chunk)
+ } catch (err) {
+ this.abort(err)
+ }
}
}
- return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
-};
+ onRequestSent () {
+ if (channels.bodySent.hasSubscribers) {
+ channels.bodySent.publish({ request: this })
+ }
-FormData.prototype._getContentDisposition = function(value, options) {
+ if (this[kHandler].onRequestSent) {
+ try {
+ return this[kHandler].onRequestSent()
+ } catch (err) {
+ this.abort(err)
+ }
+ }
+ }
- var filename
- , contentDisposition
- ;
+ onConnect (abort) {
+ assert(!this.aborted)
+ assert(!this.completed)
- if (typeof options.filepath === 'string') {
- // custom filepath for relative paths
- filename = path.normalize(options.filepath).replace(/\\/g, '/');
- } else if (options.filename || value.name || value.path) {
- // custom filename take precedence
- // formidable and the browser add a name property
- // fs- and request- streams have path property
- filename = path.basename(options.filename || value.name || value.path);
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
- // or try http response
- filename = path.basename(value.client._httpMessage.path || '');
+ if (this.error) {
+ abort(this.error)
+ } else {
+ this.abort = abort
+ return this[kHandler].onConnect(abort)
+ }
}
- if (filename) {
- contentDisposition = 'filename="' + filename + '"';
+ onResponseStarted () {
+ return this[kHandler].onResponseStarted?.()
}
- return contentDisposition;
-};
-
-FormData.prototype._getContentType = function(value, options) {
+ onHeaders (statusCode, headers, resume, statusText) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // use custom content-type above all
- var contentType = options.contentType;
+ if (channels.headers.hasSubscribers) {
+ channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
+ }
- // or try `name` from formidable, browser
- if (!contentType && value.name) {
- contentType = mime.lookup(value.name);
+ try {
+ return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
+ } catch (err) {
+ this.abort(err)
+ }
}
- // or try `path` from fs-, request- streams
- if (!contentType && value.path) {
- contentType = mime.lookup(value.path);
- }
+ onData (chunk) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // or if it's http-reponse
- if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
- contentType = value.headers['content-type'];
+ try {
+ return this[kHandler].onData(chunk)
+ } catch (err) {
+ this.abort(err)
+ return false
+ }
}
- // or guess it from the filepath or filename
- if (!contentType && (options.filepath || options.filename)) {
- contentType = mime.lookup(options.filepath || options.filename);
- }
+ onUpgrade (statusCode, headers, socket) {
+ assert(!this.aborted)
+ assert(!this.completed)
- // fallback to the default content type if `value` is not simple value
- if (!contentType && typeof value == 'object') {
- contentType = FormData.DEFAULT_CONTENT_TYPE;
+ return this[kHandler].onUpgrade(statusCode, headers, socket)
}
- return contentType;
-};
+ onComplete (trailers) {
+ this.onFinally()
-FormData.prototype._multiPartFooter = function() {
- return function(next) {
- var footer = FormData.LINE_BREAK;
+ assert(!this.aborted)
- var lastPart = (this._streams.length === 0);
- if (lastPart) {
- footer += this._lastBoundary();
+ this.completed = true
+ if (channels.trailers.hasSubscribers) {
+ channels.trailers.publish({ request: this, trailers })
}
- next(footer);
- }.bind(this);
-};
-
-FormData.prototype._lastBoundary = function() {
- return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
-};
-
-FormData.prototype.getHeaders = function(userHeaders) {
- var header;
- var formHeaders = {
- 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
- };
-
- for (header in userHeaders) {
- if (userHeaders.hasOwnProperty(header)) {
- formHeaders[header.toLowerCase()] = userHeaders[header];
+ try {
+ return this[kHandler].onComplete(trailers)
+ } catch (err) {
+ // TODO (fix): This might be a bad idea?
+ this.onError(err)
}
}
- return formHeaders;
-};
-
-FormData.prototype.setBoundary = function(boundary) {
- this._boundary = boundary;
-};
-
-FormData.prototype.getBoundary = function() {
- if (!this._boundary) {
- this._generateBoundary();
- }
+ onError (error) {
+ this.onFinally()
- return this._boundary;
-};
+ if (channels.error.hasSubscribers) {
+ channels.error.publish({ request: this, error })
+ }
-FormData.prototype.getBuffer = function() {
- var dataBuffer = new Buffer.alloc( 0 );
- var boundary = this.getBoundary();
+ if (this.aborted) {
+ return
+ }
+ this.aborted = true
- // Create the form content. Add Line breaks to the end of data.
- for (var i = 0, len = this._streams.length; i < len; i++) {
- if (typeof this._streams[i] !== 'function') {
+ return this[kHandler].onError(error)
+ }
- // Add content to the buffer.
- if(Buffer.isBuffer(this._streams[i])) {
- dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);
- }else {
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);
- }
+ onFinally () {
+ if (this.errorHandler) {
+ this.body.off('error', this.errorHandler)
+ this.errorHandler = null
+ }
- // Add break after content.
- if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );
- }
+ if (this.endHandler) {
+ this.body.off('end', this.endHandler)
+ this.endHandler = null
}
}
- // Add the footer and return the Buffer object.
- return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );
-};
-
-FormData.prototype._generateBoundary = function() {
- // This generates a 50 character boundary similar to those used by Firefox.
- // They are optimized for boyer-moore parsing.
- var boundary = '--------------------------';
- for (var i = 0; i < 24; i++) {
- boundary += Math.floor(Math.random() * 10).toString(16);
+ addHeader (key, value) {
+ processHeader(this, key, value)
+ return this
}
+}
- this._boundary = boundary;
-};
+function processHeader (request, key, val) {
+ if (val && (typeof val === 'object' && !Array.isArray(val))) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ } else if (val === undefined) {
+ return
+ }
-// Note: getLengthSync DOESN'T calculate streams length
-// As workaround one can calculate file size manually
-// and add it as knownLength option
-FormData.prototype.getLengthSync = function() {
- var knownLength = this._overheadLength + this._valueLength;
+ let headerName = headerNameLowerCasedRecord[key]
- // Don't get confused, there are 3 "internal" streams for each keyval pair
- // so it basically checks if there is any value added to the form
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
+ if (headerName === undefined) {
+ headerName = key.toLowerCase()
+ if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {
+ throw new InvalidArgumentError('invalid header key')
+ }
}
- // https://github.com/form-data/form-data/issues/40
- if (!this.hasKnownLength()) {
- // Some async length retrievers are present
- // therefore synchronous length calculation is false.
- // Please use getLength(callback) to get proper length
- this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ if (Array.isArray(val)) {
+ const arr = []
+ for (let i = 0; i < val.length; i++) {
+ if (typeof val[i] === 'string') {
+ if (!isValidHeaderValue(val[i])) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ }
+ arr.push(val[i])
+ } else if (val[i] === null) {
+ arr.push('')
+ } else if (typeof val[i] === 'object') {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ } else {
+ arr.push(`${val[i]}`)
+ }
+ }
+ val = arr
+ } else if (typeof val === 'string') {
+ if (!isValidHeaderValue(val)) {
+ throw new InvalidArgumentError(`invalid ${key} header`)
+ }
+ } else if (val === null) {
+ val = ''
+ } else {
+ val = `${val}`
}
- return knownLength;
-};
-
-// Public API to check if length of added values is known
-// https://github.com/form-data/form-data/issues/196
-// https://github.com/form-data/form-data/issues/262
-FormData.prototype.hasKnownLength = function() {
- var hasKnownLength = true;
+ if (headerName === 'host') {
+ if (request.host !== null) {
+ throw new InvalidArgumentError('duplicate host header')
+ }
+ if (typeof val !== 'string') {
+ throw new InvalidArgumentError('invalid host header')
+ }
+ // Consumed by Client
+ request.host = val
+ } else if (headerName === 'content-length') {
+ if (request.contentLength !== null) {
+ throw new InvalidArgumentError('duplicate content-length header')
+ }
+ request.contentLength = parseInt(val, 10)
+ if (!Number.isFinite(request.contentLength)) {
+ throw new InvalidArgumentError('invalid content-length header')
+ }
+ } else if (request.contentType === null && headerName === 'content-type') {
+ request.contentType = val
+ request.headers.push(key, val)
+ } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {
+ throw new InvalidArgumentError(`invalid ${headerName} header`)
+ } else if (headerName === 'connection') {
+ const value = typeof val === 'string' ? val.toLowerCase() : null
+ if (value !== 'close' && value !== 'keep-alive') {
+ throw new InvalidArgumentError('invalid connection header')
+ }
- if (this._valuesToMeasure.length) {
- hasKnownLength = false;
+ if (value === 'close') {
+ request.reset = true
+ }
+ } else if (headerName === 'expect') {
+ throw new NotSupportedError('expect header not supported')
+ } else {
+ request.headers.push(key, val)
}
+}
- return hasKnownLength;
-};
-
-FormData.prototype.getLength = function(cb) {
- var knownLength = this._overheadLength + this._valueLength;
+module.exports = Request
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
- }
- if (!this._valuesToMeasure.length) {
- process.nextTick(cb.bind(this, null, knownLength));
- return;
- }
+/***/ }),
- asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
- if (err) {
- cb(err);
- return;
- }
+/***/ 6443:
+/***/ ((module) => {
- values.forEach(function(length) {
- knownLength += length;
- });
+module.exports = {
+ kClose: Symbol('close'),
+ kDestroy: Symbol('destroy'),
+ kDispatch: Symbol('dispatch'),
+ kUrl: Symbol('url'),
+ kWriting: Symbol('writing'),
+ kResuming: Symbol('resuming'),
+ kQueue: Symbol('queue'),
+ kConnect: Symbol('connect'),
+ kConnecting: Symbol('connecting'),
+ kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
+ kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
+ kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
+ kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
+ kKeepAlive: Symbol('keep alive'),
+ kHeadersTimeout: Symbol('headers timeout'),
+ kBodyTimeout: Symbol('body timeout'),
+ kServerName: Symbol('server name'),
+ kLocalAddress: Symbol('local address'),
+ kHost: Symbol('host'),
+ kNoRef: Symbol('no ref'),
+ kBodyUsed: Symbol('used'),
+ kBody: Symbol('abstracted request body'),
+ kRunning: Symbol('running'),
+ kBlocking: Symbol('blocking'),
+ kPending: Symbol('pending'),
+ kSize: Symbol('size'),
+ kBusy: Symbol('busy'),
+ kQueued: Symbol('queued'),
+ kFree: Symbol('free'),
+ kConnected: Symbol('connected'),
+ kClosed: Symbol('closed'),
+ kNeedDrain: Symbol('need drain'),
+ kReset: Symbol('reset'),
+ kDestroyed: Symbol.for('nodejs.stream.destroyed'),
+ kResume: Symbol('resume'),
+ kOnError: Symbol('on error'),
+ kMaxHeadersSize: Symbol('max headers size'),
+ kRunningIdx: Symbol('running index'),
+ kPendingIdx: Symbol('pending index'),
+ kError: Symbol('error'),
+ kClients: Symbol('clients'),
+ kClient: Symbol('client'),
+ kParser: Symbol('parser'),
+ kOnDestroyed: Symbol('destroy callbacks'),
+ kPipelining: Symbol('pipelining'),
+ kSocket: Symbol('socket'),
+ kHostHeader: Symbol('host header'),
+ kConnector: Symbol('connector'),
+ kStrictContentLength: Symbol('strict content length'),
+ kMaxRedirections: Symbol('maxRedirections'),
+ kMaxRequests: Symbol('maxRequestsPerClient'),
+ kProxy: Symbol('proxy agent options'),
+ kCounter: Symbol('socket request counter'),
+ kInterceptors: Symbol('dispatch interceptors'),
+ kMaxResponseSize: Symbol('max response size'),
+ kHTTP2Session: Symbol('http2Session'),
+ kHTTP2SessionState: Symbol('http2Session state'),
+ kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
+ kConstruct: Symbol('constructable'),
+ kListeners: Symbol('listeners'),
+ kHTTPContext: Symbol('http context'),
+ kMaxConcurrentStreams: Symbol('max concurrent streams'),
+ kNoProxyAgent: Symbol('no proxy agent'),
+ kHttpProxyAgent: Symbol('http proxy agent'),
+ kHttpsProxyAgent: Symbol('https proxy agent')
+}
- cb(null, knownLength);
- });
-};
-FormData.prototype.submit = function(params, cb) {
- var request
- , options
- , defaults = {method: 'post'}
- ;
+/***/ }),
- // parse provided url if it's string
- // or treat it as options object
- if (typeof params == 'string') {
+/***/ 7752:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- params = parseUrl(params);
- options = populate({
- port: params.port,
- path: params.pathname,
- host: params.hostname,
- protocol: params.protocol
- }, defaults);
- // use custom params
- } else {
- options = populate(params, defaults);
- // if no port provided use default one
- if (!options.port) {
- options.port = options.protocol == 'https:' ? 443 : 80;
+const {
+ wellknownHeaderNames,
+ headerNameLowerCasedRecord
+} = __nccwpck_require__(735)
+
+class TstNode {
+ /** @type {any} */
+ value = null
+ /** @type {null | TstNode} */
+ left = null
+ /** @type {null | TstNode} */
+ middle = null
+ /** @type {null | TstNode} */
+ right = null
+ /** @type {number} */
+ code
+ /**
+ * @param {string} key
+ * @param {any} value
+ * @param {number} index
+ */
+ constructor (key, value, index) {
+ if (index === undefined || index >= key.length) {
+ throw new TypeError('Unreachable')
+ }
+ const code = this.code = key.charCodeAt(index)
+ // check code is ascii string
+ if (code > 0x7F) {
+ throw new TypeError('key must be ascii string')
+ }
+ if (key.length !== ++index) {
+ this.middle = new TstNode(key, value, index)
+ } else {
+ this.value = value
}
}
- // put that good code in getHeaders to some use
- options.headers = this.getHeaders(params.headers);
-
- // https if specified, fallback to http in any other case
- if (options.protocol == 'https:') {
- request = https.request(options);
- } else {
- request = http.request(options);
+ /**
+ * @param {string} key
+ * @param {any} value
+ */
+ add (key, value) {
+ const length = key.length
+ if (length === 0) {
+ throw new TypeError('Unreachable')
+ }
+ let index = 0
+ let node = this
+ while (true) {
+ const code = key.charCodeAt(index)
+ // check code is ascii string
+ if (code > 0x7F) {
+ throw new TypeError('key must be ascii string')
+ }
+ if (node.code === code) {
+ if (length === ++index) {
+ node.value = value
+ break
+ } else if (node.middle !== null) {
+ node = node.middle
+ } else {
+ node.middle = new TstNode(key, value, index)
+ break
+ }
+ } else if (node.code < code) {
+ if (node.left !== null) {
+ node = node.left
+ } else {
+ node.left = new TstNode(key, value, index)
+ break
+ }
+ } else if (node.right !== null) {
+ node = node.right
+ } else {
+ node.right = new TstNode(key, value, index)
+ break
+ }
+ }
}
- // get content length and fire away
- this.getLength(function(err, length) {
- if (err && err !== 'Unknown stream') {
- this._error(err);
- return;
+ /**
+ * @param {Uint8Array} key
+ * @return {TstNode | null}
+ */
+ search (key) {
+ const keylength = key.length
+ let index = 0
+ let node = this
+ while (node !== null && index < keylength) {
+ let code = key[index]
+ // A-Z
+ // First check if it is bigger than 0x5a.
+ // Lowercase letters have higher char codes than uppercase ones.
+ // Also we assume that headers will mostly contain lowercase characters.
+ if (code <= 0x5a && code >= 0x41) {
+ // Lowercase for uppercase.
+ code |= 32
+ }
+ while (node !== null) {
+ if (code === node.code) {
+ if (keylength === ++index) {
+ // Returns Node since it is the last key.
+ return node
+ }
+ node = node.middle
+ break
+ }
+ node = node.code < code ? node.left : node.right
+ }
}
+ return null
+ }
+}
- // add content length
- if (length) {
- request.setHeader('Content-Length', length);
- }
+class TernarySearchTree {
+ /** @type {TstNode | null} */
+ node = null
- this.pipe(request);
- if (cb) {
- var onResponse;
+ /**
+ * @param {string} key
+ * @param {any} value
+ * */
+ insert (key, value) {
+ if (this.node === null) {
+ this.node = new TstNode(key, value, 0)
+ } else {
+ this.node.add(key, value)
+ }
+ }
- var callback = function (error, responce) {
- request.removeListener('error', callback);
- request.removeListener('response', onResponse);
+ /**
+ * @param {Uint8Array} key
+ * @return {any}
+ */
+ lookup (key) {
+ return this.node?.search(key)?.value ?? null
+ }
+}
- return cb.call(this, error, responce);
- };
+const tree = new TernarySearchTree()
- onResponse = callback.bind(this, null);
+for (let i = 0; i < wellknownHeaderNames.length; ++i) {
+ const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]]
+ tree.insert(key, key)
+}
- request.on('error', callback);
- request.on('response', onResponse);
- }
- }.bind(this));
+module.exports = {
+ TernarySearchTree,
+ tree
+}
- return request;
-};
-FormData.prototype._error = function(err) {
- if (!this.error) {
- this.error = err;
- this.pause();
- this.emit('error', err);
- }
-};
+/***/ }),
-FormData.prototype.toString = function () {
- return '[object FormData]';
-};
+/***/ 3440:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/***/ }),
-/***/ 7142:
-/***/ ((module) => {
+const assert = __nccwpck_require__(4589)
+const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(6443)
+const { IncomingMessage } = __nccwpck_require__(7067)
+const stream = __nccwpck_require__(7075)
+const net = __nccwpck_require__(7030)
+const { Blob } = __nccwpck_require__(4573)
+const nodeUtil = __nccwpck_require__(7975)
+const { stringify } = __nccwpck_require__(1792)
+const { EventEmitter: EE } = __nccwpck_require__(8474)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { headerNameLowerCasedRecord } = __nccwpck_require__(735)
+const { tree } = __nccwpck_require__(7752)
-// populates missing values
-module.exports = function(dst, src) {
+const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
- Object.keys(src).forEach(function(prop)
- {
- dst[prop] = dst[prop] || src[prop];
- });
+class BodyAsyncIterable {
+ constructor (body) {
+ this[kBody] = body
+ this[kBodyUsed] = false
+ }
- return dst;
-};
+ async * [Symbol.asyncIterator] () {
+ assert(!this[kBodyUsed], 'disturbed')
+ this[kBodyUsed] = true
+ yield * this[kBody]
+ }
+}
+function wrapRequestBody (body) {
+ if (isStream(body)) {
+ // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
+ // so that it can be dispatched again?
+ // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
+ if (bodyLength(body) === 0) {
+ body
+ .on('data', function () {
+ assert(false)
+ })
+ }
-/***/ }),
+ if (typeof body.readableDidRead !== 'boolean') {
+ body[kBodyUsed] = false
+ EE.prototype.on.call(body, 'data', function () {
+ this[kBodyUsed] = true
+ })
+ }
-/***/ 1621:
-/***/ ((module) => {
+ return body
+ } else if (body && typeof body.pipeTo === 'function') {
+ // TODO (fix): We can't access ReadableStream internal state
+ // to determine whether or not it has been disturbed. This is just
+ // a workaround.
+ return new BodyAsyncIterable(body)
+ } else if (
+ body &&
+ typeof body !== 'string' &&
+ !ArrayBuffer.isView(body) &&
+ isIterable(body)
+ ) {
+ // TODO: Should we allow re-using iterable if !this.opts.idempotent
+ // or through some other flag?
+ return new BodyAsyncIterable(body)
+ } else {
+ return body
+ }
+}
-"use strict";
+function nop () {}
-module.exports = (flag, argv) => {
- argv = argv || process.argv;
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
- const pos = argv.indexOf(prefix + flag);
- const terminatorPos = argv.indexOf('--');
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
-};
+function isStream (obj) {
+ return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
+}
+// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
+function isBlobLike (object) {
+ if (object === null) {
+ return false
+ } else if (object instanceof Blob) {
+ return true
+ } else if (typeof object !== 'object') {
+ return false
+ } else {
+ const sTag = object[Symbol.toStringTag]
-/***/ }),
+ return (sTag === 'Blob' || sTag === 'File') && (
+ ('stream' in object && typeof object.stream === 'function') ||
+ ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')
+ )
+ }
+}
-/***/ 4293:
-/***/ ((module) => {
+function buildURL (url, queryParams) {
+ if (url.includes('?') || url.includes('#')) {
+ throw new Error('Query params cannot be passed when url already contains "?" or "#".')
+ }
-// https://github.com/electron/electron/issues/2288
-function isElectron() {
- // Renderer process
- if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
- return true;
- }
+ const stringified = stringify(queryParams)
- // Main process
- if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
- return true;
- }
+ if (stringified) {
+ url += '?' + stringified
+ }
- // Detect the user agent when the `nodeIntegration` option is set to false
- if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
- return true;
- }
+ return url
+}
- return false;
+function isValidPort (port) {
+ const value = parseInt(port, 10)
+ return (
+ value === Number(port) &&
+ value >= 0 &&
+ value <= 65535
+ )
}
-module.exports = isElectron;
+function isHttpOrHttpsPrefixed (value) {
+ return (
+ value != null &&
+ value[0] === 'h' &&
+ value[1] === 't' &&
+ value[2] === 't' &&
+ value[3] === 'p' &&
+ (
+ value[4] === ':' ||
+ (
+ value[4] === 's' &&
+ value[5] === ':'
+ )
+ )
+ )
+}
+function parseURL (url) {
+ if (typeof url === 'string') {
+ url = new URL(url)
-/***/ }),
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
-/***/ 1554:
-/***/ ((module) => {
+ return url
+ }
-"use strict";
+ if (!url || typeof url !== 'object') {
+ throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
+ }
+ if (!(url instanceof URL)) {
+ if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {
+ throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
+ }
-const isStream = stream =>
- stream !== null &&
- typeof stream === 'object' &&
- typeof stream.pipe === 'function';
+ if (url.path != null && typeof url.path !== 'string') {
+ throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
+ }
-isStream.writable = stream =>
- isStream(stream) &&
- stream.writable !== false &&
- typeof stream._write === 'function' &&
- typeof stream._writableState === 'object';
+ if (url.pathname != null && typeof url.pathname !== 'string') {
+ throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
+ }
-isStream.readable = stream =>
- isStream(stream) &&
- stream.readable !== false &&
- typeof stream._read === 'function' &&
- typeof stream._readableState === 'object';
+ if (url.hostname != null && typeof url.hostname !== 'string') {
+ throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
+ }
-isStream.duplex = stream =>
- isStream.writable(stream) &&
- isStream.readable(stream);
+ if (url.origin != null && typeof url.origin !== 'string') {
+ throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
+ }
-isStream.transform = stream =>
- isStream.duplex(stream) &&
- typeof stream._transform === 'function';
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
-module.exports = isStream;
+ const port = url.port != null
+ ? url.port
+ : (url.protocol === 'https:' ? 443 : 80)
+ let origin = url.origin != null
+ ? url.origin
+ : `${url.protocol || ''}//${url.hostname || ''}:${port}`
+ let path = url.path != null
+ ? url.path
+ : `${url.pathname || ''}${url.search || ''}`
+ if (origin[origin.length - 1] === '/') {
+ origin = origin.slice(0, origin.length - 1)
+ }
-/***/ }),
+ if (path && path[0] !== '/') {
+ path = `/${path}`
+ }
+ // new URL(path, origin) is unsafe when `path` contains an absolute URL
+ // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
+ // If first parameter is a relative URL, second param is required, and will be used as the base URL.
+ // If first parameter is an absolute URL, a given second param will be ignored.
+ return new URL(`${origin}${path}`)
+ }
-/***/ 7426:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
+ throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
+ }
-/*!
- * mime-db
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
- * MIT Licensed
- */
+ return url
+}
-/**
- * Module exports.
- */
+function parseOrigin (url) {
+ url = parseURL(url)
-module.exports = __nccwpck_require__(3765)
+ if (url.pathname !== '/' || url.search || url.hash) {
+ throw new InvalidArgumentError('invalid url')
+ }
+ return url
+}
-/***/ }),
+function getHostname (host) {
+ if (host[0] === '[') {
+ const idx = host.indexOf(']')
-/***/ 3583:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ assert(idx !== -1)
+ return host.substring(1, idx)
+ }
-"use strict";
-/*!
- * mime-types
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */
+ const idx = host.indexOf(':')
+ if (idx === -1) return host
+ return host.substring(0, idx)
+}
+// IP addresses are not valid server names per RFC6066
+// > Currently, the only server names supported are DNS hostnames
+function getServerName (host) {
+ if (!host) {
+ return null
+ }
-/**
- * Module dependencies.
- * @private
- */
+ assert(typeof host === 'string')
-var db = __nccwpck_require__(7426)
-var extname = (__nccwpck_require__(1017).extname)
+ const servername = getHostname(host)
+ if (net.isIP(servername)) {
+ return ''
+ }
-/**
- * Module variables.
- * @private
- */
+ return servername
+}
-var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
-var TEXT_TYPE_REGEXP = /^text\//i
+function deepClone (obj) {
+ return JSON.parse(JSON.stringify(obj))
+}
-/**
- * Module exports.
- * @public
- */
+function isAsyncIterable (obj) {
+ return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
+}
-exports.charset = charset
-exports.charsets = { lookup: charset }
-exports.contentType = contentType
-exports.extension = extension
-exports.extensions = Object.create(null)
-exports.lookup = lookup
-exports.types = Object.create(null)
+function isIterable (obj) {
+ return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
+}
-// Populate the extensions/types maps
-populateMaps(exports.extensions, exports.types)
+function bodyLength (body) {
+ if (body == null) {
+ return 0
+ } else if (isStream(body)) {
+ const state = body._readableState
+ return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
+ ? state.length
+ : null
+ } else if (isBlobLike(body)) {
+ return body.size != null ? body.size : null
+ } else if (isBuffer(body)) {
+ return body.byteLength
+ }
-/**
- * Get the default charset for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
- */
+ return null
+}
-function charset (type) {
- if (!type || typeof type !== 'string') {
- return false
+function isDestroyed (body) {
+ return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))
+}
+
+function destroy (stream, err) {
+ if (stream == null || !isStream(stream) || isDestroyed(stream)) {
+ return
}
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
- var mime = match && db[match[1].toLowerCase()]
+ if (typeof stream.destroy === 'function') {
+ if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
+ // See: https://github.com/nodejs/node/pull/38505/files
+ stream.socket = null
+ }
- if (mime && mime.charset) {
- return mime.charset
+ stream.destroy(err)
+ } else if (err) {
+ queueMicrotask(() => {
+ stream.emit('error', err)
+ })
}
- // default text/* to utf-8
- if (match && TEXT_TYPE_REGEXP.test(match[1])) {
- return 'UTF-8'
+ if (stream.destroyed !== true) {
+ stream[kDestroyed] = true
}
+}
- return false
+const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
+function parseKeepAliveTimeout (val) {
+ const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
+ return m ? parseInt(m[1], 10) * 1000 : null
}
/**
- * Create a full Content-Type header given a MIME type or extension.
- *
- * @param {string} str
- * @return {boolean|string}
+ * Retrieves a header name and returns its lowercase value.
+ * @param {string | Buffer} value Header name
+ * @returns {string}
*/
+function headerNameToString (value) {
+ return typeof value === 'string'
+ ? headerNameLowerCasedRecord[value] ?? value.toLowerCase()
+ : tree.lookup(value) ?? value.toString('latin1').toLowerCase()
+}
-function contentType (str) {
- // TODO: should this even be in this module?
- if (!str || typeof str !== 'string') {
- return false
- }
+/**
+ * Receive the buffer as a string and return its lowercase value.
+ * @param {Buffer} value Header name
+ * @returns {string}
+ */
+function bufferToLowerCasedHeaderName (value) {
+ return tree.lookup(value) ?? value.toString('latin1').toLowerCase()
+}
- var mime = str.indexOf('/') === -1
- ? exports.lookup(str)
- : str
+/**
+ * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers
+ * @param {Record} [obj]
+ * @returns {Record}
+ */
+function parseHeaders (headers, obj) {
+ if (obj === undefined) obj = {}
+ for (let i = 0; i < headers.length; i += 2) {
+ const key = headerNameToString(headers[i])
+ let val = obj[key]
- if (!mime) {
- return false
+ if (val) {
+ if (typeof val === 'string') {
+ val = [val]
+ obj[key] = val
+ }
+ val.push(headers[i + 1].toString('utf8'))
+ } else {
+ const headersValue = headers[i + 1]
+ if (typeof headersValue === 'string') {
+ obj[key] = headersValue
+ } else {
+ obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')
+ }
+ }
}
- // TODO: use content-type or other module
- if (mime.indexOf('charset') === -1) {
- var charset = exports.charset(mime)
- if (charset) mime += '; charset=' + charset.toLowerCase()
+ // See https://github.com/nodejs/node/pull/46528
+ if ('content-length' in obj && 'content-disposition' in obj) {
+ obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
}
- return mime
+ return obj
}
-/**
- * Get the default extension for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
- */
+function parseRawHeaders (headers) {
+ const len = headers.length
+ const ret = new Array(len)
-function extension (type) {
- if (!type || typeof type !== 'string') {
- return false
- }
+ let hasContentLength = false
+ let contentDispositionIdx = -1
+ let key
+ let val
+ let kLen = 0
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
+ for (let n = 0; n < headers.length; n += 2) {
+ key = headers[n]
+ val = headers[n + 1]
- // get extensions
- var exts = match && exports.extensions[match[1].toLowerCase()]
+ typeof key !== 'string' && (key = key.toString())
+ typeof val !== 'string' && (val = val.toString('utf8'))
- if (!exts || !exts.length) {
- return false
+ kLen = key.length
+ if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
+ hasContentLength = true
+ } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
+ contentDispositionIdx = n + 1
+ }
+ ret[n] = key
+ ret[n + 1] = val
}
- return exts[0]
+ // See https://github.com/nodejs/node/pull/46528
+ if (hasContentLength && contentDispositionIdx !== -1) {
+ ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
+ }
+
+ return ret
}
-/**
- * Lookup the MIME type for a file path/extension.
- *
- * @param {string} path
- * @return {boolean|string}
- */
+function isBuffer (buffer) {
+ // See, https://github.com/mcollina/undici/pull/319
+ return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
+}
-function lookup (path) {
- if (!path || typeof path !== 'string') {
- return false
+function validateHandler (handler, method, upgrade) {
+ if (!handler || typeof handler !== 'object') {
+ throw new InvalidArgumentError('handler must be an object')
}
- // get the extension ("ext" or ".ext" or full path)
- var extension = extname('x.' + path)
- .toLowerCase()
- .substr(1)
-
- if (!extension) {
- return false
+ if (typeof handler.onConnect !== 'function') {
+ throw new InvalidArgumentError('invalid onConnect method')
}
- return exports.types[extension] || false
-}
-
-/**
- * Populate the extensions and types maps.
- * @private
- */
+ if (typeof handler.onError !== 'function') {
+ throw new InvalidArgumentError('invalid onError method')
+ }
-function populateMaps (extensions, types) {
- // source preference (least -> most)
- var preference = ['nginx', 'apache', undefined, 'iana']
+ if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
+ throw new InvalidArgumentError('invalid onBodySent method')
+ }
- Object.keys(db).forEach(function forEachMimeType (type) {
- var mime = db[type]
- var exts = mime.extensions
+ if (upgrade || method === 'CONNECT') {
+ if (typeof handler.onUpgrade !== 'function') {
+ throw new InvalidArgumentError('invalid onUpgrade method')
+ }
+ } else {
+ if (typeof handler.onHeaders !== 'function') {
+ throw new InvalidArgumentError('invalid onHeaders method')
+ }
- if (!exts || !exts.length) {
- return
+ if (typeof handler.onData !== 'function') {
+ throw new InvalidArgumentError('invalid onData method')
}
- // mime -> extensions
- extensions[type] = exts
+ if (typeof handler.onComplete !== 'function') {
+ throw new InvalidArgumentError('invalid onComplete method')
+ }
+ }
+}
- // extension -> mime
- for (var i = 0; i < exts.length; i++) {
- var extension = exts[i]
+// A body is disturbed if it has been read from and it cannot
+// be re-used without losing state or data.
+function isDisturbed (body) {
+ // TODO (fix): Why is body[kBodyUsed] needed?
+ return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))
+}
- if (types[extension]) {
- var from = preference.indexOf(db[types[extension]].source)
- var to = preference.indexOf(mime.source)
+function isErrored (body) {
+ return !!(body && stream.isErrored(body))
+}
- if (types[extension] !== 'application/octet-stream' &&
- (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
- // skip the remapping
- continue
- }
- }
+function isReadable (body) {
+ return !!(body && stream.isReadable(body))
+}
- // set the extension -> mime
- types[extension] = type
- }
- })
+function getSocketInfo (socket) {
+ return {
+ localAddress: socket.localAddress,
+ localPort: socket.localPort,
+ remoteAddress: socket.remoteAddress,
+ remotePort: socket.remotePort,
+ remoteFamily: socket.remoteFamily,
+ timeout: socket.timeout,
+ bytesWritten: socket.bytesWritten,
+ bytesRead: socket.bytesRead
+ }
}
+/** @type {globalThis['ReadableStream']} */
+function ReadableStreamFrom (iterable) {
+ // We cannot use ReadableStream.from here because it does not return a byte stream.
-/***/ }),
+ let iterator
+ return new ReadableStream(
+ {
+ async start () {
+ iterator = iterable[Symbol.asyncIterator]()
+ },
+ async pull (controller) {
+ const { done, value } = await iterator.next()
+ if (done) {
+ queueMicrotask(() => {
+ controller.close()
+ controller.byobRequest?.respond(0)
+ })
+ } else {
+ const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
+ if (buf.byteLength) {
+ controller.enqueue(new Uint8Array(buf))
+ }
+ }
+ return controller.desiredSize > 0
+ },
+ async cancel (reason) {
+ await iterator.return()
+ },
+ type: 'bytes'
+ }
+ )
+}
-/***/ 900:
-/***/ ((module) => {
+// The chunk should be a FormData instance and contains
+// all the required methods.
+function isFormDataLike (object) {
+ return (
+ object &&
+ typeof object === 'object' &&
+ typeof object.append === 'function' &&
+ typeof object.delete === 'function' &&
+ typeof object.get === 'function' &&
+ typeof object.getAll === 'function' &&
+ typeof object.has === 'function' &&
+ typeof object.set === 'function' &&
+ object[Symbol.toStringTag] === 'FormData'
+ )
+}
-/**
- * Helpers.
- */
+function addAbortListener (signal, listener) {
+ if ('addEventListener' in signal) {
+ signal.addEventListener('abort', listener, { once: true })
+ return () => signal.removeEventListener('abort', listener)
+ }
+ signal.addListener('abort', listener)
+ return () => signal.removeListener('abort', listener)
+}
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var w = d * 7;
-var y = d * 365.25;
+const hasToWellFormed = typeof String.prototype.toWellFormed === 'function'
+const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'
/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
+ * @param {string} val
*/
-
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
+function toUSVString (val) {
+ return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)
+}
/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
+ * @param {string} val
*/
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
+// TODO: move this to webidl
+function isUSVString (val) {
+ return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`
}
/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
+ * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
+ * @param {number} c
*/
-
-function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
+function isTokenCharCode (c) {
+ switch (c) {
+ case 0x22:
+ case 0x28:
+ case 0x29:
+ case 0x2c:
+ case 0x2f:
+ case 0x3a:
+ case 0x3b:
+ case 0x3c:
+ case 0x3d:
+ case 0x3e:
+ case 0x3f:
+ case 0x40:
+ case 0x5b:
+ case 0x5c:
+ case 0x5d:
+ case 0x7b:
+ case 0x7d:
+ // DQUOTE and "(),/:;<=>?@[\]{}"
+ return false
+ default:
+ // VCHAR %x21-7E
+ return c >= 0x21 && c <= 0x7e
}
- return ms + 'ms';
}
/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
+ * @param {string} characters
*/
-
-function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
+function isValidHTTPToken (characters) {
+ if (characters.length === 0) {
+ return false
}
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
+ for (let i = 0; i < characters.length; ++i) {
+ if (!isTokenCharCode(characters.charCodeAt(i))) {
+ return false
+ }
}
- return ms + ' ms';
+ return true
}
+// headerCharRegex have been lifted from
+// https://github.com/nodejs/node/blob/main/lib/_http_common.js
+
/**
- * Pluralization helper.
+ * Matches if val contains an invalid field-vchar
+ * field-value = *( field-content / obs-fold )
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+ * field-vchar = VCHAR / obs-text
*/
+const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
-function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+/**
+ * @param {string} characters
+ */
+function isValidHeaderValue (characters) {
+ return !headerCharRegex.test(characters)
}
+// Parsed accordingly to RFC 9110
+// https://www.rfc-editor.org/rfc/rfc9110#field.content-range
+function parseRangeHeader (range) {
+ if (range == null || range === '') return { start: 0, end: null, size: null }
-/***/ }),
+ const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
+ return m
+ ? {
+ start: parseInt(m[1]),
+ end: m[2] ? parseInt(m[2]) : null,
+ size: m[3] ? parseInt(m[3]) : null
+ }
+ : null
+}
-/***/ 1223:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function addListener (obj, name, listener) {
+ const listeners = (obj[kListeners] ??= [])
+ listeners.push([name, listener])
+ obj.on(name, listener)
+ return obj
+}
-var wrappy = __nccwpck_require__(2940)
-module.exports = wrappy(once)
-module.exports.strict = wrappy(onceStrict)
+function removeAllListeners (obj) {
+ for (const [name, listener] of obj[kListeners] ?? []) {
+ obj.removeListener(name, listener)
+ }
+ obj[kListeners] = null
+}
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
+function errorRequest (client, request, err) {
+ try {
+ request.onError(err)
+ assert(request.aborted)
+ } catch (err) {
+ client.emit('error', err)
+ }
+}
- Object.defineProperty(Function.prototype, 'onceStrict', {
- value: function () {
- return onceStrict(this)
- },
- configurable: true
- })
-})
+const kEnumerableProperty = Object.create(null)
+kEnumerableProperty.enumerable = true
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
+const normalizedMethodRecordsBase = {
+ delete: 'DELETE',
+ DELETE: 'DELETE',
+ get: 'GET',
+ GET: 'GET',
+ head: 'HEAD',
+ HEAD: 'HEAD',
+ options: 'OPTIONS',
+ OPTIONS: 'OPTIONS',
+ post: 'POST',
+ POST: 'POST',
+ put: 'PUT',
+ PUT: 'PUT'
}
-function onceStrict (fn) {
- var f = function () {
- if (f.called)
- throw new Error(f.onceError)
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- var name = fn.name || 'Function wrapped with `once`'
- f.onceError = name + " shouldn't be called more than once"
- f.called = false
- return f
+const normalizedMethodRecords = {
+ ...normalizedMethodRecordsBase,
+ patch: 'patch',
+ PATCH: 'PATCH'
}
+// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
+Object.setPrototypeOf(normalizedMethodRecordsBase, null)
+Object.setPrototypeOf(normalizedMethodRecords, null)
-/***/ }),
+module.exports = {
+ kEnumerableProperty,
+ nop,
+ isDisturbed,
+ isErrored,
+ isReadable,
+ toUSVString,
+ isUSVString,
+ isBlobLike,
+ parseOrigin,
+ parseURL,
+ getServerName,
+ isStream,
+ isIterable,
+ isAsyncIterable,
+ isDestroyed,
+ headerNameToString,
+ bufferToLowerCasedHeaderName,
+ addListener,
+ removeAllListeners,
+ errorRequest,
+ parseRawHeaders,
+ parseHeaders,
+ parseKeepAliveTimeout,
+ destroy,
+ bodyLength,
+ deepClone,
+ ReadableStreamFrom,
+ isBuffer,
+ validateHandler,
+ getSocketInfo,
+ isFormDataLike,
+ buildURL,
+ addAbortListener,
+ isValidHTTPToken,
+ isValidHeaderValue,
+ isTokenCharCode,
+ parseRangeHeader,
+ normalizedMethodRecordsBase,
+ normalizedMethodRecords,
+ isValidPort,
+ isHttpOrHttpsPrefixed,
+ nodeMajor,
+ nodeMinor,
+ safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],
+ wrapRequestBody
+}
-/***/ 1330:
-/***/ ((module) => {
-"use strict";
+/***/ }),
-module.exports = (promise, onFinally) => {
- onFinally = onFinally || (() => {});
+/***/ 7405:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return promise.then(
- val => new Promise(resolve => {
- resolve(onFinally());
- }).then(() => val),
- err => new Promise(resolve => {
- resolve(onFinally());
- }).then(() => {
- throw err;
- })
- );
-};
-/***/ }),
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443)
+const DispatcherBase = __nccwpck_require__(1841)
+const Pool = __nccwpck_require__(628)
+const Client = __nccwpck_require__(3701)
+const util = __nccwpck_require__(3440)
+const createRedirectInterceptor = __nccwpck_require__(5092)
-/***/ 8983:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+const kOnConnect = Symbol('onConnect')
+const kOnDisconnect = Symbol('onDisconnect')
+const kOnConnectionError = Symbol('onConnectionError')
+const kMaxRedirections = Symbol('maxRedirections')
+const kOnDrain = Symbol('onDrain')
+const kFactory = Symbol('factory')
+const kOptions = Symbol('options')
-"use strict";
+function defaultFactory (origin, opts) {
+ return opts && opts.connections === 1
+ ? new Client(origin, opts)
+ : new Pool(origin, opts)
+}
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const EventEmitter = __nccwpck_require__(4924);
-const p_timeout_1 = __nccwpck_require__(6424);
-const priority_queue_1 = __nccwpck_require__(8492);
-// eslint-disable-next-line @typescript-eslint/no-empty-function
-const empty = () => { };
-const timeoutError = new p_timeout_1.TimeoutError();
-/**
-Promise queue with concurrency control.
-*/
-class PQueue extends EventEmitter {
- constructor(options) {
- var _a, _b, _c, _d;
- super();
- this._intervalCount = 0;
- this._intervalEnd = 0;
- this._pendingCount = 0;
- this._resolveEmpty = empty;
- this._resolveIdle = empty;
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
- options = Object.assign({ carryoverConcurrencyCount: false, intervalCap: Infinity, interval: 0, concurrency: Infinity, autoStart: true, queueClass: priority_queue_1.default }, options);
- if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`);
- }
- if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`);
- }
- this._carryoverConcurrencyCount = options.carryoverConcurrencyCount;
- this._isIntervalIgnored = options.intervalCap === Infinity || options.interval === 0;
- this._intervalCap = options.intervalCap;
- this._interval = options.interval;
- this._queue = new options.queueClass();
- this._queueClass = options.queueClass;
- this.concurrency = options.concurrency;
- this._timeout = options.timeout;
- this._throwOnTimeout = options.throwOnTimeout === true;
- this._isPaused = options.autoStart === false;
- }
- get _doesIntervalAllowAnother() {
- return this._isIntervalIgnored || this._intervalCount < this._intervalCap;
- }
- get _doesConcurrentAllowAnother() {
- return this._pendingCount < this._concurrency;
- }
- _next() {
- this._pendingCount--;
- this._tryToStartAnother();
- this.emit('next');
- }
- _resolvePromises() {
- this._resolveEmpty();
- this._resolveEmpty = empty;
- if (this._pendingCount === 0) {
- this._resolveIdle();
- this._resolveIdle = empty;
- this.emit('idle');
- }
- }
- _onResumeInterval() {
- this._onInterval();
- this._initializeIntervalIfNeeded();
- this._timeoutId = undefined;
- }
- _isIntervalPaused() {
- const now = Date.now();
- if (this._intervalId === undefined) {
- const delay = this._intervalEnd - now;
- if (delay < 0) {
- // Act as the interval was done
- // We don't need to resume it here because it will be resumed on line 160
- this._intervalCount = (this._carryoverConcurrencyCount) ? this._pendingCount : 0;
- }
- else {
- // Act as the interval is pending
- if (this._timeoutId === undefined) {
- this._timeoutId = setTimeout(() => {
- this._onResumeInterval();
- }, delay);
- }
- return true;
- }
- }
- return false;
- }
- _tryToStartAnother() {
- if (this._queue.size === 0) {
- // We can clear the interval ("pause")
- // Because we can redo it later ("resume")
- if (this._intervalId) {
- clearInterval(this._intervalId);
- }
- this._intervalId = undefined;
- this._resolvePromises();
- return false;
- }
- if (!this._isPaused) {
- const canInitializeInterval = !this._isIntervalPaused();
- if (this._doesIntervalAllowAnother && this._doesConcurrentAllowAnother) {
- const job = this._queue.dequeue();
- if (!job) {
- return false;
- }
- this.emit('active');
- job();
- if (canInitializeInterval) {
- this._initializeIntervalIfNeeded();
- }
- return true;
- }
- }
- return false;
- }
- _initializeIntervalIfNeeded() {
- if (this._isIntervalIgnored || this._intervalId !== undefined) {
- return;
- }
- this._intervalId = setInterval(() => {
- this._onInterval();
- }, this._interval);
- this._intervalEnd = Date.now() + this._interval;
- }
- _onInterval() {
- if (this._intervalCount === 0 && this._pendingCount === 0 && this._intervalId) {
- clearInterval(this._intervalId);
- this._intervalId = undefined;
- }
- this._intervalCount = this._carryoverConcurrencyCount ? this._pendingCount : 0;
- this._processQueue();
- }
- /**
- Executes all queued functions until it reaches the limit.
- */
- _processQueue() {
- // eslint-disable-next-line no-empty
- while (this._tryToStartAnother()) { }
- }
- get concurrency() {
- return this._concurrency;
- }
- set concurrency(newConcurrency) {
- if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {
- throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
- }
- this._concurrency = newConcurrency;
- this._processQueue();
- }
- /**
- Adds a sync or async task to the queue. Always returns a promise.
- */
- async add(fn, options = {}) {
- return new Promise((resolve, reject) => {
- const run = async () => {
- this._pendingCount++;
- this._intervalCount++;
- try {
- const operation = (this._timeout === undefined && options.timeout === undefined) ? fn() : p_timeout_1.default(Promise.resolve(fn()), (options.timeout === undefined ? this._timeout : options.timeout), () => {
- if (options.throwOnTimeout === undefined ? this._throwOnTimeout : options.throwOnTimeout) {
- reject(timeoutError);
- }
- return undefined;
- });
- resolve(await operation);
- }
- catch (error) {
- reject(error);
- }
- this._next();
- };
- this._queue.enqueue(run, options);
- this._tryToStartAnother();
- this.emit('add');
- });
+class Agent extends DispatcherBase {
+ constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
}
- /**
- Same as `.add()`, but accepts an array of sync or async functions.
- @returns A promise that resolves when all functions are resolved.
- */
- async addAll(functions, options) {
- return Promise.all(functions.map(async (function_) => this.add(function_, options)));
- }
- /**
- Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
- */
- start() {
- if (!this._isPaused) {
- return this;
- }
- this._isPaused = false;
- this._processQueue();
- return this;
- }
- /**
- Put queue execution on hold.
- */
- pause() {
- this._isPaused = true;
- }
- /**
- Clear the queue.
- */
- clear() {
- this._queue = new this._queueClass();
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
}
- /**
- Can be called multiple times. Useful if you for example add additional items at a later time.
- @returns A promise that settles when the queue becomes empty.
- */
- async onEmpty() {
- // Instantly resolve if the queue is empty
- if (this._queue.size === 0) {
- return;
- }
- return new Promise(resolve => {
- const existingResolve = this._resolveEmpty;
- this._resolveEmpty = () => {
- existingResolve();
- resolve();
- };
- });
+ if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
+ throw new InvalidArgumentError('maxRedirections must be a positive number')
}
- /**
- The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
- @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
- */
- async onIdle() {
- // Instantly resolve if none pending and if nothing else is queued
- if (this._pendingCount === 0 && this._queue.size === 0) {
- return;
- }
- return new Promise(resolve => {
- const existingResolve = this._resolveIdle;
- this._resolveIdle = () => {
- existingResolve();
- resolve();
- };
- });
- }
- /**
- Size of the queue.
- */
- get size() {
- return this._queue.size;
- }
- /**
- Size of the queue, filtered by the given options.
+ super(options)
- For example, this can be used to find the number of items remaining in the queue with a specific priority level.
- */
- sizeBy(options) {
- // eslint-disable-next-line unicorn/no-fn-reference-in-iterator
- return this._queue.filter(options).length;
- }
- /**
- Number of pending promises.
- */
- get pending() {
- return this._pendingCount;
+ if (connect && typeof connect !== 'function') {
+ connect = { ...connect }
}
- /**
- Whether the queue is currently paused.
- */
- get isPaused() {
- return this._isPaused;
+
+ this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)
+ ? options.interceptors.Agent
+ : [createRedirectInterceptor({ maxRedirections })]
+
+ this[kOptions] = { ...util.deepClone(options), connect }
+ this[kOptions].interceptors = options.interceptors
+ ? { ...options.interceptors }
+ : undefined
+ this[kMaxRedirections] = maxRedirections
+ this[kFactory] = factory
+ this[kClients] = new Map()
+
+ this[kOnDrain] = (origin, targets) => {
+ this.emit('drain', origin, [this, ...targets])
}
- get timeout() {
- return this._timeout;
+
+ this[kOnConnect] = (origin, targets) => {
+ this.emit('connect', origin, [this, ...targets])
}
- /**
- Set the timeout for future operations.
- */
- set timeout(milliseconds) {
- this._timeout = milliseconds;
+
+ this[kOnDisconnect] = (origin, targets, err) => {
+ this.emit('disconnect', origin, [this, ...targets], err)
}
-}
-exports["default"] = PQueue;
+ this[kOnConnectionError] = (origin, targets, err) => {
+ this.emit('connectionError', origin, [this, ...targets], err)
+ }
+ }
-/***/ }),
+ get [kRunning] () {
+ let ret = 0
+ for (const client of this[kClients].values()) {
+ ret += client[kRunning]
+ }
+ return ret
+ }
-/***/ 2291:
-/***/ ((__unused_webpack_module, exports) => {
+ [kDispatch] (opts, handler) {
+ let key
+ if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
+ key = String(opts.origin)
+ } else {
+ throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
+ }
-"use strict";
+ let dispatcher = this[kClients].get(key)
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
-// Used to compute insertion index to keep queue sorted after insertion
-function lowerBound(array, value, comparator) {
- let first = 0;
- let count = array.length;
- while (count > 0) {
- const step = (count / 2) | 0;
- let it = first + step;
- if (comparator(array[it], value) <= 0) {
- first = ++it;
- count -= step + 1;
- }
- else {
- count = step;
- }
- }
- return first;
-}
-exports["default"] = lowerBound;
+ if (!dispatcher) {
+ dispatcher = this[kFactory](opts.origin, this[kOptions])
+ .on('drain', this[kOnDrain])
+ .on('connect', this[kOnConnect])
+ .on('disconnect', this[kOnDisconnect])
+ .on('connectionError', this[kOnConnectionError])
+ // This introduces a tiny memory leak, as dispatchers are never removed from the map.
+ // TODO(mcollina): remove te timer when the client/pool do not have any more
+ // active connections.
+ this[kClients].set(key, dispatcher)
+ }
-/***/ }),
+ return dispatcher.dispatch(opts, handler)
+ }
-/***/ 8492:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ async [kClose] () {
+ const closePromises = []
+ for (const client of this[kClients].values()) {
+ closePromises.push(client.close())
+ }
+ this[kClients].clear()
-"use strict";
+ await Promise.all(closePromises)
+ }
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const lower_bound_1 = __nccwpck_require__(2291);
-class PriorityQueue {
- constructor() {
- this._queue = [];
- }
- enqueue(run, options) {
- options = Object.assign({ priority: 0 }, options);
- const element = {
- priority: options.priority,
- run
- };
- if (this.size && this._queue[this.size - 1].priority >= options.priority) {
- this._queue.push(element);
- return;
- }
- const index = lower_bound_1.default(this._queue, element, (a, b) => b.priority - a.priority);
- this._queue.splice(index, 0, element);
- }
- dequeue() {
- const item = this._queue.shift();
- return item === null || item === void 0 ? void 0 : item.run;
- }
- filter(options) {
- return this._queue.filter((element) => element.priority === options.priority).map((element) => element.run);
- }
- get size() {
- return this._queue.length;
+ async [kDestroy] (err) {
+ const destroyPromises = []
+ for (const client of this[kClients].values()) {
+ destroyPromises.push(client.destroy(err))
}
-}
-exports["default"] = PriorityQueue;
+ this[kClients].clear()
+ await Promise.all(destroyPromises)
+ }
+}
-/***/ }),
+module.exports = Agent
-/***/ 4924:
-/***/ ((module) => {
-"use strict";
+/***/ }),
+/***/ 837:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-/**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
-function Events() {}
-//
-// We try to not inherit from `Object.prototype`. In some engines creating an
-// instance in this way is faster than calling `Object.create(null)` directly.
-// If `Object.create(null)` is not supported we prefix the event names with a
-// character to make sure that the built-in object properties are not
-// overridden or used as an attack vector.
-//
-if (Object.create) {
- Events.prototype = Object.create(null);
+const {
+ BalancedPoolMissingUpstreamError,
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kRemoveClient,
+ kGetDispatcher
+} = __nccwpck_require__(2128)
+const Pool = __nccwpck_require__(628)
+const { kUrl, kInterceptors } = __nccwpck_require__(6443)
+const { parseOrigin } = __nccwpck_require__(3440)
+const kFactory = Symbol('factory')
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
-}
+const kOptions = Symbol('options')
+const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
+const kCurrentWeight = Symbol('kCurrentWeight')
+const kIndex = Symbol('kIndex')
+const kWeight = Symbol('kWeight')
+const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
+const kErrorPenalty = Symbol('kErrorPenalty')
/**
- * Representation of a single event listener.
+ * Calculate the greatest common divisor of two numbers by
+ * using the Euclidean algorithm.
*
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
+ * @param {number} a
+ * @param {number} b
+ * @returns {number}
*/
-function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
-}
+function getGreatestCommonDivisor (a, b) {
+ if (a === 0) return b
-/**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
-function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
+ while (b !== 0) {
+ const t = b
+ b = a % b
+ a = t
}
+ return a
+}
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
+function defaultFactory (origin, opts) {
+ return new Pool(origin, opts)
+}
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
+class BalancedPool extends PoolBase {
+ constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
+ super()
- return emitter;
-}
+ this[kOptions] = opts
+ this[kIndex] = -1
+ this[kCurrentWeight] = 0
-/**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
-function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
-}
+ this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
+ this[kErrorPenalty] = this[kOptions].errorPenalty || 15
-/**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
-function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
-}
+ if (!Array.isArray(upstreams)) {
+ upstreams = [upstreams]
+ }
-/**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
-EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
+ }
- if (this._eventsCount === 0) return names;
+ this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
+ ? opts.interceptors.BalancedPool
+ : []
+ this[kFactory] = factory
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
+ for (const upstream of upstreams) {
+ this.addUpstream(upstream)
+ }
+ this._updateBalancedPoolStats()
}
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
+ addUpstream (upstream) {
+ const upstreamOrigin = parseOrigin(upstream).origin
- return names;
-};
+ if (this[kClients].find((pool) => (
+ pool[kUrl].origin === upstreamOrigin &&
+ pool.closed !== true &&
+ pool.destroyed !== true
+ ))) {
+ return this
+ }
+ const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
-/**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
-EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
+ this[kAddClient](pool)
+ pool.on('connect', () => {
+ pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
+ })
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
+ pool.on('connectionError', () => {
+ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
+ this._updateBalancedPoolStats()
+ })
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
+ pool.on('disconnect', (...args) => {
+ const err = args[2]
+ if (err && err.code === 'UND_ERR_SOCKET') {
+ // decrease the weight of the pool.
+ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
+ this._updateBalancedPoolStats()
+ }
+ })
- return ee;
-};
+ for (const client of this[kClients]) {
+ client[kWeight] = this[kMaxWeightPerServer]
+ }
-/**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
-EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
+ this._updateBalancedPoolStats()
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
-};
+ return this
+ }
-/**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
-EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
+ _updateBalancedPoolStats () {
+ let result = 0
+ for (let i = 0; i < this[kClients].length; i++) {
+ result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)
+ }
- if (!this._events[evt]) return false;
+ this[kGreatestCommonDivisor] = result
+ }
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
+ removeUpstream (upstream) {
+ const upstreamOrigin = parseOrigin(upstream).origin
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+ const pool = this[kClients].find((pool) => (
+ pool[kUrl].origin === upstreamOrigin &&
+ pool.closed !== true &&
+ pool.destroyed !== true
+ ))
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ if (pool) {
+ this[kRemoveClient](pool)
}
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
+ return this
+ }
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
+ get upstreams () {
+ return this[kClients]
+ .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
+ .map((p) => p[kUrl].origin)
+ }
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+ [kGetDispatcher] () {
+ // We validate that pools is greater than 0,
+ // otherwise we would have to wait until an upstream
+ // is added, which might never happen.
+ if (this[kClients].length === 0) {
+ throw new BalancedPoolMissingUpstreamError()
+ }
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
+ const dispatcher = this[kClients].find(dispatcher => (
+ !dispatcher[kNeedDrain] &&
+ dispatcher.closed !== true &&
+ dispatcher.destroyed !== true
+ ))
- listeners[i].fn.apply(listeners[i].context, args);
- }
+ if (!dispatcher) {
+ return
}
- }
- return true;
-};
+ const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
-/**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
-};
+ if (allClientsBusy) {
+ return
+ }
-/**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
-};
+ let counter = 0
-/**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
+ let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
+ while (counter++ < this[kClients].length) {
+ this[kIndex] = (this[kIndex] + 1) % this[kClients].length
+ const pool = this[kClients][this[kIndex]]
- var listeners = this._events[evt];
+ // find pool index with the largest weight
+ if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
+ maxWeightIndex = this[kIndex]
+ }
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
+ // decrease the current weight every `this[kClients].length`.
+ if (this[kIndex] === 0) {
+ // Set the current weight to the next lower weight.
+ this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
+
+ if (this[kCurrentWeight] <= 0) {
+ this[kCurrentWeight] = this[kMaxWeightPerServer]
+ }
+ }
+ if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
+ return pool
}
}
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
+ this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
+ this[kIndex] = maxWeightIndex
+ return this[kClients][maxWeightIndex]
}
+}
- return this;
-};
+module.exports = BalancedPool
-/**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
+/***/ }),
- return this;
-};
+/***/ 637:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-//
-// Alias methods names because people roll like that.
-//
-EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-//
-// Expose the prefix.
-//
-EventEmitter.prefixed = prefix;
-//
-// Allow `EventEmitter` to be imported as module namespace.
-//
-EventEmitter.EventEmitter = EventEmitter;
+/* global WebAssembly */
-//
-// Expose the module.
-//
-if (true) {
- module.exports = EventEmitter;
-}
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const timers = __nccwpck_require__(6603)
+const {
+ RequestContentLengthMismatchError,
+ ResponseContentLengthMismatchError,
+ RequestAbortedError,
+ HeadersTimeoutError,
+ HeadersOverflowError,
+ SocketError,
+ InformationalError,
+ BodyTimeoutError,
+ HTTPParserError,
+ ResponseExceededMaxSizeError
+} = __nccwpck_require__(8707)
+const {
+ kUrl,
+ kReset,
+ kClient,
+ kParser,
+ kBlocking,
+ kRunning,
+ kPending,
+ kSize,
+ kWriting,
+ kQueue,
+ kNoRef,
+ kKeepAliveDefaultTimeout,
+ kHostHeader,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kPipelining,
+ kSocket,
+ kKeepAliveTimeoutValue,
+ kMaxHeadersSize,
+ kKeepAliveMaxTimeout,
+ kKeepAliveTimeoutThreshold,
+ kHeadersTimeout,
+ kBodyTimeout,
+ kStrictContentLength,
+ kMaxRequests,
+ kCounter,
+ kMaxResponseSize,
+ kOnError,
+ kResume,
+ kHTTPContext
+} = __nccwpck_require__(6443)
+
+const constants = __nccwpck_require__(2824)
+const EMPTY_BUF = Buffer.alloc(0)
+const FastBuffer = Buffer[Symbol.species]
+const addListener = util.addListener
+const removeAllListeners = util.removeAllListeners
+const kIdleSocketValidation = Symbol('kIdleSocketValidation')
+const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout')
+const kSocketUsed = Symbol('kSocketUsed')
+let extractBody
-/***/ }),
+async function lazyllhttp () {
+ const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(3870) : undefined
-/***/ 2548:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ let mod
+ try {
+ mod = await WebAssembly.compile(__nccwpck_require__(3434))
+ } catch (e) {
+ /* istanbul ignore next */
-"use strict";
+ // We could check if the error was caused by the simd option not
+ // being enabled, but the occurring of this other error
+ // * https://github.com/emscripten-core/emscripten/issues/11495
+ // got me to remove that check to avoid breaking Node 12.
+ mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(3870))
+ }
-const retry = __nccwpck_require__(1604);
+ return await WebAssembly.instantiate(mod, {
+ env: {
+ /* eslint-disable camelcase */
-const networkErrorMsgs = [
- 'Failed to fetch', // Chrome
- 'NetworkError when attempting to fetch resource.', // Firefox
- 'The Internet connection appears to be offline.', // Safari
- 'Network request failed' // `cross-fetch`
-];
+ wasm_on_url: (p, at, len) => {
+ /* istanbul ignore next */
+ return 0
+ },
+ wasm_on_status: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_message_begin: (p) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onMessageBegin() || 0
+ },
+ wasm_on_header_field: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_header_value: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
+ },
+ wasm_on_body: (p, at, len) => {
+ assert(currentParser.ptr === p)
+ const start = at - currentBufferPtr + currentBufferRef.byteOffset
+ return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
+ },
+ wasm_on_message_complete: (p) => {
+ assert(currentParser.ptr === p)
+ return currentParser.onMessageComplete() || 0
+ }
-class AbortError extends Error {
- constructor(message) {
- super();
+ /* eslint-enable camelcase */
+ }
+ })
+}
- if (message instanceof Error) {
- this.originalError = message;
- ({message} = message);
- } else {
- this.originalError = new Error(message);
- this.originalError.stack = this.stack;
- }
+let llhttpInstance = null
+let llhttpPromise = lazyllhttp()
+llhttpPromise.catch()
- this.name = 'AbortError';
- this.message = message;
- }
-}
+let currentParser = null
+let currentBufferRef = null
+let currentBufferSize = 0
+let currentBufferPtr = null
-const decorateErrorWithCounts = (error, attemptNumber, options) => {
- // Minus 1 from attemptNumber because the first attempt does not count as a retry
- const retriesLeft = options.retries - (attemptNumber - 1);
+const USE_NATIVE_TIMER = 0
+const USE_FAST_TIMER = 1
- error.attemptNumber = attemptNumber;
- error.retriesLeft = retriesLeft;
- return error;
-};
+// Use fast timers for headers and body to take eventual event loop
+// latency into account.
+const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER
+const TIMEOUT_BODY = 4 | USE_FAST_TIMER
-const isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);
+// Use native timers to ignore event loop latency for keep-alive
+// handling.
+const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER
-const pRetry = (input, options) => new Promise((resolve, reject) => {
- options = {
- onFailedAttempt: () => {},
- retries: 10,
- ...options
- };
+class Parser {
+ constructor (client, socket, { exports }) {
+ assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
- const operation = retry.operation(options);
+ this.llhttp = exports
+ this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
+ this.client = client
+ this.socket = socket
+ this.timeout = null
+ this.timeoutValue = null
+ this.timeoutType = null
+ this.statusCode = null
+ this.statusText = ''
+ this.upgrade = false
+ this.headers = []
+ this.headersSize = 0
+ this.headersMaxSize = client[kMaxHeadersSize]
+ this.shouldKeepAlive = false
+ this.paused = false
+ this.resume = this.resume.bind(this)
- operation.attempt(async attemptNumber => {
- try {
- resolve(await input(attemptNumber));
- } catch (error) {
- if (!(error instanceof Error)) {
- reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
- return;
- }
+ this.bytesRead = 0
- if (error instanceof AbortError) {
- operation.stop();
- reject(error.originalError);
- } else if (error instanceof TypeError && !isNetworkError(error.message)) {
- operation.stop();
- reject(error);
- } else {
- decorateErrorWithCounts(error, attemptNumber, options);
+ this.keepAlive = ''
+ this.contentLength = ''
+ this.connection = ''
+ this.maxResponseSize = client[kMaxResponseSize]
+ }
- try {
- await options.onFailedAttempt(error);
- } catch (error) {
- reject(error);
- return;
- }
+ setTimeout (delay, type) {
+ // If the existing timer and the new timer are of different timer type
+ // (fast or native) or have different delay, we need to clear the existing
+ // timer and set a new one.
+ if (
+ delay !== this.timeoutValue ||
+ (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)
+ ) {
+ // If a timeout is already set, clear it with clearTimeout of the fast
+ // timer implementation, as it can clear fast and native timers.
+ if (this.timeout) {
+ timers.clearTimeout(this.timeout)
+ this.timeout = null
+ }
- if (!operation.retry(error)) {
- reject(operation.mainError());
- }
- }
- }
- });
-});
+ if (delay) {
+ if (type & USE_FAST_TIMER) {
+ this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))
+ } else {
+ this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))
+ this.timeout.unref()
+ }
+ }
-module.exports = pRetry;
-// TODO: remove this in the next major version
-module.exports["default"] = pRetry;
+ this.timeoutValue = delay
+ } else if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
-module.exports.AbortError = AbortError;
+ this.timeoutType = type
+ }
+ resume () {
+ if (this.socket.destroyed || !this.paused) {
+ return
+ }
-/***/ }),
+ assert(this.ptr != null)
+ assert(currentParser == null)
-/***/ 6424:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this.llhttp.llhttp_resume(this.ptr)
-"use strict";
+ assert(this.timeoutType === TIMEOUT_BODY)
+ if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
+ this.paused = false
+ this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
+ this.readMore()
+ }
-const pFinally = __nccwpck_require__(1330);
+ readMore () {
+ while (!this.paused && this.ptr) {
+ const chunk = this.socket.read()
+ if (chunk === null) {
+ break
+ }
+ this.execute(chunk)
+ }
+ }
-class TimeoutError extends Error {
- constructor(message) {
- super(message);
- this.name = 'TimeoutError';
- }
-}
+ execute (data) {
+ assert(this.ptr != null)
+ assert(currentParser == null)
+ assert(!this.paused)
-const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => {
- if (typeof milliseconds !== 'number' || milliseconds < 0) {
- throw new TypeError('Expected `milliseconds` to be a positive number');
- }
+ const { socket, llhttp } = this
- if (milliseconds === Infinity) {
- resolve(promise);
- return;
- }
+ if (data.length > currentBufferSize) {
+ if (currentBufferPtr) {
+ llhttp.free(currentBufferPtr)
+ }
+ currentBufferSize = Math.ceil(data.length / 4096) * 4096
+ currentBufferPtr = llhttp.malloc(currentBufferSize)
+ }
- const timer = setTimeout(() => {
- if (typeof fallback === 'function') {
- try {
- resolve(fallback());
- } catch (error) {
- reject(error);
- }
+ new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
- return;
- }
+ // Call `execute` on the wasm parser.
+ // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
+ // and finally the length of bytes to parse.
+ // The return value is an error code or `constants.ERROR.OK`.
+ try {
+ let ret
- const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
- const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
+ try {
+ currentBufferRef = data
+ currentParser = this
+ ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
+ /* eslint-disable-next-line no-useless-catch */
+ } catch (err) {
+ /* istanbul ignore next: difficult to make a test case for */
+ throw err
+ } finally {
+ currentParser = null
+ currentBufferRef = null
+ }
- if (typeof promise.cancel === 'function') {
- promise.cancel();
- }
+ const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
- reject(timeoutError);
- }, milliseconds);
+ if (ret !== constants.ERROR.OK) {
+ const body = data.subarray(offset)
- // TODO: Use native `finally` keyword when targeting Node.js 10
- pFinally(
- // eslint-disable-next-line promise/prefer-await-to-then
- promise.then(resolve, reject),
- () => {
- clearTimeout(timer);
- }
- );
-});
+ if (ret === constants.ERROR.PAUSED_UPGRADE) {
+ this.onUpgrade(body)
+ } else if (ret === constants.ERROR.PAUSED) {
+ this.paused = true
+ socket.unshift(body)
+ } else {
+ throw this.createError(ret, body)
+ }
+ }
+ } catch (err) {
+ util.destroy(socket, err)
+ }
+ }
-module.exports = pTimeout;
-// TODO: Remove this for the next major release
-module.exports["default"] = pTimeout;
+ finish () {
+ assert(currentParser === null)
+ assert(this.ptr != null)
+ assert(!this.paused)
-module.exports.TimeoutError = TimeoutError;
+ const { llhttp } = this
+ let ret
-/***/ }),
+ try {
+ currentParser = this
+ ret = llhttp.llhttp_finish(this.ptr)
+ } finally {
+ currentParser = null
+ }
-/***/ 3329:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if (ret === constants.ERROR.OK) {
+ return null
+ }
-"use strict";
+ if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
+ this.paused = true
+ return null
+ }
+ return this.createError(ret, EMPTY_BUF)
+ }
-var parseUrl = (__nccwpck_require__(7310).parse);
+ createError (ret, data) {
+ const { llhttp, contentLength, bytesRead } = this
-var DEFAULT_PORTS = {
- ftp: 21,
- gopher: 70,
- http: 80,
- https: 443,
- ws: 80,
- wss: 443,
-};
+ if (contentLength && bytesRead !== parseInt(contentLength, 10)) {
+ return new ResponseContentLengthMismatchError()
+ }
-var stringEndsWith = String.prototype.endsWith || function(s) {
- return s.length <= this.length &&
- this.indexOf(s, this.length - s.length) !== -1;
-};
+ const ptr = llhttp.llhttp_get_error_reason(this.ptr)
+ let message = ''
+ if (ptr) {
+ const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
+ message =
+ 'Response does not match the HTTP/1.1 protocol (' +
+ Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
+ ')'
+ }
-/**
- * @param {string|object} url - The URL, or the result from url.parse.
- * @return {string} The URL of the proxy that should handle the request to the
- * given URL. If no proxy is set, this will be an empty string.
- */
-function getProxyForUrl(url) {
- var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};
- var proto = parsedUrl.protocol;
- var hostname = parsedUrl.host;
- var port = parsedUrl.port;
- if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
- return ''; // Don't proxy URLs without a valid scheme or host.
+ return new HTTPParserError(message, constants.ERROR[ret], data)
}
- proto = proto.split(':', 1)[0];
- // Stripping ports in this way instead of using parsedUrl.hostname to make
- // sure that the brackets around IPv6 addresses are kept.
- hostname = hostname.replace(/:\d*$/, '');
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
- if (!shouldProxy(hostname, port)) {
- return ''; // Don't proxy URLs that match NO_PROXY.
- }
+ destroy () {
+ assert(this.ptr != null)
+ assert(currentParser == null)
- var proxy =
- getEnv('npm_config_' + proto + '_proxy') ||
- getEnv(proto + '_proxy') ||
- getEnv('npm_config_proxy') ||
- getEnv('all_proxy');
- if (proxy && proxy.indexOf('://') === -1) {
- // Missing scheme in proxy, default to the requested URL's scheme.
- proxy = proto + '://' + proxy;
- }
- return proxy;
-}
+ this.llhttp.llhttp_free(this.ptr)
+ this.ptr = null
-/**
- * Determines whether a given URL should be proxied.
- *
- * @param {string} hostname - The host name of the URL.
- * @param {number} port - The effective port of the URL.
- * @returns {boolean} Whether the given URL should be proxied.
- * @private
- */
-function shouldProxy(hostname, port) {
- var NO_PROXY =
- (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
- if (!NO_PROXY) {
- return true; // Always proxy if NO_PROXY is not set.
+ this.timeout && timers.clearTimeout(this.timeout)
+ this.timeout = null
+ this.timeoutValue = null
+ this.timeoutType = null
+
+ this.paused = false
}
- if (NO_PROXY === '*') {
- return false; // Never proxy if wildcard is set.
+
+ onStatus (buf) {
+ this.statusText = buf.toString()
}
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
- if (!proxy) {
- return true; // Skip zero-length hosts.
- }
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
- if (parsedProxyPort && parsedProxyPort !== port) {
- return true; // Skip if ports don't match.
- }
+ onMessageBegin () {
+ const { socket, client } = this
- if (!/^[.*]/.test(parsedProxyHostname)) {
- // No wildcards, so stop proxying if there is an exact match.
- return hostname !== parsedProxyHostname;
+ /* istanbul ignore next: difficult to make a test case for */
+ if (socket.destroyed) {
+ return -1
}
- if (parsedProxyHostname.charAt(0) === '*') {
- // Remove leading wildcard.
- parsedProxyHostname = parsedProxyHostname.slice(1);
+ if (client[kRunning] === 0) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
}
- // Stop proxying if the hostname ends with the no_proxy host.
- return !stringEndsWith.call(hostname, parsedProxyHostname);
- });
-}
-
-/**
- * Get the value for an environment variable.
- *
- * @param {string} key - The name of the environment variable.
- * @return {string} The value of the environment variable.
- * @private
- */
-function getEnv(key) {
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
-}
-
-exports.getProxyForUrl = getProxyForUrl;
-
-
-/***/ }),
-
-/***/ 1604:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = __nccwpck_require__(6244);
+ const request = client[kQueue][client[kRunningIdx]]
+ if (!request) {
+ return -1
+ }
+ request.onResponseStarted()
+ }
-/***/ }),
+ onHeaderField (buf) {
+ const len = this.headers.length
-/***/ 6244:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if ((len & 1) === 0) {
+ this.headers.push(buf)
+ } else {
+ this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ }
-var RetryOperation = __nccwpck_require__(5369);
+ this.trackHeader(buf.length)
+ }
-exports.operation = function(options) {
- var timeouts = exports.timeouts(options);
- return new RetryOperation(timeouts, {
- forever: options && (options.forever || options.retries === Infinity),
- unref: options && options.unref,
- maxRetryTime: options && options.maxRetryTime
- });
-};
+ onHeaderValue (buf) {
+ let len = this.headers.length
-exports.timeouts = function(options) {
- if (options instanceof Array) {
- return [].concat(options);
- }
+ if ((len & 1) === 1) {
+ this.headers.push(buf)
+ len += 1
+ } else {
+ this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ }
- var opts = {
- retries: 10,
- factor: 2,
- minTimeout: 1 * 1000,
- maxTimeout: Infinity,
- randomize: false
- };
- for (var key in options) {
- opts[key] = options[key];
- }
+ const key = this.headers[len - 2]
+ if (key.length === 10) {
+ const headerName = util.bufferToLowerCasedHeaderName(key)
+ if (headerName === 'keep-alive') {
+ this.keepAlive += buf.toString()
+ } else if (headerName === 'connection') {
+ this.connection += buf.toString()
+ }
+ } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {
+ this.contentLength += buf.toString()
+ }
- if (opts.minTimeout > opts.maxTimeout) {
- throw new Error('minTimeout is greater than maxTimeout');
+ this.trackHeader(buf.length)
}
- var timeouts = [];
- for (var i = 0; i < opts.retries; i++) {
- timeouts.push(this.createTimeout(i, opts));
+ trackHeader (len) {
+ this.headersSize += len
+ if (this.headersSize >= this.headersMaxSize) {
+ util.destroy(this.socket, new HeadersOverflowError())
+ }
}
- if (options && options.forever && !timeouts.length) {
- timeouts.push(this.createTimeout(i, opts));
- }
+ onUpgrade (head) {
+ const { upgrade, client, socket, headers, statusCode } = this
- // sort the array numerically ascending
- timeouts.sort(function(a,b) {
- return a - b;
- });
+ assert(upgrade)
+ assert(client[kSocket] === socket)
+ assert(!socket.destroyed)
+ assert(!this.paused)
+ assert((headers.length & 1) === 0)
- return timeouts;
-};
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
+ assert(request.upgrade || request.method === 'CONNECT')
-exports.createTimeout = function(attempt, opts) {
- var random = (opts.randomize)
- ? (Math.random() + 1)
- : 1;
+ this.statusCode = null
+ this.statusText = ''
+ this.shouldKeepAlive = null
- var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
- timeout = Math.min(timeout, opts.maxTimeout);
+ this.headers = []
+ this.headersSize = 0
- return timeout;
-};
+ socket.unshift(head)
-exports.wrap = function(obj, options, methods) {
- if (options instanceof Array) {
- methods = options;
- options = null;
- }
+ socket[kParser].destroy()
+ socket[kParser] = null
- if (!methods) {
- methods = [];
- for (var key in obj) {
- if (typeof obj[key] === 'function') {
- methods.push(key);
- }
- }
- }
+ socket[kClient] = null
+ socket[kError] = null
- for (var i = 0; i < methods.length; i++) {
- var method = methods[i];
- var original = obj[method];
+ removeAllListeners(socket)
- obj[method] = function retryWrapper(original) {
- var op = exports.operation(options);
- var args = Array.prototype.slice.call(arguments, 1);
- var callback = args.pop();
+ client[kSocket] = null
+ client[kHTTPContext] = null // TODO (fix): This is hacky...
+ client[kQueue][client[kRunningIdx]++] = null
+ client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
- args.push(function(err) {
- if (op.retry(err)) {
- return;
- }
- if (err) {
- arguments[0] = op.mainError();
- }
- callback.apply(this, arguments);
- });
+ try {
+ request.onUpgrade(statusCode, headers, socket)
+ } catch (err) {
+ util.destroy(socket, err)
+ }
- op.attempt(function() {
- original.apply(obj, args);
- });
- }.bind(obj, original);
- obj[method].options = options;
+ client[kResume]()
}
-};
+ onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
+ const { client, socket, headers, statusText } = this
-/***/ }),
+ /* istanbul ignore next: difficult to make a test case for */
+ if (socket.destroyed) {
+ return -1
+ }
-/***/ 5369:
-/***/ ((module) => {
+ if (client[kRunning] === 0) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
+ }
-function RetryOperation(timeouts, options) {
- // Compatibility for the old (timeouts, retryForever) signature
- if (typeof options === 'boolean') {
- options = { forever: options };
- }
+ const request = client[kQueue][client[kRunningIdx]]
- this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
- this._timeouts = timeouts;
- this._options = options || {};
- this._maxRetryTime = options && options.maxRetryTime || Infinity;
- this._fn = null;
- this._errors = [];
- this._attempts = 1;
- this._operationTimeout = null;
- this._operationTimeoutCb = null;
- this._timeout = null;
- this._operationStart = null;
- this._timer = null;
+ /* istanbul ignore next: difficult to make a test case for */
+ if (!request) {
+ return -1
+ }
- if (this._options.forever) {
- this._cachedTimeouts = this._timeouts.slice(0);
- }
-}
-module.exports = RetryOperation;
+ assert(!this.upgrade)
+ assert(this.statusCode < 200)
-RetryOperation.prototype.reset = function() {
- this._attempts = 1;
- this._timeouts = this._originalTimeouts.slice(0);
-}
+ if (statusCode === 100) {
+ util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
+ return -1
+ }
-RetryOperation.prototype.stop = function() {
- if (this._timeout) {
- clearTimeout(this._timeout);
- }
- if (this._timer) {
- clearTimeout(this._timer);
- }
+ /* this can only happen if server is misbehaving */
+ if (upgrade && !request.upgrade) {
+ util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
+ return -1
+ }
- this._timeouts = [];
- this._cachedTimeouts = null;
-};
+ assert(this.timeoutType === TIMEOUT_HEADERS)
-RetryOperation.prototype.retry = function(err) {
- if (this._timeout) {
- clearTimeout(this._timeout);
- }
+ this.statusCode = statusCode
+ this.shouldKeepAlive = (
+ shouldKeepAlive ||
+ // Override llhttp value which does not allow keepAlive for HEAD.
+ (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
+ )
- if (!err) {
- return false;
- }
- var currentTime = new Date().getTime();
- if (err && currentTime - this._operationStart >= this._maxRetryTime) {
- this._errors.push(err);
- this._errors.unshift(new Error('RetryOperation timeout occurred'));
- return false;
- }
+ if (this.statusCode >= 200) {
+ const bodyTimeout = request.bodyTimeout != null
+ ? request.bodyTimeout
+ : client[kBodyTimeout]
+ this.setTimeout(bodyTimeout, TIMEOUT_BODY)
+ } else if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
- this._errors.push(err);
+ if (request.method === 'CONNECT') {
+ assert(client[kRunning] === 1)
+ this.upgrade = true
+ return 2
+ }
- var timeout = this._timeouts.shift();
- if (timeout === undefined) {
- if (this._cachedTimeouts) {
- // retry forever, only keep last error
- this._errors.splice(0, this._errors.length - 1);
- timeout = this._cachedTimeouts.slice(-1);
- } else {
- return false;
+ if (upgrade) {
+ assert(client[kRunning] === 1)
+ this.upgrade = true
+ return 2
}
- }
- var self = this;
- this._timer = setTimeout(function() {
- self._attempts++;
+ assert((this.headers.length & 1) === 0)
+ this.headers = []
+ this.headersSize = 0
- if (self._operationTimeoutCb) {
- self._timeout = setTimeout(function() {
- self._operationTimeoutCb(self._attempts);
- }, self._operationTimeout);
+ if (this.shouldKeepAlive && client[kPipelining]) {
+ const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
- if (self._options.unref) {
- self._timeout.unref();
+ if (keepAliveTimeout != null) {
+ const timeout = Math.min(
+ keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
+ client[kKeepAliveMaxTimeout]
+ )
+ if (timeout <= 0) {
+ socket[kReset] = true
+ } else {
+ client[kKeepAliveTimeoutValue] = timeout
+ }
+ } else {
+ client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
}
+ } else {
+ // Stop more requests from being dispatched.
+ socket[kReset] = true
}
- self._fn(self._attempts);
- }, timeout);
-
- if (this._options.unref) {
- this._timer.unref();
- }
+ const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
- return true;
-};
+ if (request.aborted) {
+ return -1
+ }
-RetryOperation.prototype.attempt = function(fn, timeoutOps) {
- this._fn = fn;
+ if (request.method === 'HEAD') {
+ return 1
+ }
- if (timeoutOps) {
- if (timeoutOps.timeout) {
- this._operationTimeout = timeoutOps.timeout;
+ if (statusCode < 200) {
+ return 1
}
- if (timeoutOps.cb) {
- this._operationTimeoutCb = timeoutOps.cb;
+
+ if (socket[kBlocking]) {
+ socket[kBlocking] = false
+ client[kResume]()
}
- }
- var self = this;
- if (this._operationTimeoutCb) {
- this._timeout = setTimeout(function() {
- self._operationTimeoutCb();
- }, self._operationTimeout);
+ return pause ? constants.ERROR.PAUSED : 0
}
- this._operationStart = new Date().getTime();
+ onBody (buf) {
+ const { client, socket, statusCode, maxResponseSize } = this
- this._fn(this._attempts);
-};
+ if (socket.destroyed) {
+ return -1
+ }
-RetryOperation.prototype.try = function(fn) {
- console.log('Using RetryOperation.try() is deprecated');
- this.attempt(fn);
-};
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
-RetryOperation.prototype.start = function(fn) {
- console.log('Using RetryOperation.start() is deprecated');
- this.attempt(fn);
-};
+ assert(this.timeoutType === TIMEOUT_BODY)
+ if (this.timeout) {
+ // istanbul ignore else: only for jest
+ if (this.timeout.refresh) {
+ this.timeout.refresh()
+ }
+ }
-RetryOperation.prototype.start = RetryOperation.prototype.try;
+ assert(statusCode >= 200)
-RetryOperation.prototype.errors = function() {
- return this._errors;
-};
+ if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
+ util.destroy(socket, new ResponseExceededMaxSizeError())
+ return -1
+ }
-RetryOperation.prototype.attempts = function() {
- return this._attempts;
-};
+ this.bytesRead += buf.length
-RetryOperation.prototype.mainError = function() {
- if (this._errors.length === 0) {
- return null;
+ if (request.onData(buf) === false) {
+ return constants.ERROR.PAUSED
+ }
}
- var counts = {};
- var mainError = null;
- var mainErrorCount = 0;
-
- for (var i = 0; i < this._errors.length; i++) {
- var error = this._errors[i];
- var message = error.message;
- var count = (counts[message] || 0) + 1;
+ onMessageComplete () {
+ const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
- counts[message] = count;
+ if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
+ return -1
+ }
- if (count >= mainErrorCount) {
- mainError = error;
- mainErrorCount = count;
+ if (upgrade) {
+ return
}
- }
- return mainError;
-};
+ assert(statusCode >= 100)
+ assert((this.headers.length & 1) === 0)
+ const request = client[kQueue][client[kRunningIdx]]
+ assert(request)
-/***/ }),
+ this.statusCode = null
+ this.statusText = ''
+ this.bytesRead = 0
+ this.contentLength = ''
+ this.keepAlive = ''
+ this.connection = ''
-/***/ 9318:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this.headers = []
+ this.headersSize = 0
+
+ if (statusCode < 200) {
+ return
+ }
-"use strict";
+ /* istanbul ignore next: should be handled by llhttp? */
+ if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
+ util.destroy(socket, new ResponseContentLengthMismatchError())
+ return -1
+ }
-const os = __nccwpck_require__(2037);
-const hasFlag = __nccwpck_require__(1621);
+ request.onComplete(headers)
-const env = process.env;
+ client[kQueue][client[kRunningIdx]++] = null
+ socket[kSocketUsed] = true
-let forceColor;
-if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false')) {
- forceColor = false;
-} else if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
- forceColor = true;
-}
-if ('FORCE_COLOR' in env) {
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
+ if (socket[kWriting]) {
+ assert(client[kRunning] === 0)
+ // Response completed before request.
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (!shouldKeepAlive) {
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (socket[kReset] && client[kRunning] === 0) {
+ // Destroy socket once all requests have completed.
+ // The request at the tail of the pipeline is the one
+ // that requested reset and no further requests should
+ // have been queued since then.
+ util.destroy(socket, new InformationalError('reset'))
+ return constants.ERROR.PAUSED
+ } else if (client[kPipelining] == null || client[kPipelining] === 1) {
+ // We must wait a full event loop cycle to reuse this socket to make sure
+ // that non-spec compliant servers are not closing the connection even if they
+ // said they won't.
+ setImmediate(() => client[kResume]())
+ } else {
+ client[kResume]()
+ }
+ }
}
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
+function onParserTimeout (parser) {
+ const { socket, timeoutType, client, paused } = parser.deref()
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
+ /* istanbul ignore else */
+ if (timeoutType === TIMEOUT_HEADERS) {
+ if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
+ assert(!paused, 'cannot be paused while waiting for headers')
+ util.destroy(socket, new HeadersTimeoutError())
+ }
+ } else if (timeoutType === TIMEOUT_BODY) {
+ if (!paused) {
+ util.destroy(socket, new BodyTimeoutError())
+ }
+ } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
+ assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
+ util.destroy(socket, new InformationalError('socket idle timeout'))
+ }
}
-function supportsColor(stream) {
- if (forceColor === false) {
- return 0;
- }
+async function connectH1 (client, socket) {
+ client[kSocket] = socket
- if (hasFlag('color=16m') ||
- hasFlag('color=full') ||
- hasFlag('color=truecolor')) {
- return 3;
- }
+ if (!llhttpInstance) {
+ llhttpInstance = await llhttpPromise
+ llhttpPromise = null
+ }
- if (hasFlag('color=256')) {
- return 2;
- }
+ socket[kNoRef] = false
+ socket[kWriting] = false
+ socket[kReset] = false
+ socket[kBlocking] = false
+ socket[kIdleSocketValidation] = 0
+ socket[kIdleSocketValidationTimeout] = null
+ socket[kSocketUsed] = false
+ socket[kParser] = new Parser(client, socket, llhttpInstance)
- if (stream && !stream.isTTY && forceColor !== true) {
- return 0;
- }
+ addListener(socket, 'error', function (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- const min = forceColor ? 1 : 0;
+ const parser = this[kParser]
- if (process.platform === 'win32') {
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
- // libuv that enables 256 color output on Windows. Anything earlier and it
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
- // release that supports 256 colors. Windows 10 build 14931 is the first release
- // that supports 16m/TrueColor.
- const osRelease = os.release().split('.');
- if (
- Number(process.versions.node.split('.')[0]) >= 8 &&
- Number(osRelease[0]) >= 10 &&
- Number(osRelease[2]) >= 10586
- ) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
+ // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
+ // to the user.
+ if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
+ const parserErr = parser.finish()
+ if (parserErr) {
+ this[kError] = parserErr
+ this[kClient][kOnError](parserErr)
+ }
+ return
+ }
- return 1;
- }
+ this[kError] = err
- if ('CI' in env) {
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
- return 1;
- }
+ this[kClient][kOnError](err)
+ })
+ addListener(socket, 'readable', function () {
+ const parser = this[kParser]
- return min;
- }
+ if (parser) {
+ parser.readMore()
+ }
+ })
+ addListener(socket, 'end', function () {
+ const parser = this[kParser]
- if ('TEAMCITY_VERSION' in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
+ if (parser.statusCode && !parser.shouldKeepAlive) {
+ const parserErr = parser.finish()
+ if (parserErr) {
+ util.destroy(this, parserErr)
+ }
+ return
+ }
- if (env.COLORTERM === 'truecolor') {
- return 3;
- }
+ util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
+ })
+ addListener(socket, 'close', function () {
+ const client = this[kClient]
+ const parser = this[kParser]
- if ('TERM_PROGRAM' in env) {
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+ clearIdleSocketValidation(this)
- switch (env.TERM_PROGRAM) {
- case 'iTerm.app':
- return version >= 3 ? 3 : 2;
- case 'Apple_Terminal':
- return 2;
- // No default
- }
- }
+ if (parser) {
+ if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
+ this[kError] = parser.finish() || this[kError]
+ }
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
+ this[kParser].destroy()
+ this[kParser] = null
+ }
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
+ const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
- if ('COLORTERM' in env) {
- return 1;
- }
+ client[kSocket] = null
+ client[kHTTPContext] = null // TODO (fix): This is hacky...
- if (env.TERM === 'dumb') {
- return min;
- }
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
- return min;
-}
+ // Fail entire queue.
+ const requests = client[kQueue].splice(client[kRunningIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
+ }
+ } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
+ // Fail head of pipeline.
+ const request = client[kQueue][client[kRunningIdx]]
+ client[kQueue][client[kRunningIdx]++] = null
-function getSupportLevel(stream) {
- const level = supportsColor(stream);
- return translateLevel(level);
-}
+ util.errorRequest(client, request, err)
+ }
-module.exports = {
- supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr)
-};
+ client[kPendingIdx] = client[kRunningIdx]
+ assert(client[kRunning] === 0)
-/***/ }),
+ client.emit('disconnect', client[kUrl], [client], err)
-/***/ 4294:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ client[kResume]()
+ })
-module.exports = __nccwpck_require__(4219);
+ let closed = false
+ socket.on('close', () => {
+ closed = true
+ })
+ return {
+ version: 'h1',
+ defaultPipelining: 1,
+ write (...args) {
+ return writeH1(client, ...args)
+ },
+ resume () {
+ resumeH1(client)
+ },
+ destroy (err, callback) {
+ if (closed) {
+ queueMicrotask(callback)
+ } else {
+ socket.destroy(err).on('close', callback)
+ }
+ },
+ get destroyed () {
+ return socket.destroyed
+ },
+ busy (request) {
+ if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {
+ return true
+ }
-/***/ }),
+ if (request) {
+ if (client[kRunning] > 0 && !request.idempotent) {
+ // Non-idempotent request cannot be retried.
+ // Ensure that no other requests are inflight and
+ // could cause failure.
+ return true
+ }
-/***/ 4219:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
+ // Don't dispatch an upgrade until all preceding requests have completed.
+ // A misbehaving server might upgrade the connection before all pipelined
+ // request has completed.
+ return true
+ }
-"use strict";
+ if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
+ (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {
+ // Request with stream or iterator body can error while other requests
+ // are inflight and indirectly error those as well.
+ // Ensure this doesn't happen by waiting for inflight
+ // to complete before dispatching.
+ // Request with stream or iterator body cannot be retried.
+ // Ensure that no other requests are inflight and
+ // could cause failure.
+ return true
+ }
+ }
-var net = __nccwpck_require__(1808);
-var tls = __nccwpck_require__(4404);
-var http = __nccwpck_require__(3685);
-var https = __nccwpck_require__(5687);
-var events = __nccwpck_require__(2361);
-var assert = __nccwpck_require__(9491);
-var util = __nccwpck_require__(3837);
+ return false
+ }
+ }
+}
+function clearIdleSocketValidation (socket) {
+ if (socket[kIdleSocketValidationTimeout]) {
+ clearTimeout(socket[kIdleSocketValidationTimeout])
+ socket[kIdleSocketValidationTimeout] = null
+ }
-exports.httpOverHttp = httpOverHttp;
-exports.httpsOverHttp = httpsOverHttp;
-exports.httpOverHttps = httpOverHttps;
-exports.httpsOverHttps = httpsOverHttps;
+ socket[kIdleSocketValidation] = 0
+}
+function scheduleIdleSocketValidation (client, socket) {
+ socket[kIdleSocketValidation] = 1
+ socket[kIdleSocketValidationTimeout] = setTimeout(() => {
+ socket[kIdleSocketValidationTimeout] = null
+ socket[kIdleSocketValidation] = 2
-function httpOverHttp(options) {
- var agent = new TunnelingAgent(options);
- agent.request = http.request;
- return agent;
+ if (client[kSocket] === socket && !socket.destroyed) {
+ client[kResume]()
+ }
+ }, 0)
+ socket[kIdleSocketValidationTimeout].unref?.()
}
-function httpsOverHttp(options) {
- var agent = new TunnelingAgent(options);
- agent.request = http.request;
- agent.createSocket = createSecureSocket;
- agent.defaultPort = 443;
- return agent;
-}
+/**
+ * @param {import('./client.js')} client
+ */
+function resumeH1 (client) {
+ const socket = client[kSocket]
-function httpOverHttps(options) {
- var agent = new TunnelingAgent(options);
- agent.request = https.request;
- return agent;
+ if (socket && !socket.destroyed) {
+ if (client[kSize] === 0) {
+ if (!socket[kNoRef] && socket.unref) {
+ socket.unref()
+ socket[kNoRef] = true
+ }
+ } else if (socket[kNoRef] && socket.ref) {
+ socket.ref()
+ socket[kNoRef] = false
+ }
+
+ if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {
+ if (socket[kIdleSocketValidation] === 0) {
+ scheduleIdleSocketValidation(client, socket)
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ return
+ }
+
+ if (socket[kIdleSocketValidation] === 1) {
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ return
+ }
+ }
+
+ if (client[kRunning] === 0) {
+ socket[kParser].readMore()
+ if (socket.destroyed) {
+ return
+ }
+ }
+
+ if (client[kSize] === 0) {
+ if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
+ socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)
+ }
+ } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
+ if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
+ const request = client[kQueue][client[kRunningIdx]]
+ const headersTimeout = request.headersTimeout != null
+ ? request.headersTimeout
+ : client[kHeadersTimeout]
+ socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
+ }
+ }
+ }
}
-function httpsOverHttps(options) {
- var agent = new TunnelingAgent(options);
- agent.request = https.request;
- agent.createSocket = createSecureSocket;
- agent.defaultPort = 443;
- return agent;
+// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
+function shouldSendContentLength (method) {
+ return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
}
+function writeH1 (client, request) {
+ const { method, path, host, upgrade, blocking, reset } = request
+
+ let { body, headers, contentLength } = request
+
+ // https://tools.ietf.org/html/rfc7231#section-4.3.1
+ // https://tools.ietf.org/html/rfc7231#section-4.3.2
+ // https://tools.ietf.org/html/rfc7231#section-4.3.5
+
+ // Sending a payload body on a request that does not
+ // expect it can cause undefined behavior on some
+ // servers and corrupt connection state. Do not
+ // re-use the connection for further requests.
+
+ const expectsPayload = (
+ method === 'PUT' ||
+ method === 'POST' ||
+ method === 'PATCH' ||
+ method === 'QUERY' ||
+ method === 'PROPFIND' ||
+ method === 'PROPPATCH'
+ )
-function TunnelingAgent(options) {
- var self = this;
- self.options = options || {};
- self.proxyOptions = self.options.proxy || {};
- self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
- self.requests = [];
- self.sockets = [];
+ if (util.isFormDataLike(body)) {
+ if (!extractBody) {
+ extractBody = (__nccwpck_require__(4492).extractBody)
+ }
- self.on('free', function onFree(socket, host, port, localAddress) {
- var options = toOptions(host, port, localAddress);
- for (var i = 0, len = self.requests.length; i < len; ++i) {
- var pending = self.requests[i];
- if (pending.host === options.host && pending.port === options.port) {
- // Detect the request to connect same origin server,
- // reuse the connection.
- self.requests.splice(i, 1);
- pending.request.onSocket(socket);
- return;
- }
+ const [bodyStream, contentType] = extractBody(body)
+ if (request.contentType == null) {
+ headers.push('content-type', contentType)
}
- socket.destroy();
- self.removeSocket(socket);
- });
-}
-util.inherits(TunnelingAgent, events.EventEmitter);
+ body = bodyStream.stream
+ contentLength = bodyStream.length
+ } else if (util.isBlobLike(body) && request.contentType == null && body.type) {
+ headers.push('content-type', body.type)
+ }
-TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
- var self = this;
- var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
+ if (body && typeof body.read === 'function') {
+ // Try to read EOF in order to get length.
+ body.read(0)
+ }
- if (self.sockets.length >= this.maxSockets) {
- // We are over limit so we'll add it to the queue.
- self.requests.push(options);
- return;
+ const bodyLength = util.bodyLength(body)
+
+ contentLength = bodyLength ?? contentLength
+
+ if (contentLength === null) {
+ contentLength = request.contentLength
}
- // If we are under maxSockets create a new one.
- self.createSocket(options, function(socket) {
- socket.on('free', onFree);
- socket.on('close', onCloseOrRemove);
- socket.on('agentRemove', onCloseOrRemove);
- req.onSocket(socket);
+ if (contentLength === 0 && !expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD NOT send a Content-Length header field when
+ // the request message does not contain a payload body and the method
+ // semantics do not anticipate such a body.
- function onFree() {
- self.emit('free', socket, options);
- }
+ contentLength = null
+ }
- function onCloseOrRemove(err) {
- self.removeSocket(socket);
- socket.removeListener('free', onFree);
- socket.removeListener('close', onCloseOrRemove);
- socket.removeListener('agentRemove', onCloseOrRemove);
+ // https://github.com/nodejs/undici/issues/2046
+ // A user agent may send a Content-Length header with 0 value, this should be allowed.
+ if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
+ if (client[kStrictContentLength]) {
+ util.errorRequest(client, request, new RequestContentLengthMismatchError())
+ return false
}
- });
-};
-TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
- var self = this;
- var placeholder = {};
- self.sockets.push(placeholder);
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
- var connectOptions = mergeOptions({}, self.proxyOptions, {
- method: 'CONNECT',
- path: options.host + ':' + options.port,
- agent: false,
- headers: {
- host: options.host + ':' + options.port
+ const socket = client[kSocket]
+ clearIdleSocketValidation(socket)
+
+ const abort = (err) => {
+ if (request.aborted || request.completed) {
+ return
}
- });
- if (options.localAddress) {
- connectOptions.localAddress = options.localAddress;
- }
- if (connectOptions.proxyAuth) {
- connectOptions.headers = connectOptions.headers || {};
- connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
- new Buffer(connectOptions.proxyAuth).toString('base64');
- }
- debug('making CONNECT request');
- var connectReq = self.request(connectOptions);
- connectReq.useChunkedEncodingByDefault = false; // for v0.6
- connectReq.once('response', onResponse); // for v0.6
- connectReq.once('upgrade', onUpgrade); // for v0.6
- connectReq.once('connect', onConnect); // for v0.7 or later
- connectReq.once('error', onError);
- connectReq.end();
+ util.errorRequest(client, request, err || new RequestAbortedError())
- function onResponse(res) {
- // Very hacky. This is necessary to avoid http-parser leaks.
- res.upgrade = true;
+ util.destroy(body)
+ util.destroy(socket, new InformationalError('aborted'))
}
- function onUpgrade(res, socket, head) {
- // Hacky.
- process.nextTick(function() {
- onConnect(res, socket, head);
- });
+ try {
+ request.onConnect(abort)
+ } catch (err) {
+ util.errorRequest(client, request, err)
}
- function onConnect(res, socket, head) {
- connectReq.removeAllListeners();
- socket.removeAllListeners();
+ if (request.aborted) {
+ return false
+ }
- if (res.statusCode !== 200) {
- debug('tunneling socket could not be established, statusCode=%d',
- res.statusCode);
- socket.destroy();
- var error = new Error('tunneling socket could not be established, ' +
- 'statusCode=' + res.statusCode);
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
- return;
- }
- if (head.length > 0) {
- debug('got illegal response body from proxy');
- socket.destroy();
- var error = new Error('got illegal response body from proxy');
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
- return;
- }
- debug('tunneling connection has established');
- self.sockets[self.sockets.indexOf(placeholder)] = socket;
- return cb(socket);
+ if (method === 'HEAD') {
+ // https://github.com/mcollina/undici/issues/258
+ // Close after a HEAD request to interop with misbehaving servers
+ // that may send a body in the response.
+
+ socket[kReset] = true
}
- function onError(cause) {
- connectReq.removeAllListeners();
+ if (upgrade || method === 'CONNECT') {
+ // On CONNECT or upgrade, block pipeline from dispatching further
+ // requests on this connection.
- debug('tunneling socket could not be established, cause=%s\n',
- cause.message, cause.stack);
- var error = new Error('tunneling socket could not be established, ' +
- 'cause=' + cause.message);
- error.code = 'ECONNRESET';
- options.request.emit('error', error);
- self.removeSocket(placeholder);
+ socket[kReset] = true
}
-};
-TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
- var pos = this.sockets.indexOf(socket)
- if (pos === -1) {
- return;
+ if (reset != null) {
+ socket[kReset] = reset
}
- this.sockets.splice(pos, 1);
- var pending = this.requests.shift();
- if (pending) {
- // If we have pending requests and a socket gets closed a new one
- // needs to be created to take over in the pool for the one that closed.
- this.createSocket(pending, function(socket) {
- pending.request.onSocket(socket);
- });
+ if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
+ socket[kReset] = true
}
-};
-function createSecureSocket(options, cb) {
- var self = this;
- TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
- var hostHeader = options.request.getHeader('host');
- var tlsOptions = mergeOptions({}, self.options, {
- socket: socket,
- servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
- });
+ if (blocking) {
+ socket[kBlocking] = true
+ }
- // 0 is dummy port for v0.6
- var secureSocket = tls.connect(0, tlsOptions);
- self.sockets[self.sockets.indexOf(socket)] = secureSocket;
- cb(secureSocket);
- });
-}
+ let header = `${method} ${path} HTTP/1.1\r\n`
+ if (typeof host === 'string') {
+ header += `host: ${host}\r\n`
+ } else {
+ header += client[kHostHeader]
+ }
-function toOptions(host, port, localAddress) {
- if (typeof host === 'string') { // since v0.10
- return {
- host: host,
- port: port,
- localAddress: localAddress
- };
+ if (upgrade) {
+ header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
+ } else if (client[kPipelining] && !socket[kReset]) {
+ header += 'connection: keep-alive\r\n'
+ } else {
+ header += 'connection: close\r\n'
}
- return host; // for v0.11 or later
-}
-function mergeOptions(target) {
- for (var i = 1, len = arguments.length; i < len; ++i) {
- var overrides = arguments[i];
- if (typeof overrides === 'object') {
- var keys = Object.keys(overrides);
- for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
- var k = keys[j];
- if (overrides[k] !== undefined) {
- target[k] = overrides[k];
+ if (Array.isArray(headers)) {
+ for (let n = 0; n < headers.length; n += 2) {
+ const key = headers[n + 0]
+ const val = headers[n + 1]
+
+ if (Array.isArray(val)) {
+ for (let i = 0; i < val.length; i++) {
+ header += `${key}: ${val[i]}\r\n`
}
+ } else {
+ header += `${key}: ${val}\r\n`
}
}
}
- return target;
-}
+ if (channels.sendHeaders.hasSubscribers) {
+ channels.sendHeaders.publish({ request, headers: header, socket })
+ }
-var debug;
-if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
- debug = function() {
- var args = Array.prototype.slice.call(arguments);
- if (typeof args[0] === 'string') {
- args[0] = 'TUNNEL: ' + args[0];
+ /* istanbul ignore else: assertion */
+ if (!body || bodyLength === 0) {
+ writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isBuffer(body)) {
+ writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isBlobLike(body)) {
+ if (typeof body.stream === 'function') {
+ writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)
} else {
- args.unshift('TUNNEL:');
+ writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)
}
- console.error.apply(console, args);
+ } else if (util.isStream(body)) {
+ writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else if (util.isIterable(body)) {
+ writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)
+ } else {
+ assert(false)
}
-} else {
- debug = function() {};
-}
-exports.debug = debug; // for test
-
-
-/***/ }),
-
-/***/ 1773:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-const Client = __nccwpck_require__(3598)
-const Dispatcher = __nccwpck_require__(412)
-const errors = __nccwpck_require__(8045)
-const Pool = __nccwpck_require__(4634)
-const BalancedPool = __nccwpck_require__(7931)
-const Agent = __nccwpck_require__(7890)
-const util = __nccwpck_require__(3983)
-const { InvalidArgumentError } = errors
-const api = __nccwpck_require__(4059)
-const buildConnector = __nccwpck_require__(2067)
-const MockClient = __nccwpck_require__(8687)
-const MockAgent = __nccwpck_require__(6771)
-const MockPool = __nccwpck_require__(6193)
-const mockErrors = __nccwpck_require__(888)
-const ProxyAgent = __nccwpck_require__(7858)
-const RetryHandler = __nccwpck_require__(2286)
-const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
-const DecoratorHandler = __nccwpck_require__(6930)
-const RedirectHandler = __nccwpck_require__(2860)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-
-let hasCrypto
-try {
- __nccwpck_require__(6113)
- hasCrypto = true
-} catch {
- hasCrypto = false
+ return true
}
-Object.assign(Dispatcher.prototype, api)
+function writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
-module.exports.Dispatcher = Dispatcher
-module.exports.Client = Client
-module.exports.Pool = Pool
-module.exports.BalancedPool = BalancedPool
-module.exports.Agent = Agent
-module.exports.ProxyAgent = ProxyAgent
-module.exports.RetryHandler = RetryHandler
+ let finished = false
-module.exports.DecoratorHandler = DecoratorHandler
-module.exports.RedirectHandler = RedirectHandler
-module.exports.createRedirectInterceptor = createRedirectInterceptor
+ const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
-module.exports.buildConnector = buildConnector
-module.exports.errors = errors
+ const onData = function (chunk) {
+ if (finished) {
+ return
+ }
-function makeDispatcher (fn) {
- return (url, opts, handler) => {
- if (typeof opts === 'function') {
- handler = opts
- opts = null
+ try {
+ if (!writer.write(chunk) && this.pause) {
+ this.pause()
+ }
+ } catch (err) {
+ util.destroy(this, err)
+ }
+ }
+ const onDrain = function () {
+ if (finished) {
+ return
}
- if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
- throw new InvalidArgumentError('invalid url')
+ if (body.resume) {
+ body.resume()
}
+ }
+ const onClose = function () {
+ // 'close' might be emitted *before* 'error' for
+ // broken streams. Wait a tick to avoid this case.
+ queueMicrotask(() => {
+ // It's only safe to remove 'error' listener after
+ // 'close'.
+ body.removeListener('error', onFinished)
+ })
- if (opts != null && typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+ if (!finished) {
+ const err = new RequestAbortedError()
+ queueMicrotask(() => onFinished(err))
+ }
+ }
+ const onFinished = function (err) {
+ if (finished) {
+ return
}
- if (opts && opts.path != null) {
- if (typeof opts.path !== 'string') {
- throw new InvalidArgumentError('invalid opts.path')
- }
+ finished = true
- let path = opts.path
- if (!opts.path.startsWith('/')) {
- path = `/${path}`
- }
+ assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
- url = new URL(util.parseOrigin(url).origin + path)
- } else {
- if (!opts) {
- opts = typeof url === 'object' ? url : {}
- }
+ socket
+ .off('drain', onDrain)
+ .off('error', onFinished)
- url = util.parseURL(url)
+ body
+ .removeListener('data', onData)
+ .removeListener('end', onFinished)
+ .removeListener('close', onClose)
+
+ if (!err) {
+ try {
+ writer.end()
+ } catch (er) {
+ err = er
+ }
}
- const { agent, dispatcher = getGlobalDispatcher() } = opts
+ writer.destroy(err)
- if (agent) {
- throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
+ if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
+ util.destroy(body, err)
+ } else {
+ util.destroy(body)
}
-
- return fn.call(dispatcher, {
- ...opts,
- origin: url.origin,
- path: url.search ? `${url.pathname}${url.search}` : url.pathname,
- method: opts.method || (opts.body ? 'PUT' : 'GET')
- }, handler)
}
-}
-module.exports.setGlobalDispatcher = setGlobalDispatcher
-module.exports.getGlobalDispatcher = getGlobalDispatcher
+ body
+ .on('data', onData)
+ .on('end', onFinished)
+ .on('error', onFinished)
+ .on('close', onClose)
-if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
- let fetchImpl = null
- module.exports.fetch = async function fetch (resource) {
- if (!fetchImpl) {
- fetchImpl = (__nccwpck_require__(4881).fetch)
- }
+ if (body.resume) {
+ body.resume()
+ }
- try {
- return await fetchImpl(...arguments)
- } catch (err) {
- if (typeof err === 'object') {
- Error.captureStackTrace(err, this)
- }
+ socket
+ .on('drain', onDrain)
+ .on('error', onFinished)
- throw err
- }
+ if (body.errorEmitted ?? body.errored) {
+ setImmediate(() => onFinished(body.errored))
+ } else if (body.endEmitted ?? body.readableEnded) {
+ setImmediate(() => onFinished(null))
+ }
+
+ if (body.closeEmitted ?? body.closed) {
+ setImmediate(onClose)
}
- module.exports.Headers = __nccwpck_require__(554).Headers
- module.exports.Response = __nccwpck_require__(7823).Response
- module.exports.Request = __nccwpck_require__(8359).Request
- module.exports.FormData = __nccwpck_require__(2015).FormData
- module.exports.File = __nccwpck_require__(8511).File
- module.exports.FileReader = __nccwpck_require__(1446).FileReader
+}
- const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
+function writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ try {
+ if (!body) {
+ if (contentLength === 0) {
+ socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
+ } else {
+ assert(contentLength === null, 'no body must not have content length')
+ socket.write(`${header}\r\n`, 'latin1')
+ }
+ } else if (util.isBuffer(body)) {
+ assert(contentLength === body.byteLength, 'buffer body must have content length')
- module.exports.setGlobalOrigin = setGlobalOrigin
- module.exports.getGlobalOrigin = getGlobalOrigin
+ socket.cork()
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ socket.write(body)
+ socket.uncork()
+ request.onBodySent(body)
- const { CacheStorage } = __nccwpck_require__(7907)
- const { kConstruct } = __nccwpck_require__(9174)
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
+ }
+ }
+ request.onRequestSent()
- // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
- // in an older version of Node, it doesn't have any use without fetch.
- module.exports.caches = new CacheStorage(kConstruct)
+ client[kResume]()
+ } catch (err) {
+ abort(err)
+ }
}
-if (util.nodeMajor >= 16) {
- const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
+async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength === body.size, 'blob body must have content length')
+
+ try {
+ if (contentLength != null && contentLength !== body.size) {
+ throw new RequestContentLengthMismatchError()
+ }
- module.exports.deleteCookie = deleteCookie
- module.exports.getCookies = getCookies
- module.exports.getSetCookies = getSetCookies
- module.exports.setCookie = setCookie
+ const buffer = Buffer.from(await body.arrayBuffer())
- const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
+ socket.cork()
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ socket.write(buffer)
+ socket.uncork()
- module.exports.parseMIMEType = parseMIMEType
- module.exports.serializeAMimeType = serializeAMimeType
-}
+ request.onBodySent(buffer)
+ request.onRequestSent()
-if (util.nodeMajor >= 18 && hasCrypto) {
- const { WebSocket } = __nccwpck_require__(4284)
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
+ }
- module.exports.WebSocket = WebSocket
+ client[kResume]()
+ } catch (err) {
+ abort(err)
+ }
}
-module.exports.request = makeDispatcher(api.request)
-module.exports.stream = makeDispatcher(api.stream)
-module.exports.pipeline = makeDispatcher(api.pipeline)
-module.exports.connect = makeDispatcher(api.connect)
-module.exports.upgrade = makeDispatcher(api.upgrade)
+async function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
-module.exports.MockClient = MockClient
-module.exports.MockPool = MockPool
-module.exports.MockAgent = MockAgent
-module.exports.mockErrors = mockErrors
+ let callback = null
+ function onDrain () {
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb()
+ }
+ }
+ const waitForDrain = () => new Promise((resolve, reject) => {
+ assert(callback === null)
-/***/ }),
+ if (socket[kError]) {
+ reject(socket[kError])
+ } else {
+ callback = resolve
+ }
+ })
-/***/ 7890:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ socket
+ .on('close', onDrain)
+ .on('drain', onDrain)
-"use strict";
+ const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
+ try {
+ // It's up to the user to somehow abort the async iterable.
+ for await (const chunk of body) {
+ if (socket[kError]) {
+ throw socket[kError]
+ }
+ if (!writer.write(chunk)) {
+ await waitForDrain()
+ }
+ }
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
-const DispatcherBase = __nccwpck_require__(4839)
-const Pool = __nccwpck_require__(4634)
-const Client = __nccwpck_require__(3598)
-const util = __nccwpck_require__(3983)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
+ writer.end()
+ } catch (err) {
+ writer.destroy(err)
+ } finally {
+ socket
+ .off('close', onDrain)
+ .off('drain', onDrain)
+ }
+}
-const kOnConnect = Symbol('onConnect')
-const kOnDisconnect = Symbol('onDisconnect')
-const kOnConnectionError = Symbol('onConnectionError')
-const kMaxRedirections = Symbol('maxRedirections')
-const kOnDrain = Symbol('onDrain')
-const kFactory = Symbol('factory')
-const kFinalizer = Symbol('finalizer')
-const kOptions = Symbol('options')
+class AsyncWriter {
+ constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {
+ this.socket = socket
+ this.request = request
+ this.contentLength = contentLength
+ this.client = client
+ this.bytesWritten = 0
+ this.expectsPayload = expectsPayload
+ this.header = header
+ this.abort = abort
-function defaultFactory (origin, opts) {
- return opts && opts.connections === 1
- ? new Client(origin, opts)
- : new Pool(origin, opts)
-}
+ socket[kWriting] = true
+ }
-class Agent extends DispatcherBase {
- constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
- super()
+ write (chunk) {
+ const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
+ if (socket[kError]) {
+ throw socket[kError]
}
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
+ if (socket.destroyed) {
+ return false
}
- if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
+ const len = Buffer.byteLength(chunk)
+ if (!len) {
+ return true
}
- if (connect && typeof connect !== 'function') {
- connect = { ...connect }
+ // We should defer writing chunks.
+ if (contentLength !== null && bytesWritten + len > contentLength) {
+ if (client[kStrictContentLength]) {
+ throw new RequestContentLengthMismatchError()
+ }
+
+ process.emitWarning(new RequestContentLengthMismatchError())
}
- this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
- ? options.interceptors.Agent
- : [createRedirectInterceptor({ maxRedirections })]
+ socket.cork()
- this[kOptions] = { ...util.deepClone(options), connect }
- this[kOptions].interceptors = options.interceptors
- ? { ...options.interceptors }
- : undefined
- this[kMaxRedirections] = maxRedirections
- this[kFactory] = factory
- this[kClients] = new Map()
- this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
- const ref = this[kClients].get(key)
- if (ref !== undefined && ref.deref() === undefined) {
- this[kClients].delete(key)
+ if (bytesWritten === 0) {
+ if (!expectsPayload && request.reset !== false) {
+ socket[kReset] = true
}
- })
- const agent = this
-
- this[kOnDrain] = (origin, targets) => {
- agent.emit('drain', origin, [agent, ...targets])
+ if (contentLength === null) {
+ socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
+ } else {
+ socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
+ }
}
- this[kOnConnect] = (origin, targets) => {
- agent.emit('connect', origin, [agent, ...targets])
+ if (contentLength === null) {
+ socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
}
- this[kOnDisconnect] = (origin, targets, err) => {
- agent.emit('disconnect', origin, [agent, ...targets], err)
- }
+ this.bytesWritten += len
- this[kOnConnectionError] = (origin, targets, err) => {
- agent.emit('connectionError', origin, [agent, ...targets], err)
- }
- }
+ const ret = socket.write(chunk)
- get [kRunning] () {
- let ret = 0
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore next: gc is undeterministic */
- if (client) {
- ret += client[kRunning]
+ socket.uncork()
+
+ request.onBodySent(chunk)
+
+ if (!ret) {
+ if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
+ // istanbul ignore else: only for jest
+ if (socket[kParser].timeout.refresh) {
+ socket[kParser].timeout.refresh()
+ }
}
}
+
return ret
}
- [kDispatch] (opts, handler) {
- let key
- if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
- key = String(opts.origin)
- } else {
- throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
- }
+ end () {
+ const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
+ request.onRequestSent()
- const ref = this[kClients].get(key)
+ socket[kWriting] = false
- let dispatcher = ref ? ref.deref() : null
- if (!dispatcher) {
- dispatcher = this[kFactory](opts.origin, this[kOptions])
- .on('drain', this[kOnDrain])
- .on('connect', this[kOnConnect])
- .on('disconnect', this[kOnDisconnect])
- .on('connectionError', this[kOnConnectionError])
+ if (socket[kError]) {
+ throw socket[kError]
+ }
- this[kClients].set(key, new WeakRef(dispatcher))
- this[kFinalizer].register(dispatcher, key)
+ if (socket.destroyed) {
+ return
}
- return dispatcher.dispatch(opts, handler)
- }
+ if (bytesWritten === 0) {
+ if (expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD send a Content-Length in a request message when
+ // no Transfer-Encoding is sent and the request method defines a meaning
+ // for an enclosed payload body.
- async [kClose] () {
- const closePromises = []
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore else: gc is undeterministic */
- if (client) {
- closePromises.push(client.close())
+ socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
+ } else {
+ socket.write(`${header}\r\n`, 'latin1')
}
+ } else if (contentLength === null) {
+ socket.write('\r\n0\r\n\r\n', 'latin1')
}
- await Promise.all(closePromises)
- }
+ if (contentLength !== null && bytesWritten !== contentLength) {
+ if (client[kStrictContentLength]) {
+ throw new RequestContentLengthMismatchError()
+ } else {
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
+ }
- async [kDestroy] (err) {
- const destroyPromises = []
- for (const ref of this[kClients].values()) {
- const client = ref.deref()
- /* istanbul ignore else: gc is undeterministic */
- if (client) {
- destroyPromises.push(client.destroy(err))
+ if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
+ // istanbul ignore else: only for jest
+ if (socket[kParser].timeout.refresh) {
+ socket[kParser].timeout.refresh()
}
}
- await Promise.all(destroyPromises)
+ client[kResume]()
+ }
+
+ destroy (err) {
+ const { socket, client, abort } = this
+
+ socket[kWriting] = false
+
+ if (err) {
+ assert(client[kRunning] <= 1, 'pipeline should only contain this request')
+ abort(err)
+ }
}
}
-module.exports = Agent
+module.exports = connectH1
/***/ }),
-/***/ 7032:
+/***/ 8788:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-const { addAbortListener } = __nccwpck_require__(3983)
-const { RequestAbortedError } = __nccwpck_require__(8045)
-
-const kListener = Symbol('kListener')
-const kSignal = Symbol('kSignal')
-function abort (self) {
- if (self.abort) {
- self.abort()
- } else {
- self.onError(new RequestAbortedError())
- }
-}
-function addSignal (self, signal) {
- self[kSignal] = null
- self[kListener] = null
+const assert = __nccwpck_require__(4589)
+const { pipeline } = __nccwpck_require__(7075)
+const util = __nccwpck_require__(3440)
+const {
+ RequestContentLengthMismatchError,
+ RequestAbortedError,
+ SocketError,
+ InformationalError
+} = __nccwpck_require__(8707)
+const {
+ kUrl,
+ kReset,
+ kClient,
+ kRunning,
+ kPending,
+ kQueue,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kSocket,
+ kStrictContentLength,
+ kOnError,
+ kMaxConcurrentStreams,
+ kHTTP2Session,
+ kResume,
+ kSize,
+ kHTTPContext
+} = __nccwpck_require__(6443)
- if (!signal) {
- return
- }
+const kOpenStreams = Symbol('open streams')
- if (signal.aborted) {
- abort(self)
- return
- }
+let extractBody
- self[kSignal] = signal
- self[kListener] = () => {
- abort(self)
- }
+// Experimental
+let h2ExperimentalWarned = false
- addAbortListener(self[kSignal], self[kListener])
+/** @type {import('http2')} */
+let http2
+try {
+ http2 = __nccwpck_require__(2467)
+} catch {
+ // @ts-ignore
+ http2 = { constants: {} }
}
-function removeSignal (self) {
- if (!self[kSignal]) {
- return
+const {
+ constants: {
+ HTTP2_HEADER_AUTHORITY,
+ HTTP2_HEADER_METHOD,
+ HTTP2_HEADER_PATH,
+ HTTP2_HEADER_SCHEME,
+ HTTP2_HEADER_CONTENT_LENGTH,
+ HTTP2_HEADER_EXPECT,
+ HTTP2_HEADER_STATUS
}
+} = http2
- if ('removeEventListener' in self[kSignal]) {
- self[kSignal].removeEventListener('abort', self[kListener])
- } else {
- self[kSignal].removeListener('abort', self[kListener])
+function parseH2Headers (headers) {
+ const result = []
+
+ for (const [name, value] of Object.entries(headers)) {
+ // h2 may concat the header value by array
+ // e.g. Set-Cookie
+ if (Array.isArray(value)) {
+ for (const subvalue of value) {
+ // we need to provide each header value of header name
+ // because the headers handler expect name-value pair
+ result.push(Buffer.from(name), Buffer.from(subvalue))
+ }
+ } else {
+ result.push(Buffer.from(name), Buffer.from(value))
+ }
}
- self[kSignal] = null
- self[kListener] = null
+ return result
}
-module.exports = {
- addSignal,
- removeSignal
-}
+async function connectH2 (client, socket) {
+ client[kSocket] = socket
+ if (!h2ExperimentalWarned) {
+ h2ExperimentalWarned = true
+ process.emitWarning('H2 support is experimental, expect them to change at any time.', {
+ code: 'UNDICI-H2'
+ })
+ }
-/***/ }),
+ const session = http2.connect(client[kUrl], {
+ createConnection: () => socket,
+ peerMaxConcurrentStreams: client[kMaxConcurrentStreams]
+ })
-/***/ 9744:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ session[kOpenStreams] = 0
+ session[kClient] = client
+ session[kSocket] = socket
-"use strict";
+ util.addListener(session, 'error', onHttp2SessionError)
+ util.addListener(session, 'frameError', onHttp2FrameError)
+ util.addListener(session, 'end', onHttp2SessionEnd)
+ util.addListener(session, 'goaway', onHTTP2GoAway)
+ util.addListener(session, 'close', function () {
+ const { [kClient]: client } = this
+ const { [kSocket]: socket } = client
+ const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket))
-const { AsyncResource } = __nccwpck_require__(852)
-const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
+ client[kHTTP2Session] = null
-class ConnectHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
+ // Fail entire queue.
+ const requests = client[kQueue].splice(client[kRunningIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
+ }
}
+ })
- const { signal, opaque, responseHeaders } = opts
-
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ session.unref()
- super('UNDICI_CONNECT')
+ client[kHTTP2Session] = session
+ socket[kHTTP2Session] = session
- this.opaque = opaque || null
- this.responseHeaders = responseHeaders || null
- this.callback = callback
- this.abort = null
+ util.addListener(socket, 'error', function (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
- addSignal(this, signal)
- }
+ this[kError] = err
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
- }
+ this[kClient][kOnError](err)
+ })
- this.abort = abort
- this.context = context
- }
+ util.addListener(socket, 'end', function () {
+ util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
+ })
- onHeaders () {
- throw new SocketError('bad connect', null)
- }
+ util.addListener(socket, 'close', function () {
+ const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
- onUpgrade (statusCode, rawHeaders, socket) {
- const { callback, opaque, context } = this
+ client[kSocket] = null
- removeSignal(this)
+ if (this[kHTTP2Session] != null) {
+ this[kHTTP2Session].destroy(err)
+ }
- this.callback = null
+ client[kPendingIdx] = client[kRunningIdx]
- let headers = rawHeaders
- // Indicates is an HTTP2Session
- if (headers != null) {
- headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- }
+ assert(client[kRunning] === 0)
- this.runInAsyncScope(callback, null, null, {
- statusCode,
- headers,
- socket,
- opaque,
- context
- })
- }
+ client.emit('disconnect', client[kUrl], [client], err)
- onError (err) {
- const { callback, opaque } = this
+ client[kResume]()
+ })
- removeSignal(this)
+ let closed = false
+ socket.on('close', () => {
+ closed = true
+ })
- if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
+ return {
+ version: 'h2',
+ defaultPipelining: Infinity,
+ write (...args) {
+ return writeH2(client, ...args)
+ },
+ resume () {
+ resumeH2(client)
+ },
+ destroy (err, callback) {
+ if (closed) {
+ queueMicrotask(callback)
+ } else {
+ // Destroying the socket will trigger the session close
+ socket.destroy(err).on('close', callback)
+ }
+ },
+ get destroyed () {
+ return socket.destroyed
+ },
+ busy () {
+ return false
}
}
}
-function connect (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- connect.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+function resumeH2 (client) {
+ const socket = client[kSocket]
- try {
- const connectHandler = new ConnectHandler(opts, callback)
- this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ if (socket?.destroyed === false) {
+ if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) {
+ socket.unref()
+ client[kHTTP2Session].unref()
+ } else {
+ socket.ref()
+ client[kHTTP2Session].ref()
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
}
}
-module.exports = connect
-
-
-/***/ }),
-
-/***/ 8752:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function onHttp2SessionError (err) {
+ assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
-"use strict";
+ this[kSocket][kError] = err
+ this[kClient][kOnError](err)
+}
+function onHttp2FrameError (type, code, id) {
+ if (id === 0) {
+ const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
+ this[kSocket][kError] = err
+ this[kClient][kOnError](err)
+ }
+}
-const {
- Readable,
- Duplex,
- PassThrough
-} = __nccwpck_require__(2781)
-const {
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
-const assert = __nccwpck_require__(9491)
+function onHttp2SessionEnd () {
+ const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket]))
+ this.destroy(err)
+ util.destroy(this[kSocket], err)
+}
-const kResume = Symbol('resume')
+/**
+ * This is the root cause of #3011
+ * We need to handle GOAWAY frames properly, and trigger the session close
+ * along with the socket right away
+ */
+function onHTTP2GoAway (code) {
+ // We cannot recover, so best to close the session and the socket
+ const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this))
+ const client = this[kClient]
-class PipelineRequest extends Readable {
- constructor () {
- super({ autoDestroy: true })
+ client[kSocket] = null
+ client[kHTTPContext] = null
- this[kResume] = null
+ if (this[kHTTP2Session] != null) {
+ this[kHTTP2Session].destroy(err)
+ this[kHTTP2Session] = null
}
- _read () {
- const { [kResume]: resume } = this
+ util.destroy(this[kSocket], err)
- if (resume) {
- this[kResume] = null
- resume()
- }
+ // Fail head of pipeline.
+ if (client[kRunningIdx] < client[kQueue].length) {
+ const request = client[kQueue][client[kRunningIdx]]
+ client[kQueue][client[kRunningIdx]++] = null
+ util.errorRequest(client, request, err)
+ client[kPendingIdx] = client[kRunningIdx]
}
- _destroy (err, callback) {
- this._read()
+ assert(client[kRunning] === 0)
- callback(err)
- }
-}
+ client.emit('disconnect', client[kUrl], [client], err)
-class PipelineResponse extends Readable {
- constructor (resume) {
- super({ autoDestroy: true })
- this[kResume] = resume
- }
+ client[kResume]()
+}
- _read () {
- this[kResume]()
- }
+// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
+function shouldSendContentLength (method) {
+ return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
+}
- _destroy (err, callback) {
- if (!err && !this._readableState.endEmitted) {
- err = new RequestAbortedError()
- }
+function writeH2 (client, request) {
+ const session = client[kHTTP2Session]
+ const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
+ let { body } = request
- callback(err)
+ if (upgrade) {
+ util.errorRequest(client, request, new Error('Upgrade not supported for H2'))
+ return false
}
-}
-class PipelineHandler extends AsyncResource {
- constructor (opts, handler) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
+ const headers = {}
+ for (let n = 0; n < reqHeaders.length; n += 2) {
+ const key = reqHeaders[n + 0]
+ const val = reqHeaders[n + 1]
- if (typeof handler !== 'function') {
- throw new InvalidArgumentError('invalid handler')
+ if (Array.isArray(val)) {
+ for (let i = 0; i < val.length; i++) {
+ if (headers[key]) {
+ headers[key] += `,${val[i]}`
+ } else {
+ headers[key] = val[i]
+ }
+ }
+ } else {
+ headers[key] = val
}
+ }
- const { signal, method, opaque, onInfo, responseHeaders } = opts
+ /** @type {import('node:http2').ClientHttp2Stream} */
+ let stream
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ const { hostname, port } = client[kUrl]
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+ headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
+ headers[HTTP2_HEADER_METHOD] = method
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
+ const abort = (err) => {
+ if (request.aborted || request.completed) {
+ return
}
- super('UNDICI_PIPELINE')
-
- this.opaque = opaque || null
- this.responseHeaders = responseHeaders || null
- this.handler = handler
- this.abort = null
- this.context = null
- this.onInfo = onInfo || null
-
- this.req = new PipelineRequest().on('error', util.nop)
-
- this.ret = new Duplex({
- readableObjectMode: opts.objectMode,
- autoDestroy: true,
- read: () => {
- const { body } = this
-
- if (body && body.resume) {
- body.resume()
- }
- },
- write: (chunk, encoding, callback) => {
- const { req } = this
-
- if (req.push(chunk, encoding) || req._readableState.destroyed) {
- callback()
- } else {
- req[kResume] = callback
- }
- },
- destroy: (err, callback) => {
- const { body, req, res, ret, abort } = this
-
- if (!err && !ret._readableState.endEmitted) {
- err = new RequestAbortedError()
- }
-
- if (abort && err) {
- abort()
- }
-
- util.destroy(body, err)
- util.destroy(req, err)
- util.destroy(res, err)
-
- removeSignal(this)
+ err = err || new RequestAbortedError()
- callback(err)
- }
- }).on('prefinish', () => {
- const { req } = this
+ util.errorRequest(client, request, err)
- // Node < 15 does not call _final in same tick.
- req.push(null)
- })
+ if (stream != null) {
+ util.destroy(stream, err)
+ }
- this.res = null
+ // We do not destroy the socket as we can continue using the session
+ // the stream get's destroyed and the session remains to create new streams
+ util.destroy(body, err)
+ client[kQueue][client[kRunningIdx]++] = null
+ client[kResume]()
+ }
- addSignal(this, signal)
+ try {
+ // We are already connected, streams are pending.
+ // We can call on connect, and wait for abort
+ request.onConnect(abort)
+ } catch (err) {
+ util.errorRequest(client, request, err)
}
- onConnect (abort, context) {
- const { ret, res } = this
+ if (request.aborted) {
+ return false
+ }
- assert(!res, 'pipeline cannot be retried')
+ if (method === 'CONNECT') {
+ session.ref()
+ // We are already connected, streams are pending, first request
+ // will create a new stream. We trigger a request to create the stream and wait until
+ // `ready` event is triggered
+ // We disabled endStream to allow the user to write to the stream
+ stream = session.request(headers, { endStream: false, signal })
- if (ret.destroyed) {
- throw new RequestAbortedError()
+ if (stream.id && !stream.pending) {
+ request.onUpgrade(null, null, stream)
+ ++session[kOpenStreams]
+ client[kQueue][client[kRunningIdx]++] = null
+ } else {
+ stream.once('ready', () => {
+ request.onUpgrade(null, null, stream)
+ ++session[kOpenStreams]
+ client[kQueue][client[kRunningIdx]++] = null
+ })
}
- this.abort = abort
- this.context = context
- }
+ stream.once('close', () => {
+ session[kOpenStreams] -= 1
+ if (session[kOpenStreams] === 0) session.unref()
+ })
- onHeaders (statusCode, rawHeaders, resume) {
- const { opaque, handler, context } = this
+ return true
+ }
- if (statusCode < 200) {
- if (this.onInfo) {
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- this.onInfo({ statusCode, headers })
- }
- return
- }
+ // https://tools.ietf.org/html/rfc7540#section-8.3
+ // :path and :scheme headers must be omitted when sending CONNECT
- this.res = new PipelineResponse(resume)
+ headers[HTTP2_HEADER_PATH] = path
+ headers[HTTP2_HEADER_SCHEME] = 'https'
- let body
- try {
- this.handler = null
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- body = this.runInAsyncScope(handler, null, {
- statusCode,
- headers,
- opaque,
- body: this.res,
- context
- })
- } catch (err) {
- this.res.on('error', util.nop)
- throw err
- }
+ // https://tools.ietf.org/html/rfc7231#section-4.3.1
+ // https://tools.ietf.org/html/rfc7231#section-4.3.2
+ // https://tools.ietf.org/html/rfc7231#section-4.3.5
- if (!body || typeof body.on !== 'function') {
- throw new InvalidReturnValueError('expected Readable')
- }
+ // Sending a payload body on a request that does not
+ // expect it can cause undefined behavior on some
+ // servers and corrupt connection state. Do not
+ // re-use the connection for further requests.
- body
- .on('data', (chunk) => {
- const { ret, body } = this
+ const expectsPayload = (
+ method === 'PUT' ||
+ method === 'POST' ||
+ method === 'PATCH'
+ )
- if (!ret.push(chunk) && body.pause) {
- body.pause()
- }
- })
- .on('error', (err) => {
- const { ret } = this
+ if (body && typeof body.read === 'function') {
+ // Try to read EOF in order to get length.
+ body.read(0)
+ }
- util.destroy(ret, err)
- })
- .on('end', () => {
- const { ret } = this
+ let contentLength = util.bodyLength(body)
- ret.push(null)
- })
- .on('close', () => {
- const { ret } = this
+ if (util.isFormDataLike(body)) {
+ extractBody ??= (__nccwpck_require__(4492).extractBody)
- if (!ret._readableState.ended) {
- util.destroy(ret, new RequestAbortedError())
- }
- })
+ const [bodyStream, contentType] = extractBody(body)
+ headers['content-type'] = contentType
- this.body = body
+ body = bodyStream.stream
+ contentLength = bodyStream.length
}
- onData (chunk) {
- const { res } = this
- return res.push(chunk)
+ if (contentLength == null) {
+ contentLength = request.contentLength
}
- onComplete (trailers) {
- const { res } = this
- res.push(null)
- }
+ if (contentLength === 0 || !expectsPayload) {
+ // https://tools.ietf.org/html/rfc7230#section-3.3.2
+ // A user agent SHOULD NOT send a Content-Length header field when
+ // the request message does not contain a payload body and the method
+ // semantics do not anticipate such a body.
- onError (err) {
- const { ret } = this
- this.handler = null
- util.destroy(ret, err)
+ contentLength = null
}
-}
-function pipeline (opts, handler) {
- try {
- const pipelineHandler = new PipelineHandler(opts, handler)
- this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
- return pipelineHandler.ret
- } catch (err) {
- return new PassThrough().destroy(err)
- }
-}
+ // https://github.com/nodejs/undici/issues/2046
+ // A user agent may send a Content-Length header with 0 value, this should be allowed.
+ if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
+ if (client[kStrictContentLength]) {
+ util.errorRequest(client, request, new RequestContentLengthMismatchError())
+ return false
+ }
-module.exports = pipeline
+ process.emitWarning(new RequestContentLengthMismatchError())
+ }
+ if (contentLength != null) {
+ assert(body, 'no body must not have content length')
+ headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
+ }
-/***/ }),
+ session.ref()
-/***/ 5448:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null
+ if (expectContinue) {
+ headers[HTTP2_HEADER_EXPECT] = '100-continue'
+ stream = session.request(headers, { endStream: shouldEndStream, signal })
-"use strict";
+ stream.once('continue', writeBodyH2)
+ } else {
+ stream = session.request(headers, {
+ endStream: shouldEndStream,
+ signal
+ })
+ writeBodyH2()
+ }
+ // Increment counter as we have new streams open
+ ++session[kOpenStreams]
-const Readable = __nccwpck_require__(3858)
-const {
- InvalidArgumentError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
+ stream.once('response', headers => {
+ const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
+ request.onResponseStarted()
-class RequestHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+ // Due to the stream nature, it is possible we face a race condition
+ // where the stream has been assigned, but the request has been aborted
+ // the request remains in-flight and headers hasn't been received yet
+ // for those scenarios, best effort is to destroy the stream immediately
+ // as there's no value to keep it open.
+ if (request.aborted) {
+ const err = new RequestAbortedError()
+ util.errorRequest(client, request, err)
+ util.destroy(stream, err)
+ return
}
- const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
-
- try {
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
-
- if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
- throw new InvalidArgumentError('invalid highWaterMark')
- }
+ if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) {
+ stream.pause()
+ }
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
+ stream.on('data', (chunk) => {
+ if (request.onData(chunk) === false) {
+ stream.pause()
}
+ })
+ })
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+ stream.once('end', () => {
+ // When state is null, it means we haven't consumed body and the stream still do not have
+ // a state.
+ // Present specially when using pipeline or stream
+ if (stream.state?.state == null || stream.state.state < 6) {
+ request.onComplete([])
+ }
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
- }
+ if (session[kOpenStreams] === 0) {
+ // Stream is closed or half-closed-remote (6), decrement counter and cleanup
+ // It does not have sense to continue working with the stream as we do not
+ // have yet RST_STREAM support on client-side
- super('UNDICI_REQUEST')
- } catch (err) {
- if (util.isStream(body)) {
- util.destroy(body.on('error', util.nop), err)
- }
- throw err
+ session.unref()
}
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.callback = callback
- this.res = null
- this.abort = null
- this.body = body
- this.trailers = {}
- this.context = null
- this.onInfo = onInfo || null
- this.throwOnError = throwOnError
- this.highWaterMark = highWaterMark
+ abort(new InformationalError('HTTP/2: stream half-closed (remote)'))
+ client[kQueue][client[kRunningIdx]++] = null
+ client[kPendingIdx] = client[kRunningIdx]
+ client[kResume]()
+ })
- if (util.isStream(body)) {
- body.on('error', (err) => {
- this.onError(err)
- })
+ stream.once('close', () => {
+ session[kOpenStreams] -= 1
+ if (session[kOpenStreams] === 0) {
+ session.unref()
}
+ })
- addSignal(this, signal)
- }
+ stream.once('error', function (err) {
+ abort(err)
+ })
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
- }
+ stream.once('frameError', (type, code) => {
+ abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`))
+ })
- this.abort = abort
- this.context = context
- }
+ // stream.on('aborted', () => {
+ // // TODO(HTTP/2): Support aborted
+ // })
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
+ // stream.on('timeout', () => {
+ // // TODO(HTTP/2): Support timeout
+ // })
- const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+ // stream.on('push', headers => {
+ // // TODO(HTTP/2): Support push
+ // })
- if (statusCode < 200) {
- if (this.onInfo) {
- this.onInfo({ statusCode, headers })
- }
- return
- }
+ // stream.on('trailers', headers => {
+ // // TODO(HTTP/2): Support trailers
+ // })
- const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
- const contentType = parsedHeaders['content-type']
- const body = new Readable({ resume, abort, contentType, highWaterMark })
+ return true
- this.callback = null
- this.res = body
- if (callback !== null) {
- if (this.throwOnError && statusCode >= 400) {
- this.runInAsyncScope(getResolveErrorBodyCallback, null,
- { callback, body, contentType, statusCode, statusMessage, headers }
+ function writeBodyH2 () {
+ /* istanbul ignore else: assertion */
+ if (!body || contentLength === 0) {
+ writeBuffer(
+ abort,
+ stream,
+ null,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else if (util.isBuffer(body)) {
+ writeBuffer(
+ abort,
+ stream,
+ body,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else if (util.isBlobLike(body)) {
+ if (typeof body.stream === 'function') {
+ writeIterable(
+ abort,
+ stream,
+ body.stream(),
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
)
} else {
- this.runInAsyncScope(callback, null, null, {
- statusCode,
- headers,
- trailers: this.trailers,
- opaque,
+ writeBlob(
+ abort,
+ stream,
body,
- context
- })
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
}
+ } else if (util.isStream(body)) {
+ writeStream(
+ abort,
+ client[kSocket],
+ expectsPayload,
+ stream,
+ body,
+ client,
+ request,
+ contentLength
+ )
+ } else if (util.isIterable(body)) {
+ writeIterable(
+ abort,
+ stream,
+ body,
+ client,
+ request,
+ client[kSocket],
+ contentLength,
+ expectsPayload
+ )
+ } else {
+ assert(false)
}
}
+}
- onData (chunk) {
- const { res } = this
- return res.push(chunk)
- }
-
- onComplete (trailers) {
- const { res } = this
+function writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ try {
+ if (body != null && util.isBuffer(body)) {
+ assert(contentLength === body.byteLength, 'buffer body must have content length')
+ h2stream.cork()
+ h2stream.write(body)
+ h2stream.uncork()
+ h2stream.end()
- removeSignal(this)
+ request.onBodySent(body)
+ }
- util.parseHeaders(trailers, this.trailers)
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
- res.push(null)
+ request.onRequestSent()
+ client[kResume]()
+ } catch (error) {
+ abort(error)
}
+}
- onError (err) {
- const { res, callback, body, opaque } = this
+function writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
- removeSignal(this)
+ // For HTTP/2, is enough to pipe the stream
+ const pipe = pipeline(
+ body,
+ h2stream,
+ (err) => {
+ if (err) {
+ util.destroy(pipe, err)
+ abort(err)
+ } else {
+ util.removeAllListeners(pipe)
+ request.onRequestSent()
- if (callback) {
- // TODO: Does this need queueMicrotask?
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
- }
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
- if (res) {
- this.res = null
- // Ensure all queued handlers are invoked before destroying res.
- queueMicrotask(() => {
- util.destroy(res, err)
- })
+ client[kResume]()
+ }
}
+ )
- if (body) {
- this.body = null
- util.destroy(body, err)
- }
+ util.addListener(pipe, 'data', onPipeData)
+
+ function onPipeData (chunk) {
+ request.onBodySent(chunk)
}
}
-function request (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- request.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+async function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ assert(contentLength === body.size, 'blob body must have content length')
try {
- this.dispatch(opts, new RequestHandler(opts, callback))
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ if (contentLength != null && contentLength !== body.size) {
+ throw new RequestContentLengthMismatchError()
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
- }
-}
-
-module.exports = request
-module.exports.RequestHandler = RequestHandler
+ const buffer = Buffer.from(await body.arrayBuffer())
-/***/ }),
+ h2stream.cork()
+ h2stream.write(buffer)
+ h2stream.uncork()
+ h2stream.end()
-/***/ 5395:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ request.onBodySent(buffer)
+ request.onRequestSent()
-"use strict";
+ if (!expectsPayload) {
+ socket[kReset] = true
+ }
+ client[kResume]()
+ } catch (err) {
+ abort(err)
+ }
+}
-const { finished, PassThrough } = __nccwpck_require__(2781)
-const {
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
-const { AsyncResource } = __nccwpck_require__(852)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
+async function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) {
+ assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
-class StreamHandler extends AsyncResource {
- constructor (opts, factory, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
+ let callback = null
+ function onDrain () {
+ if (callback) {
+ const cb = callback
+ callback = null
+ cb()
}
+ }
- const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
-
- try {
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
-
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('invalid factory')
- }
+ const waitForDrain = () => new Promise((resolve, reject) => {
+ assert(callback === null)
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ if (socket[kError]) {
+ reject(socket[kError])
+ } else {
+ callback = resolve
+ }
+ })
- if (method === 'CONNECT') {
- throw new InvalidArgumentError('invalid method')
- }
+ h2stream
+ .on('close', onDrain)
+ .on('drain', onDrain)
- if (onInfo && typeof onInfo !== 'function') {
- throw new InvalidArgumentError('invalid onInfo callback')
+ try {
+ // It's up to the user to somehow abort the async iterable.
+ for await (const chunk of body) {
+ if (socket[kError]) {
+ throw socket[kError]
}
- super('UNDICI_STREAM')
- } catch (err) {
- if (util.isStream(body)) {
- util.destroy(body.on('error', util.nop), err)
+ const res = h2stream.write(chunk)
+ request.onBodySent(chunk)
+ if (!res) {
+ await waitForDrain()
}
- throw err
}
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.factory = factory
- this.callback = callback
- this.res = null
- this.abort = null
- this.context = null
- this.trailers = null
- this.body = body
- this.onInfo = onInfo || null
- this.throwOnError = throwOnError || false
+ h2stream.end()
- if (util.isStream(body)) {
- body.on('error', (err) => {
- this.onError(err)
- })
+ request.onRequestSent()
+
+ if (!expectsPayload) {
+ socket[kReset] = true
}
- addSignal(this, signal)
+ client[kResume]()
+ } catch (err) {
+ abort(err)
+ } finally {
+ h2stream
+ .off('close', onDrain)
+ .off('drain', onDrain)
}
+}
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
- }
+module.exports = connectH2
- this.abort = abort
- this.context = context
- }
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const { factory, opaque, context, callback, responseHeaders } = this
+/***/ }),
- const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
+/***/ 3701:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (statusCode < 200) {
- if (this.onInfo) {
- this.onInfo({ statusCode, headers })
- }
- return
- }
+// @ts-check
- this.factory = null
- let res
- if (this.throwOnError && statusCode >= 400) {
- const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
- const contentType = parsedHeaders['content-type']
- res = new PassThrough()
+const assert = __nccwpck_require__(4589)
+const net = __nccwpck_require__(7030)
+const http = __nccwpck_require__(7067)
+const util = __nccwpck_require__(3440)
+const { channels } = __nccwpck_require__(2414)
+const Request = __nccwpck_require__(4655)
+const DispatcherBase = __nccwpck_require__(1841)
+const {
+ InvalidArgumentError,
+ InformationalError,
+ ClientDestroyedError
+} = __nccwpck_require__(8707)
+const buildConnector = __nccwpck_require__(9136)
+const {
+ kUrl,
+ kServerName,
+ kClient,
+ kBusy,
+ kConnect,
+ kResuming,
+ kRunning,
+ kPending,
+ kSize,
+ kQueue,
+ kConnected,
+ kConnecting,
+ kNeedDrain,
+ kKeepAliveDefaultTimeout,
+ kHostHeader,
+ kPendingIdx,
+ kRunningIdx,
+ kError,
+ kPipelining,
+ kKeepAliveTimeoutValue,
+ kMaxHeadersSize,
+ kKeepAliveMaxTimeout,
+ kKeepAliveTimeoutThreshold,
+ kHeadersTimeout,
+ kBodyTimeout,
+ kStrictContentLength,
+ kConnector,
+ kMaxRedirections,
+ kMaxRequests,
+ kCounter,
+ kClose,
+ kDestroy,
+ kDispatch,
+ kInterceptors,
+ kLocalAddress,
+ kMaxResponseSize,
+ kOnError,
+ kHTTPContext,
+ kMaxConcurrentStreams,
+ kResume
+} = __nccwpck_require__(6443)
+const connectH1 = __nccwpck_require__(637)
+const connectH2 = __nccwpck_require__(8788)
+let deprecatedInterceptorWarned = false
- this.callback = null
- this.runInAsyncScope(getResolveErrorBodyCallback, null,
- { callback, body: res, contentType, statusCode, statusMessage, headers }
- )
- } else {
- if (factory === null) {
- return
- }
+const kClosedResolve = Symbol('kClosedResolve')
- res = this.runInAsyncScope(factory, null, {
- statusCode,
- headers,
- opaque,
- context
- })
+const noop = () => {}
- if (
- !res ||
- typeof res.write !== 'function' ||
- typeof res.end !== 'function' ||
- typeof res.on !== 'function'
- ) {
- throw new InvalidReturnValueError('expected Writable')
- }
+function getPipelining (client) {
+ return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1
+}
+
+/**
+ * @type {import('../../types/client.js').default}
+ */
+class Client extends DispatcherBase {
+ /**
+ *
+ * @param {string|URL} url
+ * @param {import('../../types/client.js').Client.Options} options
+ */
+ constructor (url, {
+ interceptors,
+ maxHeaderSize,
+ headersTimeout,
+ socketTimeout,
+ requestTimeout,
+ connectTimeout,
+ bodyTimeout,
+ idleTimeout,
+ keepAlive,
+ keepAliveTimeout,
+ maxKeepAliveTimeout,
+ keepAliveMaxTimeout,
+ keepAliveTimeoutThreshold,
+ socketPath,
+ pipelining,
+ tls,
+ strictContentLength,
+ maxCachedSessions,
+ maxRedirections,
+ connect,
+ maxRequestsPerClient,
+ localAddress,
+ maxResponseSize,
+ autoSelectFamily,
+ autoSelectFamilyAttemptTimeout,
+ // h2
+ maxConcurrentStreams,
+ allowH2,
+ webSocket
+ } = {}) {
+ super({ webSocket })
- // TODO: Avoid finished. It registers an unnecessary amount of listeners.
- finished(res, { readable: false }, (err) => {
- const { callback, res, opaque, trailers, abort } = this
+ if (keepAlive !== undefined) {
+ throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
+ }
- this.res = null
- if (err || !res.readable) {
- util.destroy(res, err)
- }
+ if (socketTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
+ }
- this.callback = null
- this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
+ if (requestTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
+ }
- if (err) {
- abort()
- }
- })
+ if (idleTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
}
- res.on('drain', resume)
+ if (maxKeepAliveTimeout !== undefined) {
+ throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
+ }
- this.res = res
+ if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
+ throw new InvalidArgumentError('invalid maxHeaderSize')
+ }
- const needDrain = res.writableNeedDrain !== undefined
- ? res.writableNeedDrain
- : res._writableState && res._writableState.needDrain
+ if (socketPath != null && typeof socketPath !== 'string') {
+ throw new InvalidArgumentError('invalid socketPath')
+ }
- return needDrain !== true
- }
+ if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
+ throw new InvalidArgumentError('invalid connectTimeout')
+ }
- onData (chunk) {
- const { res } = this
+ if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
+ throw new InvalidArgumentError('invalid keepAliveTimeout')
+ }
- return res ? res.write(chunk) : true
- }
+ if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
+ throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
+ }
- onComplete (trailers) {
- const { res } = this
+ if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
+ throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
+ }
- removeSignal(this)
+ if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
+ throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
+ }
- if (!res) {
- return
+ if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
+ throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
}
- this.trailers = util.parseHeaders(trailers)
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
+ }
- res.end()
- }
+ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
+ throw new InvalidArgumentError('maxRedirections must be a positive number')
+ }
- onError (err) {
- const { res, callback, opaque, body } = this
+ if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
+ throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
+ }
- removeSignal(this)
+ if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
+ throw new InvalidArgumentError('localAddress must be valid string IP address')
+ }
- this.factory = null
+ if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
+ throw new InvalidArgumentError('maxResponseSize must be a positive number')
+ }
- if (res) {
- this.res = null
- util.destroy(res, err)
- } else if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
+ if (
+ autoSelectFamilyAttemptTimeout != null &&
+ (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
+ ) {
+ throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
}
- if (body) {
- this.body = null
- util.destroy(body, err)
+ // h2
+ if (allowH2 != null && typeof allowH2 !== 'boolean') {
+ throw new InvalidArgumentError('allowH2 must be a valid boolean value')
}
- }
-}
-function stream (opts, factory, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- stream.call(this, opts, factory, (err, data) => {
- return err ? reject(err) : resolve(data)
+ if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
+ throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')
+ }
+
+ if (typeof connect !== 'function') {
+ connect = buildConnector({
+ ...tls,
+ maxCachedSessions,
+ allowH2,
+ socketPath,
+ timeout: connectTimeout,
+ ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
+ ...connect
})
- })
- }
+ }
- try {
- this.dispatch(opts, new StreamHandler(opts, factory, callback))
- } catch (err) {
- if (typeof callback !== 'function') {
- throw err
+ if (interceptors?.Client && Array.isArray(interceptors.Client)) {
+ this[kInterceptors] = interceptors.Client
+ if (!deprecatedInterceptorWarned) {
+ deprecatedInterceptorWarned = true
+ process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', {
+ code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED'
+ })
+ }
+ } else {
+ this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
- }
-}
-module.exports = stream
+ this[kUrl] = util.parseOrigin(url)
+ this[kConnector] = connect
+ this[kPipelining] = pipelining != null ? pipelining : 1
+ this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
+ this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
+ this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
+ this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold
+ this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
+ this[kServerName] = null
+ this[kLocalAddress] = localAddress != null ? localAddress : null
+ this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
+ this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
+ this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
+ this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
+ this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
+ this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
+ this[kMaxRedirections] = maxRedirections
+ this[kMaxRequests] = maxRequestsPerClient
+ this[kClosedResolve] = null
+ this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
+ this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
+ this[kHTTPContext] = null
+ // kQueue is built up of 3 sections separated by
+ // the kRunningIdx and kPendingIdx indices.
+ // | complete | running | pending |
+ // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
+ // kRunningIdx points to the first running element.
+ // kPendingIdx points to the first pending element.
+ // This implements a fast queue with an amortized
+ // time of O(1).
-/***/ }),
+ this[kQueue] = []
+ this[kRunningIdx] = 0
+ this[kPendingIdx] = 0
-/***/ 6923:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this[kResume] = (sync) => resume(this, sync)
+ this[kOnError] = (err) => onError(this, err)
+ }
-"use strict";
+ get pipelining () {
+ return this[kPipelining]
+ }
+ set pipelining (value) {
+ this[kPipelining] = value
+ this[kResume](true)
+ }
-const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
-const { AsyncResource } = __nccwpck_require__(852)
-const util = __nccwpck_require__(3983)
-const { addSignal, removeSignal } = __nccwpck_require__(7032)
-const assert = __nccwpck_require__(9491)
+ get [kPending] () {
+ return this[kQueue].length - this[kPendingIdx]
+ }
-class UpgradeHandler extends AsyncResource {
- constructor (opts, callback) {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('invalid opts')
- }
+ get [kRunning] () {
+ return this[kPendingIdx] - this[kRunningIdx]
+ }
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
+ get [kSize] () {
+ return this[kQueue].length - this[kRunningIdx]
+ }
- const { signal, opaque, responseHeaders } = opts
+ get [kConnected] () {
+ return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed
+ }
- if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
- throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
- }
+ get [kBusy] () {
+ return Boolean(
+ this[kHTTPContext]?.busy(null) ||
+ (this[kSize] >= (getPipelining(this) || 1)) ||
+ this[kPending] > 0
+ )
+ }
- super('UNDICI_UPGRADE')
+ /* istanbul ignore: only used for test */
+ [kConnect] (cb) {
+ connect(this)
+ this.once('connect', cb)
+ }
- this.responseHeaders = responseHeaders || null
- this.opaque = opaque || null
- this.callback = callback
- this.abort = null
- this.context = null
+ [kDispatch] (opts, handler) {
+ const origin = opts.origin || this[kUrl].origin
+ const request = new Request(origin, opts, handler)
- addSignal(this, signal)
- }
+ this[kQueue].push(request)
+ if (this[kResuming]) {
+ // Do nothing.
+ } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
+ // Wait a tick in case stream/iterator is ended in the same tick.
+ this[kResuming] = 1
+ queueMicrotask(() => resume(this))
+ } else {
+ this[kResume](true)
+ }
- onConnect (abort, context) {
- if (!this.callback) {
- throw new RequestAbortedError()
+ if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
+ this[kNeedDrain] = 2
}
- this.abort = abort
- this.context = null
+ return this[kNeedDrain] < 2
}
- onHeaders () {
- throw new SocketError('bad upgrade', null)
+ async [kClose] () {
+ // TODO: for H2 we need to gracefully flush the remaining enqueued
+ // request and close each stream.
+ return new Promise((resolve) => {
+ if (this[kSize]) {
+ this[kClosedResolve] = resolve
+ } else {
+ resolve(null)
+ }
+ })
}
- onUpgrade (statusCode, rawHeaders, socket) {
- const { callback, opaque, context } = this
+ async [kDestroy] (err) {
+ return new Promise((resolve) => {
+ const requests = this[kQueue].splice(this[kPendingIdx])
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(this, request, err)
+ }
- assert.strictEqual(statusCode, 101)
+ const callback = () => {
+ if (this[kClosedResolve]) {
+ // TODO (fix): Should we error here with ClientDestroyedError?
+ this[kClosedResolve]()
+ this[kClosedResolve] = null
+ }
+ resolve(null)
+ }
- removeSignal(this)
+ if (this[kHTTPContext]) {
+ this[kHTTPContext].destroy(err, callback)
+ this[kHTTPContext] = null
+ } else {
+ queueMicrotask(callback)
+ }
- this.callback = null
- const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
- this.runInAsyncScope(callback, null, null, {
- headers,
- socket,
- opaque,
- context
+ this[kResume]()
})
}
+}
- onError (err) {
- const { callback, opaque } = this
+const createRedirectInterceptor = __nccwpck_require__(5092)
- removeSignal(this)
+function onError (client, err) {
+ if (
+ client[kRunning] === 0 &&
+ err.code !== 'UND_ERR_INFO' &&
+ err.code !== 'UND_ERR_SOCKET'
+ ) {
+ // Error is not caused by running request and not a recoverable
+ // socket error.
- if (callback) {
- this.callback = null
- queueMicrotask(() => {
- this.runInAsyncScope(callback, null, err, { opaque })
- })
+ assert(client[kPendingIdx] === client[kRunningIdx])
+
+ const requests = client[kQueue].splice(client[kRunningIdx])
+
+ for (let i = 0; i < requests.length; i++) {
+ const request = requests[i]
+ util.errorRequest(client, request, err)
}
+ assert(client[kSize] === 0)
}
}
-function upgrade (opts, callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- upgrade.call(this, opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
+/**
+ * @param {Client} client
+ * @returns
+ */
+async function connect (client) {
+ assert(!client[kConnecting])
+ assert(!client[kHTTPContext])
+
+ let { host, hostname, protocol, port } = client[kUrl]
+
+ // Resolve ipv6
+ if (hostname[0] === '[') {
+ const idx = hostname.indexOf(']')
+
+ assert(idx !== -1)
+ const ip = hostname.substring(1, idx)
+
+ assert(net.isIP(ip))
+ hostname = ip
+ }
+
+ client[kConnecting] = true
+
+ if (channels.beforeConnect.hasSubscribers) {
+ channels.beforeConnect.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector]
})
}
try {
- const upgradeHandler = new UpgradeHandler(opts, callback)
- this.dispatch({
- ...opts,
- method: opts.method || 'GET',
- upgrade: opts.protocol || 'Websocket'
- }, upgradeHandler)
- } catch (err) {
- if (typeof callback !== 'function') {
+ const socket = await new Promise((resolve, reject) => {
+ client[kConnector]({
+ host,
+ hostname,
+ protocol,
+ port,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ }, (err, socket) => {
+ if (err) {
+ reject(err)
+ } else {
+ resolve(socket)
+ }
+ })
+ })
+
+ if (client.destroyed) {
+ util.destroy(socket.on('error', noop), new ClientDestroyedError())
+ return
+ }
+
+ assert(socket)
+
+ try {
+ client[kHTTPContext] = socket.alpnProtocol === 'h2'
+ ? await connectH2(client, socket)
+ : await connectH1(client, socket)
+ } catch (err) {
+ socket.destroy().on('error', noop)
throw err
}
- const opaque = opts && opts.opaque
- queueMicrotask(() => callback(err, { opaque }))
- }
-}
-module.exports = upgrade
+ client[kConnecting] = false
+ socket[kCounter] = 0
+ socket[kMaxRequests] = client[kMaxRequests]
+ socket[kClient] = client
+ socket[kError] = null
-/***/ }),
+ if (channels.connected.hasSubscribers) {
+ channels.connected.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector],
+ socket
+ })
+ }
+ client.emit('connect', client[kUrl], [client])
+ } catch (err) {
+ if (client.destroyed) {
+ return
+ }
-/***/ 4059:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ client[kConnecting] = false
-"use strict";
+ if (channels.connectError.hasSubscribers) {
+ channels.connectError.publish({
+ connectParams: {
+ host,
+ hostname,
+ protocol,
+ port,
+ version: client[kHTTPContext]?.version,
+ servername: client[kServerName],
+ localAddress: client[kLocalAddress]
+ },
+ connector: client[kConnector],
+ error: err
+ })
+ }
+ if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
+ assert(client[kRunning] === 0)
+ while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
+ const request = client[kQueue][client[kPendingIdx]++]
+ util.errorRequest(client, request, err)
+ }
+ } else {
+ onError(client, err)
+ }
-module.exports.request = __nccwpck_require__(5448)
-module.exports.stream = __nccwpck_require__(5395)
-module.exports.pipeline = __nccwpck_require__(8752)
-module.exports.upgrade = __nccwpck_require__(6923)
-module.exports.connect = __nccwpck_require__(9744)
+ client.emit('connectionError', client[kUrl], [client], err)
+ }
+ client[kResume]()
+}
-/***/ }),
+function emitDrain (client) {
+ client[kNeedDrain] = 0
+ client.emit('drain', client[kUrl], [client])
+}
-/***/ 3858:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function resume (client, sync) {
+ if (client[kResuming] === 2) {
+ return
+ }
-"use strict";
-// Ported from https://github.com/nodejs/undici/pull/907
+ client[kResuming] = 2
+ _resume(client, sync)
+ client[kResuming] = 0
+ if (client[kRunningIdx] > 256) {
+ client[kQueue].splice(0, client[kRunningIdx])
+ client[kPendingIdx] -= client[kRunningIdx]
+ client[kRunningIdx] = 0
+ }
+}
-const assert = __nccwpck_require__(9491)
-const { Readable } = __nccwpck_require__(2781)
-const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
+function _resume (client, sync) {
+ while (true) {
+ if (client.destroyed) {
+ assert(client[kPending] === 0)
+ return
+ }
-let Blob
+ if (client[kClosedResolve] && !client[kSize]) {
+ client[kClosedResolve]()
+ client[kClosedResolve] = null
+ return
+ }
-const kConsume = Symbol('kConsume')
-const kReading = Symbol('kReading')
-const kBody = Symbol('kBody')
-const kAbort = Symbol('abort')
-const kContentType = Symbol('kContentType')
+ if (client[kHTTPContext]) {
+ client[kHTTPContext].resume()
+ }
-const noop = () => {}
+ if (client[kBusy]) {
+ client[kNeedDrain] = 2
+ } else if (client[kNeedDrain] === 2) {
+ if (sync) {
+ client[kNeedDrain] = 1
+ queueMicrotask(() => emitDrain(client))
+ } else {
+ emitDrain(client)
+ }
+ continue
+ }
-module.exports = class BodyReadable extends Readable {
- constructor ({
- resume,
- abort,
- contentType = '',
- highWaterMark = 64 * 1024 // Same as nodejs fs streams.
- }) {
- super({
- autoDestroy: true,
- read: resume,
- highWaterMark
- })
+ if (client[kPending] === 0) {
+ return
+ }
- this._readableState.dataEmitted = false
+ if (client[kRunning] >= (getPipelining(client) || 1)) {
+ return
+ }
- this[kAbort] = abort
- this[kConsume] = null
- this[kBody] = null
- this[kContentType] = contentType
+ const request = client[kQueue][client[kPendingIdx]]
- // Is stream being consumed through Readable API?
- // This is an optimization so that we avoid checking
- // for 'data' and 'readable' listeners in the hot path
- // inside push().
- this[kReading] = false
- }
+ if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
+ if (client[kRunning] > 0) {
+ return
+ }
- destroy (err) {
- if (this.destroyed) {
- // Node < 16
- return this
+ client[kServerName] = request.servername
+ client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => {
+ client[kHTTPContext] = null
+ resume(client)
+ })
}
- if (!err && !this._readableState.endEmitted) {
- err = new RequestAbortedError()
+ if (client[kConnecting]) {
+ return
}
- if (err) {
- this[kAbort]()
+ if (!client[kHTTPContext]) {
+ connect(client)
+ return
}
- return super.destroy(err)
- }
+ if (client[kHTTPContext].destroyed) {
+ return
+ }
- emit (ev, ...args) {
- if (ev === 'data') {
- // Node < 16.7
- this._readableState.dataEmitted = true
- } else if (ev === 'error') {
- // Node < 16
- this._readableState.errorEmitted = true
+ if (client[kHTTPContext].busy(request)) {
+ return
}
- return super.emit(ev, ...args)
- }
- on (ev, ...args) {
- if (ev === 'data' || ev === 'readable') {
- this[kReading] = true
+ if (!request.aborted && client[kHTTPContext].write(request)) {
+ client[kPendingIdx]++
+ } else {
+ client[kQueue].splice(client[kPendingIdx], 1)
}
- return super.on(ev, ...args)
}
+}
- addListener (ev, ...args) {
- return this.on(ev, ...args)
- }
+module.exports = Client
- off (ev, ...args) {
- const ret = super.off(ev, ...args)
- if (ev === 'data' || ev === 'readable') {
- this[kReading] = (
- this.listenerCount('data') > 0 ||
- this.listenerCount('readable') > 0
- )
- }
- return ret
- }
- removeListener (ev, ...args) {
- return this.off(ev, ...args)
+/***/ }),
+
+/***/ 1841:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const Dispatcher = __nccwpck_require__(883)
+const {
+ ClientDestroyedError,
+ ClientClosedError,
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(6443)
+
+const kOnDestroyed = Symbol('onDestroyed')
+const kOnClosed = Symbol('onClosed')
+const kInterceptedDispatch = Symbol('Intercepted Dispatch')
+const kWebSocketOptions = Symbol('webSocketOptions')
+
+class DispatcherBase extends Dispatcher {
+ constructor (opts) {
+ super()
+
+ this[kDestroyed] = false
+ this[kOnDestroyed] = null
+ this[kClosed] = false
+ this[kOnClosed] = []
+ this[kWebSocketOptions] = opts?.webSocket ?? {}
}
- push (chunk) {
- if (this[kConsume] && chunk !== null && this.readableLength === 0) {
- consumePush(this[kConsume], chunk)
- return this[kReading] ? super.push(chunk) : true
+ get webSocketOptions () {
+ return {
+ maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,
+ maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024
}
- return super.push(chunk)
}
- // https://fetch.spec.whatwg.org/#dom-body-text
- async text () {
- return consume(this, 'text')
+ get destroyed () {
+ return this[kDestroyed]
}
- // https://fetch.spec.whatwg.org/#dom-body-json
- async json () {
- return consume(this, 'json')
+ get closed () {
+ return this[kClosed]
}
- // https://fetch.spec.whatwg.org/#dom-body-blob
- async blob () {
- return consume(this, 'blob')
+ get interceptors () {
+ return this[kInterceptors]
}
- // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
- async arrayBuffer () {
- return consume(this, 'arrayBuffer')
- }
+ set interceptors (newInterceptors) {
+ if (newInterceptors) {
+ for (let i = newInterceptors.length - 1; i >= 0; i--) {
+ const interceptor = this[kInterceptors][i]
+ if (typeof interceptor !== 'function') {
+ throw new InvalidArgumentError('interceptor must be an function')
+ }
+ }
+ }
- // https://fetch.spec.whatwg.org/#dom-body-formdata
- async formData () {
- // TODO: Implement.
- throw new NotSupportedError()
+ this[kInterceptors] = newInterceptors
}
- // https://fetch.spec.whatwg.org/#dom-body-bodyused
- get bodyUsed () {
- return util.isDisturbed(this)
- }
+ close (callback) {
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ this.close((err, data) => {
+ return err ? reject(err) : resolve(data)
+ })
+ })
+ }
- // https://fetch.spec.whatwg.org/#dom-body-body
- get body () {
- if (!this[kBody]) {
- this[kBody] = ReadableStreamFrom(this)
- if (this[kConsume]) {
- // TODO: Is this the best way to force a lock?
- this[kBody].getReader() // Ensure stream is locked.
- assert(this[kBody].locked)
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
+
+ if (this[kDestroyed]) {
+ queueMicrotask(() => callback(new ClientDestroyedError(), null))
+ return
+ }
+
+ if (this[kClosed]) {
+ if (this[kOnClosed]) {
+ this[kOnClosed].push(callback)
+ } else {
+ queueMicrotask(() => callback(null, null))
}
+ return
}
- return this[kBody]
- }
- dump (opts) {
- let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
- const signal = opts && opts.signal
+ this[kClosed] = true
+ this[kOnClosed].push(callback)
- if (signal) {
- try {
- if (typeof signal !== 'object' || !('aborted' in signal)) {
- throw new InvalidArgumentError('signal must be an AbortSignal')
- }
- util.throwIfAborted(signal)
- } catch (err) {
- return Promise.reject(err)
+ const onClosed = () => {
+ const callbacks = this[kOnClosed]
+ this[kOnClosed] = null
+ for (let i = 0; i < callbacks.length; i++) {
+ callbacks[i](null, null)
}
}
- if (this.closed) {
- return Promise.resolve(null)
+ // Should not error.
+ this[kClose]()
+ .then(() => this.destroy())
+ .then(() => {
+ queueMicrotask(onClosed)
+ })
+ }
+
+ destroy (err, callback) {
+ if (typeof err === 'function') {
+ callback = err
+ err = null
}
- return new Promise((resolve, reject) => {
- const signalListenerCleanup = signal
- ? util.addAbortListener(signal, () => {
- this.destroy()
+ if (callback === undefined) {
+ return new Promise((resolve, reject) => {
+ this.destroy(err, (err, data) => {
+ return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
})
- : noop
+ })
+ }
- this
- .on('close', function () {
- signalListenerCleanup()
- if (signal && signal.aborted) {
- reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
- } else {
- resolve(null)
- }
- })
- .on('error', noop)
- .on('data', function (chunk) {
- limit -= chunk.length
- if (limit <= 0) {
- this.destroy()
- }
- })
- .resume()
- })
- }
-}
+ if (typeof callback !== 'function') {
+ throw new InvalidArgumentError('invalid callback')
+ }
-// https://streams.spec.whatwg.org/#readablestream-locked
-function isLocked (self) {
- // Consume is an implicit lock.
- return (self[kBody] && self[kBody].locked === true) || self[kConsume]
-}
+ if (this[kDestroyed]) {
+ if (this[kOnDestroyed]) {
+ this[kOnDestroyed].push(callback)
+ } else {
+ queueMicrotask(() => callback(null, null))
+ }
+ return
+ }
-// https://fetch.spec.whatwg.org/#body-unusable
-function isUnusable (self) {
- return util.isDisturbed(self) || isLocked(self)
-}
+ if (!err) {
+ err = new ClientDestroyedError()
+ }
-async function consume (stream, type) {
- if (isUnusable(stream)) {
- throw new TypeError('unusable')
+ this[kDestroyed] = true
+ this[kOnDestroyed] = this[kOnDestroyed] || []
+ this[kOnDestroyed].push(callback)
+
+ const onDestroyed = () => {
+ const callbacks = this[kOnDestroyed]
+ this[kOnDestroyed] = null
+ for (let i = 0; i < callbacks.length; i++) {
+ callbacks[i](null, null)
+ }
+ }
+
+ // Should not error.
+ this[kDestroy](err).then(() => {
+ queueMicrotask(onDestroyed)
+ })
}
- assert(!stream[kConsume])
+ [kInterceptedDispatch] (opts, handler) {
+ if (!this[kInterceptors] || this[kInterceptors].length === 0) {
+ this[kInterceptedDispatch] = this[kDispatch]
+ return this[kDispatch](opts, handler)
+ }
- return new Promise((resolve, reject) => {
- stream[kConsume] = {
- type,
- stream,
- resolve,
- reject,
- length: 0,
- body: []
+ let dispatch = this[kDispatch].bind(this)
+ for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
+ dispatch = this[kInterceptors][i](dispatch)
}
+ this[kInterceptedDispatch] = dispatch
+ return dispatch(opts, handler)
+ }
- stream
- .on('error', function (err) {
- consumeFinish(this[kConsume], err)
- })
- .on('close', function () {
- if (this[kConsume].body !== null) {
- consumeFinish(this[kConsume], new RequestAbortedError())
- }
- })
+ dispatch (opts, handler) {
+ if (!handler || typeof handler !== 'object') {
+ throw new InvalidArgumentError('handler must be an object')
+ }
- process.nextTick(consumeStart, stream[kConsume])
- })
-}
+ try {
+ if (!opts || typeof opts !== 'object') {
+ throw new InvalidArgumentError('opts must be an object.')
+ }
-function consumeStart (consume) {
- if (consume.body === null) {
- return
- }
+ if (this[kDestroyed] || this[kOnDestroyed]) {
+ throw new ClientDestroyedError()
+ }
- const { _readableState: state } = consume.stream
+ if (this[kClosed]) {
+ throw new ClientClosedError()
+ }
+
+ return this[kInterceptedDispatch](opts, handler)
+ } catch (err) {
+ if (typeof handler.onError !== 'function') {
+ throw new InvalidArgumentError('invalid onError method')
+ }
+
+ handler.onError(err)
- for (const chunk of state.buffer) {
- consumePush(consume, chunk)
+ return false
+ }
}
+}
- if (state.endEmitted) {
- consumeEnd(this[kConsume])
- } else {
- consume.stream.on('end', function () {
- consumeEnd(this[kConsume])
- })
+module.exports = DispatcherBase
+
+
+/***/ }),
+
+/***/ 883:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+const EventEmitter = __nccwpck_require__(8474)
+
+class Dispatcher extends EventEmitter {
+ dispatch () {
+ throw new Error('not implemented')
}
- consume.stream.resume()
+ close () {
+ throw new Error('not implemented')
+ }
- while (consume.stream.read() != null) {
- // Loop
+ destroy () {
+ throw new Error('not implemented')
}
-}
-function consumeEnd (consume) {
- const { type, body, resolve, stream, length } = consume
+ compose (...args) {
+ // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...
+ const interceptors = Array.isArray(args[0]) ? args[0] : args
+ let dispatch = this.dispatch.bind(this)
- try {
- if (type === 'text') {
- resolve(toUSVString(Buffer.concat(body)))
- } else if (type === 'json') {
- resolve(JSON.parse(Buffer.concat(body)))
- } else if (type === 'arrayBuffer') {
- const dst = new Uint8Array(length)
+ for (const interceptor of interceptors) {
+ if (interceptor == null) {
+ continue
+ }
- let pos = 0
- for (const buf of body) {
- dst.set(buf, pos)
- pos += buf.byteLength
+ if (typeof interceptor !== 'function') {
+ throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)
}
- resolve(dst.buffer)
- } else if (type === 'blob') {
- if (!Blob) {
- Blob = (__nccwpck_require__(4300).Blob)
+ dispatch = interceptor(dispatch)
+
+ if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {
+ throw new TypeError('invalid interceptor')
}
- resolve(new Blob(body, { type: stream[kContentType] }))
}
- consumeFinish(consume)
- } catch (err) {
- stream.destroy(err)
+ return new ComposedDispatcher(this, dispatch)
}
}
-function consumePush (consume, chunk) {
- consume.length += chunk.length
- consume.body.push(chunk)
-}
+class ComposedDispatcher extends Dispatcher {
+ #dispatcher = null
+ #dispatch = null
-function consumeFinish (consume, err) {
- if (consume.body === null) {
- return
+ constructor (dispatcher, dispatch) {
+ super()
+ this.#dispatcher = dispatcher
+ this.#dispatch = dispatch
}
- if (err) {
- consume.reject(err)
- } else {
- consume.resolve()
+ dispatch (...args) {
+ this.#dispatch(...args)
}
- consume.type = null
- consume.stream = null
- consume.resolve = null
- consume.reject = null
- consume.length = 0
- consume.body = null
+ close (...args) {
+ return this.#dispatcher.close(...args)
+ }
+
+ destroy (...args) {
+ return this.#dispatcher.destroy(...args)
+ }
}
+module.exports = Dispatcher
+
/***/ }),
-/***/ 7474:
+/***/ 3137:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-const assert = __nccwpck_require__(9491)
-const {
- ResponseStatusCodeError
-} = __nccwpck_require__(8045)
-const { toUSVString } = __nccwpck_require__(3983)
-async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
- assert(body)
- let chunks = []
- let limit = 0
+const DispatcherBase = __nccwpck_require__(1841)
+const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(6443)
+const ProxyAgent = __nccwpck_require__(6672)
+const Agent = __nccwpck_require__(7405)
- for await (const chunk of body) {
- chunks.push(chunk)
- limit += chunk.length
- if (limit > 128 * 1024) {
- chunks = null
- break
+const DEFAULT_PORTS = {
+ 'http:': 80,
+ 'https:': 443
+}
+
+let experimentalWarned = false
+
+class EnvHttpProxyAgent extends DispatcherBase {
+ #noProxyValue = null
+ #noProxyEntries = null
+ #opts = null
+
+ constructor (opts = {}) {
+ super()
+ this.#opts = opts
+
+ if (!experimentalWarned) {
+ experimentalWarned = true
+ process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', {
+ code: 'UNDICI-EHPA'
+ })
}
+
+ const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts
+
+ this[kNoProxyAgent] = new Agent(agentOpts)
+
+ const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY
+ if (HTTP_PROXY) {
+ this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY })
+ } else {
+ this[kHttpProxyAgent] = this[kNoProxyAgent]
+ }
+
+ const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY
+ if (HTTPS_PROXY) {
+ this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY })
+ } else {
+ this[kHttpsProxyAgent] = this[kHttpProxyAgent]
+ }
+
+ this.#parseNoProxy()
}
- if (statusCode === 204 || !contentType || !chunks) {
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
- return
+ [kDispatch] (opts, handler) {
+ const url = new URL(opts.origin)
+ const agent = this.#getProxyAgentForUrl(url)
+ return agent.dispatch(opts, handler)
}
- try {
- if (contentType.startsWith('application/json')) {
- const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
- return
+ async [kClose] () {
+ await this[kNoProxyAgent].close()
+ if (!this[kHttpProxyAgent][kClosed]) {
+ await this[kHttpProxyAgent].close()
}
+ if (!this[kHttpsProxyAgent][kClosed]) {
+ await this[kHttpsProxyAgent].close()
+ }
+ }
- if (contentType.startsWith('text/')) {
- const payload = toUSVString(Buffer.concat(chunks))
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
- return
+ async [kDestroy] (err) {
+ await this[kNoProxyAgent].destroy(err)
+ if (!this[kHttpProxyAgent][kDestroyed]) {
+ await this[kHttpProxyAgent].destroy(err)
+ }
+ if (!this[kHttpsProxyAgent][kDestroyed]) {
+ await this[kHttpsProxyAgent].destroy(err)
}
- } catch (err) {
- // Process in a fallback if error
}
- process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
-}
+ #getProxyAgentForUrl (url) {
+ let { protocol, host: hostname, port } = url
-module.exports = { getResolveErrorBodyCallback }
+ // Stripping ports in this way instead of using parsedUrl.hostname to make
+ // sure that the brackets around IPv6 addresses are kept.
+ hostname = hostname.replace(/:\d*$/, '').toLowerCase()
+ port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0
+ if (!this.#shouldProxy(hostname, port)) {
+ return this[kNoProxyAgent]
+ }
+ if (protocol === 'https:') {
+ return this[kHttpsProxyAgent]
+ }
+ return this[kHttpProxyAgent]
+ }
+ #shouldProxy (hostname, port) {
+ if (this.#noProxyChanged) {
+ this.#parseNoProxy()
+ }
-/***/ }),
+ if (this.#noProxyEntries.length === 0) {
+ return true // Always proxy if NO_PROXY is not set or empty.
+ }
+ if (this.#noProxyValue === '*') {
+ return false // Never proxy if wildcard is set.
+ }
-/***/ 7931:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ for (let i = 0; i < this.#noProxyEntries.length; i++) {
+ const entry = this.#noProxyEntries[i]
+ if (entry.port && entry.port !== port) {
+ continue // Skip if ports don't match.
+ }
+ if (!/^[.*]/.test(entry.hostname)) {
+ // No wildcards, so don't proxy only if there is not an exact match.
+ if (hostname === entry.hostname) {
+ return false
+ }
+ } else {
+ // Don't proxy if the hostname ends with the no_proxy host.
+ if (hostname.endsWith(entry.hostname.replace(/^\*/, ''))) {
+ return false
+ }
+ }
+ }
-"use strict";
+ return true
+ }
+ #parseNoProxy () {
+ const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv
+ const noProxySplit = noProxyValue.split(/[,\s]/)
+ const noProxyEntries = []
-const {
- BalancedPoolMissingUpstreamError,
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kRemoveClient,
- kGetDispatcher
-} = __nccwpck_require__(3198)
-const Pool = __nccwpck_require__(4634)
-const { kUrl, kInterceptors } = __nccwpck_require__(2785)
-const { parseOrigin } = __nccwpck_require__(3983)
-const kFactory = Symbol('factory')
+ for (let i = 0; i < noProxySplit.length; i++) {
+ const entry = noProxySplit[i]
+ if (!entry) {
+ continue
+ }
+ const parsed = entry.match(/^(.+):(\d+)$/)
+ noProxyEntries.push({
+ hostname: (parsed ? parsed[1] : entry).toLowerCase(),
+ port: parsed ? Number.parseInt(parsed[2], 10) : 0
+ })
+ }
-const kOptions = Symbol('options')
-const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
-const kCurrentWeight = Symbol('kCurrentWeight')
-const kIndex = Symbol('kIndex')
-const kWeight = Symbol('kWeight')
-const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
-const kErrorPenalty = Symbol('kErrorPenalty')
+ this.#noProxyValue = noProxyValue
+ this.#noProxyEntries = noProxyEntries
+ }
-function getGreatestCommonDivisor (a, b) {
- if (b === 0) return a
- return getGreatestCommonDivisor(b, a % b)
-}
+ get #noProxyChanged () {
+ if (this.#opts.noProxy !== undefined) {
+ return false
+ }
+ return this.#noProxyValue !== this.#noProxyEnv
+ }
-function defaultFactory (origin, opts) {
- return new Pool(origin, opts)
+ get #noProxyEnv () {
+ return process.env.no_proxy ?? process.env.NO_PROXY ?? ''
+ }
}
-class BalancedPool extends PoolBase {
- constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
- super()
-
- this[kOptions] = opts
- this[kIndex] = -1
- this[kCurrentWeight] = 0
+module.exports = EnvHttpProxyAgent
- this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
- this[kErrorPenalty] = this[kOptions].errorPenalty || 15
- if (!Array.isArray(upstreams)) {
- upstreams = [upstreams]
- }
+/***/ }),
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
- }
+/***/ 4660:
+/***/ ((module) => {
- this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
- ? opts.interceptors.BalancedPool
- : []
- this[kFactory] = factory
+/* eslint-disable */
- for (const upstream of upstreams) {
- this.addUpstream(upstream)
- }
- this._updateBalancedPoolStats()
- }
- addUpstream (upstream) {
- const upstreamOrigin = parseOrigin(upstream).origin
- if (this[kClients].find((pool) => (
- pool[kUrl].origin === upstreamOrigin &&
- pool.closed !== true &&
- pool.destroyed !== true
- ))) {
- return this
- }
- const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
+// Extracted from node/lib/internal/fixed_queue.js
- this[kAddClient](pool)
- pool.on('connect', () => {
- pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
- })
+// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
+const kSize = 2048;
+const kMask = kSize - 1;
- pool.on('connectionError', () => {
- pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
- this._updateBalancedPoolStats()
- })
+// The FixedQueue is implemented as a singly-linked list of fixed-size
+// circular buffers. It looks something like this:
+//
+// head tail
+// | |
+// v v
+// +-----------+ <-----\ +-----------+ <------\ +-----------+
+// | [null] | \----- | next | \------- | next |
+// +-----------+ +-----------+ +-----------+
+// | item | <-- bottom | item | <-- bottom | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | | [empty] |
+// | item | | item | bottom --> | item |
+// | item | | item | | item |
+// | ... | | ... | | ... |
+// | item | | item | | item |
+// | item | | item | | item |
+// | [empty] | <-- top | item | | item |
+// | [empty] | | item | | item |
+// | [empty] | | [empty] | <-- top top --> | [empty] |
+// +-----------+ +-----------+ +-----------+
+//
+// Or, if there is only one circular buffer, it looks something
+// like either of these:
+//
+// head tail head tail
+// | | | |
+// v v v v
+// +-----------+ +-----------+
+// | [null] | | [null] |
+// +-----------+ +-----------+
+// | [empty] | | item |
+// | [empty] | | item |
+// | item | <-- bottom top --> | [empty] |
+// | item | | [empty] |
+// | [empty] | <-- top bottom --> | item |
+// | [empty] | | item |
+// +-----------+ +-----------+
+//
+// Adding a value means moving `top` forward by one, removing means
+// moving `bottom` forward by one. After reaching the end, the queue
+// wraps around.
+//
+// When `top === bottom` the current queue is empty and when
+// `top + 1 === bottom` it's full. This wastes a single space of storage
+// but allows much quicker checks.
- pool.on('disconnect', (...args) => {
- const err = args[2]
- if (err && err.code === 'UND_ERR_SOCKET') {
- // decrease the weight of the pool.
- pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
- this._updateBalancedPoolStats()
- }
- })
+class FixedCircularBuffer {
+ constructor() {
+ this.bottom = 0;
+ this.top = 0;
+ this.list = new Array(kSize);
+ this.next = null;
+ }
- for (const client of this[kClients]) {
- client[kWeight] = this[kMaxWeightPerServer]
- }
+ isEmpty() {
+ return this.top === this.bottom;
+ }
- this._updateBalancedPoolStats()
+ isFull() {
+ return ((this.top + 1) & kMask) === this.bottom;
+ }
- return this
+ push(data) {
+ this.list[this.top] = data;
+ this.top = (this.top + 1) & kMask;
}
- _updateBalancedPoolStats () {
- this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
+ shift() {
+ const nextItem = this.list[this.bottom];
+ if (nextItem === undefined)
+ return null;
+ this.list[this.bottom] = undefined;
+ this.bottom = (this.bottom + 1) & kMask;
+ return nextItem;
}
+}
- removeUpstream (upstream) {
- const upstreamOrigin = parseOrigin(upstream).origin
+module.exports = class FixedQueue {
+ constructor() {
+ this.head = this.tail = new FixedCircularBuffer();
+ }
- const pool = this[kClients].find((pool) => (
- pool[kUrl].origin === upstreamOrigin &&
- pool.closed !== true &&
- pool.destroyed !== true
- ))
+ isEmpty() {
+ return this.head.isEmpty();
+ }
- if (pool) {
- this[kRemoveClient](pool)
+ push(data) {
+ if (this.head.isFull()) {
+ // Head is full: Creates a new queue, sets the old queue's `.next` to it,
+ // and sets it as the new main queue.
+ this.head = this.head.next = new FixedCircularBuffer();
}
-
- return this
+ this.head.push(data);
}
- get upstreams () {
- return this[kClients]
- .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
- .map((p) => p[kUrl].origin)
+ shift() {
+ const tail = this.tail;
+ const next = tail.shift();
+ if (tail.isEmpty() && tail.next !== null) {
+ // If there is another queue, it forms the new tail.
+ this.tail = tail.next;
+ }
+ return next;
}
+};
- [kGetDispatcher] () {
- // We validate that pools is greater than 0,
- // otherwise we would have to wait until an upstream
- // is added, which might never happen.
- if (this[kClients].length === 0) {
- throw new BalancedPoolMissingUpstreamError()
- }
- const dispatcher = this[kClients].find(dispatcher => (
- !dispatcher[kNeedDrain] &&
- dispatcher.closed !== true &&
- dispatcher.destroyed !== true
- ))
+/***/ }),
- if (!dispatcher) {
- return
- }
+/***/ 2128:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
- if (allClientsBusy) {
- return
- }
- let counter = 0
+const DispatcherBase = __nccwpck_require__(1841)
+const FixedQueue = __nccwpck_require__(4660)
+const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(6443)
+const PoolStats = __nccwpck_require__(3246)
- let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
+const kClients = Symbol('clients')
+const kNeedDrain = Symbol('needDrain')
+const kQueue = Symbol('queue')
+const kClosedResolve = Symbol('closed resolve')
+const kOnDrain = Symbol('onDrain')
+const kOnConnect = Symbol('onConnect')
+const kOnDisconnect = Symbol('onDisconnect')
+const kOnConnectionError = Symbol('onConnectionError')
+const kGetDispatcher = Symbol('get dispatcher')
+const kAddClient = Symbol('add client')
+const kRemoveClient = Symbol('remove client')
+const kStats = Symbol('stats')
- while (counter++ < this[kClients].length) {
- this[kIndex] = (this[kIndex] + 1) % this[kClients].length
- const pool = this[kClients][this[kIndex]]
+class PoolBase extends DispatcherBase {
+ constructor (opts) {
+ super(opts)
- // find pool index with the largest weight
- if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
- maxWeightIndex = this[kIndex]
- }
+ this[kQueue] = new FixedQueue()
+ this[kClients] = []
+ this[kQueued] = 0
- // decrease the current weight every `this[kClients].length`.
- if (this[kIndex] === 0) {
- // Set the current weight to the next lower weight.
- this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
+ const pool = this
- if (this[kCurrentWeight] <= 0) {
- this[kCurrentWeight] = this[kMaxWeightPerServer]
+ this[kOnDrain] = function onDrain (origin, targets) {
+ const queue = pool[kQueue]
+
+ let needDrain = false
+
+ while (!needDrain) {
+ const item = queue.shift()
+ if (!item) {
+ break
}
+ pool[kQueued]--
+ needDrain = !this.dispatch(item.opts, item.handler)
}
- if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
- return pool
- }
- }
-
- this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
- this[kIndex] = maxWeightIndex
- return this[kClients][maxWeightIndex]
- }
-}
-module.exports = BalancedPool
+ this[kNeedDrain] = needDrain
+ if (!this[kNeedDrain] && pool[kNeedDrain]) {
+ pool[kNeedDrain] = false
+ pool.emit('drain', origin, [pool, ...targets])
+ }
-/***/ }),
+ if (pool[kClosedResolve] && queue.isEmpty()) {
+ Promise
+ .all(pool[kClients].map(c => c.close()))
+ .then(pool[kClosedResolve])
+ }
+ }
-/***/ 6101:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this[kOnConnect] = (origin, targets) => {
+ pool.emit('connect', origin, [pool, ...targets])
+ }
-"use strict";
+ this[kOnDisconnect] = (origin, targets, err) => {
+ pool.emit('disconnect', origin, [pool, ...targets], err)
+ }
+ this[kOnConnectionError] = (origin, targets, err) => {
+ pool.emit('connectionError', origin, [pool, ...targets], err)
+ }
-const { kConstruct } = __nccwpck_require__(9174)
-const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
-const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
-const { kHeadersList } = __nccwpck_require__(2785)
-const { webidl } = __nccwpck_require__(1744)
-const { Response, cloneResponse } = __nccwpck_require__(7823)
-const { Request } = __nccwpck_require__(8359)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const { fetching } = __nccwpck_require__(4881)
-const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
-const assert = __nccwpck_require__(9491)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
+ this[kStats] = new PoolStats(this)
+ }
-/**
- * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
- * @typedef {Object} CacheBatchOperation
- * @property {'delete' | 'put'} type
- * @property {any} request
- * @property {any} response
- * @property {import('../../types/cache').CacheQueryOptions} options
- */
+ get [kBusy] () {
+ return this[kNeedDrain]
+ }
-/**
- * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
- * @typedef {[any, any][]} requestResponseList
- */
+ get [kConnected] () {
+ return this[kClients].filter(client => client[kConnected]).length
+ }
-class Cache {
- /**
- * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
- * @type {requestResponseList}
- */
- #relevantRequestResponseList
+ get [kFree] () {
+ return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
+ }
- constructor () {
- if (arguments[0] !== kConstruct) {
- webidl.illegalConstructor()
+ get [kPending] () {
+ let ret = this[kQueued]
+ for (const { [kPending]: pending } of this[kClients]) {
+ ret += pending
}
+ return ret
+ }
- this.#relevantRequestResponseList = arguments[1]
+ get [kRunning] () {
+ let ret = 0
+ for (const { [kRunning]: running } of this[kClients]) {
+ ret += running
+ }
+ return ret
}
- async match (request, options = {}) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
+ get [kSize] () {
+ let ret = this[kQueued]
+ for (const { [kSize]: size } of this[kClients]) {
+ ret += size
+ }
+ return ret
+ }
- request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
+ get stats () {
+ return this[kStats]
+ }
- const p = await this.matchAll(request, options)
+ async [kClose] () {
+ if (this[kQueue].isEmpty()) {
+ await Promise.all(this[kClients].map(c => c.close()))
+ } else {
+ await new Promise((resolve) => {
+ this[kClosedResolve] = resolve
+ })
+ }
+ }
- if (p.length === 0) {
- return
+ async [kDestroy] (err) {
+ while (true) {
+ const item = this[kQueue].shift()
+ if (!item) {
+ break
+ }
+ item.handler.onError(err)
}
- return p[0]
+ await Promise.all(this[kClients].map(c => c.destroy(err)))
}
- async matchAll (request = undefined, options = {}) {
- webidl.brandCheck(this, Cache)
+ [kDispatch] (opts, handler) {
+ const dispatcher = this[kGetDispatcher]()
- if (request !== undefined) request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
+ if (!dispatcher) {
+ this[kNeedDrain] = true
+ this[kQueue].push({ opts, handler })
+ this[kQueued]++
+ } else if (!dispatcher.dispatch(opts, handler)) {
+ dispatcher[kNeedDrain] = true
+ this[kNeedDrain] = !this[kGetDispatcher]()
+ }
- // 1.
- let r = null
+ return !this[kNeedDrain]
+ }
- // 2.
- if (request !== undefined) {
- if (request instanceof Request) {
- // 2.1.1
- r = request[kState]
+ [kAddClient] (client) {
+ client
+ .on('drain', this[kOnDrain])
+ .on('connect', this[kOnConnect])
+ .on('disconnect', this[kOnDisconnect])
+ .on('connectionError', this[kOnConnectionError])
- // 2.1.2
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return []
+ this[kClients].push(client)
+
+ if (this[kNeedDrain]) {
+ queueMicrotask(() => {
+ if (this[kNeedDrain]) {
+ this[kOnDrain](client[kUrl], [this, client])
}
- } else if (typeof request === 'string') {
- // 2.2.1
- r = new Request(request)[kState]
- }
+ })
}
- // 5.
- // 5.1
- const responses = []
+ return this
+ }
- // 5.2
- if (request === undefined) {
- // 5.2.1
- for (const requestResponse of this.#relevantRequestResponseList) {
- responses.push(requestResponse[1])
+ [kRemoveClient] (client) {
+ client.close(() => {
+ const idx = this[kClients].indexOf(client)
+ if (idx !== -1) {
+ this[kClients].splice(idx, 1)
}
- } else { // 5.3
- // 5.3.1
- const requestResponses = this.#queryCache(r, options)
+ })
- // 5.3.2
- for (const requestResponse of requestResponses) {
- responses.push(requestResponse[1])
- }
- }
+ this[kNeedDrain] = this[kClients].some(dispatcher => (
+ !dispatcher[kNeedDrain] &&
+ dispatcher.closed !== true &&
+ dispatcher.destroyed !== true
+ ))
+ }
+}
- // 5.4
- // We don't implement CORs so we don't need to loop over the responses, yay!
+module.exports = {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kRemoveClient,
+ kGetDispatcher
+}
- // 5.5.1
- const responseList = []
- // 5.5.2
- for (const response of responses) {
- // 5.5.2.1
- const responseObject = new Response(response.body?.source ?? null)
- const body = responseObject[kState].body
- responseObject[kState] = response
- responseObject[kState].body = body
- responseObject[kHeaders][kHeadersList] = response.headersList
- responseObject[kHeaders][kGuard] = 'immutable'
+/***/ }),
- responseList.push(responseObject)
- }
+/***/ 3246:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 6.
- return Object.freeze(responseList)
- }
+const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(6443)
+const kPool = Symbol('pool')
- async add (request) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
+class PoolStats {
+ constructor (pool) {
+ this[kPool] = pool
+ }
- request = webidl.converters.RequestInfo(request)
+ get connected () {
+ return this[kPool][kConnected]
+ }
- // 1.
- const requests = [request]
+ get free () {
+ return this[kPool][kFree]
+ }
- // 2.
- const responseArrayPromise = this.addAll(requests)
+ get pending () {
+ return this[kPool][kPending]
+ }
- // 3.
- return await responseArrayPromise
+ get queued () {
+ return this[kPool][kQueued]
}
- async addAll (requests) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
+ get running () {
+ return this[kPool][kRunning]
+ }
- requests = webidl.converters['sequence'](requests)
+ get size () {
+ return this[kPool][kSize]
+ }
+}
- // 1.
- const responsePromises = []
+module.exports = PoolStats
- // 2.
- const requestList = []
- // 3.
- for (const request of requests) {
- if (typeof request === 'string') {
- continue
- }
+/***/ }),
- // 3.1
- const r = request[kState]
+/***/ 628:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 3.2
- if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Expected http/s scheme when method is not GET.'
- })
- }
- }
- // 4.
- /** @type {ReturnType[]} */
- const fetchControllers = []
- // 5.
- for (const request of requests) {
- // 5.1
- const r = new Request(request)[kState]
+const {
+ PoolBase,
+ kClients,
+ kNeedDrain,
+ kAddClient,
+ kGetDispatcher
+} = __nccwpck_require__(2128)
+const Client = __nccwpck_require__(3701)
+const {
+ InvalidArgumentError
+} = __nccwpck_require__(8707)
+const util = __nccwpck_require__(3440)
+const { kUrl, kInterceptors } = __nccwpck_require__(6443)
+const buildConnector = __nccwpck_require__(9136)
- // 5.2
- if (!urlIsHttpHttpsScheme(r.url)) {
- throw webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Expected http/s scheme.'
- })
- }
+const kOptions = Symbol('options')
+const kConnections = Symbol('connections')
+const kFactory = Symbol('factory')
- // 5.4
- r.initiator = 'fetch'
- r.destination = 'subresource'
+function defaultFactory (origin, opts) {
+ return new Client(origin, opts)
+}
- // 5.5
- requestList.push(r)
+class Pool extends PoolBase {
+ constructor (origin, {
+ connections,
+ factory = defaultFactory,
+ connect,
+ connectTimeout,
+ tls,
+ maxCachedSessions,
+ socketPath,
+ autoSelectFamily,
+ autoSelectFamilyAttemptTimeout,
+ allowH2,
+ ...options
+ } = {}) {
+ if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
+ throw new InvalidArgumentError('invalid connections')
+ }
- // 5.6
- const responsePromise = createDeferredPromise()
+ if (typeof factory !== 'function') {
+ throw new InvalidArgumentError('factory must be a function.')
+ }
- // 5.7
- fetchControllers.push(fetching({
- request: r,
- dispatcher: getGlobalDispatcher(),
- processResponse (response) {
- // 1.
- if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
- responsePromise.reject(webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'Received an invalid status code or the request failed.'
- }))
- } else if (response.headersList.contains('vary')) { // 2.
- // 2.1
- const fieldValues = getFieldValues(response.headersList.get('vary'))
+ if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
+ throw new InvalidArgumentError('connect must be a function or an object')
+ }
- // 2.2
- for (const fieldValue of fieldValues) {
- // 2.2.1
- if (fieldValue === '*') {
- responsePromise.reject(webidl.errors.exception({
- header: 'Cache.addAll',
- message: 'invalid vary field value'
- }))
+ if (typeof connect !== 'function') {
+ connect = buildConnector({
+ ...tls,
+ maxCachedSessions,
+ allowH2,
+ socketPath,
+ timeout: connectTimeout,
+ ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
+ ...connect
+ })
+ }
- for (const controller of fetchControllers) {
- controller.abort()
- }
+ super(options)
- return
- }
- }
- }
- },
- processResponseEndOfBody (response) {
- // 1.
- if (response.aborted) {
- responsePromise.reject(new DOMException('aborted', 'AbortError'))
- return
- }
+ this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool)
+ ? options.interceptors.Pool
+ : []
+ this[kConnections] = connections || null
+ this[kUrl] = util.parseOrigin(origin)
+ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
+ this[kOptions].interceptors = options.interceptors
+ ? { ...options.interceptors }
+ : undefined
+ this[kFactory] = factory
- // 2.
- responsePromise.resolve(response)
+ this.on('connectionError', (origin, targets, error) => {
+ // If a connection error occurs, we remove the client from the pool,
+ // and emit a connectionError event. They will not be re-used.
+ // Fixes https://github.com/nodejs/undici/issues/3895
+ for (const target of targets) {
+ // Do not use kRemoveClient here, as it will close the client,
+ // but the client cannot be closed in this state.
+ const idx = this[kClients].indexOf(target)
+ if (idx !== -1) {
+ this[kClients].splice(idx, 1)
}
- }))
+ }
+ })
+ }
- // 5.8
- responsePromises.push(responsePromise.promise)
+ [kGetDispatcher] () {
+ for (const client of this[kClients]) {
+ if (!client[kNeedDrain]) {
+ return client
+ }
}
- // 6.
- const p = Promise.all(responsePromises)
-
- // 7.
- const responses = await p
-
- // 7.1
- const operations = []
+ if (!this[kConnections] || this[kClients].length < this[kConnections]) {
+ const dispatcher = this[kFactory](this[kUrl], this[kOptions])
+ this[kAddClient](dispatcher)
+ return dispatcher
+ }
+ }
+}
- // 7.2
- let index = 0
+module.exports = Pool
- // 7.3
- for (const response of responses) {
- // 7.3.1
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'put', // 7.3.2
- request: requestList[index], // 7.3.3
- response // 7.3.4
- }
- operations.push(operation) // 7.3.5
+/***/ }),
- index++ // 7.3.6
- }
+/***/ 6672:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 7.5
- const cacheJobPromise = createDeferredPromise()
- // 7.6.1
- let errorData = null
- // 7.6.2
- try {
- this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
- }
+const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(6443)
+const { URL } = __nccwpck_require__(3136)
+const Agent = __nccwpck_require__(7405)
+const Pool = __nccwpck_require__(628)
+const DispatcherBase = __nccwpck_require__(1841)
+const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(8707)
+const buildConnector = __nccwpck_require__(9136)
+const Client = __nccwpck_require__(3701)
- // 7.6.3
- queueMicrotask(() => {
- // 7.6.3.1
- if (errorData === null) {
- cacheJobPromise.resolve(undefined)
- } else {
- // 7.6.3.2
- cacheJobPromise.reject(errorData)
- }
- })
+const kAgent = Symbol('proxy agent')
+const kClient = Symbol('proxy client')
+const kProxyHeaders = Symbol('proxy headers')
+const kRequestTls = Symbol('request tls settings')
+const kProxyTls = Symbol('proxy tls settings')
+const kConnectEndpoint = Symbol('connect endpoint function')
+const kTunnelProxy = Symbol('tunnel proxy')
- // 7.7
- return cacheJobPromise.promise
- }
+function defaultProtocolPort (protocol) {
+ return protocol === 'https:' ? 443 : 80
+}
- async put (request, response) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
+function defaultFactory (origin, opts) {
+ return new Pool(origin, opts)
+}
- request = webidl.converters.RequestInfo(request)
- response = webidl.converters.Response(response)
+const noop = () => {}
- // 1.
- let innerRequest = null
+function defaultAgentFactory (origin, opts) {
+ if (opts.connections === 1) {
+ return new Client(origin, opts)
+ }
+ return new Pool(origin, opts)
+}
- // 2.
- if (request instanceof Request) {
- innerRequest = request[kState]
- } else { // 3.
- innerRequest = new Request(request)[kState]
- }
+class Http1ProxyWrapper extends DispatcherBase {
+ #client
- // 4.
- if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Expected an http/s scheme when method is not GET'
- })
+ constructor (proxyUrl, { headers = {}, connect, factory }) {
+ super()
+ if (!proxyUrl) {
+ throw new InvalidArgumentError('Proxy URL is mandatory')
}
- // 5.
- const innerResponse = response[kState]
-
- // 6.
- if (innerResponse.status === 206) {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Got 206 status'
- })
+ this[kProxyHeaders] = headers
+ if (factory) {
+ this.#client = factory(proxyUrl, { connect })
+ } else {
+ this.#client = new Client(proxyUrl, { connect })
}
+ }
- // 7.
- if (innerResponse.headersList.contains('vary')) {
- // 7.1.
- const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
-
- // 7.2.
- for (const fieldValue of fieldValues) {
- // 7.2.1
- if (fieldValue === '*') {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Got * vary field value'
- })
+ [kDispatch] (opts, handler) {
+ const onHeaders = handler.onHeaders
+ handler.onHeaders = function (statusCode, data, resume) {
+ if (statusCode === 407) {
+ if (typeof handler.onError === 'function') {
+ handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)'))
}
+ return
}
+ if (onHeaders) onHeaders.call(this, statusCode, data, resume)
}
- // 8.
- if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
- throw webidl.errors.exception({
- header: 'Cache.put',
- message: 'Response body is locked or disturbed'
- })
+ // Rewrite request as an HTTP1 Proxy request, without tunneling.
+ const {
+ origin,
+ path = '/',
+ headers = {}
+ } = opts
+
+ opts.path = origin + path
+
+ if (!('host' in headers) && !('Host' in headers)) {
+ const { host } = new URL(origin)
+ headers.host = host
}
+ opts.headers = { ...this[kProxyHeaders], ...headers }
- // 9.
- const clonedResponse = cloneResponse(innerResponse)
+ return this.#client[kDispatch](opts, handler)
+ }
- // 10.
- const bodyReadPromise = createDeferredPromise()
+ async [kClose] () {
+ return this.#client.close()
+ }
- // 11.
- if (innerResponse.body != null) {
- // 11.1
- const stream = innerResponse.body.stream
+ async [kDestroy] (err) {
+ return this.#client.destroy(err)
+ }
+}
- // 11.2
- const reader = stream.getReader()
+class ProxyAgent extends DispatcherBase {
+ constructor (opts) {
+ super()
- // 11.3
- readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
- } else {
- bodyReadPromise.resolve(undefined)
+ if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) {
+ throw new InvalidArgumentError('Proxy uri is mandatory')
}
- // 12.
- /** @type {CacheBatchOperation[]} */
- const operations = []
-
- // 13.
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'put', // 14.
- request: innerRequest, // 15.
- response: clonedResponse // 16.
+ const { clientFactory = defaultFactory } = opts
+ if (typeof clientFactory !== 'function') {
+ throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
}
- // 17.
- operations.push(operation)
+ const { proxyTunnel = true } = opts
- // 19.
- const bytes = await bodyReadPromise.promise
+ const url = this.#getUrl(opts)
+ const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url
- if (clonedResponse.body != null) {
- clonedResponse.body.source = bytes
- }
+ this[kProxy] = { uri: href, protocol }
+ this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
+ ? opts.interceptors.ProxyAgent
+ : []
+ this[kRequestTls] = opts.requestTls
+ this[kProxyTls] = opts.proxyTls
+ this[kProxyHeaders] = opts.headers || {}
+ this[kTunnelProxy] = proxyTunnel
- // 19.1
- const cacheJobPromise = createDeferredPromise()
+ if (opts.auth && opts.token) {
+ throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
+ } else if (opts.auth) {
+ /* @deprecated in favour of opts.token */
+ this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
+ } else if (opts.token) {
+ this[kProxyHeaders]['proxy-authorization'] = opts.token
+ } else if (username && password) {
+ this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
+ }
- // 19.2.1
- let errorData = null
+ const connect = buildConnector({ ...opts.proxyTls })
+ this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
- // 19.2.2
- try {
- this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
+ const agentFactory = opts.factory || defaultAgentFactory
+ const factory = (origin, options) => {
+ const { protocol } = new URL(origin)
+ if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') {
+ return new Http1ProxyWrapper(this[kProxy].uri, {
+ headers: this[kProxyHeaders],
+ connect,
+ factory: agentFactory
+ })
+ }
+ return agentFactory(origin, options)
}
-
- // 19.2.3
- queueMicrotask(() => {
- // 19.2.3.1
- if (errorData === null) {
- cacheJobPromise.resolve()
- } else { // 19.2.3.2
- cacheJobPromise.reject(errorData)
+ this[kClient] = clientFactory(url, { connect })
+ this[kAgent] = new Agent({
+ ...opts,
+ factory,
+ connect: async (opts, callback) => {
+ let requestedPath = opts.host
+ if (!opts.port) {
+ requestedPath += `:${defaultProtocolPort(opts.protocol)}`
+ }
+ try {
+ const { socket, statusCode } = await this[kClient].connect({
+ origin,
+ port,
+ path: requestedPath,
+ signal: opts.signal,
+ headers: {
+ ...this[kProxyHeaders],
+ host: opts.host
+ },
+ servername: this[kProxyTls]?.servername || proxyHostname
+ })
+ if (statusCode !== 200) {
+ socket.on('error', noop).destroy()
+ callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
+ }
+ if (opts.protocol !== 'https:') {
+ callback(null, socket)
+ return
+ }
+ let servername
+ if (this[kRequestTls]) {
+ servername = this[kRequestTls].servername
+ } else {
+ servername = opts.servername
+ }
+ this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
+ } catch (err) {
+ if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
+ // Throw a custom error to avoid loop in client.js#connect
+ callback(new SecureProxyConnectionError(err))
+ } else {
+ callback(err)
+ }
+ }
}
})
-
- return cacheJobPromise.promise
}
- async delete (request, options = {}) {
- webidl.brandCheck(this, Cache)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
-
- request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
+ dispatch (opts, handler) {
+ const headers = buildHeaders(opts.headers)
+ throwIfProxyAuthIsSent(headers)
- /**
- * @type {Request}
- */
- let r = null
+ if (headers && !('host' in headers) && !('Host' in headers)) {
+ const { host } = new URL(opts.origin)
+ headers.host = host
+ }
- if (request instanceof Request) {
- r = request[kState]
+ return this[kAgent].dispatch(
+ {
+ ...opts,
+ headers
+ },
+ handler
+ )
+ }
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return false
- }
+ /**
+ * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts
+ * @returns {URL}
+ */
+ #getUrl (opts) {
+ if (typeof opts === 'string') {
+ return new URL(opts)
+ } else if (opts instanceof URL) {
+ return opts
} else {
- assert(typeof request === 'string')
-
- r = new Request(request)[kState]
+ return new URL(opts.uri)
}
+ }
- /** @type {CacheBatchOperation[]} */
- const operations = []
+ async [kClose] () {
+ await this[kAgent].close()
+ await this[kClient].close()
+ }
- /** @type {CacheBatchOperation} */
- const operation = {
- type: 'delete',
- request: r,
- options
+ async [kDestroy] () {
+ await this[kAgent].destroy()
+ await this[kClient].destroy()
+ }
+}
+
+/**
+ * @param {string[] | Record} headers
+ * @returns {Record}
+ */
+function buildHeaders (headers) {
+ // When using undici.fetch, the headers list is stored
+ // as an array.
+ if (Array.isArray(headers)) {
+ /** @type {Record} */
+ const headersPair = {}
+
+ for (let i = 0; i < headers.length; i += 2) {
+ headersPair[headers[i]] = headers[i + 1]
}
- operations.push(operation)
+ return headersPair
+ }
- const cacheJobPromise = createDeferredPromise()
+ return headers
+}
- let errorData = null
- let requestResponses
+/**
+ * @param {Record} headers
+ *
+ * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
+ * Nevertheless, it was changed and to avoid a security vulnerability by end users
+ * this check was created.
+ * It should be removed in the next major version for performance reasons
+ */
+function throwIfProxyAuthIsSent (headers) {
+ const existProxyAuth = headers && Object.keys(headers)
+ .find((key) => key.toLowerCase() === 'proxy-authorization')
+ if (existProxyAuth) {
+ throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
+ }
+}
- try {
- requestResponses = this.#batchCacheOperations(operations)
- } catch (e) {
- errorData = e
- }
+module.exports = ProxyAgent
- queueMicrotask(() => {
- if (errorData === null) {
- cacheJobPromise.resolve(!!requestResponses?.length)
- } else {
- cacheJobPromise.reject(errorData)
- }
- })
- return cacheJobPromise.promise
- }
+/***/ }),
- /**
- * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
- * @param {any} request
- * @param {import('../../types/cache').CacheQueryOptions} options
- * @returns {readonly Request[]}
- */
- async keys (request = undefined, options = {}) {
- webidl.brandCheck(this, Cache)
+/***/ 50:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (request !== undefined) request = webidl.converters.RequestInfo(request)
- options = webidl.converters.CacheQueryOptions(options)
- // 1.
- let r = null
- // 2.
- if (request !== undefined) {
- // 2.1
- if (request instanceof Request) {
- // 2.1.1
- r = request[kState]
+const Dispatcher = __nccwpck_require__(883)
+const RetryHandler = __nccwpck_require__(7816)
- // 2.1.2
- if (r.method !== 'GET' && !options.ignoreMethod) {
- return []
- }
- } else if (typeof request === 'string') { // 2.2
- r = new Request(request)[kState]
- }
- }
+class RetryAgent extends Dispatcher {
+ #agent = null
+ #options = null
+ constructor (agent, options = {}) {
+ super(options)
+ this.#agent = agent
+ this.#options = options
+ }
- // 4.
- const promise = createDeferredPromise()
+ dispatch (opts, handler) {
+ const retry = new RetryHandler({
+ ...opts,
+ retryOptions: this.#options
+ }, {
+ dispatch: this.#agent.dispatch.bind(this.#agent),
+ handler
+ })
+ return this.#agent.dispatch(opts, retry)
+ }
- // 5.
- // 5.1
- const requests = []
+ close () {
+ return this.#agent.close()
+ }
- // 5.2
- if (request === undefined) {
- // 5.2.1
- for (const requestResponse of this.#relevantRequestResponseList) {
- // 5.2.1.1
- requests.push(requestResponse[0])
- }
- } else { // 5.3
- // 5.3.1
- const requestResponses = this.#queryCache(r, options)
+ destroy () {
+ return this.#agent.destroy()
+ }
+}
- // 5.3.2
- for (const requestResponse of requestResponses) {
- // 5.3.2.1
- requests.push(requestResponse[0])
- }
- }
+module.exports = RetryAgent
- // 5.4
- queueMicrotask(() => {
- // 5.4.1
- const requestList = []
- // 5.4.2
- for (const request of requests) {
- const requestObject = new Request('https://a')
- requestObject[kState] = request
- requestObject[kHeaders][kHeadersList] = request.headersList
- requestObject[kHeaders][kGuard] = 'immutable'
- requestObject[kRealm] = request.client
+/***/ }),
- // 5.4.2.1
- requestList.push(requestObject)
- }
+/***/ 2581:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 5.4.3
- promise.resolve(Object.freeze(requestList))
- })
- return promise.promise
- }
- /**
- * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
- * @param {CacheBatchOperation[]} operations
- * @returns {requestResponseList}
- */
- #batchCacheOperations (operations) {
- // 1.
- const cache = this.#relevantRequestResponseList
+// We include a version number for the Dispatcher API. In case of breaking changes,
+// this version number must be increased to avoid conflicts.
+const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const Agent = __nccwpck_require__(7405)
- // 2.
- const backupCache = [...cache]
+if (getGlobalDispatcher() === undefined) {
+ setGlobalDispatcher(new Agent())
+}
- // 3.
- const addedItems = []
+function setGlobalDispatcher (agent) {
+ if (!agent || typeof agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument agent must implement Agent')
+ }
+ Object.defineProperty(globalThis, globalDispatcher, {
+ value: agent,
+ writable: true,
+ enumerable: false,
+ configurable: false
+ })
+}
- // 4.1
- const resultList = []
+function getGlobalDispatcher () {
+ return globalThis[globalDispatcher]
+}
- try {
- // 4.2
- for (const operation of operations) {
- // 4.2.1
- if (operation.type !== 'delete' && operation.type !== 'put') {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'operation type does not match "delete" or "put"'
- })
- }
+module.exports = {
+ setGlobalDispatcher,
+ getGlobalDispatcher
+}
- // 4.2.2
- if (operation.type === 'delete' && operation.response != null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'delete operation should not have an associated response'
- })
- }
- // 4.2.3
- if (this.#queryCache(operation.request, operation.options, addedItems).length) {
- throw new DOMException('???', 'InvalidStateError')
- }
+/***/ }),
- // 4.2.4
- let requestResponses
+/***/ 8155:
+/***/ ((module) => {
- // 4.2.5
- if (operation.type === 'delete') {
- // 4.2.5.1
- requestResponses = this.#queryCache(operation.request, operation.options)
- // TODO: the spec is wrong, this is needed to pass WPTs
- if (requestResponses.length === 0) {
- return []
- }
- // 4.2.5.2
- for (const requestResponse of requestResponses) {
- const idx = cache.indexOf(requestResponse)
- assert(idx !== -1)
+module.exports = class DecoratorHandler {
+ #handler
- // 4.2.5.2.1
- cache.splice(idx, 1)
- }
- } else if (operation.type === 'put') { // 4.2.6
- // 4.2.6.1
- if (operation.response == null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'put operation should have an associated response'
- })
- }
+ constructor (handler) {
+ if (typeof handler !== 'object' || handler === null) {
+ throw new TypeError('handler must be an object')
+ }
+ this.#handler = handler
+ }
+
+ onConnect (...args) {
+ return this.#handler.onConnect?.(...args)
+ }
+
+ onError (...args) {
+ return this.#handler.onError?.(...args)
+ }
- // 4.2.6.2
- const r = operation.request
+ onUpgrade (...args) {
+ return this.#handler.onUpgrade?.(...args)
+ }
- // 4.2.6.3
- if (!urlIsHttpHttpsScheme(r.url)) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'expected http or https scheme'
- })
- }
+ onResponseStarted (...args) {
+ return this.#handler.onResponseStarted?.(...args)
+ }
- // 4.2.6.4
- if (r.method !== 'GET') {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'not get method'
- })
- }
+ onHeaders (...args) {
+ return this.#handler.onHeaders?.(...args)
+ }
- // 4.2.6.5
- if (operation.options != null) {
- throw webidl.errors.exception({
- header: 'Cache.#batchCacheOperations',
- message: 'options must not be defined'
- })
- }
+ onData (...args) {
+ return this.#handler.onData?.(...args)
+ }
- // 4.2.6.6
- requestResponses = this.#queryCache(operation.request)
+ onComplete (...args) {
+ return this.#handler.onComplete?.(...args)
+ }
- // 4.2.6.7
- for (const requestResponse of requestResponses) {
- const idx = cache.indexOf(requestResponse)
- assert(idx !== -1)
+ onBodySent (...args) {
+ return this.#handler.onBodySent?.(...args)
+ }
+}
- // 4.2.6.7.1
- cache.splice(idx, 1)
- }
- // 4.2.6.8
- cache.push([operation.request, operation.response])
+/***/ }),
- // 4.2.6.10
- addedItems.push([operation.request, operation.response])
- }
+/***/ 8754:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // 4.2.7
- resultList.push([operation.request, operation.response])
- }
- // 4.3
- return resultList
- } catch (e) { // 5.
- // 5.1
- this.#relevantRequestResponseList.length = 0
- // 5.2
- this.#relevantRequestResponseList = backupCache
+const util = __nccwpck_require__(3440)
+const { kBodyUsed } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const EE = __nccwpck_require__(8474)
- // 5.3
- throw e
- }
+const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
+
+const kBody = Symbol('body')
+
+class BodyAsyncIterable {
+ constructor (body) {
+ this[kBody] = body
+ this[kBodyUsed] = false
}
- /**
- * @see https://w3c.github.io/ServiceWorker/#query-cache
- * @param {any} requestQuery
- * @param {import('../../types/cache').CacheQueryOptions} options
- * @param {requestResponseList} targetStorage
- * @returns {requestResponseList}
- */
- #queryCache (requestQuery, options, targetStorage) {
- /** @type {requestResponseList} */
- const resultList = []
+ async * [Symbol.asyncIterator] () {
+ assert(!this[kBodyUsed], 'disturbed')
+ this[kBodyUsed] = true
+ yield * this[kBody]
+ }
+}
- const storage = targetStorage ?? this.#relevantRequestResponseList
+class RedirectHandler {
+ constructor (dispatch, maxRedirections, opts, handler) {
+ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
+ throw new InvalidArgumentError('maxRedirections must be a positive number')
+ }
- for (const requestResponse of storage) {
- const [cachedRequest, cachedResponse] = requestResponse
- if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
- resultList.push(requestResponse)
+ util.validateHandler(handler, opts.method, opts.upgrade)
+
+ this.dispatch = dispatch
+ this.location = null
+ this.abort = null
+ this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
+ this.maxRedirections = maxRedirections
+ this.handler = handler
+ this.history = []
+ this.redirectionLimitReached = false
+
+ if (util.isStream(this.opts.body)) {
+ // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
+ // so that it can be dispatched again?
+ // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
+ if (util.bodyLength(this.opts.body) === 0) {
+ this.opts.body
+ .on('data', function () {
+ assert(false)
+ })
+ }
+
+ if (typeof this.opts.body.readableDidRead !== 'boolean') {
+ this.opts.body[kBodyUsed] = false
+ EE.prototype.on.call(this.opts.body, 'data', function () {
+ this[kBodyUsed] = true
+ })
}
+ } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
+ // TODO (fix): We can't access ReadableStream internal state
+ // to determine whether or not it has been disturbed. This is just
+ // a workaround.
+ this.opts.body = new BodyAsyncIterable(this.opts.body)
+ } else if (
+ this.opts.body &&
+ typeof this.opts.body !== 'string' &&
+ !ArrayBuffer.isView(this.opts.body) &&
+ util.isIterable(this.opts.body)
+ ) {
+ // TODO: Should we allow re-using iterable if !this.opts.idempotent
+ // or through some other flag?
+ this.opts.body = new BodyAsyncIterable(this.opts.body)
}
+ }
- return resultList
+ onConnect (abort) {
+ this.abort = abort
+ this.handler.onConnect(abort, { history: this.history })
}
- /**
- * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
- * @param {any} requestQuery
- * @param {any} request
- * @param {any | null} response
- * @param {import('../../types/cache').CacheQueryOptions | undefined} options
- * @returns {boolean}
- */
- #requestMatchesCachedItem (requestQuery, request, response = null, options) {
- // if (options?.ignoreMethod === false && request.method === 'GET') {
- // return false
- // }
+ onUpgrade (statusCode, headers, socket) {
+ this.handler.onUpgrade(statusCode, headers, socket)
+ }
- const queryURL = new URL(requestQuery.url)
+ onError (error) {
+ this.handler.onError(error)
+ }
- const cachedURL = new URL(request.url)
+ onHeaders (statusCode, headers, resume, statusText) {
+ this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
+ ? null
+ : parseLocation(statusCode, headers)
- if (options?.ignoreSearch) {
- cachedURL.search = ''
+ if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
+ if (this.request) {
+ this.request.abort(new Error('max redirects'))
+ }
- queryURL.search = ''
+ this.redirectionLimitReached = true
+ this.abort(new Error('max redirects'))
+ return
}
- if (!urlEquals(queryURL, cachedURL, true)) {
- return false
+ if (this.opts.origin) {
+ this.history.push(new URL(this.opts.path, this.opts.origin))
}
- if (
- response == null ||
- options?.ignoreVary ||
- !response.headersList.contains('vary')
- ) {
- return true
+ if (!this.location) {
+ return this.handler.onHeaders(statusCode, headers, resume, statusText)
}
- const fieldValues = getFieldValues(response.headersList.get('vary'))
-
- for (const fieldValue of fieldValues) {
- if (fieldValue === '*') {
- return false
- }
+ const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
+ const path = search ? `${pathname}${search}` : pathname
- const requestValue = request.headersList.get(fieldValue)
- const queryValue = requestQuery.headersList.get(fieldValue)
+ // Remove headers referring to the original URL.
+ // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
+ // https://tools.ietf.org/html/rfc7231#section-6.4
+ this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
+ this.opts.path = path
+ this.opts.origin = origin
+ this.opts.maxRedirections = 0
+ this.opts.query = null
- // If one has the header and the other doesn't, or one has
- // a different value than the other, return false
- if (requestValue !== queryValue) {
- return false
- }
+ // https://tools.ietf.org/html/rfc7231#section-6.4.4
+ // In case of HTTP 303, always replace method to be either HEAD or GET
+ if (statusCode === 303 && this.opts.method !== 'HEAD') {
+ this.opts.method = 'GET'
+ this.opts.body = null
}
+ }
- return true
+ onData (chunk) {
+ if (this.location) {
+ /*
+ https://tools.ietf.org/html/rfc7231#section-6.4
+
+ TLDR: undici always ignores 3xx response bodies.
+
+ Redirection is used to serve the requested resource from another URL, so it is assumes that
+ no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
+
+ For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
+ (which means it's optional and not mandated) contain just an hyperlink to the value of
+ the Location response header, so the body can be ignored safely.
+
+ For status 300, which is "Multiple Choices", the spec mentions both generating a Location
+ response header AND a response body with the other possible location to follow.
+ Since the spec explicitly chooses not to specify a format for such body and leave it to
+ servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
+ */
+ } else {
+ return this.handler.onData(chunk)
+ }
}
-}
-Object.defineProperties(Cache.prototype, {
- [Symbol.toStringTag]: {
- value: 'Cache',
- configurable: true
- },
- match: kEnumerableProperty,
- matchAll: kEnumerableProperty,
- add: kEnumerableProperty,
- addAll: kEnumerableProperty,
- put: kEnumerableProperty,
- delete: kEnumerableProperty,
- keys: kEnumerableProperty
-})
+ onComplete (trailers) {
+ if (this.location) {
+ /*
+ https://tools.ietf.org/html/rfc7231#section-6.4
-const cacheQueryOptionConverters = [
- {
- key: 'ignoreSearch',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'ignoreMethod',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'ignoreVary',
- converter: webidl.converters.boolean,
- defaultValue: false
+ TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
+ and neither are useful if present.
+
+ See comment on onData method above for more detailed information.
+ */
+
+ this.location = null
+ this.abort = null
+
+ this.dispatch(this.opts, this)
+ } else {
+ this.handler.onComplete(trailers)
+ }
}
-]
-webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
+ onBodySent (chunk) {
+ if (this.handler.onBodySent) {
+ this.handler.onBodySent(chunk)
+ }
+ }
+}
-webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
- ...cacheQueryOptionConverters,
- {
- key: 'cacheName',
- converter: webidl.converters.DOMString
+function parseLocation (statusCode, headers) {
+ if (redirectableStatusCodes.indexOf(statusCode) === -1) {
+ return null
}
-])
-webidl.converters.Response = webidl.interfaceConverter(Response)
+ for (let i = 0; i < headers.length; i += 2) {
+ if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') {
+ return headers[i + 1]
+ }
+ }
+}
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.RequestInfo
-)
+// https://tools.ietf.org/html/rfc7231#section-6.4.4
+function shouldRemoveHeader (header, removeContent, unknownOrigin) {
+ if (header.length === 4) {
+ return util.headerNameToString(header) === 'host'
+ }
+ if (removeContent && util.headerNameToString(header).startsWith('content-')) {
+ return true
+ }
+ if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
+ const name = util.headerNameToString(header)
+ return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
+ }
+ return false
+}
-module.exports = {
- Cache
+// https://tools.ietf.org/html/rfc7231#section-6.4
+function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
+ const ret = []
+ if (Array.isArray(headers)) {
+ for (let i = 0; i < headers.length; i += 2) {
+ if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
+ ret.push(headers[i], headers[i + 1])
+ }
+ }
+ } else if (headers && typeof headers === 'object') {
+ for (const key of Object.keys(headers)) {
+ if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
+ ret.push(key, headers[key])
+ }
+ }
+ } else {
+ assert(headers == null, 'headers must be an object or an array')
+ }
+ return ret
}
+module.exports = RedirectHandler
+
/***/ }),
-/***/ 7907:
+/***/ 7816:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+const assert = __nccwpck_require__(4589)
-const { kConstruct } = __nccwpck_require__(9174)
-const { Cache } = __nccwpck_require__(6101)
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+const { kRetryHandlerDefaultRetry } = __nccwpck_require__(6443)
+const { RequestRetryError } = __nccwpck_require__(8707)
+const {
+ isDisturbed,
+ parseHeaders,
+ parseRangeHeader,
+ wrapRequestBody
+} = __nccwpck_require__(3440)
-class CacheStorage {
- /**
- * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
- * @type {Map {
+ this.aborted = true
+ if (this.abort) {
+ this.abort(reason)
+ } else {
+ this.reason = reason
+ }
+ })
}
- async match (request, options = {}) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
+ onRequestSent () {
+ if (this.handler.onRequestSent) {
+ this.handler.onRequestSent()
+ }
+ }
- request = webidl.converters.RequestInfo(request)
- options = webidl.converters.MultiCacheQueryOptions(options)
+ onUpgrade (statusCode, headers, socket) {
+ if (this.handler.onUpgrade) {
+ this.handler.onUpgrade(statusCode, headers, socket)
+ }
+ }
- // 1.
- if (options.cacheName != null) {
- // 1.1.1.1
- if (this.#caches.has(options.cacheName)) {
- // 1.1.1.1.1
- const cacheList = this.#caches.get(options.cacheName)
- const cache = new Cache(kConstruct, cacheList)
+ onConnect (abort) {
+ if (this.aborted) {
+ abort(this.reason)
+ } else {
+ this.abort = abort
+ }
+ }
- return await cache.match(request, options)
- }
- } else { // 2.
- // 2.2
- for (const cacheList of this.#caches.values()) {
- const cache = new Cache(kConstruct, cacheList)
+ onBodySent (chunk) {
+ if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
+ }
- // 2.2.1.2
- const response = await cache.match(request, options)
+ static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
+ const { statusCode, code, headers } = err
+ const { method, retryOptions } = opts
+ const {
+ maxRetries,
+ minTimeout,
+ maxTimeout,
+ timeoutFactor,
+ statusCodes,
+ errorCodes,
+ methods
+ } = retryOptions
+ const { counter } = state
- if (response !== undefined) {
- return response
- }
- }
+ // Any code that is not a Undici's originated and allowed to retry
+ if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) {
+ cb(err)
+ return
}
- }
- /**
- * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
- * @param {string} cacheName
- * @returns {Promise}
- */
- async has (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
+ // If a set of method are provided and the current method is not in the list
+ if (Array.isArray(methods) && !methods.includes(method)) {
+ cb(err)
+ return
+ }
- cacheName = webidl.converters.DOMString(cacheName)
+ // If a set of status code are provided and the current status code is not in the list
+ if (
+ statusCode != null &&
+ Array.isArray(statusCodes) &&
+ !statusCodes.includes(statusCode)
+ ) {
+ cb(err)
+ return
+ }
- // 2.1.1
- // 2.2
- return this.#caches.has(cacheName)
- }
+ // If we reached the max number of retries
+ if (counter > maxRetries) {
+ cb(err)
+ return
+ }
- /**
- * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
- * @param {string} cacheName
- * @returns {Promise}
- */
- async open (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
+ let retryAfterHeader = headers?.['retry-after']
+ if (retryAfterHeader) {
+ retryAfterHeader = Number(retryAfterHeader)
+ retryAfterHeader = Number.isNaN(retryAfterHeader)
+ ? calculateRetryAfterHeader(retryAfterHeader)
+ : retryAfterHeader * 1e3 // Retry-After is in seconds
+ }
- cacheName = webidl.converters.DOMString(cacheName)
+ const retryTimeout =
+ retryAfterHeader > 0
+ ? Math.min(retryAfterHeader, maxTimeout)
+ : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)
- // 2.1
- if (this.#caches.has(cacheName)) {
- // await caches.open('v1') !== await caches.open('v1')
+ setTimeout(() => cb(null), retryTimeout)
+ }
- // 2.1.1
- const cache = this.#caches.get(cacheName)
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const headers = parseHeaders(rawHeaders)
- // 2.1.1.1
- return new Cache(kConstruct, cache)
+ this.retryCount += 1
+
+ if (statusCode >= 300) {
+ if (this.retryOpts.statusCodes.includes(statusCode) === false) {
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ } else {
+ this.abort(
+ new RequestRetryError('Request failed', statusCode, {
+ headers,
+ data: {
+ count: this.retryCount
+ }
+ })
+ )
+ return false
+ }
}
- // 2.2
- const cache = []
+ // Checkpoint for resume from where we left it
+ if (this.resume != null) {
+ this.resume = null
- // 2.3
- this.#caches.set(cacheName, cache)
+ // Only Partial Content 206 supposed to provide Content-Range,
+ // any other status code that partially consumed the payload
+ // should not be retry because it would result in downstream
+ // wrongly concatanete multiple responses.
+ if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) {
+ this.abort(
+ new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
- // 2.4
- return new Cache(kConstruct, cache)
- }
+ const contentRange = parseRangeHeader(headers['content-range'])
+ // If no content range
+ if (!contentRange) {
+ this.abort(
+ new RequestRetryError('Content-Range mismatch', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
- /**
- * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
- * @param {string} cacheName
- * @returns {Promise}
- */
- async delete (cacheName) {
- webidl.brandCheck(this, CacheStorage)
- webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
+ // Let's start with a weak etag check
+ if (this.etag != null && this.etag !== headers.etag) {
+ this.abort(
+ new RequestRetryError('ETag mismatch', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ )
+ return false
+ }
- cacheName = webidl.converters.DOMString(cacheName)
+ const { start, size, end = size - 1 } = contentRange
- return this.#caches.delete(cacheName)
- }
+ assert(this.start === start, 'content-range mismatch')
+ assert(this.end == null || this.end === end, 'content-range mismatch')
- /**
- * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
- * @returns {string[]}
- */
- async keys () {
- webidl.brandCheck(this, CacheStorage)
+ this.resume = resume
+ return true
+ }
- // 2.1
- const keys = this.#caches.keys()
+ if (this.end == null) {
+ if (statusCode === 206) {
+ // First time we receive 206
+ const range = parseRangeHeader(headers['content-range'])
- // 2.2
- return [...keys]
- }
-}
+ if (range == null) {
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ }
-Object.defineProperties(CacheStorage.prototype, {
- [Symbol.toStringTag]: {
- value: 'CacheStorage',
- configurable: true
- },
- match: kEnumerableProperty,
- has: kEnumerableProperty,
- open: kEnumerableProperty,
- delete: kEnumerableProperty,
- keys: kEnumerableProperty
-})
+ const { start, size, end = size - 1 } = range
+ assert(
+ start != null && Number.isFinite(start),
+ 'content-range mismatch'
+ )
+ assert(end != null && Number.isFinite(end), 'invalid content-length')
-module.exports = {
- CacheStorage
-}
+ this.start = start
+ this.end = end
+ }
+ // We make our best to checkpoint the body for further range headers
+ if (this.end == null) {
+ const contentLength = headers['content-length']
+ this.end = contentLength != null ? Number(contentLength) - 1 : null
+ }
-/***/ }),
+ assert(Number.isFinite(this.start))
+ assert(
+ this.end == null || Number.isFinite(this.end),
+ 'invalid content-length'
+ )
-/***/ 9174:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this.resume = resume
+ this.etag = headers.etag != null ? headers.etag : null
-"use strict";
+ // Weak etags are not useful for comparison nor cache
+ // for instance not safe to assume if the response is byte-per-byte
+ // equal
+ if (this.etag != null && this.etag.startsWith('W/')) {
+ this.etag = null
+ }
+ return this.handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
+ }
-module.exports = {
- kConstruct: (__nccwpck_require__(2785).kConstruct)
-}
+ const err = new RequestRetryError('Request failed', statusCode, {
+ headers,
+ data: { count: this.retryCount }
+ })
+ this.abort(err)
-/***/ }),
+ return false
+ }
-/***/ 2396:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ onData (chunk) {
+ this.start += chunk.length
-"use strict";
+ return this.handler.onData(chunk)
+ }
+ onComplete (rawTrailers) {
+ this.retryCount = 0
+ return this.handler.onComplete(rawTrailers)
+ }
-const assert = __nccwpck_require__(9491)
-const { URLSerializer } = __nccwpck_require__(685)
-const { isValidHeaderName } = __nccwpck_require__(2538)
+ onError (err) {
+ if (this.aborted || isDisturbed(this.opts.body)) {
+ return this.handler.onError(err)
+ }
-/**
- * @see https://url.spec.whatwg.org/#concept-url-equals
- * @param {URL} A
- * @param {URL} B
- * @param {boolean | undefined} excludeFragment
- * @returns {boolean}
- */
-function urlEquals (A, B, excludeFragment = false) {
- const serializedA = URLSerializer(A, excludeFragment)
+ // We reconcile in case of a mix between network errors
+ // and server error response
+ if (this.retryCount - this.retryCountCheckpoint > 0) {
+ // We count the difference between the last checkpoint and the current retry count
+ this.retryCount =
+ this.retryCountCheckpoint +
+ (this.retryCount - this.retryCountCheckpoint)
+ } else {
+ this.retryCount += 1
+ }
- const serializedB = URLSerializer(B, excludeFragment)
+ this.retryOpts.retry(
+ err,
+ {
+ state: { counter: this.retryCount },
+ opts: { retryOptions: this.retryOpts, ...this.opts }
+ },
+ onRetry.bind(this)
+ )
- return serializedA === serializedB
-}
+ function onRetry (err) {
+ if (err != null || this.aborted || isDisturbed(this.opts.body)) {
+ return this.handler.onError(err)
+ }
-/**
- * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
- * @param {string} header
- */
-function fieldValues (header) {
- assert(header !== null)
+ if (this.start !== 0) {
+ const headers = { range: `bytes=${this.start}-${this.end ?? ''}` }
- const values = []
+ // Weak etag check - weak etags will make comparison algorithms never match
+ if (this.etag != null) {
+ headers['if-match'] = this.etag
+ }
- for (let value of header.split(',')) {
- value = value.trim()
+ this.opts = {
+ ...this.opts,
+ headers: {
+ ...this.opts.headers,
+ ...headers
+ }
+ }
+ }
- if (!value.length) {
- continue
- } else if (!isValidHeaderName(value)) {
- continue
+ try {
+ this.retryCountCheckpoint = this.retryCount
+ this.dispatch(this.opts, this)
+ } catch (err) {
+ this.handler.onError(err)
+ }
}
-
- values.push(value)
}
-
- return values
}
-module.exports = {
- urlEquals,
- fieldValues
-}
+module.exports = RetryHandler
/***/ }),
-/***/ 3598:
+/***/ 379:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-// @ts-check
+const { isIP } = __nccwpck_require__(7030)
+const { lookup } = __nccwpck_require__(610)
+const DecoratorHandler = __nccwpck_require__(8155)
+const { InvalidArgumentError, InformationalError } = __nccwpck_require__(8707)
+const maxInt = Math.pow(2, 31) - 1
+class DNSInstance {
+ #maxTTL = 0
+ #maxItems = 0
+ #records = new Map()
+ dualStack = true
+ affinity = null
+ lookup = null
+ pick = null
-/* global WebAssembly */
+ constructor (opts) {
+ this.#maxTTL = opts.maxTTL
+ this.#maxItems = opts.maxItems
+ this.dualStack = opts.dualStack
+ this.affinity = opts.affinity
+ this.lookup = opts.lookup ?? this.#defaultLookup
+ this.pick = opts.pick ?? this.#defaultPick
+ }
-const assert = __nccwpck_require__(9491)
-const net = __nccwpck_require__(1808)
-const http = __nccwpck_require__(3685)
-const { pipeline } = __nccwpck_require__(2781)
-const util = __nccwpck_require__(3983)
-const timers = __nccwpck_require__(9459)
-const Request = __nccwpck_require__(2905)
-const DispatcherBase = __nccwpck_require__(4839)
-const {
- RequestContentLengthMismatchError,
- ResponseContentLengthMismatchError,
- InvalidArgumentError,
- RequestAbortedError,
- HeadersTimeoutError,
- HeadersOverflowError,
- SocketError,
- InformationalError,
- BodyTimeoutError,
- HTTPParserError,
- ResponseExceededMaxSizeError,
- ClientDestroyedError
-} = __nccwpck_require__(8045)
-const buildConnector = __nccwpck_require__(2067)
-const {
- kUrl,
- kReset,
- kServerName,
- kClient,
- kBusy,
- kParser,
- kConnect,
- kBlocking,
- kResuming,
- kRunning,
- kPending,
- kSize,
- kWriting,
- kQueue,
- kConnected,
- kConnecting,
- kNeedDrain,
- kNoRef,
- kKeepAliveDefaultTimeout,
- kHostHeader,
- kPendingIdx,
- kRunningIdx,
- kError,
- kPipelining,
- kSocket,
- kKeepAliveTimeoutValue,
- kMaxHeadersSize,
- kKeepAliveMaxTimeout,
- kKeepAliveTimeoutThreshold,
- kHeadersTimeout,
- kBodyTimeout,
- kStrictContentLength,
- kConnector,
- kMaxRedirections,
- kMaxRequests,
- kCounter,
- kClose,
- kDestroy,
- kDispatch,
- kInterceptors,
- kLocalAddress,
- kMaxResponseSize,
- kHTTPConnVersion,
- // HTTP2
- kHost,
- kHTTP2Session,
- kHTTP2SessionState,
- kHTTP2BuildRequest,
- kHTTP2CopyHeaders,
- kHTTP1BuildRequest
-} = __nccwpck_require__(2785)
+ get full () {
+ return this.#records.size === this.#maxItems
+ }
-/** @type {import('http2')} */
-let http2
-try {
- http2 = __nccwpck_require__(5158)
-} catch {
- // @ts-ignore
- http2 = { constants: {} }
-}
+ runLookup (origin, opts, cb) {
+ const ips = this.#records.get(origin.hostname)
-const {
- constants: {
- HTTP2_HEADER_AUTHORITY,
- HTTP2_HEADER_METHOD,
- HTTP2_HEADER_PATH,
- HTTP2_HEADER_SCHEME,
- HTTP2_HEADER_CONTENT_LENGTH,
- HTTP2_HEADER_EXPECT,
- HTTP2_HEADER_STATUS
- }
-} = http2
+ // If full, we just return the origin
+ if (ips == null && this.full) {
+ cb(null, origin.origin)
+ return
+ }
-// Experimental
-let h2ExperimentalWarned = false
+ const newOpts = {
+ affinity: this.affinity,
+ dualStack: this.dualStack,
+ lookup: this.lookup,
+ pick: this.pick,
+ ...opts.dns,
+ maxTTL: this.#maxTTL,
+ maxItems: this.#maxItems
+ }
-const FastBuffer = Buffer[Symbol.species]
+ // If no IPs we lookup
+ if (ips == null) {
+ this.lookup(origin, newOpts, (err, addresses) => {
+ if (err || addresses == null || addresses.length === 0) {
+ cb(err ?? new InformationalError('No DNS entries found'))
+ return
+ }
-const kClosedResolve = Symbol('kClosedResolve')
+ this.setRecords(origin, addresses)
+ const records = this.#records.get(origin.hostname)
-const channels = {}
+ const ip = this.pick(
+ origin,
+ records,
+ newOpts.affinity
+ )
-try {
- const diagnosticsChannel = __nccwpck_require__(7643)
- channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
- channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
- channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
- channels.connected = diagnosticsChannel.channel('undici:client:connected')
-} catch {
- channels.sendHeaders = { hasSubscribers: false }
- channels.beforeConnect = { hasSubscribers: false }
- channels.connectError = { hasSubscribers: false }
- channels.connected = { hasSubscribers: false }
-}
+ let port
+ if (typeof ip.port === 'number') {
+ port = `:${ip.port}`
+ } else if (origin.port !== '') {
+ port = `:${origin.port}`
+ } else {
+ port = ''
+ }
-/**
- * @type {import('../types/client').default}
- */
-class Client extends DispatcherBase {
- /**
- *
- * @param {string|URL} url
- * @param {import('../types/client').Client.Options} options
- */
- constructor (url, {
- interceptors,
- maxHeaderSize,
- headersTimeout,
- socketTimeout,
- requestTimeout,
- connectTimeout,
- bodyTimeout,
- idleTimeout,
- keepAlive,
- keepAliveTimeout,
- maxKeepAliveTimeout,
- keepAliveMaxTimeout,
- keepAliveTimeoutThreshold,
- socketPath,
- pipelining,
- tls,
- strictContentLength,
- maxCachedSessions,
- maxRedirections,
- connect,
- maxRequestsPerClient,
- localAddress,
- maxResponseSize,
- autoSelectFamily,
- autoSelectFamilyAttemptTimeout,
- // h2
- allowH2,
- maxConcurrentStreams
- } = {}) {
- super()
+ cb(
+ null,
+ `${origin.protocol}//${
+ ip.family === 6 ? `[${ip.address}]` : ip.address
+ }${port}`
+ )
+ })
+ } else {
+ // If there's IPs we pick
+ const ip = this.pick(
+ origin,
+ ips,
+ newOpts.affinity
+ )
- if (keepAlive !== undefined) {
- throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
- }
+ // If no IPs we lookup - deleting old records
+ if (ip == null) {
+ this.#records.delete(origin.hostname)
+ this.runLookup(origin, opts, cb)
+ return
+ }
- if (socketTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
- }
+ let port
+ if (typeof ip.port === 'number') {
+ port = `:${ip.port}`
+ } else if (origin.port !== '') {
+ port = `:${origin.port}`
+ } else {
+ port = ''
+ }
- if (requestTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
+ cb(
+ null,
+ `${origin.protocol}//${
+ ip.family === 6 ? `[${ip.address}]` : ip.address
+ }${port}`
+ )
}
+ }
- if (idleTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
- }
+ #defaultLookup (origin, opts, cb) {
+ lookup(
+ origin.hostname,
+ {
+ all: true,
+ family: this.dualStack === false ? this.affinity : 0,
+ order: 'ipv4first'
+ },
+ (err, addresses) => {
+ if (err) {
+ return cb(err)
+ }
- if (maxKeepAliveTimeout !== undefined) {
- throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
- }
+ const results = new Map()
- if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
- throw new InvalidArgumentError('invalid maxHeaderSize')
- }
+ for (const addr of addresses) {
+ // On linux we found duplicates, we attempt to remove them with
+ // the latest record
+ results.set(`${addr.address}:${addr.family}`, addr)
+ }
- if (socketPath != null && typeof socketPath !== 'string') {
- throw new InvalidArgumentError('invalid socketPath')
- }
+ cb(null, results.values())
+ }
+ )
+ }
- if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
- throw new InvalidArgumentError('invalid connectTimeout')
- }
+ #defaultPick (origin, hostnameRecords, affinity) {
+ let ip = null
+ const { records, offset } = hostnameRecords
- if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
- throw new InvalidArgumentError('invalid keepAliveTimeout')
- }
+ let family
+ if (this.dualStack) {
+ if (affinity == null) {
+ // Balance between ip families
+ if (offset == null || offset === maxInt) {
+ hostnameRecords.offset = 0
+ affinity = 4
+ } else {
+ hostnameRecords.offset++
+ affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4
+ }
+ }
- if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
- throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
+ if (records[affinity] != null && records[affinity].ips.length > 0) {
+ family = records[affinity]
+ } else {
+ family = records[affinity === 4 ? 6 : 4]
+ }
+ } else {
+ family = records[affinity]
}
- if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
- throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
+ // If no IPs we return null
+ if (family == null || family.ips.length === 0) {
+ return ip
}
- if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
- throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
+ if (family.offset == null || family.offset === maxInt) {
+ family.offset = 0
+ } else {
+ family.offset++
}
- if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
- throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
- }
+ const position = family.offset % family.ips.length
+ ip = family.ips[position] ?? null
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
+ if (ip == null) {
+ return ip
}
- if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
+ if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms
+ // We delete expired records
+ // It is possible that they have different TTL, so we manage them individually
+ family.ips.splice(position, 1)
+ return this.pick(origin, hostnameRecords, affinity)
}
- if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
- throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
- }
+ return ip
+ }
- if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
- throw new InvalidArgumentError('localAddress must be valid string IP address')
- }
+ setRecords (origin, addresses) {
+ const timestamp = Date.now()
+ const records = { records: { 4: null, 6: null } }
+ for (const record of addresses) {
+ record.timestamp = timestamp
+ if (typeof record.ttl === 'number') {
+ // The record TTL is expected to be in ms
+ record.ttl = Math.min(record.ttl, this.#maxTTL)
+ } else {
+ record.ttl = this.#maxTTL
+ }
- if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
- throw new InvalidArgumentError('maxResponseSize must be a positive number')
- }
+ const familyRecords = records.records[record.family] ?? { ips: [] }
- if (
- autoSelectFamilyAttemptTimeout != null &&
- (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
- ) {
- throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
+ familyRecords.ips.push(record)
+ records.records[record.family] = familyRecords
}
- // h2
- if (allowH2 != null && typeof allowH2 !== 'boolean') {
- throw new InvalidArgumentError('allowH2 must be a valid boolean value')
- }
+ this.#records.set(origin.hostname, records)
+ }
- if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
- throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
- }
+ getHandler (meta, opts) {
+ return new DNSDispatchHandler(this, meta, opts)
+ }
+}
- if (typeof connect !== 'function') {
- connect = buildConnector({
- ...tls,
- maxCachedSessions,
- allowH2,
- socketPath,
- timeout: connectTimeout,
- ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
- ...connect
- })
- }
+class DNSDispatchHandler extends DecoratorHandler {
+ #state = null
+ #opts = null
+ #dispatch = null
+ #handler = null
+ #origin = null
- this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
- ? interceptors.Client
- : [createRedirectInterceptor({ maxRedirections })]
- this[kUrl] = util.parseOrigin(url)
- this[kConnector] = connect
- this[kSocket] = null
- this[kPipelining] = pipelining != null ? pipelining : 1
- this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
- this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
- this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
- this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
- this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
- this[kServerName] = null
- this[kLocalAddress] = localAddress != null ? localAddress : null
- this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
- this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
- this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
- this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
- this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
- this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
- this[kMaxRedirections] = maxRedirections
- this[kMaxRequests] = maxRequestsPerClient
- this[kClosedResolve] = null
- this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
- this[kHTTPConnVersion] = 'h1'
+ constructor (state, { origin, handler, dispatch }, opts) {
+ super(handler)
+ this.#origin = origin
+ this.#handler = handler
+ this.#opts = { ...opts }
+ this.#state = state
+ this.#dispatch = dispatch
+ }
- // HTTP/2
- this[kHTTP2Session] = null
- this[kHTTP2SessionState] = !allowH2
- ? null
- : {
- // streams: null, // Fixed queue of streams - For future support of `push`
- openStreams: 0, // Keep track of them to decide wether or not unref the session
- maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
+ onError (err) {
+ switch (err.code) {
+ case 'ETIMEDOUT':
+ case 'ECONNREFUSED': {
+ if (this.#state.dualStack) {
+ // We delete the record and retry
+ this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => {
+ if (err) {
+ return this.#handler.onError(err)
+ }
+
+ const dispatchOpts = {
+ ...this.#opts,
+ origin: newOrigin
+ }
+
+ this.#dispatch(dispatchOpts, this)
+ })
+
+ // if dual-stack disabled, we error out
+ return
}
- this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
- // kQueue is built up of 3 sections separated by
- // the kRunningIdx and kPendingIdx indices.
- // | complete | running | pending |
- // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
- // kRunningIdx points to the first running element.
- // kPendingIdx points to the first pending element.
- // This implements a fast queue with an amortized
- // time of O(1).
+ this.#handler.onError(err)
+ return
+ }
+ case 'ENOTFOUND':
+ this.#state.deleteRecord(this.#origin)
+ // eslint-disable-next-line no-fallthrough
+ default:
+ this.#handler.onError(err)
+ break
+ }
+ }
+}
- this[kQueue] = []
- this[kRunningIdx] = 0
- this[kPendingIdx] = 0
+module.exports = interceptorOpts => {
+ if (
+ interceptorOpts?.maxTTL != null &&
+ (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0)
+ ) {
+ throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number')
}
- get pipelining () {
- return this[kPipelining]
+ if (
+ interceptorOpts?.maxItems != null &&
+ (typeof interceptorOpts?.maxItems !== 'number' ||
+ interceptorOpts?.maxItems < 1)
+ ) {
+ throw new InvalidArgumentError(
+ 'Invalid maxItems. Must be a positive number and greater than zero'
+ )
+ }
+
+ if (
+ interceptorOpts?.affinity != null &&
+ interceptorOpts?.affinity !== 4 &&
+ interceptorOpts?.affinity !== 6
+ ) {
+ throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6')
}
- set pipelining (value) {
- this[kPipelining] = value
- resume(this, true)
+ if (
+ interceptorOpts?.dualStack != null &&
+ typeof interceptorOpts?.dualStack !== 'boolean'
+ ) {
+ throw new InvalidArgumentError('Invalid dualStack. Must be a boolean')
}
- get [kPending] () {
- return this[kQueue].length - this[kPendingIdx]
+ if (
+ interceptorOpts?.lookup != null &&
+ typeof interceptorOpts?.lookup !== 'function'
+ ) {
+ throw new InvalidArgumentError('Invalid lookup. Must be a function')
}
- get [kRunning] () {
- return this[kPendingIdx] - this[kRunningIdx]
+ if (
+ interceptorOpts?.pick != null &&
+ typeof interceptorOpts?.pick !== 'function'
+ ) {
+ throw new InvalidArgumentError('Invalid pick. Must be a function')
}
- get [kSize] () {
- return this[kQueue].length - this[kRunningIdx]
+ const dualStack = interceptorOpts?.dualStack ?? true
+ let affinity
+ if (dualStack) {
+ affinity = interceptorOpts?.affinity ?? null
+ } else {
+ affinity = interceptorOpts?.affinity ?? 4
}
- get [kConnected] () {
- return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
+ const opts = {
+ maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms
+ lookup: interceptorOpts?.lookup ?? null,
+ pick: interceptorOpts?.pick ?? null,
+ dualStack,
+ affinity,
+ maxItems: interceptorOpts?.maxItems ?? Infinity
}
- get [kBusy] () {
- const socket = this[kSocket]
- return (
- (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
- (this[kSize] >= (this[kPipelining] || 1)) ||
- this[kPending] > 0
- )
+ const instance = new DNSInstance(opts)
+
+ return dispatch => {
+ return function dnsInterceptor (origDispatchOpts, handler) {
+ const origin =
+ origDispatchOpts.origin.constructor === URL
+ ? origDispatchOpts.origin
+ : new URL(origDispatchOpts.origin)
+
+ if (isIP(origin.hostname) !== 0) {
+ return dispatch(origDispatchOpts, handler)
+ }
+
+ instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {
+ if (err) {
+ return handler.onError(err)
+ }
+
+ let dispatchOpts = null
+ dispatchOpts = {
+ ...origDispatchOpts,
+ servername: origin.hostname, // For SNI on TLS
+ origin: newOrigin,
+ headers: {
+ host: origin.hostname,
+ ...origDispatchOpts.headers
+ }
+ }
+
+ dispatch(
+ dispatchOpts,
+ instance.getHandler({ origin, dispatch, handler }, origDispatchOpts)
+ )
+ })
+
+ return true
+ }
}
+}
- /* istanbul ignore: only used for test */
- [kConnect] (cb) {
- connect(this)
- this.once('connect', cb)
+
+/***/ }),
+
+/***/ 8060:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const util = __nccwpck_require__(3440)
+const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8707)
+const DecoratorHandler = __nccwpck_require__(8155)
+
+class DumpHandler extends DecoratorHandler {
+ #maxSize = 1024 * 1024
+ #abort = null
+ #dumped = false
+ #aborted = false
+ #size = 0
+ #reason = null
+ #handler = null
+
+ constructor ({ maxSize }, handler) {
+ super(handler)
+
+ if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {
+ throw new InvalidArgumentError('maxSize must be a number greater than 0')
+ }
+
+ this.#maxSize = maxSize ?? this.#maxSize
+ this.#handler = handler
}
- [kDispatch] (opts, handler) {
- const origin = opts.origin || this[kUrl].origin
+ onConnect (abort) {
+ this.#abort = abort
- const request = this[kHTTPConnVersion] === 'h2'
- ? Request[kHTTP2BuildRequest](origin, opts, handler)
- : Request[kHTTP1BuildRequest](origin, opts, handler)
+ this.#handler.onConnect(this.#customAbort.bind(this))
+ }
- this[kQueue].push(request)
- if (this[kResuming]) {
- // Do nothing.
- } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
- // Wait a tick in case stream/iterator is ended in the same tick.
- this[kResuming] = 1
- process.nextTick(resume, this)
- } else {
- resume(this, true)
+ #customAbort (reason) {
+ this.#aborted = true
+ this.#reason = reason
+ }
+
+ // TODO: will require adjustment after new hooks are out
+ onHeaders (statusCode, rawHeaders, resume, statusMessage) {
+ const headers = util.parseHeaders(rawHeaders)
+ const contentLength = headers['content-length']
+
+ if (contentLength != null && contentLength > this.#maxSize) {
+ throw new RequestAbortedError(
+ `Response size (${contentLength}) larger than maxSize (${
+ this.#maxSize
+ })`
+ )
}
- if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
- this[kNeedDrain] = 2
+ if (this.#aborted) {
+ return true
}
- return this[kNeedDrain] < 2
+ return this.#handler.onHeaders(
+ statusCode,
+ rawHeaders,
+ resume,
+ statusMessage
+ )
}
- async [kClose] () {
- // TODO: for H2 we need to gracefully flush the remaining enqueued
- // request and close each stream.
- return new Promise((resolve) => {
- if (!this[kSize]) {
- resolve(null)
- } else {
- this[kClosedResolve] = resolve
- }
- })
- }
+ onError (err) {
+ if (this.#dumped) {
+ return
+ }
- async [kDestroy] (err) {
- return new Promise((resolve) => {
- const requests = this[kQueue].splice(this[kPendingIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(this, request, err)
- }
+ err = this.#reason ?? err
- const callback = () => {
- if (this[kClosedResolve]) {
- // TODO (fix): Should we error here with ClientDestroyedError?
- this[kClosedResolve]()
- this[kClosedResolve] = null
- }
- resolve()
- }
+ this.#handler.onError(err)
+ }
- if (this[kHTTP2Session] != null) {
- util.destroy(this[kHTTP2Session], err)
- this[kHTTP2Session] = null
- this[kHTTP2SessionState] = null
- }
+ onData (chunk) {
+ this.#size = this.#size + chunk.length
- if (!this[kSocket]) {
- queueMicrotask(callback)
+ if (this.#size >= this.#maxSize) {
+ this.#dumped = true
+
+ if (this.#aborted) {
+ this.#handler.onError(this.#reason)
} else {
- util.destroy(this[kSocket].on('close', callback), err)
+ this.#handler.onComplete([])
}
+ }
- resume(this)
- })
+ return true
}
-}
-function onHttp2SessionError (err) {
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
+ onComplete (trailers) {
+ if (this.#dumped) {
+ return
+ }
- this[kSocket][kError] = err
+ if (this.#aborted) {
+ this.#handler.onError(this.reason)
+ return
+ }
- onError(this[kClient], err)
+ this.#handler.onComplete(trailers)
+ }
}
-function onHttp2FrameError (type, code, id) {
- const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
+function createDumpInterceptor (
+ { maxSize: defaultMaxSize } = {
+ maxSize: 1024 * 1024
+ }
+) {
+ return dispatch => {
+ return function Intercept (opts, handler) {
+ const { dumpMaxSize = defaultMaxSize } =
+ opts
- if (id === 0) {
- this[kSocket][kError] = err
- onError(this[kClient], err)
+ const dumpHandler = new DumpHandler(
+ { maxSize: dumpMaxSize },
+ handler
+ )
+
+ return dispatch(opts, dumpHandler)
+ }
}
}
-function onHttp2SessionEnd () {
- util.destroy(this, new SocketError('other side closed'))
- util.destroy(this[kSocket], new SocketError('other side closed'))
-}
+module.exports = createDumpInterceptor
-function onHTTP2GoAway (code) {
- const client = this[kClient]
- const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
- client[kSocket] = null
- client[kHTTP2Session] = null
- if (client.destroyed) {
- assert(this[kPending] === 0)
+/***/ }),
- // Fail entire queue.
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(this, request, err)
- }
- } else if (client[kRunning] > 0) {
- // Fail head of pipeline.
- const request = client[kQueue][client[kRunningIdx]]
- client[kQueue][client[kRunningIdx]++] = null
+/***/ 5092:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- errorRequest(client, request, err)
- }
- client[kPendingIdx] = client[kRunningIdx]
- assert(client[kRunning] === 0)
+const RedirectHandler = __nccwpck_require__(8754)
- client.emit('disconnect',
- client[kUrl],
- [client],
- err
- )
+function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
+ return (dispatch) => {
+ return function Intercept (opts, handler) {
+ const { maxRedirections = defaultMaxRedirections } = opts
+
+ if (!maxRedirections) {
+ return dispatch(opts, handler)
+ }
- resume(client)
+ const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
+ opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
+ return dispatch(opts, redirectHandler)
+ }
+ }
}
-const constants = __nccwpck_require__(953)
-const createRedirectInterceptor = __nccwpck_require__(8861)
-const EMPTY_BUF = Buffer.alloc(0)
+module.exports = createRedirectInterceptor
-async function lazyllhttp () {
- const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
- let mod
- try {
- mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
- } catch (e) {
- /* istanbul ignore next */
+/***/ }),
- // We could check if the error was caused by the simd option not
- // being enabled, but the occurring of this other error
- // * https://github.com/emscripten-core/emscripten/issues/11495
- // got me to remove that check to avoid breaking Node 12.
- mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
- }
+/***/ 1514:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return await WebAssembly.instantiate(mod, {
- env: {
- /* eslint-disable camelcase */
- wasm_on_url: (p, at, len) => {
- /* istanbul ignore next */
- return 0
- },
- wasm_on_status: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_message_begin: (p) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onMessageBegin() || 0
- },
- wasm_on_header_field: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_header_value: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
- },
- wasm_on_body: (p, at, len) => {
- assert.strictEqual(currentParser.ptr, p)
- const start = at - currentBufferPtr + currentBufferRef.byteOffset
- return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
- },
- wasm_on_message_complete: (p) => {
- assert.strictEqual(currentParser.ptr, p)
- return currentParser.onMessageComplete() || 0
+const RedirectHandler = __nccwpck_require__(8754)
+
+module.exports = opts => {
+ const globalMaxRedirections = opts?.maxRedirections
+ return dispatch => {
+ return function redirectInterceptor (opts, handler) {
+ const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts
+
+ if (!maxRedirections) {
+ return dispatch(opts, handler)
}
- /* eslint-enable camelcase */
+ const redirectHandler = new RedirectHandler(
+ dispatch,
+ maxRedirections,
+ opts,
+ handler
+ )
+
+ return dispatch(baseOpts, redirectHandler)
}
- })
+ }
}
-let llhttpInstance = null
-let llhttpPromise = lazyllhttp()
-llhttpPromise.catch()
-let currentParser = null
-let currentBufferRef = null
-let currentBufferSize = 0
-let currentBufferPtr = null
+/***/ }),
-const TIMEOUT_HEADERS = 1
-const TIMEOUT_BODY = 2
-const TIMEOUT_IDLE = 3
+/***/ 2026:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-class Parser {
- constructor (client, socket, { exports }) {
- assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
- this.llhttp = exports
- this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
- this.client = client
- this.socket = socket
- this.timeout = null
- this.timeoutValue = null
- this.timeoutType = null
- this.statusCode = null
- this.statusText = ''
- this.upgrade = false
- this.headers = []
- this.headersSize = 0
- this.headersMaxSize = client[kMaxHeadersSize]
- this.shouldKeepAlive = false
- this.paused = false
- this.resume = this.resume.bind(this)
+const RetryHandler = __nccwpck_require__(7816)
- this.bytesRead = 0
+module.exports = globalOpts => {
+ return dispatch => {
+ return function retryInterceptor (opts, handler) {
+ return dispatch(
+ opts,
+ new RetryHandler(
+ { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } },
+ {
+ handler,
+ dispatch
+ }
+ )
+ )
+ }
+ }
+}
+
+
+/***/ }),
+
+/***/ 2824:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
+const utils_1 = __nccwpck_require__(172);
+// C headers
+var ERROR;
+(function (ERROR) {
+ ERROR[ERROR["OK"] = 0] = "OK";
+ ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
+ ERROR[ERROR["STRICT"] = 2] = "STRICT";
+ ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
+ ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
+ ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
+ ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
+ ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
+ ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
+ ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
+ ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
+ ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
+ ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
+ ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
+ ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
+ ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
+ ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
+ ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
+ ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
+ ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
+ ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
+ ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
+ ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
+ ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
+ ERROR[ERROR["USER"] = 24] = "USER";
+})(ERROR = exports.ERROR || (exports.ERROR = {}));
+var TYPE;
+(function (TYPE) {
+ TYPE[TYPE["BOTH"] = 0] = "BOTH";
+ TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
+ TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
+})(TYPE = exports.TYPE || (exports.TYPE = {}));
+var FLAGS;
+(function (FLAGS) {
+ FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
+ FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
+ FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
+ FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
+ FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
+ FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
+ FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
+ FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
+ // 1 << 8 is unused
+ FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
+})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
+var LENIENT_FLAGS;
+(function (LENIENT_FLAGS) {
+ LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
+ LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
+ LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
+})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
+var METHODS;
+(function (METHODS) {
+ METHODS[METHODS["DELETE"] = 0] = "DELETE";
+ METHODS[METHODS["GET"] = 1] = "GET";
+ METHODS[METHODS["HEAD"] = 2] = "HEAD";
+ METHODS[METHODS["POST"] = 3] = "POST";
+ METHODS[METHODS["PUT"] = 4] = "PUT";
+ /* pathological */
+ METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
+ METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
+ METHODS[METHODS["TRACE"] = 7] = "TRACE";
+ /* WebDAV */
+ METHODS[METHODS["COPY"] = 8] = "COPY";
+ METHODS[METHODS["LOCK"] = 9] = "LOCK";
+ METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
+ METHODS[METHODS["MOVE"] = 11] = "MOVE";
+ METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
+ METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
+ METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
+ METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
+ METHODS[METHODS["BIND"] = 16] = "BIND";
+ METHODS[METHODS["REBIND"] = 17] = "REBIND";
+ METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
+ METHODS[METHODS["ACL"] = 19] = "ACL";
+ /* subversion */
+ METHODS[METHODS["REPORT"] = 20] = "REPORT";
+ METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
+ METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
+ METHODS[METHODS["MERGE"] = 23] = "MERGE";
+ /* upnp */
+ METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
+ METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
+ METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
+ METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
+ /* RFC-5789 */
+ METHODS[METHODS["PATCH"] = 28] = "PATCH";
+ METHODS[METHODS["PURGE"] = 29] = "PURGE";
+ /* CalDAV */
+ METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
+ /* RFC-2068, section 19.6.1.2 */
+ METHODS[METHODS["LINK"] = 31] = "LINK";
+ METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
+ /* icecast */
+ METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
+ /* RFC-7540, section 11.6 */
+ METHODS[METHODS["PRI"] = 34] = "PRI";
+ /* RFC-2326 RTSP */
+ METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
+ METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
+ METHODS[METHODS["SETUP"] = 37] = "SETUP";
+ METHODS[METHODS["PLAY"] = 38] = "PLAY";
+ METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
+ METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
+ METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
+ METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
+ METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
+ METHODS[METHODS["RECORD"] = 44] = "RECORD";
+ /* RAOP */
+ METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
+})(METHODS = exports.METHODS || (exports.METHODS = {}));
+exports.METHODS_HTTP = [
+ METHODS.DELETE,
+ METHODS.GET,
+ METHODS.HEAD,
+ METHODS.POST,
+ METHODS.PUT,
+ METHODS.CONNECT,
+ METHODS.OPTIONS,
+ METHODS.TRACE,
+ METHODS.COPY,
+ METHODS.LOCK,
+ METHODS.MKCOL,
+ METHODS.MOVE,
+ METHODS.PROPFIND,
+ METHODS.PROPPATCH,
+ METHODS.SEARCH,
+ METHODS.UNLOCK,
+ METHODS.BIND,
+ METHODS.REBIND,
+ METHODS.UNBIND,
+ METHODS.ACL,
+ METHODS.REPORT,
+ METHODS.MKACTIVITY,
+ METHODS.CHECKOUT,
+ METHODS.MERGE,
+ METHODS['M-SEARCH'],
+ METHODS.NOTIFY,
+ METHODS.SUBSCRIBE,
+ METHODS.UNSUBSCRIBE,
+ METHODS.PATCH,
+ METHODS.PURGE,
+ METHODS.MKCALENDAR,
+ METHODS.LINK,
+ METHODS.UNLINK,
+ METHODS.PRI,
+ // TODO(indutny): should we allow it with HTTP?
+ METHODS.SOURCE,
+];
+exports.METHODS_ICE = [
+ METHODS.SOURCE,
+];
+exports.METHODS_RTSP = [
+ METHODS.OPTIONS,
+ METHODS.DESCRIBE,
+ METHODS.ANNOUNCE,
+ METHODS.SETUP,
+ METHODS.PLAY,
+ METHODS.PAUSE,
+ METHODS.TEARDOWN,
+ METHODS.GET_PARAMETER,
+ METHODS.SET_PARAMETER,
+ METHODS.REDIRECT,
+ METHODS.RECORD,
+ METHODS.FLUSH,
+ // For AirPlay
+ METHODS.GET,
+ METHODS.POST,
+];
+exports.METHOD_MAP = utils_1.enumToMap(METHODS);
+exports.H_METHOD_MAP = {};
+Object.keys(exports.METHOD_MAP).forEach((key) => {
+ if (/^H/.test(key)) {
+ exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
+ }
+});
+var FINISH;
+(function (FINISH) {
+ FINISH[FINISH["SAFE"] = 0] = "SAFE";
+ FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
+ FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
+})(FINISH = exports.FINISH || (exports.FINISH = {}));
+exports.ALPHA = [];
+for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
+ // Upper case
+ exports.ALPHA.push(String.fromCharCode(i));
+ // Lower case
+ exports.ALPHA.push(String.fromCharCode(i + 0x20));
+}
+exports.NUM_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+};
+exports.HEX_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+ A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
+ a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
+};
+exports.NUM = [
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+];
+exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
+exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
+exports.USERINFO_CHARS = exports.ALPHANUM
+ .concat(exports.MARK)
+ .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
+// TODO(indutny): use RFC
+exports.STRICT_URL_CHAR = [
+ '!', '"', '$', '%', '&', '\'',
+ '(', ')', '*', '+', ',', '-', '.', '/',
+ ':', ';', '<', '=', '>',
+ '@', '[', '\\', ']', '^', '_',
+ '`',
+ '{', '|', '}', '~',
+].concat(exports.ALPHANUM);
+exports.URL_CHAR = exports.STRICT_URL_CHAR
+ .concat(['\t', '\f']);
+// All characters with 0x80 bit set to 1
+for (let i = 0x80; i <= 0xff; i++) {
+ exports.URL_CHAR.push(i);
+}
+exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
+/* Tokens as defined by rfc 2616. Also lowercases them.
+ * token = 1*
+ * separators = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+ * | "{" | "}" | SP | HT
+ */
+exports.STRICT_TOKEN = [
+ '!', '#', '$', '%', '&', '\'',
+ '*', '+', '-', '.',
+ '^', '_', '`',
+ '|', '~',
+].concat(exports.ALPHANUM);
+exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
+/*
+ * Verify that a char is a valid visible (printable) US-ASCII
+ * character or %x80-FF
+ */
+exports.HEADER_CHARS = ['\t'];
+for (let i = 32; i <= 255; i++) {
+ if (i !== 127) {
+ exports.HEADER_CHARS.push(i);
+ }
+}
+// ',' = \x44
+exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
+exports.MAJOR = exports.NUM_MAP;
+exports.MINOR = exports.MAJOR;
+var HEADER_STATE;
+(function (HEADER_STATE) {
+ HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
+ HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
+ HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
+ HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
+ HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
+ HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
+ HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
+})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
+exports.SPECIAL_HEADERS = {
+ 'connection': HEADER_STATE.CONNECTION,
+ 'content-length': HEADER_STATE.CONTENT_LENGTH,
+ 'proxy-connection': HEADER_STATE.CONNECTION,
+ 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
+ 'upgrade': HEADER_STATE.UPGRADE,
+};
+//# sourceMappingURL=constants.js.map
- this.keepAlive = ''
- this.contentLength = ''
- this.connection = ''
- this.maxResponseSize = client[kMaxResponseSize]
- }
+/***/ }),
- setTimeout (value, type) {
- this.timeoutType = type
- if (value !== this.timeoutValue) {
- timers.clearTimeout(this.timeout)
- if (value) {
- this.timeout = timers.setTimeout(onParserTimeout, value, this)
- // istanbul ignore else: only for jest
- if (this.timeout.unref) {
- this.timeout.unref()
- }
- } else {
- this.timeout = null
- }
- this.timeoutValue = value
- } else if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
- }
+/***/ 3870:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- resume () {
- if (this.socket.destroyed || !this.paused) {
- return
- }
- assert(this.ptr != null)
- assert(currentParser == null)
- this.llhttp.llhttp_resume(this.ptr)
+const { Buffer } = __nccwpck_require__(4573)
- assert(this.timeoutType === TIMEOUT_BODY)
- if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
+module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZ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N+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQY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IAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiAB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EGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64')
- this.paused = false
- this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
- this.readMore()
- }
- readMore () {
- while (!this.paused && this.ptr) {
- const chunk = this.socket.read()
- if (chunk === null) {
- break
- }
- this.execute(chunk)
- }
- }
+/***/ }),
- execute (data) {
- assert(this.ptr != null)
- assert(currentParser == null)
- assert(!this.paused)
+/***/ 3434:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const { socket, llhttp } = this
- if (data.length > currentBufferSize) {
- if (currentBufferPtr) {
- llhttp.free(currentBufferPtr)
- }
- currentBufferSize = Math.ceil(data.length / 4096) * 4096
- currentBufferPtr = llhttp.malloc(currentBufferSize)
- }
- new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
+const { Buffer } = __nccwpck_require__(4573)
- // Call `execute` on the wasm parser.
- // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
- // and finally the length of bytes to parse.
- // The return value is an error code or `constants.ERROR.OK`.
- try {
- let ret
+module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgD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AgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgM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JAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAG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FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFq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IMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE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SQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')
- try {
- currentBufferRef = data
- currentParser = this
- ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
- /* eslint-disable-next-line no-useless-catch */
- } catch (err) {
- /* istanbul ignore next: difficult to make a test case for */
- throw err
- } finally {
- currentParser = null
- currentBufferRef = null
- }
- const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
+/***/ }),
- if (ret === constants.ERROR.PAUSED_UPGRADE) {
- this.onUpgrade(data.slice(offset))
- } else if (ret === constants.ERROR.PAUSED) {
- this.paused = true
- socket.unshift(data.slice(offset))
- } else if (ret !== constants.ERROR.OK) {
- const ptr = llhttp.llhttp_get_error_reason(this.ptr)
- let message = ''
- /* istanbul ignore else: difficult to make a test case for */
- if (ptr) {
- const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
- message =
- 'Response does not match the HTTP/1.1 protocol (' +
- Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
- ')'
- }
- throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
- }
- } catch (err) {
- util.destroy(socket, err)
- }
- }
+/***/ 172:
+/***/ ((__unused_webpack_module, exports) => {
- destroy () {
- assert(this.ptr != null)
- assert(currentParser == null)
- this.llhttp.llhttp_free(this.ptr)
- this.ptr = null
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.enumToMap = void 0;
+function enumToMap(obj) {
+ const res = {};
+ Object.keys(obj).forEach((key) => {
+ const value = obj[key];
+ if (typeof value === 'number') {
+ res[key] = value;
+ }
+ });
+ return res;
+}
+exports.enumToMap = enumToMap;
+//# sourceMappingURL=utils.js.map
- timers.clearTimeout(this.timeout)
- this.timeout = null
- this.timeoutValue = null
- this.timeoutType = null
+/***/ }),
- this.paused = false
- }
+/***/ 7501:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- onStatus (buf) {
- this.statusText = buf.toString()
- }
- onMessageBegin () {
- const { socket, client } = this
- /* istanbul ignore next: difficult to make a test case for */
- if (socket.destroyed) {
- return -1
- }
+const { kClients } = __nccwpck_require__(6443)
+const Agent = __nccwpck_require__(7405)
+const {
+ kAgent,
+ kMockAgentSet,
+ kMockAgentGet,
+ kDispatches,
+ kIsMockActive,
+ kNetConnect,
+ kGetNetConnect,
+ kOptions,
+ kFactory
+} = __nccwpck_require__(1117)
+const MockClient = __nccwpck_require__(7365)
+const MockPool = __nccwpck_require__(4004)
+const { matchValue, buildMockOptions } = __nccwpck_require__(3397)
+const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8707)
+const Dispatcher = __nccwpck_require__(883)
+const Pluralizer = __nccwpck_require__(1529)
+const PendingInterceptorsFormatter = __nccwpck_require__(6142)
- const request = client[kQueue][client[kRunningIdx]]
- if (!request) {
- return -1
- }
- }
+class MockAgent extends Dispatcher {
+ constructor (opts) {
+ super(opts)
- onHeaderField (buf) {
- const len = this.headers.length
+ this[kNetConnect] = true
+ this[kIsMockActive] = true
- if ((len & 1) === 0) {
- this.headers.push(buf)
- } else {
- this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
+ // Instantiate Agent and encapsulate
+ if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
+ const agent = opts?.agent ? opts.agent : new Agent(opts)
+ this[kAgent] = agent
- this.trackHeader(buf.length)
+ this[kClients] = agent[kClients]
+ this[kOptions] = buildMockOptions(opts)
}
- onHeaderValue (buf) {
- let len = this.headers.length
-
- if ((len & 1) === 1) {
- this.headers.push(buf)
- len += 1
- } else {
- this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
- }
+ get (origin) {
+ let dispatcher = this[kMockAgentGet](origin)
- const key = this.headers[len - 2]
- if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
- this.keepAlive += buf.toString()
- } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
- this.connection += buf.toString()
- } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
- this.contentLength += buf.toString()
+ if (!dispatcher) {
+ dispatcher = this[kFactory](origin)
+ this[kMockAgentSet](origin, dispatcher)
}
-
- this.trackHeader(buf.length)
+ return dispatcher
}
- trackHeader (len) {
- this.headersSize += len
- if (this.headersSize >= this.headersMaxSize) {
- util.destroy(this.socket, new HeadersOverflowError())
- }
+ dispatch (opts, handler) {
+ // Call MockAgent.get to perform additional setup before dispatching as normal
+ this.get(opts.origin)
+ return this[kAgent].dispatch(opts, handler)
}
- onUpgrade (head) {
- const { upgrade, client, socket, headers, statusCode } = this
-
- assert(upgrade)
-
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
-
- assert(!socket.destroyed)
- assert(socket === client[kSocket])
- assert(!this.paused)
- assert(request.upgrade || request.method === 'CONNECT')
-
- this.statusCode = null
- this.statusText = ''
- this.shouldKeepAlive = null
-
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
-
- socket.unshift(head)
-
- socket[kParser].destroy()
- socket[kParser] = null
-
- socket[kClient] = null
- socket[kError] = null
- socket
- .removeListener('error', onSocketError)
- .removeListener('readable', onSocketReadable)
- .removeListener('end', onSocketEnd)
- .removeListener('close', onSocketClose)
-
- client[kSocket] = null
- client[kQueue][client[kRunningIdx]++] = null
- client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
-
- try {
- request.onUpgrade(statusCode, headers, socket)
- } catch (err) {
- util.destroy(socket, err)
- }
-
- resume(client)
+ async close () {
+ await this[kAgent].close()
+ this[kClients].clear()
}
- onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
- const { client, socket, headers, statusText } = this
-
- /* istanbul ignore next: difficult to make a test case for */
- if (socket.destroyed) {
- return -1
- }
-
- const request = client[kQueue][client[kRunningIdx]]
-
- /* istanbul ignore next: difficult to make a test case for */
- if (!request) {
- return -1
- }
-
- assert(!this.upgrade)
- assert(this.statusCode < 200)
-
- if (statusCode === 100) {
- util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
- return -1
- }
-
- /* this can only happen if server is misbehaving */
- if (upgrade && !request.upgrade) {
- util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
- return -1
- }
-
- assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
-
- this.statusCode = statusCode
- this.shouldKeepAlive = (
- shouldKeepAlive ||
- // Override llhttp value which does not allow keepAlive for HEAD.
- (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
- )
-
- if (this.statusCode >= 200) {
- const bodyTimeout = request.bodyTimeout != null
- ? request.bodyTimeout
- : client[kBodyTimeout]
- this.setTimeout(bodyTimeout, TIMEOUT_BODY)
- } else if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
-
- if (request.method === 'CONNECT') {
- assert(client[kRunning] === 1)
- this.upgrade = true
- return 2
- }
-
- if (upgrade) {
- assert(client[kRunning] === 1)
- this.upgrade = true
- return 2
- }
-
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
+ deactivate () {
+ this[kIsMockActive] = false
+ }
- if (this.shouldKeepAlive && client[kPipelining]) {
- const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
+ activate () {
+ this[kIsMockActive] = true
+ }
- if (keepAliveTimeout != null) {
- const timeout = Math.min(
- keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
- client[kKeepAliveMaxTimeout]
- )
- if (timeout <= 0) {
- socket[kReset] = true
- } else {
- client[kKeepAliveTimeoutValue] = timeout
- }
+ enableNetConnect (matcher) {
+ if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
+ if (Array.isArray(this[kNetConnect])) {
+ this[kNetConnect].push(matcher)
} else {
- client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
+ this[kNetConnect] = [matcher]
}
+ } else if (typeof matcher === 'undefined') {
+ this[kNetConnect] = true
} else {
- // Stop more requests from being dispatched.
- socket[kReset] = true
- }
-
- const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
-
- if (request.aborted) {
- return -1
- }
-
- if (request.method === 'HEAD') {
- return 1
- }
-
- if (statusCode < 200) {
- return 1
- }
-
- if (socket[kBlocking]) {
- socket[kBlocking] = false
- resume(client)
+ throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
}
-
- return pause ? constants.ERROR.PAUSED : 0
}
- onBody (buf) {
- const { client, socket, statusCode, maxResponseSize } = this
-
- if (socket.destroyed) {
- return -1
- }
-
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
-
- assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
- if (this.timeout) {
- // istanbul ignore else: only for jest
- if (this.timeout.refresh) {
- this.timeout.refresh()
- }
- }
-
- assert(statusCode >= 200)
-
- if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
- util.destroy(socket, new ResponseExceededMaxSizeError())
- return -1
- }
-
- this.bytesRead += buf.length
-
- if (request.onData(buf) === false) {
- return constants.ERROR.PAUSED
- }
+ disableNetConnect () {
+ this[kNetConnect] = false
}
- onMessageComplete () {
- const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
-
- if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
- return -1
- }
-
- if (upgrade) {
- return
- }
-
- const request = client[kQueue][client[kRunningIdx]]
- assert(request)
-
- assert(statusCode >= 100)
-
- this.statusCode = null
- this.statusText = ''
- this.bytesRead = 0
- this.contentLength = ''
- this.keepAlive = ''
- this.connection = ''
-
- assert(this.headers.length % 2 === 0)
- this.headers = []
- this.headersSize = 0
-
- if (statusCode < 200) {
- return
- }
-
- /* istanbul ignore next: should be handled by llhttp? */
- if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
- util.destroy(socket, new ResponseContentLengthMismatchError())
- return -1
- }
-
- request.onComplete(headers)
-
- client[kQueue][client[kRunningIdx]++] = null
-
- if (socket[kWriting]) {
- assert.strictEqual(client[kRunning], 0)
- // Response completed before request.
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (!shouldKeepAlive) {
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (socket[kReset] && client[kRunning] === 0) {
- // Destroy socket once all requests have completed.
- // The request at the tail of the pipeline is the one
- // that requested reset and no further requests should
- // have been queued since then.
- util.destroy(socket, new InformationalError('reset'))
- return constants.ERROR.PAUSED
- } else if (client[kPipelining] === 1) {
- // We must wait a full event loop cycle to reuse this socket to make sure
- // that non-spec compliant servers are not closing the connection even if they
- // said they won't.
- setImmediate(resume, client)
- } else {
- resume(client)
- }
+ // This is required to bypass issues caused by using global symbols - see:
+ // https://github.com/nodejs/undici/issues/1447
+ get isMockActive () {
+ return this[kIsMockActive]
}
-}
-
-function onParserTimeout (parser) {
- const { socket, timeoutType, client } = parser
- /* istanbul ignore else */
- if (timeoutType === TIMEOUT_HEADERS) {
- if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
- assert(!parser.paused, 'cannot be paused while waiting for headers')
- util.destroy(socket, new HeadersTimeoutError())
- }
- } else if (timeoutType === TIMEOUT_BODY) {
- if (!parser.paused) {
- util.destroy(socket, new BodyTimeoutError())
- }
- } else if (timeoutType === TIMEOUT_IDLE) {
- assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
- util.destroy(socket, new InformationalError('socket idle timeout'))
+ [kMockAgentSet] (origin, dispatcher) {
+ this[kClients].set(origin, dispatcher)
}
-}
-function onSocketReadable () {
- const { [kParser]: parser } = this
- if (parser) {
- parser.readMore()
+ [kFactory] (origin) {
+ const mockOptions = Object.assign({ agent: this }, this[kOptions])
+ return this[kOptions] && this[kOptions].connections === 1
+ ? new MockClient(origin, mockOptions)
+ : new MockPool(origin, mockOptions)
}
-}
-function onSocketError (err) {
- const { [kClient]: client, [kParser]: parser } = this
+ [kMockAgentGet] (origin) {
+ // First check if we can immediately find it
+ const client = this[kClients].get(origin)
+ if (client) {
+ return client
+ }
- assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
+ // If the origin is not a string create a dummy parent pool and return to user
+ if (typeof origin !== 'string') {
+ const dispatcher = this[kFactory]('http://localhost:9999')
+ this[kMockAgentSet](origin, dispatcher)
+ return dispatcher
+ }
- if (client[kHTTPConnVersion] !== 'h2') {
- // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
- // to the user.
- if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so for as a valid response.
- parser.onMessageComplete()
- return
+ // If we match, create a pool and assign the same dispatches
+ for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) {
+ if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
+ const dispatcher = this[kFactory](origin)
+ this[kMockAgentSet](origin, dispatcher)
+ dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
+ return dispatcher
+ }
}
}
- this[kError] = err
-
- onError(this[kClient], err)
-}
-
-function onError (client, err) {
- if (
- client[kRunning] === 0 &&
- err.code !== 'UND_ERR_INFO' &&
- err.code !== 'UND_ERR_SOCKET'
- ) {
- // Error is not caused by running request and not a recoverable
- // socket error.
+ [kGetNetConnect] () {
+ return this[kNetConnect]
+ }
- assert(client[kPendingIdx] === client[kRunningIdx])
+ pendingInterceptors () {
+ const mockAgentClients = this[kClients]
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(client, request, err)
- }
- assert(client[kSize] === 0)
+ return Array.from(mockAgentClients.entries())
+ .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin })))
+ .filter(({ pending }) => pending)
}
-}
-function onSocketEnd () {
- const { [kParser]: parser, [kClient]: client } = this
+ assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
+ const pending = this.pendingInterceptors()
- if (client[kHTTPConnVersion] !== 'h2') {
- if (parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so far as a valid response.
- parser.onMessageComplete()
+ if (pending.length === 0) {
return
}
- }
- util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
+ const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
+
+ throw new UndiciError(`
+${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
+
+${pendingInterceptorsFormatter.format(pending)}
+`.trim())
+ }
}
-function onSocketClose () {
- const { [kClient]: client, [kParser]: parser } = this
+module.exports = MockAgent
- if (client[kHTTPConnVersion] === 'h1' && parser) {
- if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
- // We treat all incoming data so far as a valid response.
- parser.onMessageComplete()
- }
- this[kParser].destroy()
- this[kParser] = null
- }
+/***/ }),
- const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
+/***/ 7365:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- client[kSocket] = null
- if (client.destroyed) {
- assert(client[kPending] === 0)
- // Fail entire queue.
- const requests = client[kQueue].splice(client[kRunningIdx])
- for (let i = 0; i < requests.length; i++) {
- const request = requests[i]
- errorRequest(client, request, err)
+const { promisify } = __nccwpck_require__(7975)
+const Client = __nccwpck_require__(3701)
+const { buildMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kMockAgent,
+ kClose,
+ kOriginalClose,
+ kOrigin,
+ kOriginalDispatch,
+ kConnected
+} = __nccwpck_require__(1117)
+const { MockInterceptor } = __nccwpck_require__(1511)
+const Symbols = __nccwpck_require__(6443)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+
+/**
+ * MockClient provides an API that extends the Client to influence the mockDispatches.
+ */
+class MockClient extends Client {
+ constructor (origin, opts) {
+ super(origin, opts)
+
+ if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
- } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
- // Fail head of pipeline.
- const request = client[kQueue][client[kRunningIdx]]
- client[kQueue][client[kRunningIdx]++] = null
- errorRequest(client, request, err)
- }
+ this[kMockAgent] = opts.agent
+ this[kOrigin] = origin
+ this[kDispatches] = []
+ this[kConnected] = 1
+ this[kOriginalDispatch] = this.dispatch
+ this[kOriginalClose] = this.close.bind(this)
- client[kPendingIdx] = client[kRunningIdx]
+ this.dispatch = buildMockDispatch.call(this)
+ this.close = this[kClose]
+ }
- assert(client[kRunning] === 0)
+ get [Symbols.kConnected] () {
+ return this[kConnected]
+ }
- client.emit('disconnect', client[kUrl], [client], err)
+ /**
+ * Sets up the base interceptor for mocking replies from undici.
+ */
+ intercept (opts) {
+ return new MockInterceptor(opts, this[kDispatches])
+ }
- resume(client)
+ async [kClose] () {
+ await promisify(this[kOriginalClose])()
+ this[kConnected] = 0
+ this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ }
}
-async function connect (client) {
- assert(!client[kConnecting])
- assert(!client[kSocket])
+module.exports = MockClient
- let { host, hostname, protocol, port } = client[kUrl]
- // Resolve ipv6
- if (hostname[0] === '[') {
- const idx = hostname.indexOf(']')
+/***/ }),
- assert(idx !== -1)
- const ip = hostname.substring(1, idx)
+/***/ 2429:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- assert(net.isIP(ip))
- hostname = ip
- }
- client[kConnecting] = true
- if (channels.beforeConnect.hasSubscribers) {
- channels.beforeConnect.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector]
- })
- }
+const { UndiciError } = __nccwpck_require__(8707)
- try {
- const socket = await new Promise((resolve, reject) => {
- client[kConnector]({
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- }, (err, socket) => {
- if (err) {
- reject(err)
- } else {
- resolve(socket)
- }
- })
- })
+const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED')
- if (client.destroyed) {
- util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
- return
- }
+/**
+ * The request does not match any registered mock dispatches.
+ */
+class MockNotMatchedError extends UndiciError {
+ constructor (message) {
+ super(message)
+ Error.captureStackTrace(this, MockNotMatchedError)
+ this.name = 'MockNotMatchedError'
+ this.message = message || 'The request does not match any registered mock dispatches'
+ this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
+ }
- client[kConnecting] = false
+ static [Symbol.hasInstance] (instance) {
+ return instance && instance[kMockNotMatchedError] === true
+ }
- assert(socket)
+ [kMockNotMatchedError] = true
+}
- const isH2 = socket.alpnProtocol === 'h2'
- if (isH2) {
- if (!h2ExperimentalWarned) {
- h2ExperimentalWarned = true
- process.emitWarning('H2 support is experimental, expect them to change at any time.', {
- code: 'UNDICI-H2'
- })
- }
+module.exports = {
+ MockNotMatchedError
+}
- const session = http2.connect(client[kUrl], {
- createConnection: () => socket,
- peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
- })
- client[kHTTPConnVersion] = 'h2'
- session[kClient] = client
- session[kSocket] = socket
- session.on('error', onHttp2SessionError)
- session.on('frameError', onHttp2FrameError)
- session.on('end', onHttp2SessionEnd)
- session.on('goaway', onHTTP2GoAway)
- session.on('close', onSocketClose)
- session.unref()
+/***/ }),
- client[kHTTP2Session] = session
- socket[kHTTP2Session] = session
- } else {
- if (!llhttpInstance) {
- llhttpInstance = await llhttpPromise
- llhttpPromise = null
- }
+/***/ 1511:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- socket[kNoRef] = false
- socket[kWriting] = false
- socket[kReset] = false
- socket[kBlocking] = false
- socket[kParser] = new Parser(client, socket, llhttpInstance)
- }
- socket[kCounter] = 0
- socket[kMaxRequests] = client[kMaxRequests]
- socket[kClient] = client
- socket[kError] = null
- socket
- .on('error', onSocketError)
- .on('readable', onSocketReadable)
- .on('end', onSocketEnd)
- .on('close', onSocketClose)
+const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kDispatchKey,
+ kDefaultHeaders,
+ kDefaultTrailers,
+ kContentLength,
+ kMockDispatch
+} = __nccwpck_require__(1117)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
+const { buildURL } = __nccwpck_require__(3440)
- client[kSocket] = socket
+/**
+ * Defines the scope API for an interceptor reply
+ */
+class MockScope {
+ constructor (mockDispatch) {
+ this[kMockDispatch] = mockDispatch
+ }
- if (channels.connected.hasSubscribers) {
- channels.connected.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector],
- socket
- })
- }
- client.emit('connect', client[kUrl], [client])
- } catch (err) {
- if (client.destroyed) {
- return
+ /**
+ * Delay a reply by a set amount in ms.
+ */
+ delay (waitInMs) {
+ if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
+ throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
}
- client[kConnecting] = false
+ this[kMockDispatch].delay = waitInMs
+ return this
+ }
- if (channels.connectError.hasSubscribers) {
- channels.connectError.publish({
- connectParams: {
- host,
- hostname,
- protocol,
- port,
- servername: client[kServerName],
- localAddress: client[kLocalAddress]
- },
- connector: client[kConnector],
- error: err
- })
- }
+ /**
+ * For a defined reply, never mark as consumed.
+ */
+ persist () {
+ this[kMockDispatch].persist = true
+ return this
+ }
- if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
- assert(client[kRunning] === 0)
- while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
- const request = client[kQueue][client[kPendingIdx]++]
- errorRequest(client, request, err)
- }
- } else {
- onError(client, err)
+ /**
+ * Allow one to define a reply for a set amount of matching requests.
+ */
+ times (repeatTimes) {
+ if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
+ throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
}
- client.emit('connectionError', client[kUrl], [client], err)
+ this[kMockDispatch].times = repeatTimes
+ return this
}
-
- resume(client)
}
-function emitDrain (client) {
- client[kNeedDrain] = 0
- client.emit('drain', client[kUrl], [client])
-}
+/**
+ * Defines an interceptor for a Mock
+ */
+class MockInterceptor {
+ constructor (opts, mockDispatches) {
+ if (typeof opts !== 'object') {
+ throw new InvalidArgumentError('opts must be an object')
+ }
+ if (typeof opts.path === 'undefined') {
+ throw new InvalidArgumentError('opts.path must be defined')
+ }
+ if (typeof opts.method === 'undefined') {
+ opts.method = 'GET'
+ }
+ // See https://github.com/nodejs/undici/issues/1245
+ // As per RFC 3986, clients are not supposed to send URI
+ // fragments to servers when they retrieve a document,
+ if (typeof opts.path === 'string') {
+ if (opts.query) {
+ opts.path = buildURL(opts.path, opts.query)
+ } else {
+ // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811
+ const parsedURL = new URL(opts.path, 'data://')
+ opts.path = parsedURL.pathname + parsedURL.search
+ }
+ }
+ if (typeof opts.method === 'string') {
+ opts.method = opts.method.toUpperCase()
+ }
-function resume (client, sync) {
- if (client[kResuming] === 2) {
- return
+ this[kDispatchKey] = buildKey(opts)
+ this[kDispatches] = mockDispatches
+ this[kDefaultHeaders] = {}
+ this[kDefaultTrailers] = {}
+ this[kContentLength] = false
}
- client[kResuming] = 2
-
- _resume(client, sync)
- client[kResuming] = 0
+ createMockScopeDispatchData ({ statusCode, data, responseOptions }) {
+ const responseData = getResponseData(data)
+ const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
+ const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
+ const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
- if (client[kRunningIdx] > 256) {
- client[kQueue].splice(0, client[kRunningIdx])
- client[kPendingIdx] -= client[kRunningIdx]
- client[kRunningIdx] = 0
+ return { statusCode, data, headers, trailers }
}
-}
-function _resume (client, sync) {
- while (true) {
- if (client.destroyed) {
- assert(client[kPending] === 0)
- return
+ validateReplyParameters (replyParameters) {
+ if (typeof replyParameters.statusCode === 'undefined') {
+ throw new InvalidArgumentError('statusCode must be defined')
}
-
- if (client[kClosedResolve] && !client[kSize]) {
- client[kClosedResolve]()
- client[kClosedResolve] = null
- return
+ if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) {
+ throw new InvalidArgumentError('responseOptions must be an object')
}
+ }
- const socket = client[kSocket]
+ /**
+ * Mock an undici request with a defined reply.
+ */
+ reply (replyOptionsCallbackOrStatusCode) {
+ // Values of reply aren't available right now as they
+ // can only be available when the reply callback is invoked.
+ if (typeof replyOptionsCallbackOrStatusCode === 'function') {
+ // We'll first wrap the provided callback in another function,
+ // this function will properly resolve the data from the callback
+ // when invoked.
+ const wrappedDefaultsCallback = (opts) => {
+ // Our reply options callback contains the parameter for statusCode, data and options.
+ const resolvedData = replyOptionsCallbackOrStatusCode(opts)
- if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
- if (client[kSize] === 0) {
- if (!socket[kNoRef] && socket.unref) {
- socket.unref()
- socket[kNoRef] = true
+ // Check if it is in the right format
+ if (typeof resolvedData !== 'object' || resolvedData === null) {
+ throw new InvalidArgumentError('reply options callback must return an object')
}
- } else if (socket[kNoRef] && socket.ref) {
- socket.ref()
- socket[kNoRef] = false
- }
- if (client[kSize] === 0) {
- if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
- socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
- }
- } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
- if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
- const request = client[kQueue][client[kRunningIdx]]
- const headersTimeout = request.headersTimeout != null
- ? request.headersTimeout
- : client[kHeadersTimeout]
- socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
+ const replyParameters = { data: '', responseOptions: {}, ...resolvedData }
+ this.validateReplyParameters(replyParameters)
+ // Since the values can be obtained immediately we return them
+ // from this higher order function that will be resolved later.
+ return {
+ ...this.createMockScopeDispatchData(replyParameters)
}
}
- }
-
- if (client[kBusy]) {
- client[kNeedDrain] = 2
- } else if (client[kNeedDrain] === 2) {
- if (sync) {
- client[kNeedDrain] = 1
- process.nextTick(emitDrain, client)
- } else {
- emitDrain(client)
- }
- continue
- }
- if (client[kPending] === 0) {
- return
+ // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
+ return new MockScope(newMockDispatch)
}
- if (client[kRunning] >= (client[kPipelining] || 1)) {
- return
+ // We can have either one or three parameters, if we get here,
+ // we should have 1-3 parameters. So we spread the arguments of
+ // this function to obtain the parameters, since replyData will always
+ // just be the statusCode.
+ const replyParameters = {
+ statusCode: replyOptionsCallbackOrStatusCode,
+ data: arguments[1] === undefined ? '' : arguments[1],
+ responseOptions: arguments[2] === undefined ? {} : arguments[2]
}
+ this.validateReplyParameters(replyParameters)
- const request = client[kQueue][client[kPendingIdx]]
+ // Send in-already provided data like usual
+ const dispatchData = this.createMockScopeDispatchData(replyParameters)
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
+ return new MockScope(newMockDispatch)
+ }
- if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
- if (client[kRunning] > 0) {
- return
- }
+ /**
+ * Mock an undici request with a defined error.
+ */
+ replyWithError (error) {
+ if (typeof error === 'undefined') {
+ throw new InvalidArgumentError('error must be defined')
+ }
- client[kServerName] = request.servername
+ const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
+ return new MockScope(newMockDispatch)
+ }
- if (socket && socket.servername !== request.servername) {
- util.destroy(socket, new InformationalError('servername changed'))
- return
- }
+ /**
+ * Set default reply headers on the interceptor for subsequent replies
+ */
+ defaultReplyHeaders (headers) {
+ if (typeof headers === 'undefined') {
+ throw new InvalidArgumentError('headers must be defined')
}
- if (client[kConnecting]) {
- return
- }
+ this[kDefaultHeaders] = headers
+ return this
+ }
- if (!socket && !client[kHTTP2Session]) {
- connect(client)
- return
+ /**
+ * Set default reply trailers on the interceptor for subsequent replies
+ */
+ defaultReplyTrailers (trailers) {
+ if (typeof trailers === 'undefined') {
+ throw new InvalidArgumentError('trailers must be defined')
}
- if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
- return
- }
+ this[kDefaultTrailers] = trailers
+ return this
+ }
- if (client[kRunning] > 0 && !request.idempotent) {
- // Non-idempotent request cannot be retried.
- // Ensure that no other requests are inflight and
- // could cause failure.
- return
- }
+ /**
+ * Set reply content length header for replies on the interceptor
+ */
+ replyContentLength () {
+ this[kContentLength] = true
+ return this
+ }
+}
- if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
- // Don't dispatch an upgrade until all preceding requests have completed.
- // A misbehaving server might upgrade the connection before all pipelined
- // request has completed.
- return
- }
+module.exports.MockInterceptor = MockInterceptor
+module.exports.MockScope = MockScope
- if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
- (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
- // Request with stream or iterator body can error while other requests
- // are inflight and indirectly error those as well.
- // Ensure this doesn't happen by waiting for inflight
- // to complete before dispatching.
- // Request with stream or iterator body cannot be retried.
- // Ensure that no other requests are inflight and
- // could cause failure.
- return
- }
+/***/ }),
- if (!request.aborted && write(client, request)) {
- client[kPendingIdx]++
- } else {
- client[kQueue].splice(client[kPendingIdx], 1)
- }
- }
-}
+/***/ 4004:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
-function shouldSendContentLength (method) {
- return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
-}
-function write (client, request) {
- if (client[kHTTPConnVersion] === 'h2') {
- writeH2(client, client[kHTTP2Session], request)
- return
- }
- const { body, method, path, host, upgrade, headers, blocking, reset } = request
+const { promisify } = __nccwpck_require__(7975)
+const Pool = __nccwpck_require__(628)
+const { buildMockDispatch } = __nccwpck_require__(3397)
+const {
+ kDispatches,
+ kMockAgent,
+ kClose,
+ kOriginalClose,
+ kOrigin,
+ kOriginalDispatch,
+ kConnected
+} = __nccwpck_require__(1117)
+const { MockInterceptor } = __nccwpck_require__(1511)
+const Symbols = __nccwpck_require__(6443)
+const { InvalidArgumentError } = __nccwpck_require__(8707)
- // https://tools.ietf.org/html/rfc7231#section-4.3.1
- // https://tools.ietf.org/html/rfc7231#section-4.3.2
- // https://tools.ietf.org/html/rfc7231#section-4.3.5
+/**
+ * MockPool provides an API that extends the Pool to influence the mockDispatches.
+ */
+class MockPool extends Pool {
+ constructor (origin, opts) {
+ super(origin, opts)
- // Sending a payload body on a request that does not
- // expect it can cause undefined behavior on some
- // servers and corrupt connection state. Do not
- // re-use the connection for further requests.
+ if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
+ throw new InvalidArgumentError('Argument opts.agent must implement Agent')
+ }
- const expectsPayload = (
- method === 'PUT' ||
- method === 'POST' ||
- method === 'PATCH'
- )
+ this[kMockAgent] = opts.agent
+ this[kOrigin] = origin
+ this[kDispatches] = []
+ this[kConnected] = 1
+ this[kOriginalDispatch] = this.dispatch
+ this[kOriginalClose] = this.close.bind(this)
- if (body && typeof body.read === 'function') {
- // Try to read EOF in order to get length.
- body.read(0)
+ this.dispatch = buildMockDispatch.call(this)
+ this.close = this[kClose]
}
- const bodyLength = util.bodyLength(body)
+ get [Symbols.kConnected] () {
+ return this[kConnected]
+ }
- let contentLength = bodyLength
+ /**
+ * Sets up the base interceptor for mocking replies from undici.
+ */
+ intercept (opts) {
+ return new MockInterceptor(opts, this[kDispatches])
+ }
- if (contentLength === null) {
- contentLength = request.contentLength
+ async [kClose] () {
+ await promisify(this[kOriginalClose])()
+ this[kConnected] = 0
+ this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
}
+}
- if (contentLength === 0 && !expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD NOT send a Content-Length header field when
- // the request message does not contain a payload body and the method
- // semantics do not anticipate such a body.
+module.exports = MockPool
- contentLength = null
- }
- // https://github.com/nodejs/undici/issues/2046
- // A user agent may send a Content-Length header with 0 value, this should be allowed.
- if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
- if (client[kStrictContentLength]) {
- errorRequest(client, request, new RequestContentLengthMismatchError())
- return false
- }
+/***/ }),
+
+/***/ 1117:
+/***/ ((module) => {
+
+
+
+module.exports = {
+ kAgent: Symbol('agent'),
+ kOptions: Symbol('options'),
+ kFactory: Symbol('factory'),
+ kDispatches: Symbol('dispatches'),
+ kDispatchKey: Symbol('dispatch key'),
+ kDefaultHeaders: Symbol('default headers'),
+ kDefaultTrailers: Symbol('default trailers'),
+ kContentLength: Symbol('content length'),
+ kMockAgent: Symbol('mock agent'),
+ kMockAgentSet: Symbol('mock agent set'),
+ kMockAgentGet: Symbol('mock agent get'),
+ kMockDispatch: Symbol('mock dispatch'),
+ kClose: Symbol('close'),
+ kOriginalClose: Symbol('original agent close'),
+ kOrigin: Symbol('origin'),
+ kIsMockActive: Symbol('is mock active'),
+ kNetConnect: Symbol('net connect'),
+ kGetNetConnect: Symbol('get net connect'),
+ kConnected: Symbol('connected')
+}
- process.emitWarning(new RequestContentLengthMismatchError())
- }
- const socket = client[kSocket]
+/***/ }),
- try {
- request.onConnect((err) => {
- if (request.aborted || request.completed) {
- return
- }
+/***/ 3397:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- errorRequest(client, request, err || new RequestAbortedError())
- util.destroy(socket, new InformationalError('aborted'))
- })
- } catch (err) {
- errorRequest(client, request, err)
- }
- if (request.aborted) {
- return false
+const { MockNotMatchedError } = __nccwpck_require__(2429)
+const {
+ kDispatches,
+ kMockAgent,
+ kOriginalDispatch,
+ kOrigin,
+ kGetNetConnect
+} = __nccwpck_require__(1117)
+const { buildURL } = __nccwpck_require__(3440)
+const { STATUS_CODES } = __nccwpck_require__(7067)
+const {
+ types: {
+ isPromise
}
+} = __nccwpck_require__(7975)
- if (method === 'HEAD') {
- // https://github.com/mcollina/undici/issues/258
- // Close after a HEAD request to interop with misbehaving servers
- // that may send a body in the response.
-
- socket[kReset] = true
+function matchValue (match, value) {
+ if (typeof match === 'string') {
+ return match === value
+ }
+ if (match instanceof RegExp) {
+ return match.test(value)
}
+ if (typeof match === 'function') {
+ return match(value) === true
+ }
+ return false
+}
- if (upgrade || method === 'CONNECT') {
- // On CONNECT or upgrade, block pipeline from dispatching further
- // requests on this connection.
+function lowerCaseEntries (headers) {
+ return Object.fromEntries(
+ Object.entries(headers).map(([headerName, headerValue]) => {
+ return [headerName.toLocaleLowerCase(), headerValue]
+ })
+ )
+}
- socket[kReset] = true
- }
+/**
+ * @param {import('../../index').Headers|string[]|Record} headers
+ * @param {string} key
+ */
+function getHeaderByName (headers, key) {
+ if (Array.isArray(headers)) {
+ for (let i = 0; i < headers.length; i += 2) {
+ if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
+ return headers[i + 1]
+ }
+ }
- if (reset != null) {
- socket[kReset] = reset
+ return undefined
+ } else if (typeof headers.get === 'function') {
+ return headers.get(key)
+ } else {
+ return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
}
+}
- if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
- socket[kReset] = true
+/** @param {string[]} headers */
+function buildHeadersFromArray (headers) { // fetch HeadersList
+ const clone = headers.slice()
+ const entries = []
+ for (let index = 0; index < clone.length; index += 2) {
+ entries.push([clone[index], clone[index + 1]])
}
+ return Object.fromEntries(entries)
+}
- if (blocking) {
- socket[kBlocking] = true
+function matchHeaders (mockDispatch, headers) {
+ if (typeof mockDispatch.headers === 'function') {
+ if (Array.isArray(headers)) { // fetch HeadersList
+ headers = buildHeadersFromArray(headers)
+ }
+ return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
+ }
+ if (typeof mockDispatch.headers === 'undefined') {
+ return true
+ }
+ if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
+ return false
}
- let header = `${method} ${path} HTTP/1.1\r\n`
+ for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
+ const headerValue = getHeaderByName(headers, matchHeaderName)
- if (typeof host === 'string') {
- header += `host: ${host}\r\n`
- } else {
- header += client[kHostHeader]
+ if (!matchValue(matchHeaderValue, headerValue)) {
+ return false
+ }
}
+ return true
+}
- if (upgrade) {
- header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
- } else if (client[kPipelining] && !socket[kReset]) {
- header += 'connection: keep-alive\r\n'
- } else {
- header += 'connection: close\r\n'
+function safeUrl (path) {
+ if (typeof path !== 'string') {
+ return path
}
- if (headers) {
- header += headers
- }
+ const pathSegments = path.split('?')
- if (channels.sendHeaders.hasSubscribers) {
- channels.sendHeaders.publish({ request, headers: header, socket })
+ if (pathSegments.length !== 2) {
+ return path
}
- /* istanbul ignore else: assertion */
- if (!body || bodyLength === 0) {
- if (contentLength === 0) {
- socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
- } else {
- assert(contentLength === null, 'no body must not have content length')
- socket.write(`${header}\r\n`, 'latin1')
- }
- request.onRequestSent()
- } else if (util.isBuffer(body)) {
- assert(contentLength === body.byteLength, 'buffer body must have content length')
+ const qp = new URLSearchParams(pathSegments.pop())
+ qp.sort()
+ return [...pathSegments, qp.toString()].join('?')
+}
- socket.cork()
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- socket.write(body)
- socket.uncork()
- request.onBodySent(body)
- request.onRequestSent()
- if (!expectsPayload) {
- socket[kReset] = true
- }
- } else if (util.isBlobLike(body)) {
- if (typeof body.stream === 'function') {
- writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
- } else {
- writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
- }
- } else if (util.isStream(body)) {
- writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
- } else if (util.isIterable(body)) {
- writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
+function matchKey (mockDispatch, { path, method, body, headers }) {
+ const pathMatch = matchValue(mockDispatch.path, path)
+ const methodMatch = matchValue(mockDispatch.method, method)
+ const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
+ const headersMatch = matchHeaders(mockDispatch, headers)
+ return pathMatch && methodMatch && bodyMatch && headersMatch
+}
+
+function getResponseData (data) {
+ if (Buffer.isBuffer(data)) {
+ return data
+ } else if (data instanceof Uint8Array) {
+ return data
+ } else if (data instanceof ArrayBuffer) {
+ return data
+ } else if (typeof data === 'object') {
+ return JSON.stringify(data)
} else {
- assert(false)
+ return data.toString()
}
-
- return true
}
-function writeH2 (client, session, request) {
- const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
-
- let headers
- if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
- else headers = reqHeaders
+function getMockDispatch (mockDispatches, key) {
+ const basePath = key.query ? buildURL(key.path, key.query) : key.path
+ const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
- if (upgrade) {
- errorRequest(client, request, new Error('Upgrade not supported for H2'))
- return false
+ // Match path
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
}
- try {
- // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
- request.onConnect((err) => {
- if (request.aborted || request.completed) {
- return
- }
+ // Match method
+ matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`)
+ }
- errorRequest(client, request, err || new RequestAbortedError())
- })
- } catch (err) {
- errorRequest(client, request, err)
+ // Match body
+ matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
+ if (matchedMockDispatches.length === 0) {
+ throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`)
}
- if (request.aborted) {
- return false
+ // Match headers
+ matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
+ if (matchedMockDispatches.length === 0) {
+ const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers
+ throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`)
}
- /** @type {import('node:http2').ClientHttp2Stream} */
- let stream
- const h2State = client[kHTTP2SessionState]
+ return matchedMockDispatches[0]
+}
- headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
- headers[HTTP2_HEADER_METHOD] = method
+function addMockDispatch (mockDispatches, key, data) {
+ const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
+ const replyData = typeof data === 'function' ? { callback: data } : { ...data }
+ const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
+ mockDispatches.push(newMockDispatch)
+ return newMockDispatch
+}
- if (method === 'CONNECT') {
- session.ref()
- // we are already connected, streams are pending, first request
- // will create a new stream. We trigger a request to create the stream and wait until
- // `ready` event is triggered
- // We disabled endStream to allow the user to write to the stream
- stream = session.request(headers, { endStream: false, signal })
+function deleteMockDispatch (mockDispatches, key) {
+ const index = mockDispatches.findIndex(dispatch => {
+ if (!dispatch.consumed) {
+ return false
+ }
+ return matchKey(dispatch, key)
+ })
+ if (index !== -1) {
+ mockDispatches.splice(index, 1)
+ }
+}
- if (stream.id && !stream.pending) {
- request.onUpgrade(null, null, stream)
- ++h2State.openStreams
+function buildKey (opts) {
+ const { path, method, body, headers, query } = opts
+ return {
+ path,
+ method,
+ body,
+ headers,
+ query
+ }
+}
+
+function generateKeyValues (data) {
+ const keys = Object.keys(data)
+ const result = []
+ for (let i = 0; i < keys.length; ++i) {
+ const key = keys[i]
+ const value = data[key]
+ const name = Buffer.from(`${key}`)
+ if (Array.isArray(value)) {
+ for (let j = 0; j < value.length; ++j) {
+ result.push(name, Buffer.from(`${value[j]}`))
+ }
} else {
- stream.once('ready', () => {
- request.onUpgrade(null, null, stream)
- ++h2State.openStreams
- })
+ result.push(name, Buffer.from(`${value}`))
}
+ }
+ return result
+}
- stream.once('close', () => {
- h2State.openStreams -= 1
- // TODO(HTTP/2): unref only if current streams count is 0
- if (h2State.openStreams === 0) session.unref()
- })
+/**
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
+ * @param {number} statusCode
+ */
+function getStatusText (statusCode) {
+ return STATUS_CODES[statusCode] || 'unknown'
+}
- return true
+async function getResponse (body) {
+ const buffers = []
+ for await (const data of body) {
+ buffers.push(data)
}
+ return Buffer.concat(buffers).toString('utf8')
+}
- // https://tools.ietf.org/html/rfc7540#section-8.3
- // :path and :scheme headers must be omited when sending CONNECT
+/**
+ * Mock dispatch function used to simulate undici dispatches
+ */
+function mockDispatch (opts, handler) {
+ // Get mock dispatch from built key
+ const key = buildKey(opts)
+ const mockDispatch = getMockDispatch(this[kDispatches], key)
- headers[HTTP2_HEADER_PATH] = path
- headers[HTTP2_HEADER_SCHEME] = 'https'
+ mockDispatch.timesInvoked++
- // https://tools.ietf.org/html/rfc7231#section-4.3.1
- // https://tools.ietf.org/html/rfc7231#section-4.3.2
- // https://tools.ietf.org/html/rfc7231#section-4.3.5
+ // Here's where we resolve a callback if a callback is present for the dispatch data.
+ if (mockDispatch.data.callback) {
+ mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
+ }
- // Sending a payload body on a request that does not
- // expect it can cause undefined behavior on some
- // servers and corrupt connection state. Do not
- // re-use the connection for further requests.
+ // Parse mockDispatch data
+ const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
+ const { timesInvoked, times } = mockDispatch
- const expectsPayload = (
- method === 'PUT' ||
- method === 'POST' ||
- method === 'PATCH'
- )
+ // If it's used up and not persistent, mark as consumed
+ mockDispatch.consumed = !persist && timesInvoked >= times
+ mockDispatch.pending = timesInvoked < times
- if (body && typeof body.read === 'function') {
- // Try to read EOF in order to get length.
- body.read(0)
+ // If specified, trigger dispatch error
+ if (error !== null) {
+ deleteMockDispatch(this[kDispatches], key)
+ handler.onError(error)
+ return true
}
- let contentLength = util.bodyLength(body)
-
- if (contentLength == null) {
- contentLength = request.contentLength
+ // Handle the request with a delay if necessary
+ if (typeof delay === 'number' && delay > 0) {
+ setTimeout(() => {
+ handleReply(this[kDispatches])
+ }, delay)
+ } else {
+ handleReply(this[kDispatches])
}
- if (contentLength === 0 || !expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD NOT send a Content-Length header field when
- // the request message does not contain a payload body and the method
- // semantics do not anticipate such a body.
-
- contentLength = null
- }
+ function handleReply (mockDispatches, _data = data) {
+ // fetch's HeadersList is a 1D string array
+ const optsHeaders = Array.isArray(opts.headers)
+ ? buildHeadersFromArray(opts.headers)
+ : opts.headers
+ const body = typeof _data === 'function'
+ ? _data({ ...opts, headers: optsHeaders })
+ : _data
- // https://github.com/nodejs/undici/issues/2046
- // A user agent may send a Content-Length header with 0 value, this should be allowed.
- if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
- if (client[kStrictContentLength]) {
- errorRequest(client, request, new RequestContentLengthMismatchError())
- return false
+ // util.types.isPromise is likely needed for jest.
+ if (isPromise(body)) {
+ // If handleReply is asynchronous, throwing an error
+ // in the callback will reject the promise, rather than
+ // synchronously throw the error, which breaks some tests.
+ // Rather, we wait for the callback to resolve if it is a
+ // promise, and then re-run handleReply with the new body.
+ body.then((newData) => handleReply(mockDispatches, newData))
+ return
}
- process.emitWarning(new RequestContentLengthMismatchError())
- }
+ const responseData = getResponseData(body)
+ const responseHeaders = generateKeyValues(headers)
+ const responseTrailers = generateKeyValues(trailers)
- if (contentLength != null) {
- assert(body, 'no body must not have content length')
- headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
+ handler.onConnect?.(err => handler.onError(err), null)
+ handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode))
+ handler.onData?.(Buffer.from(responseData))
+ handler.onComplete?.(responseTrailers)
+ deleteMockDispatch(mockDispatches, key)
}
- session.ref()
-
- const shouldEndStream = method === 'GET' || method === 'HEAD'
- if (expectContinue) {
- headers[HTTP2_HEADER_EXPECT] = '100-continue'
- stream = session.request(headers, { endStream: shouldEndStream, signal })
-
- stream.once('continue', writeBodyH2)
- } else {
- stream = session.request(headers, {
- endStream: shouldEndStream,
- signal
- })
- writeBodyH2()
- }
+ function resume () {}
- // Increment counter as we have new several streams open
- ++h2State.openStreams
+ return true
+}
- stream.once('response', headers => {
- const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
+function buildMockDispatch () {
+ const agent = this[kMockAgent]
+ const origin = this[kOrigin]
+ const originalDispatch = this[kOriginalDispatch]
- if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
- stream.pause()
+ return function dispatch (opts, handler) {
+ if (agent.isMockActive) {
+ try {
+ mockDispatch.call(this, opts, handler)
+ } catch (error) {
+ if (error instanceof MockNotMatchedError) {
+ const netConnect = agent[kGetNetConnect]()
+ if (netConnect === false) {
+ throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
+ }
+ if (checkNetConnect(netConnect, origin)) {
+ originalDispatch.call(this, opts, handler)
+ } else {
+ throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
+ }
+ } else {
+ throw error
+ }
+ }
+ } else {
+ originalDispatch.call(this, opts, handler)
}
- })
+ }
+}
- stream.once('end', () => {
- request.onComplete([])
- })
+function checkNetConnect (netConnect, origin) {
+ const url = new URL(origin)
+ if (netConnect === true) {
+ return true
+ } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
+ return true
+ }
+ return false
+}
- stream.on('data', (chunk) => {
- if (request.onData(chunk) === false) {
- stream.pause()
- }
- })
+function buildMockOptions (opts) {
+ if (opts) {
+ const { agent, ...mockOptions } = opts
+ return mockOptions
+ }
+}
- stream.once('close', () => {
- h2State.openStreams -= 1
- // TODO(HTTP/2): unref only if current streams count is 0
- if (h2State.openStreams === 0) {
- session.unref()
- }
- })
+module.exports = {
+ getResponseData,
+ getMockDispatch,
+ addMockDispatch,
+ deleteMockDispatch,
+ buildKey,
+ generateKeyValues,
+ matchValue,
+ getResponse,
+ getStatusText,
+ mockDispatch,
+ buildMockDispatch,
+ checkNetConnect,
+ buildMockOptions,
+ getHeaderByName,
+ buildHeadersFromArray
+}
- stream.once('error', function (err) {
- if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
- h2State.streams -= 1
- util.destroy(stream, err)
- }
- })
- stream.once('frameError', (type, code) => {
- const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
- errorRequest(client, request, err)
+/***/ }),
- if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
- h2State.streams -= 1
- util.destroy(stream, err)
- }
- })
+/***/ 6142:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // stream.on('aborted', () => {
- // // TODO(HTTP/2): Support aborted
- // })
- // stream.on('timeout', () => {
- // // TODO(HTTP/2): Support timeout
- // })
- // stream.on('push', headers => {
- // // TODO(HTTP/2): Suppor push
- // })
+const { Transform } = __nccwpck_require__(7075)
+const { Console } = __nccwpck_require__(7540)
- // stream.on('trailers', headers => {
- // // TODO(HTTP/2): Support trailers
- // })
+const PERSISTENT = process.versions.icu ? '✅' : 'Y '
+const NOT_PERSISTENT = process.versions.icu ? '❌' : 'N '
- return true
+/**
+ * Gets the output of `console.table(…)` as a string.
+ */
+module.exports = class PendingInterceptorsFormatter {
+ constructor ({ disableColors } = {}) {
+ this.transform = new Transform({
+ transform (chunk, _enc, cb) {
+ cb(null, chunk)
+ }
+ })
- function writeBodyH2 () {
- /* istanbul ignore else: assertion */
- if (!body) {
- request.onRequestSent()
- } else if (util.isBuffer(body)) {
- assert(contentLength === body.byteLength, 'buffer body must have content length')
- stream.cork()
- stream.write(body)
- stream.uncork()
- stream.end()
- request.onBodySent(body)
- request.onRequestSent()
- } else if (util.isBlobLike(body)) {
- if (typeof body.stream === 'function') {
- writeIterable({
- client,
- request,
- contentLength,
- h2stream: stream,
- expectsPayload,
- body: body.stream(),
- socket: client[kSocket],
- header: ''
- })
- } else {
- writeBlob({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- h2stream: stream,
- header: '',
- socket: client[kSocket]
- })
+ this.logger = new Console({
+ stdout: this.transform,
+ inspectOptions: {
+ colors: !disableColors && !process.env.CI
}
- } else if (util.isStream(body)) {
- writeStream({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- socket: client[kSocket],
- h2stream: stream,
- header: ''
- })
- } else if (util.isIterable(body)) {
- writeIterable({
- body,
- client,
- request,
- contentLength,
- expectsPayload,
- header: '',
- h2stream: stream,
- socket: client[kSocket]
- })
- } else {
- assert(false)
- }
+ })
+ }
+
+ format (pendingInterceptors) {
+ const withPrettyHeaders = pendingInterceptors.map(
+ ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
+ Method: method,
+ Origin: origin,
+ Path: path,
+ 'Status code': statusCode,
+ Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
+ Invocations: timesInvoked,
+ Remaining: persist ? Infinity : times - timesInvoked
+ }))
+
+ this.logger.table(withPrettyHeaders)
+ return this.transform.read().toString()
}
}
-function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
-
- if (client[kHTTPConnVersion] === 'h2') {
- // For HTTP/2, is enough to pipe the stream
- const pipe = pipeline(
- body,
- h2stream,
- (err) => {
- if (err) {
- util.destroy(body, err)
- util.destroy(h2stream, err)
- } else {
- request.onRequestSent()
- }
- }
- )
- pipe.on('data', onPipeData)
- pipe.once('end', () => {
- pipe.removeListener('data', onPipeData)
- util.destroy(pipe)
- })
+/***/ }),
- function onPipeData (chunk) {
- request.onBodySent(chunk)
- }
+/***/ 1529:
+/***/ ((module) => {
- return
- }
- let finished = false
- const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
+const singulars = {
+ pronoun: 'it',
+ is: 'is',
+ was: 'was',
+ this: 'this'
+}
- const onData = function (chunk) {
- if (finished) {
- return
- }
+const plurals = {
+ pronoun: 'they',
+ is: 'are',
+ was: 'were',
+ this: 'these'
+}
- try {
- if (!writer.write(chunk) && this.pause) {
- this.pause()
- }
- } catch (err) {
- util.destroy(this, err)
- }
+module.exports = class Pluralizer {
+ constructor (singular, plural) {
+ this.singular = singular
+ this.plural = plural
}
- const onDrain = function () {
- if (finished) {
- return
- }
- if (body.resume) {
- body.resume()
- }
- }
- const onAbort = function () {
- if (finished) {
- return
- }
- const err = new RequestAbortedError()
- queueMicrotask(() => onFinished(err))
+ pluralize (count) {
+ const one = count === 1
+ const keys = one ? singulars : plurals
+ const noun = one ? this.singular : this.plural
+ return { ...keys, count, noun }
}
- const onFinished = function (err) {
- if (finished) {
- return
- }
+}
- finished = true
- assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
+/***/ }),
- socket
- .off('drain', onDrain)
- .off('error', onFinished)
+/***/ 6603:
+/***/ ((module) => {
- body
- .removeListener('data', onData)
- .removeListener('end', onFinished)
- .removeListener('error', onFinished)
- .removeListener('close', onAbort)
- if (!err) {
- try {
- writer.end()
- } catch (er) {
- err = er
- }
- }
- writer.destroy(err)
+/**
+ * This module offers an optimized timer implementation designed for scenarios
+ * where high precision is not critical.
+ *
+ * The timer achieves faster performance by using a low-resolution approach,
+ * with an accuracy target of within 500ms. This makes it particularly useful
+ * for timers with delays of 1 second or more, where exact timing is less
+ * crucial.
+ *
+ * It's important to note that Node.js timers are inherently imprecise, as
+ * delays can occur due to the event loop being blocked by other operations.
+ * Consequently, timers may trigger later than their scheduled time.
+ */
- if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
- util.destroy(body, err)
- } else {
- util.destroy(body)
- }
- }
+/**
+ * The fastNow variable contains the internal fast timer clock value.
+ *
+ * @type {number}
+ */
+let fastNow = 0
- body
- .on('data', onData)
- .on('end', onFinished)
- .on('error', onFinished)
- .on('close', onAbort)
+/**
+ * RESOLUTION_MS represents the target resolution time in milliseconds.
+ *
+ * @type {number}
+ * @default 1000
+ */
+const RESOLUTION_MS = 1e3
- if (body.resume) {
- body.resume()
- }
+/**
+ * TICK_MS defines the desired interval in milliseconds between each tick.
+ * The target value is set to half the resolution time, minus 1 ms, to account
+ * for potential event loop overhead.
+ *
+ * @type {number}
+ * @default 499
+ */
+const TICK_MS = (RESOLUTION_MS >> 1) - 1
- socket
- .on('drain', onDrain)
- .on('error', onFinished)
-}
+/**
+ * fastNowTimeout is a Node.js timer used to manage and process
+ * the FastTimers stored in the `fastTimers` array.
+ *
+ * @type {NodeJS.Timeout}
+ */
+let fastNowTimeout
-async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength === body.size, 'blob body must have content length')
+/**
+ * The kFastTimer symbol is used to identify FastTimer instances.
+ *
+ * @type {Symbol}
+ */
+const kFastTimer = Symbol('kFastTimer')
- const isH2 = client[kHTTPConnVersion] === 'h2'
- try {
- if (contentLength != null && contentLength !== body.size) {
- throw new RequestContentLengthMismatchError()
- }
+/**
+ * The fastTimers array contains all active FastTimers.
+ *
+ * @type {FastTimer[]}
+ */
+const fastTimers = []
- const buffer = Buffer.from(await body.arrayBuffer())
+/**
+ * These constants represent the various states of a FastTimer.
+ */
- if (isH2) {
- h2stream.cork()
- h2stream.write(buffer)
- h2stream.uncork()
- } else {
- socket.cork()
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- socket.write(buffer)
- socket.uncork()
+/**
+ * The `NOT_IN_LIST` constant indicates that the FastTimer is not included
+ * in the `fastTimers` array. Timers with this status will not be processed
+ * during the next tick by the `onTick` function.
+ *
+ * A FastTimer can be re-added to the `fastTimers` array by invoking the
+ * `refresh` method on the FastTimer instance.
+ *
+ * @type {-2}
+ */
+const NOT_IN_LIST = -2
+
+/**
+ * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled
+ * for removal from the `fastTimers` array. A FastTimer in this state will
+ * be removed in the next tick by the `onTick` function and will no longer
+ * be processed.
+ *
+ * This status is also set when the `clear` method is called on the FastTimer instance.
+ *
+ * @type {-1}
+ */
+const TO_BE_CLEARED = -1
+
+/**
+ * The `PENDING` constant signifies that the FastTimer is awaiting processing
+ * in the next tick by the `onTick` function. Timers with this status will have
+ * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick.
+ *
+ * @type {0}
+ */
+const PENDING = 0
+
+/**
+ * The `ACTIVE` constant indicates that the FastTimer is active and waiting
+ * for its timer to expire. During the next tick, the `onTick` function will
+ * check if the timer has expired, and if so, it will execute the associated callback.
+ *
+ * @type {1}
+ */
+const ACTIVE = 1
+
+/**
+ * The onTick function processes the fastTimers array.
+ *
+ * @returns {void}
+ */
+function onTick () {
+ /**
+ * Increment the fastNow value by the TICK_MS value, despite the actual time
+ * that has passed since the last tick. This approach ensures independence
+ * from the system clock and delays caused by a blocked event loop.
+ *
+ * @type {number}
+ */
+ fastNow += TICK_MS
+
+ /**
+ * The `idx` variable is used to iterate over the `fastTimers` array.
+ * Expired timers are removed by replacing them with the last element in the array.
+ * Consequently, `idx` is only incremented when the current element is not removed.
+ *
+ * @type {number}
+ */
+ let idx = 0
+
+ /**
+ * The len variable will contain the length of the fastTimers array
+ * and will be decremented when a FastTimer should be removed from the
+ * fastTimers array.
+ *
+ * @type {number}
+ */
+ let len = fastTimers.length
+
+ while (idx < len) {
+ /**
+ * @type {FastTimer}
+ */
+ const timer = fastTimers[idx]
+
+ // If the timer is in the ACTIVE state and the timer has expired, it will
+ // be processed in the next tick.
+ if (timer._state === PENDING) {
+ // Set the _idleStart value to the fastNow value minus the TICK_MS value
+ // to account for the time the timer was in the PENDING state.
+ timer._idleStart = fastNow - TICK_MS
+ timer._state = ACTIVE
+ } else if (
+ timer._state === ACTIVE &&
+ fastNow >= timer._idleStart + timer._idleTimeout
+ ) {
+ timer._state = TO_BE_CLEARED
+ timer._idleStart = -1
+ timer._onTimeout(timer._timerArg)
}
- request.onBodySent(buffer)
- request.onRequestSent()
+ if (timer._state === TO_BE_CLEARED) {
+ timer._state = NOT_IN_LIST
- if (!expectsPayload) {
- socket[kReset] = true
+ // Move the last element to the current index and decrement len if it is
+ // not the only element in the array.
+ if (--len !== 0) {
+ fastTimers[idx] = fastTimers[len]
+ }
+ } else {
+ ++idx
}
+ }
- resume(client)
- } catch (err) {
- util.destroy(isH2 ? h2stream : socket, err)
+ // Set the length of the fastTimers array to the new length and thus
+ // removing the excess FastTimers elements from the array.
+ fastTimers.length = len
+
+ // If there are still active FastTimers in the array, refresh the Timer.
+ // If there are no active FastTimers, the timer will be refreshed again
+ // when a new FastTimer is instantiated.
+ if (fastTimers.length !== 0) {
+ refreshTimeout()
}
}
-async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
- assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
+function refreshTimeout () {
+ // If the fastNowTimeout is already set, refresh it.
+ if (fastNowTimeout) {
+ fastNowTimeout.refresh()
+ // fastNowTimeout is not instantiated yet, create a new Timer.
+ } else {
+ clearTimeout(fastNowTimeout)
+ fastNowTimeout = setTimeout(onTick, TICK_MS)
- let callback = null
- function onDrain () {
- if (callback) {
- const cb = callback
- callback = null
- cb()
+ // If the Timer has an unref method, call it to allow the process to exit if
+ // there are no other active handles.
+ if (fastNowTimeout.unref) {
+ fastNowTimeout.unref()
}
}
+}
- const waitForDrain = () => new Promise((resolve, reject) => {
- assert(callback === null)
+/**
+ * The `FastTimer` class is a data structure designed to store and manage
+ * timer information.
+ */
+class FastTimer {
+ [kFastTimer] = true
- if (socket[kError]) {
- reject(socket[kError])
- } else {
- callback = resolve
- }
- })
+ /**
+ * The state of the timer, which can be one of the following:
+ * - NOT_IN_LIST (-2)
+ * - TO_BE_CLEARED (-1)
+ * - PENDING (0)
+ * - ACTIVE (1)
+ *
+ * @type {-2|-1|0|1}
+ * @private
+ */
+ _state = NOT_IN_LIST
- if (client[kHTTPConnVersion] === 'h2') {
- h2stream
- .on('close', onDrain)
- .on('drain', onDrain)
+ /**
+ * The number of milliseconds to wait before calling the callback.
+ *
+ * @type {number}
+ * @private
+ */
+ _idleTimeout = -1
- try {
- // It's up to the user to somehow abort the async iterable.
- for await (const chunk of body) {
- if (socket[kError]) {
- throw socket[kError]
- }
+ /**
+ * The time in milliseconds when the timer was started. This value is used to
+ * calculate when the timer should expire.
+ *
+ * @type {number}
+ * @default -1
+ * @private
+ */
+ _idleStart = -1
- const res = h2stream.write(chunk)
- request.onBodySent(chunk)
- if (!res) {
- await waitForDrain()
- }
- }
- } catch (err) {
- h2stream.destroy(err)
- } finally {
- request.onRequestSent()
- h2stream.end()
- h2stream
- .off('close', onDrain)
- .off('drain', onDrain)
- }
+ /**
+ * The function to be executed when the timer expires.
+ * @type {Function}
+ * @private
+ */
+ _onTimeout
- return
- }
+ /**
+ * The argument to be passed to the callback when the timer expires.
+ *
+ * @type {*}
+ * @private
+ */
+ _timerArg
- socket
- .on('close', onDrain)
- .on('drain', onDrain)
+ /**
+ * @constructor
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should wait
+ * before the specified function or code is executed.
+ * @param {*} arg
+ */
+ constructor (callback, delay, arg) {
+ this._onTimeout = callback
+ this._idleTimeout = delay
+ this._timerArg = arg
- const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
- try {
- // It's up to the user to somehow abort the async iterable.
- for await (const chunk of body) {
- if (socket[kError]) {
- throw socket[kError]
- }
+ this.refresh()
+ }
- if (!writer.write(chunk)) {
- await waitForDrain()
- }
+ /**
+ * Sets the timer's start time to the current time, and reschedules the timer
+ * to call its callback at the previously specified duration adjusted to the
+ * current time.
+ * Using this on a timer that has already called its callback will reactivate
+ * the timer.
+ *
+ * @returns {void}
+ */
+ refresh () {
+ // In the special case that the timer is not in the list of active timers,
+ // add it back to the array to be processed in the next tick by the onTick
+ // function.
+ if (this._state === NOT_IN_LIST) {
+ fastTimers.push(this)
}
- writer.end()
- } catch (err) {
- writer.destroy(err)
- } finally {
- socket
- .off('close', onDrain)
- .off('drain', onDrain)
+ // If the timer is the only active timer, refresh the fastNowTimeout for
+ // better resolution.
+ if (!fastNowTimeout || fastTimers.length === 1) {
+ refreshTimeout()
+ }
+
+ // Setting the state to PENDING will cause the timer to be reset in the
+ // next tick by the onTick function.
+ this._state = PENDING
}
-}
-class AsyncWriter {
- constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
- this.socket = socket
- this.request = request
- this.contentLength = contentLength
- this.client = client
- this.bytesWritten = 0
- this.expectsPayload = expectsPayload
- this.header = header
+ /**
+ * The `clear` method cancels the timer, preventing it from executing.
+ *
+ * @returns {void}
+ * @private
+ */
+ clear () {
+ // Set the state to TO_BE_CLEARED to mark the timer for removal in the next
+ // tick by the onTick function.
+ this._state = TO_BE_CLEARED
- socket[kWriting] = true
+ // Reset the _idleStart value to -1 to indicate that the timer is no longer
+ // active.
+ this._idleStart = -1
}
+}
- write (chunk) {
- const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
-
- if (socket[kError]) {
- throw socket[kError]
+/**
+ * This module exports a setTimeout and clearTimeout function that can be
+ * used as a drop-in replacement for the native functions.
+ */
+module.exports = {
+ /**
+ * The setTimeout() method sets a timer which executes a function once the
+ * timer expires.
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should
+ * wait before the specified function or code is executed.
+ * @param {*} [arg] An optional argument to be passed to the callback function
+ * when the timer expires.
+ * @returns {NodeJS.Timeout|FastTimer}
+ */
+ setTimeout (callback, delay, arg) {
+ // If the delay is less than or equal to the RESOLUTION_MS value return a
+ // native Node.js Timer instance.
+ return delay <= RESOLUTION_MS
+ ? setTimeout(callback, delay, arg)
+ : new FastTimer(callback, delay, arg)
+ },
+ /**
+ * The clearTimeout method cancels an instantiated Timer previously created
+ * by calling setTimeout.
+ *
+ * @param {NodeJS.Timeout|FastTimer} timeout
+ */
+ clearTimeout (timeout) {
+ // If the timeout is a FastTimer, call its own clear method.
+ if (timeout[kFastTimer]) {
+ /**
+ * @type {FastTimer}
+ */
+ timeout.clear()
+ // Otherwise it is an instance of a native NodeJS.Timeout, so call the
+ // Node.js native clearTimeout function.
+ } else {
+ clearTimeout(timeout)
}
+ },
+ /**
+ * The setFastTimeout() method sets a fastTimer which executes a function once
+ * the timer expires.
+ * @param {Function} callback A function to be executed after the timer
+ * expires.
+ * @param {number} delay The time, in milliseconds that the timer should
+ * wait before the specified function or code is executed.
+ * @param {*} [arg] An optional argument to be passed to the callback function
+ * when the timer expires.
+ * @returns {FastTimer}
+ */
+ setFastTimeout (callback, delay, arg) {
+ return new FastTimer(callback, delay, arg)
+ },
+ /**
+ * The clearTimeout method cancels an instantiated FastTimer previously
+ * created by calling setFastTimeout.
+ *
+ * @param {FastTimer} timeout
+ */
+ clearFastTimeout (timeout) {
+ timeout.clear()
+ },
+ /**
+ * The now method returns the value of the internal fast timer clock.
+ *
+ * @returns {number}
+ */
+ now () {
+ return fastNow
+ },
+ /**
+ * Trigger the onTick function to process the fastTimers array.
+ * Exported for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ * @param {number} [delay=0] The delay in milliseconds to add to the now value.
+ */
+ tick (delay = 0) {
+ fastNow += delay - RESOLUTION_MS + 1
+ onTick()
+ onTick()
+ },
+ /**
+ * Reset FastTimers.
+ * Exported for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ */
+ reset () {
+ fastNow = 0
+ fastTimers.length = 0
+ clearTimeout(fastNowTimeout)
+ fastNowTimeout = null
+ },
+ /**
+ * Exporting for testing purposes only.
+ * Marking as deprecated to discourage any use outside of testing.
+ * @deprecated
+ */
+ kFastTimer
+}
- if (socket.destroyed) {
- return false
- }
- const len = Buffer.byteLength(chunk)
- if (!len) {
- return true
- }
+/***/ }),
- // We should defer writing chunks.
- if (contentLength !== null && bytesWritten + len > contentLength) {
- if (client[kStrictContentLength]) {
- throw new RequestContentLengthMismatchError()
- }
+/***/ 9634:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- process.emitWarning(new RequestContentLengthMismatchError())
- }
- socket.cork()
- if (bytesWritten === 0) {
- if (!expectsPayload) {
- socket[kReset] = true
- }
+const { kConstruct } = __nccwpck_require__(109)
+const { urlEquals, getFieldValues } = __nccwpck_require__(6798)
+const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3440)
+const { webidl } = __nccwpck_require__(5893)
+const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(9051)
+const { Request, fromInnerRequest } = __nccwpck_require__(9967)
+const { kState } = __nccwpck_require__(3627)
+const { fetching } = __nccwpck_require__(4398)
+const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(3168)
+const assert = __nccwpck_require__(4589)
- if (contentLength === null) {
- socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
- } else {
- socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
- }
- }
+/**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
+ * @typedef {Object} CacheBatchOperation
+ * @property {'delete' | 'put'} type
+ * @property {any} request
+ * @property {any} response
+ * @property {import('../../types/cache').CacheQueryOptions} options
+ */
- if (contentLength === null) {
- socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
+/**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
+ * @typedef {[any, any][]} requestResponseList
+ */
+
+class Cache {
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
+ * @type {requestResponseList}
+ */
+ #relevantRequestResponseList
+
+ constructor () {
+ if (arguments[0] !== kConstruct) {
+ webidl.illegalConstructor()
}
- this.bytesWritten += len
+ webidl.util.markAsUncloneable(this)
+ this.#relevantRequestResponseList = arguments[1]
+ }
- const ret = socket.write(chunk)
+ async match (request, options = {}) {
+ webidl.brandCheck(this, Cache)
- socket.uncork()
+ const prefix = 'Cache.match'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- request.onBodySent(chunk)
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
- if (!ret) {
- if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
- // istanbul ignore else: only for jest
- if (socket[kParser].timeout.refresh) {
- socket[kParser].timeout.refresh()
- }
- }
+ const p = this.#internalMatchAll(request, options, 1)
+
+ if (p.length === 0) {
+ return
}
- return ret
+ return p[0]
}
- end () {
- const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
- request.onRequestSent()
+ async matchAll (request = undefined, options = {}) {
+ webidl.brandCheck(this, Cache)
- socket[kWriting] = false
+ const prefix = 'Cache.matchAll'
+ if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
- if (socket[kError]) {
- throw socket[kError]
- }
+ return this.#internalMatchAll(request, options)
+ }
- if (socket.destroyed) {
- return
- }
+ async add (request) {
+ webidl.brandCheck(this, Cache)
- if (bytesWritten === 0) {
- if (expectsPayload) {
- // https://tools.ietf.org/html/rfc7230#section-3.3.2
- // A user agent SHOULD send a Content-Length in a request message when
- // no Transfer-Encoding is sent and the request method defines a meaning
- // for an enclosed payload body.
+ const prefix = 'Cache.add'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
- } else {
- socket.write(`${header}\r\n`, 'latin1')
- }
- } else if (contentLength === null) {
- socket.write('\r\n0\r\n\r\n', 'latin1')
- }
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
- if (contentLength !== null && bytesWritten !== contentLength) {
- if (client[kStrictContentLength]) {
- throw new RequestContentLengthMismatchError()
- } else {
- process.emitWarning(new RequestContentLengthMismatchError())
- }
- }
+ // 1.
+ const requests = [request]
- if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
- // istanbul ignore else: only for jest
- if (socket[kParser].timeout.refresh) {
- socket[kParser].timeout.refresh()
- }
- }
+ // 2.
+ const responseArrayPromise = this.addAll(requests)
- resume(client)
+ // 3.
+ return await responseArrayPromise
}
- destroy (err) {
- const { socket, client } = this
+ async addAll (requests) {
+ webidl.brandCheck(this, Cache)
- socket[kWriting] = false
+ const prefix = 'Cache.addAll'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- if (err) {
- assert(client[kRunning] <= 1, 'pipeline should only contain this request')
- util.destroy(socket, err)
- }
- }
-}
+ // 1.
+ const responsePromises = []
-function errorRequest (client, request, err) {
- try {
- request.onError(err)
- assert(request.aborted)
- } catch (err) {
- client.emit('error', err)
- }
-}
+ // 2.
+ const requestList = []
-module.exports = Client
+ // 3.
+ for (let request of requests) {
+ if (request === undefined) {
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: 'Argument 1',
+ types: ['undefined is not allowed']
+ })
+ }
+ request = webidl.converters.RequestInfo(request)
-/***/ }),
+ if (typeof request === 'string') {
+ continue
+ }
-/***/ 6436:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 3.1
+ const r = request[kState]
+
+ // 3.2
+ if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected http/s scheme when method is not GET.'
+ })
+ }
+ }
+
+ // 4.
+ /** @type {ReturnType[]} */
+ const fetchControllers = []
+
+ // 5.
+ for (const request of requests) {
+ // 5.1
+ const r = new Request(request)[kState]
+
+ // 5.2
+ if (!urlIsHttpHttpsScheme(r.url)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected http/s scheme.'
+ })
+ }
-"use strict";
+ // 5.4
+ r.initiator = 'fetch'
+ r.destination = 'subresource'
+ // 5.5
+ requestList.push(r)
-/* istanbul ignore file: only for Node 12 */
+ // 5.6
+ const responsePromise = createDeferredPromise()
-const { kConnected, kSize } = __nccwpck_require__(2785)
+ // 5.7
+ fetchControllers.push(fetching({
+ request: r,
+ processResponse (response) {
+ // 1.
+ if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
+ responsePromise.reject(webidl.errors.exception({
+ header: 'Cache.addAll',
+ message: 'Received an invalid status code or the request failed.'
+ }))
+ } else if (response.headersList.contains('vary')) { // 2.
+ // 2.1
+ const fieldValues = getFieldValues(response.headersList.get('vary'))
-class CompatWeakRef {
- constructor (value) {
- this.value = value
- }
+ // 2.2
+ for (const fieldValue of fieldValues) {
+ // 2.2.1
+ if (fieldValue === '*') {
+ responsePromise.reject(webidl.errors.exception({
+ header: 'Cache.addAll',
+ message: 'invalid vary field value'
+ }))
- deref () {
- return this.value[kConnected] === 0 && this.value[kSize] === 0
- ? undefined
- : this.value
- }
-}
+ for (const controller of fetchControllers) {
+ controller.abort()
+ }
-class CompatFinalizer {
- constructor (finalizer) {
- this.finalizer = finalizer
- }
+ return
+ }
+ }
+ }
+ },
+ processResponseEndOfBody (response) {
+ // 1.
+ if (response.aborted) {
+ responsePromise.reject(new DOMException('aborted', 'AbortError'))
+ return
+ }
- register (dispatcher, key) {
- if (dispatcher.on) {
- dispatcher.on('disconnect', () => {
- if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
- this.finalizer(key)
+ // 2.
+ responsePromise.resolve(response)
}
- })
- }
- }
-}
+ }))
-module.exports = function () {
- // FIXME: remove workaround when the Node bug is fixed
- // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
- if (process.env.NODE_V8_COVERAGE) {
- return {
- WeakRef: CompatWeakRef,
- FinalizationRegistry: CompatFinalizer
+ // 5.8
+ responsePromises.push(responsePromise.promise)
}
- }
- return {
- WeakRef: global.WeakRef || CompatWeakRef,
- FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
- }
-}
-
-/***/ }),
+ // 6.
+ const p = Promise.all(responsePromises)
-/***/ 663:
-/***/ ((module) => {
+ // 7.
+ const responses = await p
-"use strict";
+ // 7.1
+ const operations = []
+ // 7.2
+ let index = 0
-// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
-const maxAttributeValueSize = 1024
+ // 7.3
+ for (const response of responses) {
+ // 7.3.1
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'put', // 7.3.2
+ request: requestList[index], // 7.3.3
+ response // 7.3.4
+ }
-// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
-const maxNameValuePairSize = 4096
+ operations.push(operation) // 7.3.5
-module.exports = {
- maxAttributeValueSize,
- maxNameValuePairSize
-}
+ index++ // 7.3.6
+ }
+ // 7.5
+ const cacheJobPromise = createDeferredPromise()
-/***/ }),
+ // 7.6.1
+ let errorData = null
-/***/ 1724:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 7.6.2
+ try {
+ this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
+ }
-"use strict";
+ // 7.6.3
+ queueMicrotask(() => {
+ // 7.6.3.1
+ if (errorData === null) {
+ cacheJobPromise.resolve(undefined)
+ } else {
+ // 7.6.3.2
+ cacheJobPromise.reject(errorData)
+ }
+ })
+ // 7.7
+ return cacheJobPromise.promise
+ }
-const { parseSetCookie } = __nccwpck_require__(4408)
-const { stringify, getHeadersList } = __nccwpck_require__(3121)
-const { webidl } = __nccwpck_require__(1744)
-const { Headers } = __nccwpck_require__(554)
+ async put (request, response) {
+ webidl.brandCheck(this, Cache)
-/**
- * @typedef {Object} Cookie
- * @property {string} name
- * @property {string} value
- * @property {Date|number|undefined} expires
- * @property {number|undefined} maxAge
- * @property {string|undefined} domain
- * @property {string|undefined} path
- * @property {boolean|undefined} secure
- * @property {boolean|undefined} httpOnly
- * @property {'Strict'|'Lax'|'None'} sameSite
- * @property {string[]} unparsed
- */
+ const prefix = 'Cache.put'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
-/**
- * @param {Headers} headers
- * @returns {Record}
- */
-function getCookies (headers) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ response = webidl.converters.Response(response, prefix, 'response')
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 1.
+ let innerRequest = null
- const cookie = headers.get('cookie')
- const out = {}
+ // 2.
+ if (request instanceof Request) {
+ innerRequest = request[kState]
+ } else { // 3.
+ innerRequest = new Request(request)[kState]
+ }
- if (!cookie) {
- return out
- }
+ // 4.
+ if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Expected an http/s scheme when method is not GET'
+ })
+ }
- for (const piece of cookie.split(';')) {
- const [name, ...value] = piece.split('=')
+ // 5.
+ const innerResponse = response[kState]
- out[name.trim()] = value.join('=')
- }
+ // 6.
+ if (innerResponse.status === 206) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Got 206 status'
+ })
+ }
- return out
-}
+ // 7.
+ if (innerResponse.headersList.contains('vary')) {
+ // 7.1.
+ const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
-/**
- * @param {Headers} headers
- * @param {string} name
- * @param {{ path?: string, domain?: string }|undefined} attributes
- * @returns {void}
- */
-function deleteCookie (headers, name, attributes) {
- webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
+ // 7.2.
+ for (const fieldValue of fieldValues) {
+ // 7.2.1
+ if (fieldValue === '*') {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Got * vary field value'
+ })
+ }
+ }
+ }
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 8.
+ if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
+ throw webidl.errors.exception({
+ header: prefix,
+ message: 'Response body is locked or disturbed'
+ })
+ }
- name = webidl.converters.DOMString(name)
- attributes = webidl.converters.DeleteCookieAttributes(attributes)
+ // 9.
+ const clonedResponse = cloneResponse(innerResponse)
- // Matches behavior of
- // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
- setCookie(headers, {
- name,
- value: '',
- expires: new Date(0),
- ...attributes
- })
-}
+ // 10.
+ const bodyReadPromise = createDeferredPromise()
-/**
- * @param {Headers} headers
- * @returns {Cookie[]}
- */
-function getSetCookies (headers) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
+ // 11.
+ if (innerResponse.body != null) {
+ // 11.1
+ const stream = innerResponse.body.stream
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 11.2
+ const reader = stream.getReader()
- const cookies = getHeadersList(headers).cookies
+ // 11.3
+ readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
+ } else {
+ bodyReadPromise.resolve(undefined)
+ }
- if (!cookies) {
- return []
- }
+ // 12.
+ /** @type {CacheBatchOperation[]} */
+ const operations = []
- // In older versions of undici, cookies is a list of name:value.
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
-}
+ // 13.
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'put', // 14.
+ request: innerRequest, // 15.
+ response: clonedResponse // 16.
+ }
-/**
- * @param {Headers} headers
- * @param {Cookie} cookie
- * @returns {void}
- */
-function setCookie (headers, cookie) {
- webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
+ // 17.
+ operations.push(operation)
- webidl.brandCheck(headers, Headers, { strict: false })
+ // 19.
+ const bytes = await bodyReadPromise.promise
- cookie = webidl.converters.Cookie(cookie)
+ if (clonedResponse.body != null) {
+ clonedResponse.body.source = bytes
+ }
- const str = stringify(cookie)
+ // 19.1
+ const cacheJobPromise = createDeferredPromise()
- if (str) {
- headers.append('Set-Cookie', stringify(cookie))
- }
-}
+ // 19.2.1
+ let errorData = null
-webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'path',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'domain',
- defaultValue: null
- }
-])
+ // 19.2.2
+ try {
+ this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
+ }
-webidl.converters.Cookie = webidl.dictionaryConverter([
- {
- converter: webidl.converters.DOMString,
- key: 'name'
- },
- {
- converter: webidl.converters.DOMString,
- key: 'value'
- },
- {
- converter: webidl.nullableConverter((value) => {
- if (typeof value === 'number') {
- return webidl.converters['unsigned long long'](value)
+ // 19.2.3
+ queueMicrotask(() => {
+ // 19.2.3.1
+ if (errorData === null) {
+ cacheJobPromise.resolve()
+ } else { // 19.2.3.2
+ cacheJobPromise.reject(errorData)
}
+ })
- return new Date(value)
- }),
- key: 'expires',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters['long long']),
- key: 'maxAge',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'domain',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.DOMString),
- key: 'path',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.boolean),
- key: 'secure',
- defaultValue: null
- },
- {
- converter: webidl.nullableConverter(webidl.converters.boolean),
- key: 'httpOnly',
- defaultValue: null
- },
- {
- converter: webidl.converters.USVString,
- key: 'sameSite',
- allowedValues: ['Strict', 'Lax', 'None']
- },
- {
- converter: webidl.sequenceConverter(webidl.converters.DOMString),
- key: 'unparsed',
- defaultValue: []
+ return cacheJobPromise.promise
}
-])
-
-module.exports = {
- getCookies,
- deleteCookie,
- getSetCookies,
- setCookie
-}
+ async delete (request, options = {}) {
+ webidl.brandCheck(this, Cache)
-/***/ }),
+ const prefix = 'Cache.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-/***/ 4408:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
-"use strict";
+ /**
+ * @type {Request}
+ */
+ let r = null
+ if (request instanceof Request) {
+ r = request[kState]
-const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
-const { isCTLExcludingHtab } = __nccwpck_require__(3121)
-const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
-const assert = __nccwpck_require__(9491)
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return false
+ }
+ } else {
+ assert(typeof request === 'string')
-/**
- * @description Parses the field-value attributes of a set-cookie header string.
- * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
- * @param {string} header
- * @returns if the header is invalid, null will be returned
- */
-function parseSetCookie (header) {
- // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
- // character (CTL characters excluding HTAB): Abort these steps and
- // ignore the set-cookie-string entirely.
- if (isCTLExcludingHtab(header)) {
- return null
- }
+ r = new Request(request)[kState]
+ }
- let nameValuePair = ''
- let unparsedAttributes = ''
- let name = ''
- let value = ''
+ /** @type {CacheBatchOperation[]} */
+ const operations = []
- // 2. If the set-cookie-string contains a %x3B (";") character:
- if (header.includes(';')) {
- // 1. The name-value-pair string consists of the characters up to,
- // but not including, the first %x3B (";"), and the unparsed-
- // attributes consist of the remainder of the set-cookie-string
- // (including the %x3B (";") in question).
- const position = { position: 0 }
+ /** @type {CacheBatchOperation} */
+ const operation = {
+ type: 'delete',
+ request: r,
+ options
+ }
- nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
- unparsedAttributes = header.slice(position.position)
- } else {
- // Otherwise:
+ operations.push(operation)
- // 1. The name-value-pair string consists of all the characters
- // contained in the set-cookie-string, and the unparsed-
- // attributes is the empty string.
- nameValuePair = header
- }
+ const cacheJobPromise = createDeferredPromise()
- // 3. If the name-value-pair string lacks a %x3D ("=") character, then
- // the name string is empty, and the value string is the value of
- // name-value-pair.
- if (!nameValuePair.includes('=')) {
- value = nameValuePair
- } else {
- // Otherwise, the name string consists of the characters up to, but
- // not including, the first %x3D ("=") character, and the (possibly
- // empty) value string consists of the characters after the first
- // %x3D ("=") character.
- const position = { position: 0 }
- name = collectASequenceOfCodePointsFast(
- '=',
- nameValuePair,
- position
- )
- value = nameValuePair.slice(position.position + 1)
- }
+ let errorData = null
+ let requestResponses
- // 4. Remove any leading or trailing WSP characters from the name
- // string and the value string.
- name = name.trim()
- value = value.trim()
+ try {
+ requestResponses = this.#batchCacheOperations(operations)
+ } catch (e) {
+ errorData = e
+ }
- // 5. If the sum of the lengths of the name string and the value string
- // is more than 4096 octets, abort these steps and ignore the set-
- // cookie-string entirely.
- if (name.length + value.length > maxNameValuePairSize) {
- return null
- }
+ queueMicrotask(() => {
+ if (errorData === null) {
+ cacheJobPromise.resolve(!!requestResponses?.length)
+ } else {
+ cacheJobPromise.reject(errorData)
+ }
+ })
- // 6. The cookie-name is the name string, and the cookie-value is the
- // value string.
- return {
- name, value, ...parseUnparsedAttributes(unparsedAttributes)
+ return cacheJobPromise.promise
}
-}
-/**
- * Parses the remaining attributes of a set-cookie header
- * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
- * @param {string} unparsedAttributes
- * @param {[Object.]={}} cookieAttributeList
- */
-function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
- // 1. If the unparsed-attributes string is empty, skip the rest of
- // these steps.
- if (unparsedAttributes.length === 0) {
- return cookieAttributeList
- }
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
+ * @param {any} request
+ * @param {import('../../types/cache').CacheQueryOptions} options
+ * @returns {Promise}
+ */
+ async keys (request = undefined, options = {}) {
+ webidl.brandCheck(this, Cache)
- // 2. Discard the first character of the unparsed-attributes (which
- // will be a %x3B (";") character).
- assert(unparsedAttributes[0] === ';')
- unparsedAttributes = unparsedAttributes.slice(1)
+ const prefix = 'Cache.keys'
- let cookieAv = ''
+ if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request')
+ options = webidl.converters.CacheQueryOptions(options, prefix, 'options')
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
- // character:
- if (unparsedAttributes.includes(';')) {
- // 1. Consume the characters of the unparsed-attributes up to, but
- // not including, the first %x3B (";") character.
- cookieAv = collectASequenceOfCodePointsFast(
- ';',
- unparsedAttributes,
- { position: 0 }
- )
- unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
- } else {
- // Otherwise:
+ // 1.
+ let r = null
- // 1. Consume the remainder of the unparsed-attributes.
- cookieAv = unparsedAttributes
- unparsedAttributes = ''
- }
+ // 2.
+ if (request !== undefined) {
+ // 2.1
+ if (request instanceof Request) {
+ // 2.1.1
+ r = request[kState]
- // Let the cookie-av string be the characters consumed in this step.
+ // 2.1.2
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return []
+ }
+ } else if (typeof request === 'string') { // 2.2
+ r = new Request(request)[kState]
+ }
+ }
- let attributeName = ''
- let attributeValue = ''
+ // 4.
+ const promise = createDeferredPromise()
- // 4. If the cookie-av string contains a %x3D ("=") character:
- if (cookieAv.includes('=')) {
- // 1. The (possibly empty) attribute-name string consists of the
- // characters up to, but not including, the first %x3D ("=")
- // character, and the (possibly empty) attribute-value string
- // consists of the characters after the first %x3D ("=")
- // character.
- const position = { position: 0 }
+ // 5.
+ // 5.1
+ const requests = []
- attributeName = collectASequenceOfCodePointsFast(
- '=',
- cookieAv,
- position
- )
- attributeValue = cookieAv.slice(position.position + 1)
- } else {
- // Otherwise:
+ // 5.2
+ if (request === undefined) {
+ // 5.2.1
+ for (const requestResponse of this.#relevantRequestResponseList) {
+ // 5.2.1.1
+ requests.push(requestResponse[0])
+ }
+ } else { // 5.3
+ // 5.3.1
+ const requestResponses = this.#queryCache(r, options)
- // 1. The attribute-name string consists of the entire cookie-av
- // string, and the attribute-value string is empty.
- attributeName = cookieAv
- }
+ // 5.3.2
+ for (const requestResponse of requestResponses) {
+ // 5.3.2.1
+ requests.push(requestResponse[0])
+ }
+ }
- // 5. Remove any leading or trailing WSP characters from the attribute-
- // name string and the attribute-value string.
- attributeName = attributeName.trim()
- attributeValue = attributeValue.trim()
+ // 5.4
+ queueMicrotask(() => {
+ // 5.4.1
+ const requestList = []
- // 6. If the attribute-value is longer than 1024 octets, ignore the
- // cookie-av string and return to Step 1 of this algorithm.
- if (attributeValue.length > maxAttributeValueSize) {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
- }
+ // 5.4.2
+ for (const request of requests) {
+ const requestObject = fromInnerRequest(
+ request,
+ new AbortController().signal,
+ 'immutable'
+ )
+ // 5.4.2.1
+ requestList.push(requestObject)
+ }
- // 7. Process the attribute-name and attribute-value according to the
- // requirements in the following subsections. (Notice that
- // attributes with unrecognized attribute-names are ignored.)
- const attributeNameLowercase = attributeName.toLowerCase()
+ // 5.4.3
+ promise.resolve(Object.freeze(requestList))
+ })
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
- // If the attribute-name case-insensitively matches the string
- // "Expires", the user agent MUST process the cookie-av as follows.
- if (attributeNameLowercase === 'expires') {
- // 1. Let the expiry-time be the result of parsing the attribute-value
- // as cookie-date (see Section 5.1.1).
- const expiryTime = new Date(attributeValue)
+ return promise.promise
+ }
- // 2. If the attribute-value failed to parse as a cookie date, ignore
- // the cookie-av.
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
+ * @param {CacheBatchOperation[]} operations
+ * @returns {requestResponseList}
+ */
+ #batchCacheOperations (operations) {
+ // 1.
+ const cache = this.#relevantRequestResponseList
- cookieAttributeList.expires = expiryTime
- } else if (attributeNameLowercase === 'max-age') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
- // If the attribute-name case-insensitively matches the string "Max-
- // Age", the user agent MUST process the cookie-av as follows.
+ // 2.
+ const backupCache = [...cache]
- // 1. If the first character of the attribute-value is not a DIGIT or a
- // "-" character, ignore the cookie-av.
- const charCode = attributeValue.charCodeAt(0)
+ // 3.
+ const addedItems = []
- if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
- }
+ // 4.1
+ const resultList = []
- // 2. If the remainder of attribute-value contains a non-DIGIT
- // character, ignore the cookie-av.
- if (!/^\d+$/.test(attributeValue)) {
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
- }
+ try {
+ // 4.2
+ for (const operation of operations) {
+ // 4.2.1
+ if (operation.type !== 'delete' && operation.type !== 'put') {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'operation type does not match "delete" or "put"'
+ })
+ }
- // 3. Let delta-seconds be the attribute-value converted to an integer.
- const deltaSeconds = Number(attributeValue)
+ // 4.2.2
+ if (operation.type === 'delete' && operation.response != null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'delete operation should not have an associated response'
+ })
+ }
- // 4. Let cookie-age-limit be the maximum age of the cookie (which
- // SHOULD be 400 days or less, see Section 4.1.2.2).
+ // 4.2.3
+ if (this.#queryCache(operation.request, operation.options, addedItems).length) {
+ throw new DOMException('???', 'InvalidStateError')
+ }
- // 5. Set delta-seconds to the smaller of its present value and cookie-
- // age-limit.
- // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
+ // 4.2.4
+ let requestResponses
- // 6. If delta-seconds is less than or equal to zero (0), let expiry-
- // time be the earliest representable date and time. Otherwise, let
- // the expiry-time be the current date and time plus delta-seconds
- // seconds.
- // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
+ // 4.2.5
+ if (operation.type === 'delete') {
+ // 4.2.5.1
+ requestResponses = this.#queryCache(operation.request, operation.options)
- // 7. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Max-Age and an attribute-value of expiry-time.
- cookieAttributeList.maxAge = deltaSeconds
- } else if (attributeNameLowercase === 'domain') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
- // If the attribute-name case-insensitively matches the string "Domain",
- // the user agent MUST process the cookie-av as follows.
+ // TODO: the spec is wrong, this is needed to pass WPTs
+ if (requestResponses.length === 0) {
+ return []
+ }
- // 1. Let cookie-domain be the attribute-value.
- let cookieDomain = attributeValue
+ // 4.2.5.2
+ for (const requestResponse of requestResponses) {
+ const idx = cache.indexOf(requestResponse)
+ assert(idx !== -1)
- // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
- // cookie-domain without its leading %x2E (".").
- if (cookieDomain[0] === '.') {
- cookieDomain = cookieDomain.slice(1)
- }
+ // 4.2.5.2.1
+ cache.splice(idx, 1)
+ }
+ } else if (operation.type === 'put') { // 4.2.6
+ // 4.2.6.1
+ if (operation.response == null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'put operation should have an associated response'
+ })
+ }
- // 3. Convert the cookie-domain to lower case.
- cookieDomain = cookieDomain.toLowerCase()
+ // 4.2.6.2
+ const r = operation.request
- // 4. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Domain and an attribute-value of cookie-domain.
- cookieAttributeList.domain = cookieDomain
- } else if (attributeNameLowercase === 'path') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
- // If the attribute-name case-insensitively matches the string "Path",
- // the user agent MUST process the cookie-av as follows.
+ // 4.2.6.3
+ if (!urlIsHttpHttpsScheme(r.url)) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'expected http or https scheme'
+ })
+ }
- // 1. If the attribute-value is empty or if the first character of the
- // attribute-value is not %x2F ("/"):
- let cookiePath = ''
- if (attributeValue.length === 0 || attributeValue[0] !== '/') {
- // 1. Let cookie-path be the default-path.
- cookiePath = '/'
- } else {
- // Otherwise:
+ // 4.2.6.4
+ if (r.method !== 'GET') {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'not get method'
+ })
+ }
- // 1. Let cookie-path be the attribute-value.
- cookiePath = attributeValue
- }
+ // 4.2.6.5
+ if (operation.options != null) {
+ throw webidl.errors.exception({
+ header: 'Cache.#batchCacheOperations',
+ message: 'options must not be defined'
+ })
+ }
- // 2. Append an attribute to the cookie-attribute-list with an
- // attribute-name of Path and an attribute-value of cookie-path.
- cookieAttributeList.path = cookiePath
- } else if (attributeNameLowercase === 'secure') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
- // If the attribute-name case-insensitively matches the string "Secure",
- // the user agent MUST append an attribute to the cookie-attribute-list
- // with an attribute-name of Secure and an empty attribute-value.
+ // 4.2.6.6
+ requestResponses = this.#queryCache(operation.request)
- cookieAttributeList.secure = true
- } else if (attributeNameLowercase === 'httponly') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
- // If the attribute-name case-insensitively matches the string
- // "HttpOnly", the user agent MUST append an attribute to the cookie-
- // attribute-list with an attribute-name of HttpOnly and an empty
- // attribute-value.
+ // 4.2.6.7
+ for (const requestResponse of requestResponses) {
+ const idx = cache.indexOf(requestResponse)
+ assert(idx !== -1)
- cookieAttributeList.httpOnly = true
- } else if (attributeNameLowercase === 'samesite') {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
- // If the attribute-name case-insensitively matches the string
- // "SameSite", the user agent MUST process the cookie-av as follows:
+ // 4.2.6.7.1
+ cache.splice(idx, 1)
+ }
- // 1. Let enforcement be "Default".
- let enforcement = 'Default'
+ // 4.2.6.8
+ cache.push([operation.request, operation.response])
- const attributeValueLowercase = attributeValue.toLowerCase()
- // 2. If cookie-av's attribute-value is a case-insensitive match for
- // "None", set enforcement to "None".
- if (attributeValueLowercase.includes('none')) {
- enforcement = 'None'
- }
+ // 4.2.6.10
+ addedItems.push([operation.request, operation.response])
+ }
- // 3. If cookie-av's attribute-value is a case-insensitive match for
- // "Strict", set enforcement to "Strict".
- if (attributeValueLowercase.includes('strict')) {
- enforcement = 'Strict'
- }
+ // 4.2.7
+ resultList.push([operation.request, operation.response])
+ }
- // 4. If cookie-av's attribute-value is a case-insensitive match for
- // "Lax", set enforcement to "Lax".
- if (attributeValueLowercase.includes('lax')) {
- enforcement = 'Lax'
- }
+ // 4.3
+ return resultList
+ } catch (e) { // 5.
+ // 5.1
+ this.#relevantRequestResponseList.length = 0
- // 5. Append an attribute to the cookie-attribute-list with an
- // attribute-name of "SameSite" and an attribute-value of
- // enforcement.
- cookieAttributeList.sameSite = enforcement
- } else {
- cookieAttributeList.unparsed ??= []
+ // 5.2
+ this.#relevantRequestResponseList = backupCache
- cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
+ // 5.3
+ throw e
+ }
}
- // 8. Return to Step 1 of this algorithm.
- return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
-}
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#query-cache
+ * @param {any} requestQuery
+ * @param {import('../../types/cache').CacheQueryOptions} options
+ * @param {requestResponseList} targetStorage
+ * @returns {requestResponseList}
+ */
+ #queryCache (requestQuery, options, targetStorage) {
+ /** @type {requestResponseList} */
+ const resultList = []
-module.exports = {
- parseSetCookie,
- parseUnparsedAttributes
-}
+ const storage = targetStorage ?? this.#relevantRequestResponseList
+ for (const requestResponse of storage) {
+ const [cachedRequest, cachedResponse] = requestResponse
+ if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
+ resultList.push(requestResponse)
+ }
+ }
-/***/ }),
+ return resultList
+ }
-/***/ 3121:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
+ * @param {any} requestQuery
+ * @param {any} request
+ * @param {any | null} response
+ * @param {import('../../types/cache').CacheQueryOptions | undefined} options
+ * @returns {boolean}
+ */
+ #requestMatchesCachedItem (requestQuery, request, response = null, options) {
+ // if (options?.ignoreMethod === false && request.method === 'GET') {
+ // return false
+ // }
-"use strict";
+ const queryURL = new URL(requestQuery.url)
+ const cachedURL = new URL(request.url)
-const assert = __nccwpck_require__(9491)
-const { kHeadersList } = __nccwpck_require__(2785)
+ if (options?.ignoreSearch) {
+ cachedURL.search = ''
-function isCTLExcludingHtab (value) {
- if (value.length === 0) {
- return false
- }
+ queryURL.search = ''
+ }
- for (const char of value) {
- const code = char.charCodeAt(0)
+ if (!urlEquals(queryURL, cachedURL, true)) {
+ return false
+ }
if (
- (code >= 0x00 || code <= 0x08) ||
- (code >= 0x0A || code <= 0x1F) ||
- code === 0x7F
+ response == null ||
+ options?.ignoreVary ||
+ !response.headersList.contains('vary')
) {
- return false
+ return true
}
- }
-}
-/**
- CHAR =
- token = 1*
- separators = "(" | ")" | "<" | ">" | "@"
- | "," | ";" | ":" | "\" | <">
- | "/" | "[" | "]" | "?" | "="
- | "{" | "}" | SP | HT
- * @param {string} name
- */
-function validateCookieName (name) {
- for (const char of name) {
- const code = char.charCodeAt(0)
+ const fieldValues = getFieldValues(response.headersList.get('vary'))
- if (
- (code <= 0x20 || code > 0x7F) ||
- char === '(' ||
- char === ')' ||
- char === '>' ||
- char === '<' ||
- char === '@' ||
- char === ',' ||
- char === ';' ||
- char === ':' ||
- char === '\\' ||
- char === '"' ||
- char === '/' ||
- char === '[' ||
- char === ']' ||
- char === '?' ||
- char === '=' ||
- char === '{' ||
- char === '}'
- ) {
- throw new Error('Invalid cookie name')
+ for (const fieldValue of fieldValues) {
+ if (fieldValue === '*') {
+ return false
+ }
+
+ const requestValue = request.headersList.get(fieldValue)
+ const queryValue = requestQuery.headersList.get(fieldValue)
+
+ // If one has the header and the other doesn't, or one has
+ // a different value than the other, return false
+ if (requestValue !== queryValue) {
+ return false
+ }
}
+
+ return true
}
-}
-/**
- cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
- cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
- ; US-ASCII characters excluding CTLs,
- ; whitespace DQUOTE, comma, semicolon,
- ; and backslash
- * @param {string} value
- */
-function validateCookieValue (value) {
- for (const char of value) {
- const code = char.charCodeAt(0)
+ #internalMatchAll (request, options, maxResponses = Infinity) {
+ // 1.
+ let r = null
- if (
- code < 0x21 || // exclude CTLs (0-31)
- code === 0x22 ||
- code === 0x2C ||
- code === 0x3B ||
- code === 0x5C ||
- code > 0x7E // non-ascii
- ) {
- throw new Error('Invalid header value')
+ // 2.
+ if (request !== undefined) {
+ if (request instanceof Request) {
+ // 2.1.1
+ r = request[kState]
+
+ // 2.1.2
+ if (r.method !== 'GET' && !options.ignoreMethod) {
+ return []
+ }
+ } else if (typeof request === 'string') {
+ // 2.2.1
+ r = new Request(request)[kState]
+ }
}
- }
-}
-/**
- * path-value =
- * @param {string} path
- */
-function validateCookiePath (path) {
- for (const char of path) {
- const code = char.charCodeAt(0)
+ // 5.
+ // 5.1
+ const responses = []
- if (code < 0x21 || char === ';') {
- throw new Error('Invalid cookie path')
+ // 5.2
+ if (request === undefined) {
+ // 5.2.1
+ for (const requestResponse of this.#relevantRequestResponseList) {
+ responses.push(requestResponse[1])
+ }
+ } else { // 5.3
+ // 5.3.1
+ const requestResponses = this.#queryCache(r, options)
+
+ // 5.3.2
+ for (const requestResponse of requestResponses) {
+ responses.push(requestResponse[1])
+ }
}
- }
-}
-/**
- * I have no idea why these values aren't allowed to be honest,
- * but Deno tests these. - Khafra
- * @param {string} domain
- */
-function validateCookieDomain (domain) {
- if (
- domain.startsWith('-') ||
- domain.endsWith('.') ||
- domain.endsWith('-')
- ) {
- throw new Error('Invalid cookie domain')
- }
-}
+ // 5.4
+ // We don't implement CORs so we don't need to loop over the responses, yay!
-/**
- * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
- * @param {number|Date} date
- IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
- ; fixed length/zone/capitalization subset of the format
- ; see Section 3.3 of [RFC5322]
+ // 5.5.1
+ const responseList = []
- day-name = %x4D.6F.6E ; "Mon", case-sensitive
- / %x54.75.65 ; "Tue", case-sensitive
- / %x57.65.64 ; "Wed", case-sensitive
- / %x54.68.75 ; "Thu", case-sensitive
- / %x46.72.69 ; "Fri", case-sensitive
- / %x53.61.74 ; "Sat", case-sensitive
- / %x53.75.6E ; "Sun", case-sensitive
- date1 = day SP month SP year
- ; e.g., 02 Jun 1982
+ // 5.5.2
+ for (const response of responses) {
+ // 5.5.2.1
+ const responseObject = fromInnerResponse(response, 'immutable')
- day = 2DIGIT
- month = %x4A.61.6E ; "Jan", case-sensitive
- / %x46.65.62 ; "Feb", case-sensitive
- / %x4D.61.72 ; "Mar", case-sensitive
- / %x41.70.72 ; "Apr", case-sensitive
- / %x4D.61.79 ; "May", case-sensitive
- / %x4A.75.6E ; "Jun", case-sensitive
- / %x4A.75.6C ; "Jul", case-sensitive
- / %x41.75.67 ; "Aug", case-sensitive
- / %x53.65.70 ; "Sep", case-sensitive
- / %x4F.63.74 ; "Oct", case-sensitive
- / %x4E.6F.76 ; "Nov", case-sensitive
- / %x44.65.63 ; "Dec", case-sensitive
- year = 4DIGIT
+ responseList.push(responseObject.clone())
- GMT = %x47.4D.54 ; "GMT", case-sensitive
+ if (responseList.length >= maxResponses) {
+ break
+ }
+ }
- time-of-day = hour ":" minute ":" second
- ; 00:00:00 - 23:59:60 (leap second)
+ // 6.
+ return Object.freeze(responseList)
+ }
+}
+
+Object.defineProperties(Cache.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'Cache',
+ configurable: true
+ },
+ match: kEnumerableProperty,
+ matchAll: kEnumerableProperty,
+ add: kEnumerableProperty,
+ addAll: kEnumerableProperty,
+ put: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ keys: kEnumerableProperty
+})
- hour = 2DIGIT
- minute = 2DIGIT
- second = 2DIGIT
- */
-function toIMFDate (date) {
- if (typeof date === 'number') {
- date = new Date(date)
+const cacheQueryOptionConverters = [
+ {
+ key: 'ignoreSearch',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'ignoreMethod',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'ignoreVary',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
}
+]
- const days = [
- 'Sun', 'Mon', 'Tue', 'Wed',
- 'Thu', 'Fri', 'Sat'
- ]
+webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
- const months = [
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
- ]
+webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
+ ...cacheQueryOptionConverters,
+ {
+ key: 'cacheName',
+ converter: webidl.converters.DOMString
+ }
+])
- const dayName = days[date.getUTCDay()]
- const day = date.getUTCDate().toString().padStart(2, '0')
- const month = months[date.getUTCMonth()]
- const year = date.getUTCFullYear()
- const hour = date.getUTCHours().toString().padStart(2, '0')
- const minute = date.getUTCMinutes().toString().padStart(2, '0')
- const second = date.getUTCSeconds().toString().padStart(2, '0')
+webidl.converters.Response = webidl.interfaceConverter(Response)
- return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
-}
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.RequestInfo
+)
-/**
- max-age-av = "Max-Age=" non-zero-digit *DIGIT
- ; In practice, both expires-av and max-age-av
- ; are limited to dates representable by the
- ; user agent.
- * @param {number} maxAge
- */
-function validateCookieMaxAge (maxAge) {
- if (maxAge < 0) {
- throw new Error('Invalid cookie max-age')
- }
+module.exports = {
+ Cache
}
-/**
- * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
- * @param {import('./index').Cookie} cookie
- */
-function stringify (cookie) {
- if (cookie.name.length === 0) {
- return null
- }
- validateCookieName(cookie.name)
- validateCookieValue(cookie.value)
+/***/ }),
- const out = [`${cookie.name}=${cookie.value}`]
+/***/ 3245:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
- // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
- if (cookie.name.startsWith('__Secure-')) {
- cookie.secure = true
- }
- if (cookie.name.startsWith('__Host-')) {
- cookie.secure = true
- cookie.domain = null
- cookie.path = '/'
- }
- if (cookie.secure) {
- out.push('Secure')
- }
+const { kConstruct } = __nccwpck_require__(109)
+const { Cache } = __nccwpck_require__(9634)
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
- if (cookie.httpOnly) {
- out.push('HttpOnly')
- }
+class CacheStorage {
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
+ * @type {Map}
+ */
+ async has (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
-function getHeadersList (headers) {
- if (headers[kHeadersList]) {
- return headers[kHeadersList]
- }
+ const prefix = 'CacheStorage.has'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- if (!kHeadersListNode) {
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
- (symbol) => symbol.description === 'headers list'
- )
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
- assert(kHeadersListNode, 'Headers cannot be parsed')
+ // 2.1.1
+ // 2.2
+ return this.#caches.has(cacheName)
}
- const headersList = headers[kHeadersListNode]
- assert(headersList)
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
+ * @param {string} cacheName
+ * @returns {Promise}
+ */
+ async open (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
- return headersList
-}
+ const prefix = 'CacheStorage.open'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-module.exports = {
- isCTLExcludingHtab,
- stringify,
- getHeadersList
-}
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
+ // 2.1
+ if (this.#caches.has(cacheName)) {
+ // await caches.open('v1') !== await caches.open('v1')
-/***/ }),
+ // 2.1.1
+ const cache = this.#caches.get(cacheName)
-/***/ 2067:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2.1.1.1
+ return new Cache(kConstruct, cache)
+ }
-"use strict";
+ // 2.2
+ const cache = []
+ // 2.3
+ this.#caches.set(cacheName, cache)
-const net = __nccwpck_require__(1808)
-const assert = __nccwpck_require__(9491)
-const util = __nccwpck_require__(3983)
-const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
+ // 2.4
+ return new Cache(kConstruct, cache)
+ }
-let tls // include tls conditionally since it is not always available
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
+ * @param {string} cacheName
+ * @returns {Promise}
+ */
+ async delete (cacheName) {
+ webidl.brandCheck(this, CacheStorage)
-// TODO: session re-use does not wait for the first
-// connection to resolve the session and might therefore
-// resolve the same servername multiple times even when
-// re-use is enabled.
+ const prefix = 'CacheStorage.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-let SessionCache
-// FIXME: remove workaround when the Node bug is fixed
-// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
-if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
- SessionCache = class WeakSessionCache {
- constructor (maxCachedSessions) {
- this._maxCachedSessions = maxCachedSessions
- this._sessionCache = new Map()
- this._sessionRegistry = new global.FinalizationRegistry((key) => {
- if (this._sessionCache.size < this._maxCachedSessions) {
- return
- }
+ cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName')
- const ref = this._sessionCache.get(key)
- if (ref !== undefined && ref.deref() === undefined) {
- this._sessionCache.delete(key)
- }
- })
- }
+ return this.#caches.delete(cacheName)
+ }
- get (sessionKey) {
- const ref = this._sessionCache.get(sessionKey)
- return ref ? ref.deref() : null
- }
+ /**
+ * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
+ * @returns {Promise}
+ */
+ async keys () {
+ webidl.brandCheck(this, CacheStorage)
- set (sessionKey, session) {
- if (this._maxCachedSessions === 0) {
- return
- }
+ // 2.1
+ const keys = this.#caches.keys()
- this._sessionCache.set(sessionKey, new WeakRef(session))
- this._sessionRegistry.register(session, sessionKey)
- }
+ // 2.2
+ return [...keys]
}
-} else {
- SessionCache = class SimpleSessionCache {
- constructor (maxCachedSessions) {
- this._maxCachedSessions = maxCachedSessions
- this._sessionCache = new Map()
- }
+}
- get (sessionKey) {
- return this._sessionCache.get(sessionKey)
- }
+Object.defineProperties(CacheStorage.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'CacheStorage',
+ configurable: true
+ },
+ match: kEnumerableProperty,
+ has: kEnumerableProperty,
+ open: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ keys: kEnumerableProperty
+})
- set (sessionKey, session) {
- if (this._maxCachedSessions === 0) {
- return
- }
+module.exports = {
+ CacheStorage
+}
- if (this._sessionCache.size >= this._maxCachedSessions) {
- // remove the oldest session
- const { value: oldestKey } = this._sessionCache.keys().next()
- this._sessionCache.delete(oldestKey)
- }
- this._sessionCache.set(sessionKey, session)
- }
- }
-}
+/***/ }),
-function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
- if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
- throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
- }
+/***/ 109:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const options = { path: socketPath, ...opts }
- const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
- timeout = timeout == null ? 10e3 : timeout
- allowH2 = allowH2 != null ? allowH2 : false
- return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
- let socket
- if (protocol === 'https:') {
- if (!tls) {
- tls = __nccwpck_require__(4404)
- }
- servername = servername || options.servername || util.getServerName(host) || null
- const sessionKey = servername || hostname
- const session = sessionCache.get(sessionKey) || null
- assert(sessionKey)
+module.exports = {
+ kConstruct: (__nccwpck_require__(6443).kConstruct)
+}
- socket = tls.connect({
- highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
- ...options,
- servername,
- session,
- localAddress,
- // TODO(HTTP/2): Add support for h2c
- ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
- socket: httpSocket, // upgrade socket connection
- port: port || 443,
- host: hostname
- })
- socket
- .on('session', function (session) {
- // TODO (fix): Can a session become invalid once established? Don't think so?
- sessionCache.set(sessionKey, session)
- })
- } else {
- assert(!httpSocket, 'httpSocket can only be sent on TLS update')
- socket = net.connect({
- highWaterMark: 64 * 1024, // Same as nodejs fs streams.
- ...options,
- localAddress,
- port: port || 80,
- host: hostname
- })
- }
+/***/ }),
- // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
- if (options.keepAlive == null || options.keepAlive) {
- const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
- socket.setKeepAlive(true, keepAliveInitialDelay)
- }
+/***/ 6798:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
- socket
- .setNoDelay(true)
- .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
- cancelTimeout()
- if (callback) {
- const cb = callback
- callback = null
- cb(null, this)
- }
- })
- .on('error', function (err) {
- cancelTimeout()
+const assert = __nccwpck_require__(4589)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { isValidHeaderName } = __nccwpck_require__(3168)
- if (callback) {
- const cb = callback
- callback = null
- cb(err)
- }
- })
+/**
+ * @see https://url.spec.whatwg.org/#concept-url-equals
+ * @param {URL} A
+ * @param {URL} B
+ * @param {boolean | undefined} excludeFragment
+ * @returns {boolean}
+ */
+function urlEquals (A, B, excludeFragment = false) {
+ const serializedA = URLSerializer(A, excludeFragment)
- return socket
- }
+ const serializedB = URLSerializer(B, excludeFragment)
+
+ return serializedA === serializedB
}
-function setupTimeout (onConnectTimeout, timeout) {
- if (!timeout) {
- return () => {}
- }
+/**
+ * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
+ * @param {string} header
+ */
+function getFieldValues (header) {
+ assert(header !== null)
- let s1 = null
- let s2 = null
- const timeoutId = setTimeout(() => {
- // setImmediate is added to make sure that we priotorise socket error events over timeouts
- s1 = setImmediate(() => {
- if (process.platform === 'win32') {
- // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
- s2 = setImmediate(() => onConnectTimeout())
- } else {
- onConnectTimeout()
- }
- })
- }, timeout)
- return () => {
- clearTimeout(timeoutId)
- clearImmediate(s1)
- clearImmediate(s2)
+ const values = []
+
+ for (let value of header.split(',')) {
+ value = value.trim()
+
+ if (isValidHeaderName(value)) {
+ values.push(value)
+ }
}
-}
-function onConnectTimeout (socket) {
- util.destroy(socket, new ConnectTimeoutError())
+ return values
}
-module.exports = buildConnector
+module.exports = {
+ urlEquals,
+ getFieldValues
+}
/***/ }),
-/***/ 4462:
+/***/ 1276:
/***/ ((module) => {
-"use strict";
-/** @type {Record} */
-const headerNameLowerCasedRecord = {}
-
-// https://developer.mozilla.org/docs/Web/HTTP/Headers
-const wellknownHeaderNames = [
- 'Accept',
- 'Accept-Encoding',
- 'Accept-Language',
- 'Accept-Ranges',
- 'Access-Control-Allow-Credentials',
- 'Access-Control-Allow-Headers',
- 'Access-Control-Allow-Methods',
- 'Access-Control-Allow-Origin',
- 'Access-Control-Expose-Headers',
- 'Access-Control-Max-Age',
- 'Access-Control-Request-Headers',
- 'Access-Control-Request-Method',
- 'Age',
- 'Allow',
- 'Alt-Svc',
- 'Alt-Used',
- 'Authorization',
- 'Cache-Control',
- 'Clear-Site-Data',
- 'Connection',
- 'Content-Disposition',
- 'Content-Encoding',
- 'Content-Language',
- 'Content-Length',
- 'Content-Location',
- 'Content-Range',
- 'Content-Security-Policy',
- 'Content-Security-Policy-Report-Only',
- 'Content-Type',
- 'Cookie',
- 'Cross-Origin-Embedder-Policy',
- 'Cross-Origin-Opener-Policy',
- 'Cross-Origin-Resource-Policy',
- 'Date',
- 'Device-Memory',
- 'Downlink',
- 'ECT',
- 'ETag',
- 'Expect',
- 'Expect-CT',
- 'Expires',
- 'Forwarded',
- 'From',
- 'Host',
- 'If-Match',
- 'If-Modified-Since',
- 'If-None-Match',
- 'If-Range',
- 'If-Unmodified-Since',
- 'Keep-Alive',
- 'Last-Modified',
- 'Link',
- 'Location',
- 'Max-Forwards',
- 'Origin',
- 'Permissions-Policy',
- 'Pragma',
- 'Proxy-Authenticate',
- 'Proxy-Authorization',
- 'RTT',
- 'Range',
- 'Referer',
- 'Referrer-Policy',
- 'Refresh',
- 'Retry-After',
- 'Sec-WebSocket-Accept',
- 'Sec-WebSocket-Extensions',
- 'Sec-WebSocket-Key',
- 'Sec-WebSocket-Protocol',
- 'Sec-WebSocket-Version',
- 'Server',
- 'Server-Timing',
- 'Service-Worker-Allowed',
- 'Service-Worker-Navigation-Preload',
- 'Set-Cookie',
- 'SourceMap',
- 'Strict-Transport-Security',
- 'Supports-Loading-Mode',
- 'TE',
- 'Timing-Allow-Origin',
- 'Trailer',
- 'Transfer-Encoding',
- 'Upgrade',
- 'Upgrade-Insecure-Requests',
- 'User-Agent',
- 'Vary',
- 'Via',
- 'WWW-Authenticate',
- 'X-Content-Type-Options',
- 'X-DNS-Prefetch-Control',
- 'X-Frame-Options',
- 'X-Permitted-Cross-Domain-Policies',
- 'X-Powered-By',
- 'X-Requested-With',
- 'X-XSS-Protection'
-]
-
-for (let i = 0; i < wellknownHeaderNames.length; ++i) {
- const key = wellknownHeaderNames[i]
- const lowerCasedKey = key.toLowerCase()
- headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
- lowerCasedKey
-}
+// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
+const maxAttributeValueSize = 1024
-// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
-Object.setPrototypeOf(headerNameLowerCasedRecord, null)
+// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
+const maxNameValuePairSize = 4096
module.exports = {
- wellknownHeaderNames,
- headerNameLowerCasedRecord
+ maxAttributeValueSize,
+ maxNameValuePairSize
}
/***/ }),
-/***/ 8045:
-/***/ ((module) => {
+/***/ 9061:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { parseSetCookie } = __nccwpck_require__(1978)
+const { stringify } = __nccwpck_require__(7797)
+const { webidl } = __nccwpck_require__(5893)
+const { Headers } = __nccwpck_require__(660)
+
+/**
+ * @typedef {Object} Cookie
+ * @property {string} name
+ * @property {string} value
+ * @property {Date|number|undefined} expires
+ * @property {number|undefined} maxAge
+ * @property {string|undefined} domain
+ * @property {string|undefined} path
+ * @property {boolean|undefined} secure
+ * @property {boolean|undefined} httpOnly
+ * @property {'Strict'|'Lax'|'None'} sameSite
+ * @property {string[]} unparsed
+ */
+
+/**
+ * @param {Headers} headers
+ * @returns {Record}
+ */
+function getCookies (headers) {
+ webidl.argumentLengthCheck(arguments, 1, 'getCookies')
-"use strict";
+ webidl.brandCheck(headers, Headers, { strict: false })
+ const cookie = headers.get('cookie')
+ const out = {}
-class UndiciError extends Error {
- constructor (message) {
- super(message)
- this.name = 'UndiciError'
- this.code = 'UND_ERR'
+ if (!cookie) {
+ return out
}
-}
-class ConnectTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ConnectTimeoutError)
- this.name = 'ConnectTimeoutError'
- this.message = message || 'Connect Timeout Error'
- this.code = 'UND_ERR_CONNECT_TIMEOUT'
- }
-}
+ for (const piece of cookie.split(';')) {
+ const [name, ...value] = piece.split('=')
-class HeadersTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, HeadersTimeoutError)
- this.name = 'HeadersTimeoutError'
- this.message = message || 'Headers Timeout Error'
- this.code = 'UND_ERR_HEADERS_TIMEOUT'
+ out[name.trim()] = value.join('=')
}
-}
-class HeadersOverflowError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, HeadersOverflowError)
- this.name = 'HeadersOverflowError'
- this.message = message || 'Headers Overflow Error'
- this.code = 'UND_ERR_HEADERS_OVERFLOW'
- }
+ return out
}
-class BodyTimeoutError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, BodyTimeoutError)
- this.name = 'BodyTimeoutError'
- this.message = message || 'Body Timeout Error'
- this.code = 'UND_ERR_BODY_TIMEOUT'
- }
-}
+/**
+ * @param {Headers} headers
+ * @param {string} name
+ * @param {{ path?: string, domain?: string }|undefined} attributes
+ * @returns {void}
+ */
+function deleteCookie (headers, name, attributes) {
+ webidl.brandCheck(headers, Headers, { strict: false })
-class ResponseStatusCodeError extends UndiciError {
- constructor (message, statusCode, headers, body) {
- super(message)
- Error.captureStackTrace(this, ResponseStatusCodeError)
- this.name = 'ResponseStatusCodeError'
- this.message = message || 'Response Status Code Error'
- this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
- this.body = body
- this.status = statusCode
- this.statusCode = statusCode
- this.headers = headers
- }
-}
+ const prefix = 'deleteCookie'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
-class InvalidArgumentError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InvalidArgumentError)
- this.name = 'InvalidArgumentError'
- this.message = message || 'Invalid Argument Error'
- this.code = 'UND_ERR_INVALID_ARG'
- }
-}
+ name = webidl.converters.DOMString(name, prefix, 'name')
+ attributes = webidl.converters.DeleteCookieAttributes(attributes)
-class InvalidReturnValueError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InvalidReturnValueError)
- this.name = 'InvalidReturnValueError'
- this.message = message || 'Invalid Return Value Error'
- this.code = 'UND_ERR_INVALID_RETURN_VALUE'
- }
+ // Matches behavior of
+ // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
+ setCookie(headers, {
+ name,
+ value: '',
+ expires: new Date(0),
+ ...attributes
+ })
}
-class RequestAbortedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, RequestAbortedError)
- this.name = 'AbortError'
- this.message = message || 'Request aborted'
- this.code = 'UND_ERR_ABORTED'
- }
-}
+/**
+ * @param {Headers} headers
+ * @returns {Cookie[]}
+ */
+function getSetCookies (headers) {
+ webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')
-class InformationalError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, InformationalError)
- this.name = 'InformationalError'
- this.message = message || 'Request information'
- this.code = 'UND_ERR_INFO'
- }
-}
+ webidl.brandCheck(headers, Headers, { strict: false })
-class RequestContentLengthMismatchError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, RequestContentLengthMismatchError)
- this.name = 'RequestContentLengthMismatchError'
- this.message = message || 'Request body length does not match content-length header'
- this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
- }
-}
+ const cookies = headers.getSetCookie()
-class ResponseContentLengthMismatchError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ResponseContentLengthMismatchError)
- this.name = 'ResponseContentLengthMismatchError'
- this.message = message || 'Response body length does not match content-length header'
- this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
+ if (!cookies) {
+ return []
}
-}
-class ClientDestroyedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ClientDestroyedError)
- this.name = 'ClientDestroyedError'
- this.message = message || 'The client is destroyed'
- this.code = 'UND_ERR_DESTROYED'
- }
+ return cookies.map((pair) => parseSetCookie(pair))
}
-class ClientClosedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ClientClosedError)
- this.name = 'ClientClosedError'
- this.message = message || 'The client is closed'
- this.code = 'UND_ERR_CLOSED'
- }
-}
+/**
+ * @param {Headers} headers
+ * @param {Cookie} cookie
+ * @returns {void}
+ */
+function setCookie (headers, cookie) {
+ webidl.argumentLengthCheck(arguments, 2, 'setCookie')
-class SocketError extends UndiciError {
- constructor (message, socket) {
- super(message)
- Error.captureStackTrace(this, SocketError)
- this.name = 'SocketError'
- this.message = message || 'Socket error'
- this.code = 'UND_ERR_SOCKET'
- this.socket = socket
- }
-}
+ webidl.brandCheck(headers, Headers, { strict: false })
-class NotSupportedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, NotSupportedError)
- this.name = 'NotSupportedError'
- this.message = message || 'Not supported error'
- this.code = 'UND_ERR_NOT_SUPPORTED'
- }
-}
+ cookie = webidl.converters.Cookie(cookie)
-class BalancedPoolMissingUpstreamError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, NotSupportedError)
- this.name = 'MissingUpstreamError'
- this.message = message || 'No upstream has been added to the BalancedPool'
- this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
- }
-}
+ const str = stringify(cookie)
-class HTTPParserError extends Error {
- constructor (message, code, data) {
- super(message)
- Error.captureStackTrace(this, HTTPParserError)
- this.name = 'HTTPParserError'
- this.code = code ? `HPE_${code}` : undefined
- this.data = data ? data.toString() : undefined
+ if (str) {
+ headers.append('Set-Cookie', str)
}
}
-class ResponseExceededMaxSizeError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, ResponseExceededMaxSizeError)
- this.name = 'ResponseExceededMaxSizeError'
- this.message = message || 'Response content exceeded max size'
- this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
+webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'path',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'domain',
+ defaultValue: () => null
}
-}
+])
-class RequestRetryError extends UndiciError {
- constructor (message, code, { headers, data }) {
- super(message)
- Error.captureStackTrace(this, RequestRetryError)
- this.name = 'RequestRetryError'
- this.message = message || 'Request retry error'
- this.code = 'UND_ERR_REQ_RETRY'
- this.statusCode = code
- this.data = data
- this.headers = headers
+webidl.converters.Cookie = webidl.dictionaryConverter([
+ {
+ converter: webidl.converters.DOMString,
+ key: 'name'
+ },
+ {
+ converter: webidl.converters.DOMString,
+ key: 'value'
+ },
+ {
+ converter: webidl.nullableConverter((value) => {
+ if (typeof value === 'number') {
+ return webidl.converters['unsigned long long'](value)
+ }
+
+ return new Date(value)
+ }),
+ key: 'expires',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters['long long']),
+ key: 'maxAge',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'domain',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.DOMString),
+ key: 'path',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.boolean),
+ key: 'secure',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.nullableConverter(webidl.converters.boolean),
+ key: 'httpOnly',
+ defaultValue: () => null
+ },
+ {
+ converter: webidl.converters.USVString,
+ key: 'sameSite',
+ allowedValues: ['Strict', 'Lax', 'None']
+ },
+ {
+ converter: webidl.sequenceConverter(webidl.converters.DOMString),
+ key: 'unparsed',
+ defaultValue: () => new Array(0)
}
-}
+])
module.exports = {
- HTTPParserError,
- UndiciError,
- HeadersTimeoutError,
- HeadersOverflowError,
- BodyTimeoutError,
- RequestContentLengthMismatchError,
- ConnectTimeoutError,
- ResponseStatusCodeError,
- InvalidArgumentError,
- InvalidReturnValueError,
- RequestAbortedError,
- ClientDestroyedError,
- ClientClosedError,
- InformationalError,
- SocketError,
- NotSupportedError,
- ResponseContentLengthMismatchError,
- BalancedPoolMissingUpstreamError,
- ResponseExceededMaxSizeError,
- RequestRetryError
+ getCookies,
+ deleteCookie,
+ getSetCookies,
+ setCookie
}
/***/ }),
-/***/ 2905:
+/***/ 1978:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-const {
- InvalidArgumentError,
- NotSupportedError
-} = __nccwpck_require__(8045)
-const assert = __nccwpck_require__(9491)
-const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
-const util = __nccwpck_require__(3983)
-
-// tokenRegExp and headerCharRegex have been lifted from
-// https://github.com/nodejs/node/blob/main/lib/_http_common.js
-/**
- * Verifies that the given val is a valid HTTP token
- * per the rules defined in RFC 7230
- * See https://tools.ietf.org/html/rfc7230#section-3.2.6
- */
-const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
+const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(1276)
+const { isCTLExcludingHtab } = __nccwpck_require__(7797)
+const { collectASequenceOfCodePointsFast } = __nccwpck_require__(1900)
+const assert = __nccwpck_require__(4589)
/**
- * Matches if val contains an invalid field-vchar
- * field-value = *( field-content / obs-fold )
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
- * field-vchar = VCHAR / obs-text
+ * @description Parses the field-value attributes of a set-cookie header string.
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
+ * @param {string} header
+ * @returns if the header is invalid, null will be returned
*/
-const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
+function parseSetCookie (header) {
+ // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
+ // character (CTL characters excluding HTAB): Abort these steps and
+ // ignore the set-cookie-string entirely.
+ if (isCTLExcludingHtab(header)) {
+ return null
+ }
-// Verifies that a given path is valid does not contain control chars \x00 to \x20
-const invalidPathRegex = /[^\u0021-\u00ff]/
+ let nameValuePair = ''
+ let unparsedAttributes = ''
+ let name = ''
+ let value = ''
-const kHandler = Symbol('handler')
+ // 2. If the set-cookie-string contains a %x3B (";") character:
+ if (header.includes(';')) {
+ // 1. The name-value-pair string consists of the characters up to,
+ // but not including, the first %x3B (";"), and the unparsed-
+ // attributes consist of the remainder of the set-cookie-string
+ // (including the %x3B (";") in question).
+ const position = { position: 0 }
-const channels = {}
+ nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
+ unparsedAttributes = header.slice(position.position)
+ } else {
+ // Otherwise:
-let extractBody
+ // 1. The name-value-pair string consists of all the characters
+ // contained in the set-cookie-string, and the unparsed-
+ // attributes is the empty string.
+ nameValuePair = header
+ }
-try {
- const diagnosticsChannel = __nccwpck_require__(7643)
- channels.create = diagnosticsChannel.channel('undici:request:create')
- channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
- channels.headers = diagnosticsChannel.channel('undici:request:headers')
- channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
- channels.error = diagnosticsChannel.channel('undici:request:error')
-} catch {
- channels.create = { hasSubscribers: false }
- channels.bodySent = { hasSubscribers: false }
- channels.headers = { hasSubscribers: false }
- channels.trailers = { hasSubscribers: false }
- channels.error = { hasSubscribers: false }
-}
+ // 3. If the name-value-pair string lacks a %x3D ("=") character, then
+ // the name string is empty, and the value string is the value of
+ // name-value-pair.
+ if (!nameValuePair.includes('=')) {
+ value = nameValuePair
+ } else {
+ // Otherwise, the name string consists of the characters up to, but
+ // not including, the first %x3D ("=") character, and the (possibly
+ // empty) value string consists of the characters after the first
+ // %x3D ("=") character.
+ const position = { position: 0 }
+ name = collectASequenceOfCodePointsFast(
+ '=',
+ nameValuePair,
+ position
+ )
+ value = nameValuePair.slice(position.position + 1)
+ }
-class Request {
- constructor (origin, {
- path,
- method,
- body,
- headers,
- query,
- idempotent,
- blocking,
- upgrade,
- headersTimeout,
- bodyTimeout,
- reset,
- throwOnError,
- expectContinue
- }, handler) {
- if (typeof path !== 'string') {
- throw new InvalidArgumentError('path must be a string')
- } else if (
- path[0] !== '/' &&
- !(path.startsWith('http://') || path.startsWith('https://')) &&
- method !== 'CONNECT'
- ) {
- throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
- } else if (invalidPathRegex.exec(path) !== null) {
- throw new InvalidArgumentError('invalid request path')
- }
+ // 4. Remove any leading or trailing WSP characters from the name
+ // string and the value string.
+ name = name.trim()
+ value = value.trim()
- if (typeof method !== 'string') {
- throw new InvalidArgumentError('method must be a string')
- } else if (tokenRegExp.exec(method) === null) {
- throw new InvalidArgumentError('invalid request method')
- }
+ // 5. If the sum of the lengths of the name string and the value string
+ // is more than 4096 octets, abort these steps and ignore the set-
+ // cookie-string entirely.
+ if (name.length + value.length > maxNameValuePairSize) {
+ return null
+ }
- if (upgrade && typeof upgrade !== 'string') {
- throw new InvalidArgumentError('upgrade must be a string')
- }
+ // 6. The cookie-name is the name string, and the cookie-value is the
+ // value string.
+ return {
+ name, value, ...parseUnparsedAttributes(unparsedAttributes)
+ }
+}
- if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
- throw new InvalidArgumentError('invalid headersTimeout')
- }
+/**
+ * Parses the remaining attributes of a set-cookie header
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
+ * @param {string} unparsedAttributes
+ * @param {[Object.]={}} cookieAttributeList
+ */
+function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
+ // 1. If the unparsed-attributes string is empty, skip the rest of
+ // these steps.
+ if (unparsedAttributes.length === 0) {
+ return cookieAttributeList
+ }
- if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
- throw new InvalidArgumentError('invalid bodyTimeout')
- }
+ // 2. Discard the first character of the unparsed-attributes (which
+ // will be a %x3B (";") character).
+ assert(unparsedAttributes[0] === ';')
+ unparsedAttributes = unparsedAttributes.slice(1)
- if (reset != null && typeof reset !== 'boolean') {
- throw new InvalidArgumentError('invalid reset')
- }
+ let cookieAv = ''
- if (expectContinue != null && typeof expectContinue !== 'boolean') {
- throw new InvalidArgumentError('invalid expectContinue')
- }
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
+ // character:
+ if (unparsedAttributes.includes(';')) {
+ // 1. Consume the characters of the unparsed-attributes up to, but
+ // not including, the first %x3B (";") character.
+ cookieAv = collectASequenceOfCodePointsFast(
+ ';',
+ unparsedAttributes,
+ { position: 0 }
+ )
+ unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
+ } else {
+ // Otherwise:
- this.headersTimeout = headersTimeout
+ // 1. Consume the remainder of the unparsed-attributes.
+ cookieAv = unparsedAttributes
+ unparsedAttributes = ''
+ }
- this.bodyTimeout = bodyTimeout
+ // Let the cookie-av string be the characters consumed in this step.
- this.throwOnError = throwOnError === true
+ let attributeName = ''
+ let attributeValue = ''
- this.method = method
+ // 4. If the cookie-av string contains a %x3D ("=") character:
+ if (cookieAv.includes('=')) {
+ // 1. The (possibly empty) attribute-name string consists of the
+ // characters up to, but not including, the first %x3D ("=")
+ // character, and the (possibly empty) attribute-value string
+ // consists of the characters after the first %x3D ("=")
+ // character.
+ const position = { position: 0 }
- this.abort = null
+ attributeName = collectASequenceOfCodePointsFast(
+ '=',
+ cookieAv,
+ position
+ )
+ attributeValue = cookieAv.slice(position.position + 1)
+ } else {
+ // Otherwise:
- if (body == null) {
- this.body = null
- } else if (util.isStream(body)) {
- this.body = body
+ // 1. The attribute-name string consists of the entire cookie-av
+ // string, and the attribute-value string is empty.
+ attributeName = cookieAv
+ }
- const rState = this.body._readableState
- if (!rState || !rState.autoDestroy) {
- this.endHandler = function autoDestroy () {
- util.destroy(this)
- }
- this.body.on('end', this.endHandler)
- }
+ // 5. Remove any leading or trailing WSP characters from the attribute-
+ // name string and the attribute-value string.
+ attributeName = attributeName.trim()
+ attributeValue = attributeValue.trim()
- this.errorHandler = err => {
- if (this.abort) {
- this.abort(err)
- } else {
- this.error = err
- }
- }
- this.body.on('error', this.errorHandler)
- } else if (util.isBuffer(body)) {
- this.body = body.byteLength ? body : null
- } else if (ArrayBuffer.isView(body)) {
- this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
- } else if (body instanceof ArrayBuffer) {
- this.body = body.byteLength ? Buffer.from(body) : null
- } else if (typeof body === 'string') {
- this.body = body.length ? Buffer.from(body) : null
- } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
- this.body = body
- } else {
- throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
- }
+ // 6. If the attribute-value is longer than 1024 octets, ignore the
+ // cookie-av string and return to Step 1 of this algorithm.
+ if (attributeValue.length > maxAttributeValueSize) {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+ }
- this.completed = false
+ // 7. Process the attribute-name and attribute-value according to the
+ // requirements in the following subsections. (Notice that
+ // attributes with unrecognized attribute-names are ignored.)
+ const attributeNameLowercase = attributeName.toLowerCase()
- this.aborted = false
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
+ // If the attribute-name case-insensitively matches the string
+ // "Expires", the user agent MUST process the cookie-av as follows.
+ if (attributeNameLowercase === 'expires') {
+ // 1. Let the expiry-time be the result of parsing the attribute-value
+ // as cookie-date (see Section 5.1.1).
+ const expiryTime = new Date(attributeValue)
- this.upgrade = upgrade || null
+ // 2. If the attribute-value failed to parse as a cookie date, ignore
+ // the cookie-av.
- this.path = query ? util.buildURL(path, query) : path
+ cookieAttributeList.expires = expiryTime
+ } else if (attributeNameLowercase === 'max-age') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
+ // If the attribute-name case-insensitively matches the string "Max-
+ // Age", the user agent MUST process the cookie-av as follows.
- this.origin = origin
+ // 1. If the first character of the attribute-value is not a DIGIT or a
+ // "-" character, ignore the cookie-av.
+ const charCode = attributeValue.charCodeAt(0)
- this.idempotent = idempotent == null
- ? method === 'HEAD' || method === 'GET'
- : idempotent
+ if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+ }
- this.blocking = blocking == null ? false : blocking
+ // 2. If the remainder of attribute-value contains a non-DIGIT
+ // character, ignore the cookie-av.
+ if (!/^\d+$/.test(attributeValue)) {
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+ }
- this.reset = reset == null ? null : reset
+ // 3. Let delta-seconds be the attribute-value converted to an integer.
+ const deltaSeconds = Number(attributeValue)
- this.host = null
+ // 4. Let cookie-age-limit be the maximum age of the cookie (which
+ // SHOULD be 400 days or less, see Section 4.1.2.2).
- this.contentLength = null
+ // 5. Set delta-seconds to the smaller of its present value and cookie-
+ // age-limit.
+ // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
- this.contentType = null
+ // 6. If delta-seconds is less than or equal to zero (0), let expiry-
+ // time be the earliest representable date and time. Otherwise, let
+ // the expiry-time be the current date and time plus delta-seconds
+ // seconds.
+ // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
- this.headers = ''
+ // 7. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Max-Age and an attribute-value of expiry-time.
+ cookieAttributeList.maxAge = deltaSeconds
+ } else if (attributeNameLowercase === 'domain') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
+ // If the attribute-name case-insensitively matches the string "Domain",
+ // the user agent MUST process the cookie-av as follows.
- // Only for H2
- this.expectContinue = expectContinue != null ? expectContinue : false
+ // 1. Let cookie-domain be the attribute-value.
+ let cookieDomain = attributeValue
- if (Array.isArray(headers)) {
- if (headers.length % 2 !== 0) {
- throw new InvalidArgumentError('headers array must be even')
- }
- for (let i = 0; i < headers.length; i += 2) {
- processHeader(this, headers[i], headers[i + 1])
- }
- } else if (headers && typeof headers === 'object') {
- const keys = Object.keys(headers)
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i]
- processHeader(this, key, headers[key])
- }
- } else if (headers != null) {
- throw new InvalidArgumentError('headers must be an object or an array')
+ // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
+ // cookie-domain without its leading %x2E (".").
+ if (cookieDomain[0] === '.') {
+ cookieDomain = cookieDomain.slice(1)
}
- if (util.isFormDataLike(this.body)) {
- if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
- throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
- }
+ // 3. Convert the cookie-domain to lower case.
+ cookieDomain = cookieDomain.toLowerCase()
- if (!extractBody) {
- extractBody = (__nccwpck_require__(1472).extractBody)
- }
+ // 4. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Domain and an attribute-value of cookie-domain.
+ cookieAttributeList.domain = cookieDomain
+ } else if (attributeNameLowercase === 'path') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
+ // If the attribute-name case-insensitively matches the string "Path",
+ // the user agent MUST process the cookie-av as follows.
- const [bodyStream, contentType] = extractBody(body)
- if (this.contentType == null) {
- this.contentType = contentType
- this.headers += `content-type: ${contentType}\r\n`
- }
- this.body = bodyStream.stream
- this.contentLength = bodyStream.length
- } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
- this.contentType = body.type
- this.headers += `content-type: ${body.type}\r\n`
+ // 1. If the attribute-value is empty or if the first character of the
+ // attribute-value is not %x2F ("/"):
+ let cookiePath = ''
+ if (attributeValue.length === 0 || attributeValue[0] !== '/') {
+ // 1. Let cookie-path be the default-path.
+ cookiePath = '/'
+ } else {
+ // Otherwise:
+
+ // 1. Let cookie-path be the attribute-value.
+ cookiePath = attributeValue
}
- util.validateHandler(handler, method, upgrade)
+ // 2. Append an attribute to the cookie-attribute-list with an
+ // attribute-name of Path and an attribute-value of cookie-path.
+ cookieAttributeList.path = cookiePath
+ } else if (attributeNameLowercase === 'secure') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
+ // If the attribute-name case-insensitively matches the string "Secure",
+ // the user agent MUST append an attribute to the cookie-attribute-list
+ // with an attribute-name of Secure and an empty attribute-value.
- this.servername = util.getServerName(this.host)
+ cookieAttributeList.secure = true
+ } else if (attributeNameLowercase === 'httponly') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
+ // If the attribute-name case-insensitively matches the string
+ // "HttpOnly", the user agent MUST append an attribute to the cookie-
+ // attribute-list with an attribute-name of HttpOnly and an empty
+ // attribute-value.
- this[kHandler] = handler
+ cookieAttributeList.httpOnly = true
+ } else if (attributeNameLowercase === 'samesite') {
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
+ // If the attribute-name case-insensitively matches the string
+ // "SameSite", the user agent MUST process the cookie-av as follows:
- if (channels.create.hasSubscribers) {
- channels.create.publish({ request: this })
- }
- }
+ const attributeValueLowercase = attributeValue.toLowerCase()
- onBodySent (chunk) {
- if (this[kHandler].onBodySent) {
- try {
- return this[kHandler].onBodySent(chunk)
- } catch (err) {
- this.abort(err)
- }
+ // 1. If cookie-av's attribute-value is a case-insensitive match for
+ // "None", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "None".
+ if (attributeValueLowercase === 'none') {
+ cookieAttributeList.sameSite = 'None'
+ } else if (attributeValueLowercase === 'strict') {
+ // 2. If cookie-av's attribute-value is a case-insensitive match for
+ // "Strict", append an attribute to the cookie-attribute-list with
+ // an attribute-name of "SameSite" and an attribute-value of
+ // "Strict".
+ cookieAttributeList.sameSite = 'Strict'
+ } else if (attributeValueLowercase === 'lax') {
+ // 3. If cookie-av's attribute-value is a case-insensitive match for
+ // "Lax", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "Lax".
+ cookieAttributeList.sameSite = 'Lax'
}
+ } else {
+ cookieAttributeList.unparsed ??= []
+
+ cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
}
- onRequestSent () {
- if (channels.bodySent.hasSubscribers) {
- channels.bodySent.publish({ request: this })
- }
+ // 8. Return to Step 1 of this algorithm.
+ return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
+}
- if (this[kHandler].onRequestSent) {
- try {
- return this[kHandler].onRequestSent()
- } catch (err) {
- this.abort(err)
- }
- }
- }
+module.exports = {
+ parseSetCookie,
+ parseUnparsedAttributes
+}
- onConnect (abort) {
- assert(!this.aborted)
- assert(!this.completed)
- if (this.error) {
- abort(this.error)
- } else {
- this.abort = abort
- return this[kHandler].onConnect(abort)
- }
- }
+/***/ }),
- onHeaders (statusCode, headers, resume, statusText) {
- assert(!this.aborted)
- assert(!this.completed)
+/***/ 7797:
+/***/ ((module) => {
- if (channels.headers.hasSubscribers) {
- channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
- }
- try {
- return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
- } catch (err) {
- this.abort(err)
- }
- }
- onData (chunk) {
- assert(!this.aborted)
- assert(!this.completed)
+/**
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isCTLExcludingHtab (value) {
+ for (let i = 0; i < value.length; ++i) {
+ const code = value.charCodeAt(i)
- try {
- return this[kHandler].onData(chunk)
- } catch (err) {
- this.abort(err)
- return false
+ if (
+ (code >= 0x00 && code <= 0x08) ||
+ (code >= 0x0A && code <= 0x1F) ||
+ code === 0x7F
+ ) {
+ return true
}
}
+ return false
+}
- onUpgrade (statusCode, headers, socket) {
- assert(!this.aborted)
- assert(!this.completed)
+/**
+ CHAR =
+ token = 1*
+ separators = "(" | ")" | "<" | ">" | "@"
+ | "," | ";" | ":" | "\" | <">
+ | "/" | "[" | "]" | "?" | "="
+ | "{" | "}" | SP | HT
+ * @param {string} name
+ */
+function validateCookieName (name) {
+ for (let i = 0; i < name.length; ++i) {
+ const code = name.charCodeAt(i)
- return this[kHandler].onUpgrade(statusCode, headers, socket)
+ if (
+ code < 0x21 || // exclude CTLs (0-31), SP and HT
+ code > 0x7E || // exclude non-ascii and DEL
+ code === 0x22 || // "
+ code === 0x28 || // (
+ code === 0x29 || // )
+ code === 0x3C || // <
+ code === 0x3E || // >
+ code === 0x40 || // @
+ code === 0x2C || // ,
+ code === 0x3B || // ;
+ code === 0x3A || // :
+ code === 0x5C || // \
+ code === 0x2F || // /
+ code === 0x5B || // [
+ code === 0x5D || // ]
+ code === 0x3F || // ?
+ code === 0x3D || // =
+ code === 0x7B || // {
+ code === 0x7D // }
+ ) {
+ throw new Error('Invalid cookie name')
+ }
}
+}
- onComplete (trailers) {
- this.onFinally()
-
- assert(!this.aborted)
-
- this.completed = true
- if (channels.trailers.hasSubscribers) {
- channels.trailers.publish({ request: this, trailers })
- }
+/**
+ cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
+ cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
+ ; US-ASCII characters excluding CTLs,
+ ; whitespace DQUOTE, comma, semicolon,
+ ; and backslash
+ * @param {string} value
+ */
+function validateCookieValue (value) {
+ let len = value.length
+ let i = 0
- try {
- return this[kHandler].onComplete(trailers)
- } catch (err) {
- // TODO (fix): This might be a bad idea?
- this.onError(err)
+ // if the value is wrapped in DQUOTE
+ if (value[0] === '"') {
+ if (len === 1 || value[len - 1] !== '"') {
+ throw new Error('Invalid cookie value')
}
+ --len
+ ++i
}
- onError (error) {
- this.onFinally()
-
- if (channels.error.hasSubscribers) {
- channels.error.publish({ request: this, error })
- }
+ while (i < len) {
+ const code = value.charCodeAt(i++)
- if (this.aborted) {
- return
+ if (
+ code < 0x21 || // exclude CTLs (0-31)
+ code > 0x7E || // non-ascii and DEL (127)
+ code === 0x22 || // "
+ code === 0x2C || // ,
+ code === 0x3B || // ;
+ code === 0x5C // \
+ ) {
+ throw new Error('Invalid cookie value')
}
- this.aborted = true
-
- return this[kHandler].onError(error)
}
+}
- onFinally () {
- if (this.errorHandler) {
- this.body.off('error', this.errorHandler)
- this.errorHandler = null
- }
+/**
+ * path-value =
+ * @param {string} path
+ */
+function validateCookiePath (path) {
+ for (let i = 0; i < path.length; ++i) {
+ const code = path.charCodeAt(i)
- if (this.endHandler) {
- this.body.off('end', this.endHandler)
- this.endHandler = null
+ if (
+ code < 0x20 || // exclude CTLs (0-31)
+ code === 0x7F || // DEL
+ code === 0x3B // ;
+ ) {
+ throw new Error('Invalid cookie path')
}
}
+}
- // TODO: adjust to support H2
- addHeader (key, value) {
- processHeader(this, key, value)
- return this
+/**
+ * I have no idea why these values aren't allowed to be honest,
+ * but Deno tests these. - Khafra
+ * @param {string} domain
+ */
+function validateCookieDomain (domain) {
+ if (
+ domain.startsWith('-') ||
+ domain.endsWith('.') ||
+ domain.endsWith('-')
+ ) {
+ throw new Error('Invalid cookie domain')
}
+}
- static [kHTTP1BuildRequest] (origin, opts, handler) {
- // TODO: Migrate header parsing here, to make Requests
- // HTTP agnostic
- return new Request(origin, opts, handler)
- }
+const IMFDays = [
+ 'Sun', 'Mon', 'Tue', 'Wed',
+ 'Thu', 'Fri', 'Sat'
+]
- static [kHTTP2BuildRequest] (origin, opts, handler) {
- const headers = opts.headers
- opts = { ...opts, headers: null }
+const IMFMonths = [
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
+]
- const request = new Request(origin, opts, handler)
+const IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))
- request.headers = {}
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
+ * @param {number|Date} date
+ IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
+ ; fixed length/zone/capitalization subset of the format
+ ; see Section 3.3 of [RFC5322]
- if (Array.isArray(headers)) {
- if (headers.length % 2 !== 0) {
- throw new InvalidArgumentError('headers array must be even')
- }
- for (let i = 0; i < headers.length; i += 2) {
- processHeader(request, headers[i], headers[i + 1], true)
- }
- } else if (headers && typeof headers === 'object') {
- const keys = Object.keys(headers)
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i]
- processHeader(request, key, headers[key], true)
- }
- } else if (headers != null) {
- throw new InvalidArgumentError('headers must be an object or an array')
- }
+ day-name = %x4D.6F.6E ; "Mon", case-sensitive
+ / %x54.75.65 ; "Tue", case-sensitive
+ / %x57.65.64 ; "Wed", case-sensitive
+ / %x54.68.75 ; "Thu", case-sensitive
+ / %x46.72.69 ; "Fri", case-sensitive
+ / %x53.61.74 ; "Sat", case-sensitive
+ / %x53.75.6E ; "Sun", case-sensitive
+ date1 = day SP month SP year
+ ; e.g., 02 Jun 1982
- return request
- }
+ day = 2DIGIT
+ month = %x4A.61.6E ; "Jan", case-sensitive
+ / %x46.65.62 ; "Feb", case-sensitive
+ / %x4D.61.72 ; "Mar", case-sensitive
+ / %x41.70.72 ; "Apr", case-sensitive
+ / %x4D.61.79 ; "May", case-sensitive
+ / %x4A.75.6E ; "Jun", case-sensitive
+ / %x4A.75.6C ; "Jul", case-sensitive
+ / %x41.75.67 ; "Aug", case-sensitive
+ / %x53.65.70 ; "Sep", case-sensitive
+ / %x4F.63.74 ; "Oct", case-sensitive
+ / %x4E.6F.76 ; "Nov", case-sensitive
+ / %x44.65.63 ; "Dec", case-sensitive
+ year = 4DIGIT
- static [kHTTP2CopyHeaders] (raw) {
- const rawHeaders = raw.split('\r\n')
- const headers = {}
+ GMT = %x47.4D.54 ; "GMT", case-sensitive
- for (const header of rawHeaders) {
- const [key, value] = header.split(': ')
+ time-of-day = hour ":" minute ":" second
+ ; 00:00:00 - 23:59:60 (leap second)
- if (value == null || value.length === 0) continue
+ hour = 2DIGIT
+ minute = 2DIGIT
+ second = 2DIGIT
+ */
+function toIMFDate (date) {
+ if (typeof date === 'number') {
+ date = new Date(date)
+ }
- if (headers[key]) headers[key] += `,${value}`
- else headers[key] = value
- }
+ return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`
+}
- return headers
+/**
+ max-age-av = "Max-Age=" non-zero-digit *DIGIT
+ ; In practice, both expires-av and max-age-av
+ ; are limited to dates representable by the
+ ; user agent.
+ * @param {number} maxAge
+ */
+function validateCookieMaxAge (maxAge) {
+ if (maxAge < 0) {
+ throw new Error('Invalid cookie max-age')
}
}
-function processHeaderValue (key, val, skipAppend) {
- if (val && typeof val === 'object') {
- throw new InvalidArgumentError(`invalid ${key} header`)
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
+ * @param {import('./index').Cookie} cookie
+ */
+function stringify (cookie) {
+ if (cookie.name.length === 0) {
+ return null
}
- val = val != null ? `${val}` : ''
+ validateCookieName(cookie.name)
+ validateCookieValue(cookie.value)
- if (headerCharRegex.exec(val) !== null) {
- throw new InvalidArgumentError(`invalid ${key} header`)
- }
+ const out = [`${cookie.name}=${cookie.value}`]
- return skipAppend ? val : `${key}: ${val}\r\n`
-}
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
+ // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
+ if (cookie.name.startsWith('__Secure-')) {
+ cookie.secure = true
+ }
-function processHeader (request, key, val, skipAppend = false) {
- if (val && (typeof val === 'object' && !Array.isArray(val))) {
- throw new InvalidArgumentError(`invalid ${key} header`)
- } else if (val === undefined) {
- return
+ if (cookie.name.startsWith('__Host-')) {
+ cookie.secure = true
+ cookie.domain = null
+ cookie.path = '/'
}
- if (
- request.host === null &&
- key.length === 4 &&
- key.toLowerCase() === 'host'
- ) {
- if (headerCharRegex.exec(val) !== null) {
- throw new InvalidArgumentError(`invalid ${key} header`)
- }
- // Consumed by Client
- request.host = val
- } else if (
- request.contentLength === null &&
- key.length === 14 &&
- key.toLowerCase() === 'content-length'
- ) {
- request.contentLength = parseInt(val, 10)
- if (!Number.isFinite(request.contentLength)) {
- throw new InvalidArgumentError('invalid content-length header')
- }
- } else if (
- request.contentType === null &&
- key.length === 12 &&
- key.toLowerCase() === 'content-type'
- ) {
- request.contentType = val
- if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
- else request.headers += processHeaderValue(key, val)
- } else if (
- key.length === 17 &&
- key.toLowerCase() === 'transfer-encoding'
- ) {
- throw new InvalidArgumentError('invalid transfer-encoding header')
- } else if (
- key.length === 10 &&
- key.toLowerCase() === 'connection'
- ) {
- const value = typeof val === 'string' ? val.toLowerCase() : null
- if (value !== 'close' && value !== 'keep-alive') {
- throw new InvalidArgumentError('invalid connection header')
- } else if (value === 'close') {
- request.reset = true
- }
- } else if (
- key.length === 10 &&
- key.toLowerCase() === 'keep-alive'
- ) {
- throw new InvalidArgumentError('invalid keep-alive header')
- } else if (
- key.length === 7 &&
- key.toLowerCase() === 'upgrade'
- ) {
- throw new InvalidArgumentError('invalid upgrade header')
- } else if (
- key.length === 6 &&
- key.toLowerCase() === 'expect'
- ) {
- throw new NotSupportedError('expect header not supported')
- } else if (tokenRegExp.exec(key) === null) {
- throw new InvalidArgumentError('invalid header key')
- } else {
- if (Array.isArray(val)) {
- for (let i = 0; i < val.length; i++) {
- if (skipAppend) {
- if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
- else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
- } else {
- request.headers += processHeaderValue(key, val[i])
- }
- }
- } else {
- if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
- else request.headers += processHeaderValue(key, val)
- }
+ if (cookie.secure) {
+ out.push('Secure')
}
-}
-module.exports = Request
+ if (cookie.httpOnly) {
+ out.push('HttpOnly')
+ }
+ if (typeof cookie.maxAge === 'number') {
+ validateCookieMaxAge(cookie.maxAge)
+ out.push(`Max-Age=${cookie.maxAge}`)
+ }
-/***/ }),
+ if (cookie.domain) {
+ validateCookieDomain(cookie.domain)
+ out.push(`Domain=${cookie.domain}`)
+ }
-/***/ 2785:
-/***/ ((module) => {
+ if (cookie.path) {
+ validateCookiePath(cookie.path)
+ out.push(`Path=${cookie.path}`)
+ }
-module.exports = {
- kClose: Symbol('close'),
- kDestroy: Symbol('destroy'),
- kDispatch: Symbol('dispatch'),
- kUrl: Symbol('url'),
- kWriting: Symbol('writing'),
- kResuming: Symbol('resuming'),
- kQueue: Symbol('queue'),
- kConnect: Symbol('connect'),
- kConnecting: Symbol('connecting'),
- kHeadersList: Symbol('headers list'),
- kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
- kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
- kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
- kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
- kKeepAlive: Symbol('keep alive'),
- kHeadersTimeout: Symbol('headers timeout'),
- kBodyTimeout: Symbol('body timeout'),
- kServerName: Symbol('server name'),
- kLocalAddress: Symbol('local address'),
- kHost: Symbol('host'),
- kNoRef: Symbol('no ref'),
- kBodyUsed: Symbol('used'),
- kRunning: Symbol('running'),
- kBlocking: Symbol('blocking'),
- kPending: Symbol('pending'),
- kSize: Symbol('size'),
- kBusy: Symbol('busy'),
- kQueued: Symbol('queued'),
- kFree: Symbol('free'),
- kConnected: Symbol('connected'),
- kClosed: Symbol('closed'),
- kNeedDrain: Symbol('need drain'),
- kReset: Symbol('reset'),
- kDestroyed: Symbol.for('nodejs.stream.destroyed'),
- kMaxHeadersSize: Symbol('max headers size'),
- kRunningIdx: Symbol('running index'),
- kPendingIdx: Symbol('pending index'),
- kError: Symbol('error'),
- kClients: Symbol('clients'),
- kClient: Symbol('client'),
- kParser: Symbol('parser'),
- kOnDestroyed: Symbol('destroy callbacks'),
- kPipelining: Symbol('pipelining'),
- kSocket: Symbol('socket'),
- kHostHeader: Symbol('host header'),
- kConnector: Symbol('connector'),
- kStrictContentLength: Symbol('strict content length'),
- kMaxRedirections: Symbol('maxRedirections'),
- kMaxRequests: Symbol('maxRequestsPerClient'),
- kProxy: Symbol('proxy agent options'),
- kCounter: Symbol('socket request counter'),
- kInterceptors: Symbol('dispatch interceptors'),
- kMaxResponseSize: Symbol('max response size'),
- kHTTP2Session: Symbol('http2Session'),
- kHTTP2SessionState: Symbol('http2Session state'),
- kHTTP2BuildRequest: Symbol('http2 build request'),
- kHTTP1BuildRequest: Symbol('http1 build request'),
- kHTTP2CopyHeaders: Symbol('http2 copy headers'),
- kHTTPConnVersion: Symbol('http connection version'),
- kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
- kConstruct: Symbol('constructable')
+ if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
+ out.push(`Expires=${toIMFDate(cookie.expires)}`)
+ }
+
+ if (cookie.sameSite) {
+ out.push(`SameSite=${cookie.sameSite}`)
+ }
+
+ for (const part of cookie.unparsed) {
+ if (!part.includes('=')) {
+ throw new Error('Invalid unparsed')
+ }
+
+ const [key, ...value] = part.split('=')
+
+ out.push(`${key.trim()}=${value.join('=')}`)
+ }
+
+ return out.join('; ')
+}
+
+module.exports = {
+ isCTLExcludingHtab,
+ validateCookieName,
+ validateCookiePath,
+ validateCookieValue,
+ toIMFDate,
+ stringify
}
/***/ }),
-/***/ 3983:
+/***/ 4031:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+const { Transform } = __nccwpck_require__(7075)
+const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(4811)
-const assert = __nccwpck_require__(9491)
-const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
-const { IncomingMessage } = __nccwpck_require__(3685)
-const stream = __nccwpck_require__(2781)
-const net = __nccwpck_require__(1808)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { Blob } = __nccwpck_require__(4300)
-const nodeUtil = __nccwpck_require__(3837)
-const { stringify } = __nccwpck_require__(3477)
-const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
-
-const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
-
-function nop () {}
+/**
+ * @type {number[]} BOM
+ */
+const BOM = [0xEF, 0xBB, 0xBF]
+/**
+ * @type {10} LF
+ */
+const LF = 0x0A
+/**
+ * @type {13} CR
+ */
+const CR = 0x0D
+/**
+ * @type {58} COLON
+ */
+const COLON = 0x3A
+/**
+ * @type {32} SPACE
+ */
+const SPACE = 0x20
-function isStream (obj) {
- return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
-}
+/**
+ * @typedef {object} EventSourceStreamEvent
+ * @type {object}
+ * @property {string} [event] The event type.
+ * @property {string} [data] The data of the message.
+ * @property {string} [id] A unique ID for the event.
+ * @property {string} [retry] The reconnection time, in milliseconds.
+ */
-// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
-function isBlobLike (object) {
- return (Blob && object instanceof Blob) || (
- object &&
- typeof object === 'object' &&
- (typeof object.stream === 'function' ||
- typeof object.arrayBuffer === 'function') &&
- /^(Blob|File)$/.test(object[Symbol.toStringTag])
- )
-}
+/**
+ * @typedef eventSourceSettings
+ * @type {object}
+ * @property {string} lastEventId The last event ID received from the server.
+ * @property {string} origin The origin of the event source.
+ * @property {number} reconnectionTime The reconnection time, in milliseconds.
+ */
-function buildURL (url, queryParams) {
- if (url.includes('?') || url.includes('#')) {
- throw new Error('Query params cannot be passed when url already contains "?" or "#".')
- }
+class EventSourceStream extends Transform {
+ /**
+ * @type {eventSourceSettings}
+ */
+ state = null
- const stringified = stringify(queryParams)
+ /**
+ * Leading byte-order-mark check.
+ * @type {boolean}
+ */
+ checkBOM = true
- if (stringified) {
- url += '?' + stringified
- }
+ /**
+ * @type {boolean}
+ */
+ crlfCheck = false
- return url
-}
+ /**
+ * @type {boolean}
+ */
+ eventEndCheck = false
-function parseURL (url) {
- if (typeof url === 'string') {
- url = new URL(url)
+ /**
+ * @type {Buffer}
+ */
+ buffer = null
- if (!/^https?:/.test(url.origin || url.protocol)) {
- throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
- }
+ pos = 0
- return url
+ event = {
+ data: undefined,
+ event: undefined,
+ id: undefined,
+ retry: undefined
}
- if (!url || typeof url !== 'object') {
- throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
- }
+ /**
+ * @param {object} options
+ * @param {eventSourceSettings} options.eventSourceSettings
+ * @param {Function} [options.push]
+ */
+ constructor (options = {}) {
+ // Enable object mode as EventSourceStream emits objects of shape
+ // EventSourceStreamEvent
+ options.readableObjectMode = true
- if (!/^https?:/.test(url.origin || url.protocol)) {
- throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
- }
+ super(options)
- if (!(url instanceof URL)) {
- if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
- throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
+ this.state = options.eventSourceSettings || {}
+ if (options.push) {
+ this.push = options.push
}
+ }
- if (url.path != null && typeof url.path !== 'string') {
- throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
+ /**
+ * @param {Buffer} chunk
+ * @param {string} _encoding
+ * @param {Function} callback
+ * @returns {void}
+ */
+ _transform (chunk, _encoding, callback) {
+ if (chunk.length === 0) {
+ callback()
+ return
}
- if (url.pathname != null && typeof url.pathname !== 'string') {
- throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
+ // Cache the chunk in the buffer, as the data might not be complete while
+ // processing it
+ // TODO: Investigate if there is a more performant way to handle
+ // incoming chunks
+ // see: https://github.com/nodejs/undici/issues/2630
+ if (this.buffer) {
+ this.buffer = Buffer.concat([this.buffer, chunk])
+ } else {
+ this.buffer = chunk
}
- if (url.hostname != null && typeof url.hostname !== 'string') {
- throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
- }
+ // Strip leading byte-order-mark if we opened the stream and started
+ // the processing of the incoming data
+ if (this.checkBOM) {
+ switch (this.buffer.length) {
+ case 1:
+ // Check if the first byte is the same as the first byte of the BOM
+ if (this.buffer[0] === BOM[0]) {
+ // If it is, we need to wait for more data
+ callback()
+ return
+ }
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
- if (url.origin != null && typeof url.origin !== 'string') {
- throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
- }
+ // The buffer only contains one byte so we need to wait for more data
+ callback()
+ return
+ case 2:
+ // Check if the first two bytes are the same as the first two bytes
+ // of the BOM
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1]
+ ) {
+ // If it is, we need to wait for more data, because the third byte
+ // is needed to determine if it is the BOM or not
+ callback()
+ return
+ }
- const port = url.port != null
- ? url.port
- : (url.protocol === 'https:' ? 443 : 80)
- let origin = url.origin != null
- ? url.origin
- : `${url.protocol}//${url.hostname}:${port}`
- let path = url.path != null
- ? url.path
- : `${url.pathname || ''}${url.search || ''}`
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
+ break
+ case 3:
+ // Check if the first three bytes are the same as the first three
+ // bytes of the BOM
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1] &&
+ this.buffer[2] === BOM[2]
+ ) {
+ // If it is, we can drop the buffered data, as it is only the BOM
+ this.buffer = Buffer.alloc(0)
+ // Set the checkBOM flag to false as we don't need to check for the
+ // BOM anymore
+ this.checkBOM = false
- if (origin.endsWith('/')) {
- origin = origin.substring(0, origin.length - 1)
- }
+ // Await more data
+ callback()
+ return
+ }
+ // If it is not the BOM, we can start processing the data
+ this.checkBOM = false
+ break
+ default:
+ // The buffer is longer than 3 bytes, so we can drop the BOM if it is
+ // present
+ if (
+ this.buffer[0] === BOM[0] &&
+ this.buffer[1] === BOM[1] &&
+ this.buffer[2] === BOM[2]
+ ) {
+ // Remove the BOM from the buffer
+ this.buffer = this.buffer.subarray(3)
+ }
- if (path && !path.startsWith('/')) {
- path = `/${path}`
+ // Set the checkBOM flag to false as we don't need to check for the
+ this.checkBOM = false
+ break
+ }
}
- // new URL(path, origin) is unsafe when `path` contains an absolute URL
- // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
- // If first parameter is a relative URL, second param is required, and will be used as the base URL.
- // If first parameter is an absolute URL, a given second param will be ignored.
- url = new URL(origin + path)
- }
- return url
-}
+ while (this.pos < this.buffer.length) {
+ // If the previous line ended with an end-of-line, we need to check
+ // if the next character is also an end-of-line.
+ if (this.eventEndCheck) {
+ // If the the current character is an end-of-line, then the event
+ // is finished and we can process it
+
+ // If the previous line ended with a carriage return, we need to
+ // check if the current character is a line feed and remove it
+ // from the buffer.
+ if (this.crlfCheck) {
+ // If the current character is a line feed, we can remove it
+ // from the buffer and reset the crlfCheck flag
+ if (this.buffer[this.pos] === LF) {
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ this.pos = 0
+ this.crlfCheck = false
+
+ // It is possible that the line feed is not the end of the
+ // event. We need to check if the next character is an
+ // end-of-line character to determine if the event is
+ // finished. We simply continue the loop to check the next
+ // character.
+
+ // As we removed the line feed from the buffer and set the
+ // crlfCheck flag to false, we basically don't make any
+ // distinction between a line feed and a carriage return.
+ continue
+ }
+ this.crlfCheck = false
+ }
-function parseOrigin (url) {
- url = parseURL(url)
+ if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+ // If the current character is a carriage return, we need to
+ // set the crlfCheck flag to true, as we need to check if the
+ // next character is a line feed so we can remove it from the
+ // buffer
+ if (this.buffer[this.pos] === CR) {
+ this.crlfCheck = true
+ }
- if (url.pathname !== '/' || url.search || url.hash) {
- throw new InvalidArgumentError('invalid url')
- }
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ this.pos = 0
+ if (
+ this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
+ this.processEvent(this.event)
+ }
+ this.clearEvent()
+ continue
+ }
+ // If the current character is not an end-of-line, then the event
+ // is not finished and we have to reset the eventEndCheck flag
+ this.eventEndCheck = false
+ continue
+ }
- return url
-}
+ // If the current character is an end-of-line, we can process the
+ // line
+ if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+ // If the current character is a carriage return, we need to
+ // set the crlfCheck flag to true, as we need to check if the
+ // next character is a line feed
+ if (this.buffer[this.pos] === CR) {
+ this.crlfCheck = true
+ }
-function getHostname (host) {
- if (host[0] === '[') {
- const idx = host.indexOf(']')
+ // In any case, we can process the line as we reached an
+ // end-of-line character
+ this.parseLine(this.buffer.subarray(0, this.pos), this.event)
+
+ // Remove the processed line from the buffer
+ this.buffer = this.buffer.subarray(this.pos + 1)
+ // Reset the position as we removed the processed line from the buffer
+ this.pos = 0
+ // A line was processed and this could be the end of the event. We need
+ // to check if the next line is empty to determine if the event is
+ // finished.
+ this.eventEndCheck = true
+ continue
+ }
- assert(idx !== -1)
- return host.substring(1, idx)
+ this.pos++
+ }
+
+ callback()
}
- const idx = host.indexOf(':')
- if (idx === -1) return host
+ /**
+ * @param {Buffer} line
+ * @param {EventStreamEvent} event
+ */
+ parseLine (line, event) {
+ // If the line is empty (a blank line)
+ // Dispatch the event, as defined below.
+ // This will be handled in the _transform method
+ if (line.length === 0) {
+ return
+ }
- return host.substring(0, idx)
-}
+ // If the line starts with a U+003A COLON character (:)
+ // Ignore the line.
+ const colonPosition = line.indexOf(COLON)
+ if (colonPosition === 0) {
+ return
+ }
-// IP addresses are not valid server names per RFC6066
-// > Currently, the only server names supported are DNS hostnames
-function getServerName (host) {
- if (!host) {
- return null
+ let field = ''
+ let value = ''
+
+ // If the line contains a U+003A COLON character (:)
+ if (colonPosition !== -1) {
+ // Collect the characters on the line before the first U+003A COLON
+ // character (:), and let field be that string.
+ // TODO: Investigate if there is a more performant way to extract the
+ // field
+ // see: https://github.com/nodejs/undici/issues/2630
+ field = line.subarray(0, colonPosition).toString('utf8')
+
+ // Collect the characters on the line after the first U+003A COLON
+ // character (:), and let value be that string.
+ // If value starts with a U+0020 SPACE character, remove it from value.
+ let valueStart = colonPosition + 1
+ if (line[valueStart] === SPACE) {
+ ++valueStart
+ }
+ // TODO: Investigate if there is a more performant way to extract the
+ // value
+ // see: https://github.com/nodejs/undici/issues/2630
+ value = line.subarray(valueStart).toString('utf8')
+
+ // Otherwise, the string is not empty but does not contain a U+003A COLON
+ // character (:)
+ } else {
+ // Process the field using the steps described below, using the whole
+ // line as the field name, and the empty string as the field value.
+ field = line.toString('utf8')
+ value = ''
+ }
+
+ // Modify the event with the field name and value. The value is also
+ // decoded as UTF-8
+ switch (field) {
+ case 'data':
+ if (event[field] === undefined) {
+ event[field] = value
+ } else {
+ event[field] += `\n${value}`
+ }
+ break
+ case 'retry':
+ if (isASCIINumber(value)) {
+ event[field] = value
+ }
+ break
+ case 'id':
+ if (isValidLastEventId(value)) {
+ event[field] = value
+ }
+ break
+ case 'event':
+ if (value.length > 0) {
+ event[field] = value
+ }
+ break
+ }
}
- assert.strictEqual(typeof host, 'string')
+ /**
+ * @param {EventSourceStreamEvent} event
+ */
+ processEvent (event) {
+ if (event.retry && isASCIINumber(event.retry)) {
+ this.state.reconnectionTime = parseInt(event.retry, 10)
+ }
- const servername = getHostname(host)
- if (net.isIP(servername)) {
- return ''
+ if (event.id && isValidLastEventId(event.id)) {
+ this.state.lastEventId = event.id
+ }
+
+ // only dispatch event, when data is provided
+ if (event.data !== undefined) {
+ this.push({
+ type: event.event || 'message',
+ options: {
+ data: event.data,
+ lastEventId: this.state.lastEventId,
+ origin: this.state.origin
+ }
+ })
+ }
}
- return servername
+ clearEvent () {
+ this.event = {
+ data: undefined,
+ event: undefined,
+ id: undefined,
+ retry: undefined
+ }
+ }
}
-function deepClone (obj) {
- return JSON.parse(JSON.stringify(obj))
+module.exports = {
+ EventSourceStream
}
-function isAsyncIterable (obj) {
- return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
-}
-function isIterable (obj) {
- return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
-}
+/***/ }),
-function bodyLength (body) {
- if (body == null) {
- return 0
- } else if (isStream(body)) {
- const state = body._readableState
- return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
- ? state.length
- : null
- } else if (isBlobLike(body)) {
- return body.size != null ? body.size : null
- } else if (isBuffer(body)) {
- return body.byteLength
- }
+/***/ 1238:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return null
-}
-function isDestroyed (stream) {
- return !stream || !!(stream.destroyed || stream[kDestroyed])
-}
-function isReadableAborted (stream) {
- const state = stream && stream._readableState
- return isDestroyed(stream) && state && !state.endEmitted
-}
+const { pipeline } = __nccwpck_require__(7075)
+const { fetching } = __nccwpck_require__(4398)
+const { makeRequest } = __nccwpck_require__(9967)
+const { webidl } = __nccwpck_require__(5893)
+const { EventSourceStream } = __nccwpck_require__(4031)
+const { parseMIMEType } = __nccwpck_require__(1900)
+const { createFastMessageEvent } = __nccwpck_require__(5188)
+const { isNetworkError } = __nccwpck_require__(9051)
+const { delay } = __nccwpck_require__(4811)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { environmentSettingsObject } = __nccwpck_require__(3168)
-function destroy (stream, err) {
- if (stream == null || !isStream(stream) || isDestroyed(stream)) {
- return
- }
+let experimentalWarned = false
- if (typeof stream.destroy === 'function') {
- if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
- // See: https://github.com/nodejs/node/pull/38505/files
- stream.socket = null
- }
+/**
+ * A reconnection time, in milliseconds. This must initially be an implementation-defined value,
+ * probably in the region of a few seconds.
+ *
+ * In Comparison:
+ * - Chrome uses 3000ms.
+ * - Deno uses 5000ms.
+ *
+ * @type {3000}
+ */
+const defaultReconnectionTime = 3000
- stream.destroy(err)
- } else if (err) {
- process.nextTick((stream, err) => {
- stream.emit('error', err)
- }, stream, err)
- }
+/**
+ * The readyState attribute represents the state of the connection.
+ * @enum
+ * @readonly
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev
+ */
- if (stream.destroyed !== true) {
- stream[kDestroyed] = true
- }
-}
+/**
+ * The connection has not yet been established, or it was closed and the user
+ * agent is reconnecting.
+ * @type {0}
+ */
+const CONNECTING = 0
-const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
-function parseKeepAliveTimeout (val) {
- const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
- return m ? parseInt(m[1], 10) * 1000 : null
-}
+/**
+ * The user agent has an open connection and is dispatching events as it
+ * receives them.
+ * @type {1}
+ */
+const OPEN = 1
/**
- * Retrieves a header name and returns its lowercase value.
- * @param {string | Buffer} value Header name
- * @returns {string}
+ * The connection is not open, and the user agent is not trying to reconnect.
+ * @type {2}
*/
-function headerNameToString (value) {
- return headerNameLowerCasedRecord[value] || value.toLowerCase()
-}
+const CLOSED = 2
-function parseHeaders (headers, obj = {}) {
- // For H2 support
- if (!Array.isArray(headers)) return headers
+/**
+ * Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin".
+ * @type {'anonymous'}
+ */
+const ANONYMOUS = 'anonymous'
- for (let i = 0; i < headers.length; i += 2) {
- const key = headers[i].toString().toLowerCase()
- let val = obj[key]
+/**
+ * Requests for the element will have their mode set to "cors" and their credentials mode set to "include".
+ * @type {'use-credentials'}
+ */
+const USE_CREDENTIALS = 'use-credentials'
- if (!val) {
- if (Array.isArray(headers[i + 1])) {
- obj[key] = headers[i + 1].map(x => x.toString('utf8'))
- } else {
- obj[key] = headers[i + 1].toString('utf8')
- }
- } else {
- if (!Array.isArray(val)) {
- val = [val]
- obj[key] = val
- }
- val.push(headers[i + 1].toString('utf8'))
- }
+/**
+ * The EventSource interface is used to receive server-sent events. It
+ * connects to a server over HTTP and receives events in text/event-stream
+ * format without closing the connection.
+ * @extends {EventTarget}
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
+ * @api public
+ */
+class EventSource extends EventTarget {
+ #events = {
+ open: null,
+ error: null,
+ message: null
}
- // See https://github.com/nodejs/node/pull/46528
- if ('content-length' in obj && 'content-disposition' in obj) {
- obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
- }
+ #url = null
+ #withCredentials = false
- return obj
-}
+ #readyState = CONNECTING
-function parseRawHeaders (headers) {
- const ret = []
- let hasContentLength = false
- let contentDispositionIdx = -1
+ #request = null
+ #controller = null
- for (let n = 0; n < headers.length; n += 2) {
- const key = headers[n + 0].toString()
- const val = headers[n + 1].toString('utf8')
+ #dispatcher
- if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
- ret.push(key, val)
- hasContentLength = true
- } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
- contentDispositionIdx = ret.push(key, val) - 1
- } else {
- ret.push(key, val)
- }
- }
+ /**
+ * @type {import('./eventsource-stream').eventSourceSettings}
+ */
+ #state
- // See https://github.com/nodejs/node/pull/46528
- if (hasContentLength && contentDispositionIdx !== -1) {
- ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
- }
+ /**
+ * Creates a new EventSource object.
+ * @param {string} url
+ * @param {EventSourceInit} [eventSourceInitDict]
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface
+ */
+ constructor (url, eventSourceInitDict = {}) {
+ // 1. Let ev be a new EventSource object.
+ super()
- return ret
-}
+ webidl.util.markAsUncloneable(this)
-function isBuffer (buffer) {
- // See, https://github.com/mcollina/undici/pull/319
- return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
-}
+ const prefix = 'EventSource constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-function validateHandler (handler, method, upgrade) {
- if (!handler || typeof handler !== 'object') {
- throw new InvalidArgumentError('handler must be an object')
- }
+ if (!experimentalWarned) {
+ experimentalWarned = true
+ process.emitWarning('EventSource is experimental, expect them to change at any time.', {
+ code: 'UNDICI-ES'
+ })
+ }
- if (typeof handler.onConnect !== 'function') {
- throw new InvalidArgumentError('invalid onConnect method')
- }
+ url = webidl.converters.USVString(url, prefix, 'url')
+ eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')
- if (typeof handler.onError !== 'function') {
- throw new InvalidArgumentError('invalid onError method')
- }
+ this.#dispatcher = eventSourceInitDict.dispatcher
+ this.#state = {
+ lastEventId: '',
+ reconnectionTime: defaultReconnectionTime
+ }
- if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
- throw new InvalidArgumentError('invalid onBodySent method')
- }
+ // 2. Let settings be ev's relevant settings object.
+ // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
+ const settings = environmentSettingsObject
- if (upgrade || method === 'CONNECT') {
- if (typeof handler.onUpgrade !== 'function') {
- throw new InvalidArgumentError('invalid onUpgrade method')
- }
- } else {
- if (typeof handler.onHeaders !== 'function') {
- throw new InvalidArgumentError('invalid onHeaders method')
- }
+ let urlRecord
- if (typeof handler.onData !== 'function') {
- throw new InvalidArgumentError('invalid onData method')
+ try {
+ // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.
+ urlRecord = new URL(url, settings.settingsObject.baseUrl)
+ this.#state.origin = urlRecord.origin
+ } catch (e) {
+ // 4. If urlRecord is failure, then throw a "SyntaxError" DOMException.
+ throw new DOMException(e, 'SyntaxError')
}
- if (typeof handler.onComplete !== 'function') {
- throw new InvalidArgumentError('invalid onComplete method')
- }
- }
-}
+ // 5. Set ev's url to urlRecord.
+ this.#url = urlRecord.href
-// A body is disturbed if it has been read from and it cannot
-// be re-used without losing state or data.
-function isDisturbed (body) {
- return !!(body && (
- stream.isDisturbed
- ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
- : body[kBodyUsed] ||
- body.readableDidRead ||
- (body._readableState && body._readableState.dataEmitted) ||
- isReadableAborted(body)
- ))
-}
+ // 6. Let corsAttributeState be Anonymous.
+ let corsAttributeState = ANONYMOUS
-function isErrored (body) {
- return !!(body && (
- stream.isErrored
- ? stream.isErrored(body)
- : /state: 'errored'/.test(nodeUtil.inspect(body)
- )))
-}
+ // 7. If the value of eventSourceInitDict's withCredentials member is true,
+ // then set corsAttributeState to Use Credentials and set ev's
+ // withCredentials attribute to true.
+ if (eventSourceInitDict.withCredentials) {
+ corsAttributeState = USE_CREDENTIALS
+ this.#withCredentials = true
+ }
-function isReadable (body) {
- return !!(body && (
- stream.isReadable
- ? stream.isReadable(body)
- : /state: 'readable'/.test(nodeUtil.inspect(body)
- )))
-}
+ // 8. Let request be the result of creating a potential-CORS request given
+ // urlRecord, the empty string, and corsAttributeState.
+ const initRequest = {
+ redirect: 'follow',
+ keepalive: true,
+ // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes
+ mode: 'cors',
+ credentials: corsAttributeState === 'anonymous'
+ ? 'same-origin'
+ : 'omit',
+ referrer: 'no-referrer'
+ }
-function getSocketInfo (socket) {
- return {
- localAddress: socket.localAddress,
- localPort: socket.localPort,
- remoteAddress: socket.remoteAddress,
- remotePort: socket.remotePort,
- remoteFamily: socket.remoteFamily,
- timeout: socket.timeout,
- bytesWritten: socket.bytesWritten,
- bytesRead: socket.bytesRead
- }
-}
+ // 9. Set request's client to settings.
+ initRequest.client = environmentSettingsObject.settingsObject
-async function * convertIterableToBuffer (iterable) {
- for await (const chunk of iterable) {
- yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
- }
-}
+ // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.
+ initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]]
-let ReadableStream
-function ReadableStreamFrom (iterable) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
+ // 11. Set request's cache mode to "no-store".
+ initRequest.cache = 'no-store'
- if (ReadableStream.from) {
- return ReadableStream.from(convertIterableToBuffer(iterable))
- }
+ // 12. Set request's initiator type to "other".
+ initRequest.initiator = 'other'
- let iterator
- return new ReadableStream(
- {
- async start () {
- iterator = iterable[Symbol.asyncIterator]()
- },
- async pull (controller) {
- const { done, value } = await iterator.next()
- if (done) {
- queueMicrotask(() => {
- controller.close()
- })
- } else {
- const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
- controller.enqueue(new Uint8Array(buf))
- }
- return controller.desiredSize > 0
- },
- async cancel (reason) {
- await iterator.return()
- }
- },
- 0
- )
-}
+ initRequest.urlList = [new URL(this.#url)]
-// The chunk should be a FormData instance and contains
-// all the required methods.
-function isFormDataLike (object) {
- return (
- object &&
- typeof object === 'object' &&
- typeof object.append === 'function' &&
- typeof object.delete === 'function' &&
- typeof object.get === 'function' &&
- typeof object.getAll === 'function' &&
- typeof object.has === 'function' &&
- typeof object.set === 'function' &&
- object[Symbol.toStringTag] === 'FormData'
- )
-}
+ // 13. Set ev's request to request.
+ this.#request = makeRequest(initRequest)
-function throwIfAborted (signal) {
- if (!signal) { return }
- if (typeof signal.throwIfAborted === 'function') {
- signal.throwIfAborted()
- } else {
- if (signal.aborted) {
- // DOMException not available < v17.0.0
- const err = new Error('The operation was aborted')
- err.name = 'AbortError'
- throw err
- }
+ this.#connect()
}
-}
-function addAbortListener (signal, listener) {
- if ('addEventListener' in signal) {
- signal.addEventListener('abort', listener, { once: true })
- return () => signal.removeEventListener('abort', listener)
+ /**
+ * Returns the state of this EventSource object's connection. It can have the
+ * values described below.
+ * @returns {0|1|2}
+ * @readonly
+ */
+ get readyState () {
+ return this.#readyState
}
- signal.addListener('abort', listener)
- return () => signal.removeListener('abort', listener)
-}
-const hasToWellFormed = !!String.prototype.toWellFormed
+ /**
+ * Returns the URL providing the event stream.
+ * @readonly
+ * @returns {string}
+ */
+ get url () {
+ return this.#url
+ }
-/**
- * @param {string} val
- */
-function toUSVString (val) {
- if (hasToWellFormed) {
- return `${val}`.toWellFormed()
- } else if (nodeUtil.toUSVString) {
- return nodeUtil.toUSVString(val)
+ /**
+ * Returns a boolean indicating whether the EventSource object was
+ * instantiated with CORS credentials set (true), or not (false, the default).
+ */
+ get withCredentials () {
+ return this.#withCredentials
}
- return `${val}`
-}
+ #connect () {
+ if (this.#readyState === CLOSED) return
-// Parsed accordingly to RFC 9110
-// https://www.rfc-editor.org/rfc/rfc9110#field.content-range
-function parseRangeHeader (range) {
- if (range == null || range === '') return { start: 0, end: null, size: null }
+ this.#readyState = CONNECTING
- const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
- return m
- ? {
- start: parseInt(m[1]),
- end: m[2] ? parseInt(m[2]) : null,
- size: m[3] ? parseInt(m[3]) : null
+ const fetchParams = {
+ request: this.#request,
+ dispatcher: this.#dispatcher
+ }
+
+ // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.
+ const processEventSourceEndOfBody = (response) => {
+ if (isNetworkError(response)) {
+ this.dispatchEvent(new Event('error'))
+ this.close()
}
- : null
-}
-const kEnumerableProperty = Object.create(null)
-kEnumerableProperty.enumerable = true
+ this.#reconnect()
+ }
-module.exports = {
- kEnumerableProperty,
- nop,
- isDisturbed,
- isErrored,
- isReadable,
- toUSVString,
- isReadableAborted,
- isBlobLike,
- parseOrigin,
- parseURL,
- getServerName,
- isStream,
- isIterable,
- isAsyncIterable,
- isDestroyed,
- headerNameToString,
- parseRawHeaders,
- parseHeaders,
- parseKeepAliveTimeout,
- destroy,
- bodyLength,
- deepClone,
- ReadableStreamFrom,
- isBuffer,
- validateHandler,
- getSocketInfo,
- isFormDataLike,
- buildURL,
- throwIfAborted,
- addAbortListener,
- parseRangeHeader,
- nodeMajor,
- nodeMinor,
- nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
- safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
-}
+ // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...
+ fetchParams.processResponseEndOfBody = processEventSourceEndOfBody
+ // and processResponse set to the following steps given response res:
+ fetchParams.processResponse = (response) => {
+ // 1. If res is an aborted network error, then fail the connection.
-/***/ }),
+ if (isNetworkError(response)) {
+ // 1. When a user agent is to fail the connection, the user agent
+ // must queue a task which, if the readyState attribute is set to a
+ // value other than CLOSED, sets the readyState attribute to CLOSED
+ // and fires an event named error at the EventSource object. Once the
+ // user agent has failed the connection, it does not attempt to
+ // reconnect.
+ if (response.aborted) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ return
+ // 2. Otherwise, if res is a network error, then reestablish the
+ // connection, unless the user agent knows that to be futile, in
+ // which case the user agent may fail the connection.
+ } else {
+ this.#reconnect()
+ return
+ }
+ }
-/***/ 4839:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 3. Otherwise, if res's status is not 200, or if res's `Content-Type`
+ // is not `text/event-stream`, then fail the connection.
+ const contentType = response.headersList.get('content-type', true)
+ const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'
+ const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'
+ if (
+ response.status !== 200 ||
+ contentTypeValid === false
+ ) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ return
+ }
-"use strict";
+ // 4. Otherwise, announce the connection and interpret res's body
+ // line by line.
+ // When a user agent is to announce the connection, the user agent
+ // must queue a task which, if the readyState attribute is set to a
+ // value other than CLOSED, sets the readyState attribute to OPEN
+ // and fires an event named open at the EventSource object.
+ // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
+ this.#readyState = OPEN
+ this.dispatchEvent(new Event('open'))
-const Dispatcher = __nccwpck_require__(412)
-const {
- ClientDestroyedError,
- ClientClosedError,
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
+ // If redirected to a different origin, set the origin to the new origin.
+ this.#state.origin = response.urlList[response.urlList.length - 1].origin
-const kDestroyed = Symbol('destroyed')
-const kClosed = Symbol('closed')
-const kOnDestroyed = Symbol('onDestroyed')
-const kOnClosed = Symbol('onClosed')
-const kInterceptedDispatch = Symbol('Intercepted Dispatch')
+ const eventSourceStream = new EventSourceStream({
+ eventSourceSettings: this.#state,
+ push: (event) => {
+ this.dispatchEvent(createFastMessageEvent(
+ event.type,
+ event.options
+ ))
+ }
+ })
-class DispatcherBase extends Dispatcher {
- constructor () {
- super()
+ pipeline(response.body.stream,
+ eventSourceStream,
+ (error) => {
+ if (
+ error?.aborted === false
+ ) {
+ this.close()
+ this.dispatchEvent(new Event('error'))
+ }
+ })
+ }
- this[kDestroyed] = false
- this[kOnDestroyed] = null
- this[kClosed] = false
- this[kOnClosed] = []
+ this.#controller = fetching(fetchParams)
}
- get destroyed () {
- return this[kDestroyed]
- }
+ /**
+ * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
+ * @returns {Promise}
+ */
+ async #reconnect () {
+ // When a user agent is to reestablish the connection, the user agent must
+ // run the following steps. These steps are run in parallel, not as part of
+ // a task. (The tasks that it queues, of course, are run like normal tasks
+ // and not themselves in parallel.)
- get closed () {
- return this[kClosed]
- }
+ // 1. Queue a task to run the following steps:
- get interceptors () {
- return this[kInterceptors]
- }
+ // 1. If the readyState attribute is set to CLOSED, abort the task.
+ if (this.#readyState === CLOSED) return
- set interceptors (newInterceptors) {
- if (newInterceptors) {
- for (let i = newInterceptors.length - 1; i >= 0; i--) {
- const interceptor = this[kInterceptors][i]
- if (typeof interceptor !== 'function') {
- throw new InvalidArgumentError('interceptor must be an function')
- }
- }
- }
+ // 2. Set the readyState attribute to CONNECTING.
+ this.#readyState = CONNECTING
- this[kInterceptors] = newInterceptors
- }
+ // 3. Fire an event named error at the EventSource object.
+ this.dispatchEvent(new Event('error'))
- close (callback) {
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- this.close((err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
+ // 2. Wait a delay equal to the reconnection time of the event source.
+ await delay(this.#state.reconnectionTime)
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
- }
+ // 5. Queue a task to run the following steps:
- if (this[kDestroyed]) {
- queueMicrotask(() => callback(new ClientDestroyedError(), null))
- return
- }
+ // 1. If the EventSource object's readyState attribute is not set to
+ // CONNECTING, then return.
+ if (this.#readyState !== CONNECTING) return
- if (this[kClosed]) {
- if (this[kOnClosed]) {
- this[kOnClosed].push(callback)
- } else {
- queueMicrotask(() => callback(null, null))
- }
- return
+ // 2. Let request be the EventSource object's request.
+ // 3. If the EventSource object's last event ID string is not the empty
+ // string, then:
+ // 1. Let lastEventIDValue be the EventSource object's last event ID
+ // string, encoded as UTF-8.
+ // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header
+ // list.
+ if (this.#state.lastEventId.length) {
+ this.#request.headersList.set('last-event-id', this.#state.lastEventId, true)
}
- this[kClosed] = true
- this[kOnClosed].push(callback)
+ // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.
+ this.#connect()
+ }
- const onClosed = () => {
- const callbacks = this[kOnClosed]
- this[kOnClosed] = null
- for (let i = 0; i < callbacks.length; i++) {
- callbacks[i](null, null)
- }
- }
+ /**
+ * Closes the connection, if any, and sets the readyState attribute to
+ * CLOSED.
+ */
+ close () {
+ webidl.brandCheck(this, EventSource)
- // Should not error.
- this[kClose]()
- .then(() => this.destroy())
- .then(() => {
- queueMicrotask(onClosed)
- })
+ if (this.#readyState === CLOSED) return
+ this.#readyState = CLOSED
+ this.#controller.abort()
+ this.#request = null
}
- destroy (err, callback) {
- if (typeof err === 'function') {
- callback = err
- err = null
- }
+ get onopen () {
+ return this.#events.open
+ }
- if (callback === undefined) {
- return new Promise((resolve, reject) => {
- this.destroy(err, (err, data) => {
- return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
- })
- })
+ set onopen (fn) {
+ if (this.#events.open) {
+ this.removeEventListener('open', this.#events.open)
}
- if (typeof callback !== 'function') {
- throw new InvalidArgumentError('invalid callback')
+ if (typeof fn === 'function') {
+ this.#events.open = fn
+ this.addEventListener('open', fn)
+ } else {
+ this.#events.open = null
}
+ }
- if (this[kDestroyed]) {
- if (this[kOnDestroyed]) {
- this[kOnDestroyed].push(callback)
- } else {
- queueMicrotask(() => callback(null, null))
- }
- return
- }
+ get onmessage () {
+ return this.#events.message
+ }
- if (!err) {
- err = new ClientDestroyedError()
+ set onmessage (fn) {
+ if (this.#events.message) {
+ this.removeEventListener('message', this.#events.message)
}
- this[kDestroyed] = true
- this[kOnDestroyed] = this[kOnDestroyed] || []
- this[kOnDestroyed].push(callback)
-
- const onDestroyed = () => {
- const callbacks = this[kOnDestroyed]
- this[kOnDestroyed] = null
- for (let i = 0; i < callbacks.length; i++) {
- callbacks[i](null, null)
- }
+ if (typeof fn === 'function') {
+ this.#events.message = fn
+ this.addEventListener('message', fn)
+ } else {
+ this.#events.message = null
}
+ }
- // Should not error.
- this[kDestroy](err).then(() => {
- queueMicrotask(onDestroyed)
- })
+ get onerror () {
+ return this.#events.error
}
- [kInterceptedDispatch] (opts, handler) {
- if (!this[kInterceptors] || this[kInterceptors].length === 0) {
- this[kInterceptedDispatch] = this[kDispatch]
- return this[kDispatch](opts, handler)
+ set onerror (fn) {
+ if (this.#events.error) {
+ this.removeEventListener('error', this.#events.error)
}
- let dispatch = this[kDispatch].bind(this)
- for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
- dispatch = this[kInterceptors][i](dispatch)
+ if (typeof fn === 'function') {
+ this.#events.error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this.#events.error = null
}
- this[kInterceptedDispatch] = dispatch
- return dispatch(opts, handler)
}
+}
- dispatch (opts, handler) {
- if (!handler || typeof handler !== 'object') {
- throw new InvalidArgumentError('handler must be an object')
- }
-
- try {
- if (!opts || typeof opts !== 'object') {
- throw new InvalidArgumentError('opts must be an object.')
- }
-
- if (this[kDestroyed] || this[kOnDestroyed]) {
- throw new ClientDestroyedError()
- }
-
- if (this[kClosed]) {
- throw new ClientClosedError()
- }
+const constantsPropertyDescriptors = {
+ CONNECTING: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: CONNECTING,
+ writable: false
+ },
+ OPEN: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: OPEN,
+ writable: false
+ },
+ CLOSED: {
+ __proto__: null,
+ configurable: false,
+ enumerable: true,
+ value: CLOSED,
+ writable: false
+ }
+}
- return this[kInterceptedDispatch](opts, handler)
- } catch (err) {
- if (typeof handler.onError !== 'function') {
- throw new InvalidArgumentError('invalid onError method')
- }
+Object.defineProperties(EventSource, constantsPropertyDescriptors)
+Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors)
- handler.onError(err)
+Object.defineProperties(EventSource.prototype, {
+ close: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onmessage: kEnumerableProperty,
+ onopen: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ url: kEnumerableProperty,
+ withCredentials: kEnumerableProperty
+})
- return false
- }
+webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
+ {
+ key: 'withCredentials',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'dispatcher', // undici only
+ converter: webidl.converters.any
}
-}
+])
-module.exports = DispatcherBase
+module.exports = {
+ EventSource,
+ defaultReconnectionTime
+}
/***/ }),
-/***/ 412:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+/***/ 4811:
+/***/ ((module) => {
-const EventEmitter = __nccwpck_require__(2361)
-class Dispatcher extends EventEmitter {
- dispatch () {
- throw new Error('not implemented')
- }
+/**
+ * Checks if the given value is a valid LastEventId.
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isValidLastEventId (value) {
+ // LastEventId should not contain U+0000 NULL
+ return value.indexOf('\u0000') === -1
+}
- close () {
- throw new Error('not implemented')
+/**
+ * Checks if the given value is a base 10 digit.
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isASCIINumber (value) {
+ if (value.length === 0) return false
+ for (let i = 0; i < value.length; i++) {
+ if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false
}
+ return true
+}
- destroy () {
- throw new Error('not implemented')
- }
+// https://github.com/nodejs/undici/issues/2664
+function delay (ms) {
+ return new Promise((resolve) => {
+ setTimeout(resolve, ms).unref()
+ })
}
-module.exports = Dispatcher
+module.exports = {
+ isValidLastEventId,
+ isASCIINumber,
+ delay
+}
/***/ }),
-/***/ 1472:
+/***/ 4492:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const Busboy = __nccwpck_require__(727)
-const util = __nccwpck_require__(3983)
+const util = __nccwpck_require__(3440)
const {
ReadableStreamFrom,
isBlobLike,
isReadableStreamLike,
readableStreamClose,
createDeferredPromise,
- fullyReadBody
-} = __nccwpck_require__(2538)
-const { FormData } = __nccwpck_require__(2015)
-const { kState } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { DOMException, structuredClone } = __nccwpck_require__(1037)
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
-const { kBodyUsed } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { isErrored } = __nccwpck_require__(3983)
-const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
-const { File: UndiciFile } = __nccwpck_require__(8511)
-const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
-
-let ReadableStream = globalThis.ReadableStream
+ fullyReadBody,
+ extractMimeType,
+ utf8DecodeBytes
+} = __nccwpck_require__(3168)
+const { FormData } = __nccwpck_require__(5910)
+const { kState } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { Blob } = __nccwpck_require__(4573)
+const assert = __nccwpck_require__(4589)
+const { isErrored, isDisturbed } = __nccwpck_require__(7075)
+const { isArrayBuffer } = __nccwpck_require__(3429)
+const { serializeAMimeType } = __nccwpck_require__(1900)
+const { multipartFormDataParser } = __nccwpck_require__(116)
+let random
+
+try {
+ const crypto = __nccwpck_require__(7598)
+ random = (max) => crypto.randomInt(0, max)
+} catch {
+ random = (max) => Math.floor(Math.random(max))
+}
-/** @type {globalThis['File']} */
-const File = NativeFile ?? UndiciFile
const textEncoder = new TextEncoder()
-const textDecoder = new TextDecoder()
+function noop () {}
+
+const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0
+let streamRegistry
+
+if (hasFinalizationRegistry) {
+ streamRegistry = new FinalizationRegistry((weakRef) => {
+ const stream = weakRef.deref()
+ if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
+ stream.cancel('Response object has been garbage collected').catch(noop)
+ }
+ })
+}
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
function extractBody (object, keepalive = false) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
// 1. Let stream be null.
let stream = null
@@ -23092,16 +26105,19 @@ function extractBody (object, keepalive = false) {
stream = object.stream()
} else {
// 4. Otherwise, set stream to a new ReadableStream object, and set
- // up stream.
+ // up stream with byte reading support.
stream = new ReadableStream({
async pull (controller) {
- controller.enqueue(
- typeof source === 'string' ? textEncoder.encode(source) : source
- )
+ const buffer = typeof source === 'string' ? textEncoder.encode(source) : source
+
+ if (buffer.byteLength) {
+ controller.enqueue(buffer)
+ }
+
queueMicrotask(() => readableStreamClose(controller))
},
start () {},
- type: undefined
+ type: 'bytes'
})
}
@@ -23152,7 +26168,7 @@ function extractBody (object, keepalive = false) {
// Set source to a copy of the bytes held by object.
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
} else if (util.isFormDataLike(object)) {
- const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
+ const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
/*! formdata-polyfill. MIT License. Jimmy Wärting */
@@ -23193,7 +26209,10 @@ function extractBody (object, keepalive = false) {
}
}
- const chunk = textEncoder.encode(`--${boundary}--`)
+ // CRLF is appended to the body to function with legacy servers and match other implementations.
+ // https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030
+ // https://github.com/form-data/form-data/issues/63
+ const chunk = textEncoder.encode(`--${boundary}--\r\n`)
blobParts.push(chunk)
length += chunk.byteLength
if (hasUnknownSizeValue) {
@@ -23216,7 +26235,7 @@ function extractBody (object, keepalive = false) {
// Set type to `multipart/form-data; boundary=`,
// followed by the multipart/form-data boundary string generated
// by the multipart/form-data encoding algorithm.
- type = 'multipart/form-data; boundary=' + boundary
+ type = `multipart/form-data; boundary=${boundary}`
} else if (isBlobLike(object)) {
// Blob
@@ -23268,13 +26287,17 @@ function extractBody (object, keepalive = false) {
// When running action is done, close stream.
queueMicrotask(() => {
controller.close()
+ controller.byobRequest?.respond(0)
})
} else {
// Whenever one or more bytes are available and stream is not errored,
// enqueue a Uint8Array wrapping an ArrayBuffer containing the available
// bytes into stream.
if (!isErrored(stream)) {
- controller.enqueue(new Uint8Array(value))
+ const buffer = new Uint8Array(value)
+ if (buffer.byteLength) {
+ controller.enqueue(buffer)
+ }
}
}
return controller.desiredSize > 0
@@ -23282,7 +26305,7 @@ function extractBody (object, keepalive = false) {
async cancel (reason) {
await iterator.return()
},
- type: undefined
+ type: 'bytes'
})
}
@@ -23296,11 +26319,6 @@ function extractBody (object, keepalive = false) {
// https://fetch.spec.whatwg.org/#bodyinit-safely-extract
function safelyExtractBody (object, keepalive = false) {
- if (!ReadableStream) {
- // istanbul ignore next
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
// To safely extract a body and a `Content-Type` value from
// a byte sequence or BodyInit object object, run these steps:
@@ -23317,52 +26335,25 @@ function safelyExtractBody (object, keepalive = false) {
return extractBody(object, keepalive)
}
-function cloneBody (body) {
+function cloneBody (instance, body) {
// To clone a body body, run these steps:
// https://fetch.spec.whatwg.org/#concept-body-clone
// 1. Let « out1, out2 » be the result of teeing body’s stream.
const [out1, out2] = body.stream.tee()
- const out2Clone = structuredClone(out2, { transfer: [out2] })
- // This, for whatever reasons, unrefs out2Clone which allows
- // the process to exit by itself.
- const [, finalClone] = out2Clone.tee()
// 2. Set body’s stream to out1.
body.stream = out1
// 3. Return a body whose stream is out2 and other members are copied from body.
return {
- stream: finalClone,
+ stream: out2,
length: body.length,
source: body.source
}
}
-async function * consumeBody (body) {
- if (body) {
- if (isUint8Array(body)) {
- yield body
- } else {
- const stream = body.stream
-
- if (util.isDisturbed(stream)) {
- throw new TypeError('The body has already been consumed.')
- }
-
- if (stream.locked) {
- throw new TypeError('The stream is locked.')
- }
-
- // Compat.
- stream[kBodyUsed] = true
-
- yield * stream
- }
- }
-}
-
function throwIfAborted (state) {
if (state.aborted) {
throw new DOMException('The operation was aborted.', 'AbortError')
@@ -23377,10 +26368,10 @@ function bodyMixinMethods (instance) {
// given a byte sequence bytes: return a Blob whose
// contents are bytes and whose type attribute is this’s
// MIME type.
- return specConsumeBody(this, (bytes) => {
+ return consumeBody(this, (bytes) => {
let mimeType = bodyMimeType(this)
- if (mimeType === 'failure') {
+ if (mimeType === null) {
mimeType = ''
} else if (mimeType) {
mimeType = serializeAMimeType(mimeType)
@@ -23397,7 +26388,7 @@ function bodyMixinMethods (instance) {
// of running consume body with this and the following step
// given a byte sequence bytes: return a new ArrayBuffer
// whose contents are bytes.
- return specConsumeBody(this, (bytes) => {
+ return consumeBody(this, (bytes) => {
return new Uint8Array(bytes).buffer
}, instance)
},
@@ -23405,126 +26396,74 @@ function bodyMixinMethods (instance) {
text () {
// The text() method steps are to return the result of running
// consume body with this and UTF-8 decode.
- return specConsumeBody(this, utf8DecodeBytes, instance)
+ return consumeBody(this, utf8DecodeBytes, instance)
},
json () {
// The json() method steps are to return the result of running
// consume body with this and parse JSON from bytes.
- return specConsumeBody(this, parseJSONFromBytes, instance)
+ return consumeBody(this, parseJSONFromBytes, instance)
},
- async formData () {
- webidl.brandCheck(this, instance)
-
- throwIfAborted(this[kState])
-
- const contentType = this.headers.get('Content-Type')
-
- // If mimeType’s essence is "multipart/form-data", then:
- if (/multipart\/form-data/.test(contentType)) {
- const headers = {}
- for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
-
- const responseFormData = new FormData()
-
- let busboy
-
- try {
- busboy = new Busboy({
- headers,
- preservePath: true
- })
- } catch (err) {
- throw new DOMException(`${err}`, 'AbortError')
- }
-
- busboy.on('field', (name, value) => {
- responseFormData.append(name, value)
- })
- busboy.on('file', (name, value, filename, encoding, mimeType) => {
- const chunks = []
-
- if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
- let base64chunk = ''
-
- value.on('data', (chunk) => {
- base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
+ formData () {
+ // The formData() method steps are to return the result of running
+ // consume body with this and the following step given a byte sequence bytes:
+ return consumeBody(this, (value) => {
+ // 1. Let mimeType be the result of get the MIME type with this.
+ const mimeType = bodyMimeType(this)
+
+ // 2. If mimeType is non-null, then switch on mimeType’s essence and run
+ // the corresponding steps:
+ if (mimeType !== null) {
+ switch (mimeType.essence) {
+ case 'multipart/form-data': {
+ // 1. ... [long step]
+ const parsed = multipartFormDataParser(value, mimeType)
+
+ // 2. If that fails for some reason, then throw a TypeError.
+ if (parsed === 'failure') {
+ throw new TypeError('Failed to parse body as FormData.')
+ }
- const end = base64chunk.length - base64chunk.length % 4
- chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
+ // 3. Return a new FormData object, appending each entry,
+ // resulting from the parsing operation, to its entry list.
+ const fd = new FormData()
+ fd[kState] = parsed
- base64chunk = base64chunk.slice(end)
- })
- value.on('end', () => {
- chunks.push(Buffer.from(base64chunk, 'base64'))
- responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
- })
- } else {
- value.on('data', (chunk) => {
- chunks.push(chunk)
- })
- value.on('end', () => {
- responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
- })
- }
- })
+ return fd
+ }
+ case 'application/x-www-form-urlencoded': {
+ // 1. Let entries be the result of parsing bytes.
+ const entries = new URLSearchParams(value.toString())
- const busboyResolve = new Promise((resolve, reject) => {
- busboy.on('finish', resolve)
- busboy.on('error', (err) => reject(new TypeError(err)))
- })
+ // 2. If entries is failure, then throw a TypeError.
- if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
- busboy.end()
- await busboyResolve
+ // 3. Return a new FormData object whose entry list is entries.
+ const fd = new FormData()
- return responseFormData
- } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
- // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
+ for (const [name, value] of entries) {
+ fd.append(name, value)
+ }
- // 1. Let entries be the result of parsing bytes.
- let entries
- try {
- let text = ''
- // application/x-www-form-urlencoded parser will keep the BOM.
- // https://url.spec.whatwg.org/#concept-urlencoded-parser
- // Note that streaming decoder is stateful and cannot be reused
- const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
-
- for await (const chunk of consumeBody(this[kState].body)) {
- if (!isUint8Array(chunk)) {
- throw new TypeError('Expected Uint8Array chunk')
+ return fd
}
- text += streamingDecoder.decode(chunk, { stream: true })
}
- text += streamingDecoder.decode()
- entries = new URLSearchParams(text)
- } catch (err) {
- // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
- // 2. If entries is failure, then throw a TypeError.
- throw Object.assign(new TypeError(), { cause: err })
- }
-
- // 3. Return a new FormData object whose entries are entries.
- const formData = new FormData()
- for (const [name, value] of entries) {
- formData.append(name, value)
}
- return formData
- } else {
- // Wait a tick before checking if the request has been aborted.
- // Otherwise, a TypeError can be thrown when an AbortError should.
- await Promise.resolve()
- throwIfAborted(this[kState])
+ // 3. Throw a TypeError.
+ throw new TypeError(
+ 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
+ )
+ }, instance)
+ },
- // Otherwise, throw a TypeError.
- throw webidl.errors.exception({
- header: `${instance.name}.formData`,
- message: 'Could not parse content as FormData.'
- })
- }
+ bytes () {
+ // The bytes() method steps are to return the result of running consume body
+ // with this and the following step given a byte sequence bytes: return the
+ // result of creating a Uint8Array from bytes in this’s relevant realm.
+ return consumeBody(this, (bytes) => {
+ return new Uint8Array(bytes)
+ }, instance)
}
}
@@ -23541,17 +26480,17 @@ function mixinBody (prototype) {
* @param {(value: unknown) => unknown} convertBytesToJSValue
* @param {Response|Request} instance
*/
-async function specConsumeBody (object, convertBytesToJSValue, instance) {
+async function consumeBody (object, convertBytesToJSValue, instance) {
webidl.brandCheck(object, instance)
- throwIfAborted(object[kState])
-
// 1. If object is unusable, then return a promise rejected
// with a TypeError.
- if (bodyUnusable(object[kState].body)) {
- throw new TypeError('Body is unusable')
+ if (bodyUnusable(object)) {
+ throw new TypeError('Body is unusable: Body has already been read')
}
+ throwIfAborted(object[kState])
+
// 2. Let promise be a new promise.
const promise = createDeferredPromise()
@@ -23573,7 +26512,7 @@ async function specConsumeBody (object, convertBytesToJSValue, instance) {
// 5. If object’s body is null, then run successSteps with an
// empty byte sequence.
if (object[kState].body == null) {
- successSteps(new Uint8Array())
+ successSteps(Buffer.allocUnsafe(0))
return promise.promise
}
@@ -23586,39 +26525,15 @@ async function specConsumeBody (object, convertBytesToJSValue, instance) {
}
// https://fetch.spec.whatwg.org/#body-unusable
-function bodyUnusable (body) {
+function bodyUnusable (object) {
+ const body = object[kState].body
+
// An object including the Body interface mixin is
// said to be unusable if its body is non-null and
// its body’s stream is disturbed or locked.
return body != null && (body.stream.locked || util.isDisturbed(body.stream))
}
-/**
- * @see https://encoding.spec.whatwg.org/#utf-8-decode
- * @param {Buffer} buffer
- */
-function utf8DecodeBytes (buffer) {
- if (buffer.length === 0) {
- return ''
- }
-
- // 1. Let buffer be the result of peeking three bytes from
- // ioQueue, converted to a byte sequence.
-
- // 2. If buffer is 0xEF 0xBB 0xBF, then read three
- // bytes from ioQueue. (Do nothing with those bytes.)
- if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
- buffer = buffer.subarray(3)
- }
-
- // 3. Process a queue with an instance of UTF-8’s
- // decoder, ioQueue, output, and "replacement".
- const output = textDecoder.decode(buffer)
-
- // 4. Return output.
- return output
-}
-
/**
* @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
* @param {Uint8Array} bytes
@@ -23629,59 +26544,70 @@ function parseJSONFromBytes (bytes) {
/**
* @see https://fetch.spec.whatwg.org/#concept-body-mime-type
- * @param {import('./response').Response|import('./request').Request} object
+ * @param {import('./response').Response|import('./request').Request} requestOrResponse
*/
-function bodyMimeType (object) {
- const { headersList } = object[kState]
- const contentType = headersList.get('content-type')
+function bodyMimeType (requestOrResponse) {
+ // 1. Let headers be null.
+ // 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.
+ // 3. Otherwise, set headers to requestOrResponse’s response’s header list.
+ /** @type {import('./headers').HeadersList} */
+ const headers = requestOrResponse[kState].headersList
- if (contentType === null) {
- return 'failure'
+ // 4. Let mimeType be the result of extracting a MIME type from headers.
+ const mimeType = extractMimeType(headers)
+
+ // 5. If mimeType is failure, then return null.
+ if (mimeType === 'failure') {
+ return null
}
- return parseMIMEType(contentType)
+ // 6. Return mimeType.
+ return mimeType
}
module.exports = {
extractBody,
safelyExtractBody,
cloneBody,
- mixinBody
+ mixinBody,
+ streamRegistry,
+ hasFinalizationRegistry,
+ bodyUnusable
}
/***/ }),
-/***/ 1037:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+/***/ 4495:
+/***/ ((module) => {
-const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
-const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
+const corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])
const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
-const nullBodyStatus = [101, 204, 205, 304]
+const nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])
-const redirectStatus = [301, 302, 303, 307, 308]
+const redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])
const redirectStatusSet = new Set(redirectStatus)
-// https://fetch.spec.whatwg.org/#block-bad-port
-const badPorts = [
+/**
+ * @see https://fetch.spec.whatwg.org/#block-bad-port
+ */
+const badPorts = /** @type {const} */ ([
'1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
'87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
'139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
'540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
- '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
- '10080'
-]
-
+ '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',
+ '6697', '10080'
+])
const badPortsSet = new Set(badPorts)
-// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
-const referrerPolicy = [
+/**
+ * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
+ */
+const referrerPolicy = /** @type {const} */ ([
'',
'no-referrer',
'no-referrer-when-downgrade',
@@ -23691,29 +26617,31 @@ const referrerPolicy = [
'origin-when-cross-origin',
'strict-origin-when-cross-origin',
'unsafe-url'
-]
+])
const referrerPolicySet = new Set(referrerPolicy)
-const requestRedirect = ['follow', 'manual', 'error']
+const requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])
-const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
+const safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])
const safeMethodsSet = new Set(safeMethods)
-const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
+const requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])
-const requestCredentials = ['omit', 'same-origin', 'include']
+const requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])
-const requestCache = [
+const requestCache = /** @type {const} */ ([
'default',
'no-store',
'reload',
'no-cache',
'force-cache',
'only-if-cached'
-]
+])
-// https://fetch.spec.whatwg.org/#request-body-header-name
-const requestBodyHeader = [
+/**
+ * @see https://fetch.spec.whatwg.org/#request-body-header-name
+ */
+const requestBodyHeader = /** @type {const} */ ([
'content-encoding',
'content-language',
'content-location',
@@ -23723,18 +26651,22 @@ const requestBodyHeader = [
// removed in the Headers implementation. However, undici doesn't
// filter out headers, so we add it here.
'content-length'
-]
+])
-// https://fetch.spec.whatwg.org/#enumdef-requestduplex
-const requestDuplex = [
+/**
+ * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex
+ */
+const requestDuplex = /** @type {const} */ ([
'half'
-]
+])
-// http://fetch.spec.whatwg.org/#forbidden-method
-const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
+/**
+ * @see http://fetch.spec.whatwg.org/#forbidden-method
+ */
+const forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])
const forbiddenMethodsSet = new Set(forbiddenMethods)
-const subresource = [
+const subresource = /** @type {const} */ ([
'audio',
'audioworklet',
'font',
@@ -23747,44 +26679,10 @@ const subresource = [
'video',
'xslt',
''
-]
+])
const subresourceSet = new Set(subresource)
-/** @type {globalThis['DOMException']} */
-const DOMException = globalThis.DOMException ?? (() => {
- // DOMException was only made a global in Node v17.0.0,
- // but fetch supports >= v16.8.
- try {
- atob('~')
- } catch (err) {
- return Object.getPrototypeOf(err).constructor
- }
-})()
-
-let channel
-
-/** @type {globalThis['structuredClone']} */
-const structuredClone =
- globalThis.structuredClone ??
- // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
- // structuredClone was added in v17.0.0, but fetch supports v16.8
- function structuredClone (value, options = undefined) {
- if (arguments.length === 0) {
- throw new TypeError('missing argument')
- }
-
- if (!channel) {
- channel = new MessageChannel()
- }
- channel.port1.unref()
- channel.port2.unref()
- channel.port1.postMessage(value, options?.transfer)
- return receiveMessageOnPort(channel.port2).message
- }
-
module.exports = {
- DOMException,
- structuredClone,
subresource,
forbiddenMethods,
requestBodyHeader,
@@ -23811,24 +26709,25 @@ module.exports = {
/***/ }),
-/***/ 685:
+/***/ 1900:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-const assert = __nccwpck_require__(9491)
-const { atob } = __nccwpck_require__(4300)
-const { isomorphicDecode } = __nccwpck_require__(2538)
+
+
+const assert = __nccwpck_require__(4589)
const encoder = new TextEncoder()
/**
* @see https://mimesniff.spec.whatwg.org/#http-token-code-point
*/
-const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
-const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
+const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/
+const HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/ // eslint-disable-line
+const ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g // eslint-disable-line
/**
* @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
*/
-const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
+const HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/ // eslint-disable-line
// https://fetch.spec.whatwg.org/#data-url-processor
/** @param {URL} dataURL */
@@ -23942,7 +26841,13 @@ function URLSerializer (url, excludeFragment = false) {
const href = url.href
const hashLength = url.hash.length
- return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
+ const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength)
+
+ if (!hashLength && href.endsWith('#')) {
+ return serialized.slice(0, -1)
+ }
+
+ return serialized
}
// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
@@ -23998,20 +26903,43 @@ function stringPercentDecode (input) {
return percentDecode(bytes)
}
+/**
+ * @param {number} byte
+ */
+function isHexCharByte (byte) {
+ // 0-9 A-F a-f
+ return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66)
+}
+
+/**
+ * @param {number} byte
+ */
+function hexByteToNumber (byte) {
+ return (
+ // 0-9
+ byte >= 0x30 && byte <= 0x39
+ ? (byte - 48)
+ // Convert to uppercase
+ // ((byte & 0xDF) - 65) + 10
+ : ((byte & 0xDF) - 55)
+ )
+}
+
// https://url.spec.whatwg.org/#percent-decode
/** @param {Uint8Array} input */
function percentDecode (input) {
+ const length = input.length
// 1. Let output be an empty byte sequence.
- /** @type {number[]} */
- const output = []
-
+ /** @type {Uint8Array} */
+ const output = new Uint8Array(length)
+ let j = 0
// 2. For each byte byte in input:
- for (let i = 0; i < input.length; i++) {
+ for (let i = 0; i < length; ++i) {
const byte = input[i]
// 1. If byte is not 0x25 (%), then append byte to output.
if (byte !== 0x25) {
- output.push(byte)
+ output[j++] = byte
// 2. Otherwise, if byte is 0x25 (%) and the next two bytes
// after byte in input are not in the ranges
@@ -24020,19 +26948,16 @@ function percentDecode (input) {
// to output.
} else if (
byte === 0x25 &&
- !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
+ !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))
) {
- output.push(0x25)
+ output[j++] = 0x25
// 3. Otherwise:
} else {
// 1. Let bytePoint be the two bytes after byte in input,
// decoded, and then interpreted as hexadecimal number.
- const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
- const bytePoint = Number.parseInt(nextTwoBytes, 16)
-
// 2. Append a byte whose value is bytePoint to output.
- output.push(bytePoint)
+ output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2])
// 3. Skip the next two bytes in input.
i += 2
@@ -24040,7 +26965,7 @@ function percentDecode (input) {
}
// 3. Return output.
- return Uint8Array.from(output)
+ return length === j ? output : output.subarray(0, j)
}
// https://mimesniff.spec.whatwg.org/#parse-a-mime-type
@@ -24220,19 +27145,25 @@ function parseMIMEType (input) {
/** @param {string} data */
function forgivingBase64 (data) {
// 1. Remove all ASCII whitespace from data.
- data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
+ data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '') // eslint-disable-line
+ let dataLength = data.length
// 2. If data’s code point length divides by 4 leaving
// no remainder, then:
- if (data.length % 4 === 0) {
+ if (dataLength % 4 === 0) {
// 1. If data ends with one or two U+003D (=) code points,
// then remove them from data.
- data = data.replace(/=?=$/, '')
+ if (data.charCodeAt(dataLength - 1) === 0x003D) {
+ --dataLength
+ if (data.charCodeAt(dataLength - 1) === 0x003D) {
+ --dataLength
+ }
+ }
}
// 3. If data’s code point length divides by 4 leaving
// a remainder of 1, then return failure.
- if (data.length % 4 === 1) {
+ if (dataLength % 4 === 1) {
return 'failure'
}
@@ -24241,18 +27172,12 @@ function forgivingBase64 (data) {
// U+002F (/)
// ASCII alphanumeric
// then return failure.
- if (/[^+/0-9A-Za-z]/.test(data)) {
+ if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) {
return 'failure'
}
- const binary = atob(data)
- const bytes = new Uint8Array(binary.length)
-
- for (let byte = 0; byte < binary.length; byte++) {
- bytes[byte] = binary.charCodeAt(byte)
- }
-
- return bytes
+ const buffer = Buffer.from(data, 'base64')
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength)
}
// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
@@ -24359,7 +27284,7 @@ function serializeAMimeType (mimeType) {
// 4. If value does not solely contain HTTP token code
// points or value is the empty string, then:
if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
- // 1. Precede each occurence of U+0022 (") or
+ // 1. Precede each occurrence of U+0022 (") or
// U+005C (\) in value with U+005C (\).
value = value.replace(/(\\|")/g, '\\$1')
@@ -24380,55 +27305,140 @@ function serializeAMimeType (mimeType) {
/**
* @see https://fetch.spec.whatwg.org/#http-whitespace
- * @param {string} char
+ * @param {number} char
*/
function isHTTPWhiteSpace (char) {
- return char === '\r' || char === '\n' || char === '\t' || char === ' '
+ // "\r\n\t "
+ return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020
}
/**
* @see https://fetch.spec.whatwg.org/#http-whitespace
* @param {string} str
+ * @param {boolean} [leading=true]
+ * @param {boolean} [trailing=true]
*/
function removeHTTPWhitespace (str, leading = true, trailing = true) {
- let lead = 0
- let trail = str.length - 1
-
- if (leading) {
- for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
- }
-
- if (trailing) {
- for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
- }
-
- return str.slice(lead, trail + 1)
+ return removeChars(str, leading, trailing, isHTTPWhiteSpace)
}
/**
* @see https://infra.spec.whatwg.org/#ascii-whitespace
- * @param {string} char
+ * @param {number} char
*/
function isASCIIWhitespace (char) {
- return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
+ // "\r\n\t\f "
+ return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020
}
/**
* @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
+ * @param {string} str
+ * @param {boolean} [leading=true]
+ * @param {boolean} [trailing=true]
*/
function removeASCIIWhitespace (str, leading = true, trailing = true) {
+ return removeChars(str, leading, trailing, isASCIIWhitespace)
+}
+
+/**
+ * @param {string} str
+ * @param {boolean} leading
+ * @param {boolean} trailing
+ * @param {(charCode: number) => boolean} predicate
+ * @returns
+ */
+function removeChars (str, leading, trailing, predicate) {
let lead = 0
let trail = str.length - 1
if (leading) {
- for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
+ while (lead < str.length && predicate(str.charCodeAt(lead))) lead++
}
if (trailing) {
- for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
+ while (trail > 0 && predicate(str.charCodeAt(trail))) trail--
+ }
+
+ return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1)
+}
+
+/**
+ * @see https://infra.spec.whatwg.org/#isomorphic-decode
+ * @param {Uint8Array} input
+ * @returns {string}
+ */
+function isomorphicDecode (input) {
+ // 1. To isomorphic decode a byte sequence input, return a string whose code point
+ // length is equal to input’s length and whose code points have the same values
+ // as the values of input’s bytes, in the same order.
+ const length = input.length
+ if ((2 << 15) - 1 > length) {
+ return String.fromCharCode.apply(null, input)
+ }
+ let result = ''; let i = 0
+ let addition = (2 << 15) - 1
+ while (i < length) {
+ if (i + addition > length) {
+ addition = length - i
+ }
+ result += String.fromCharCode.apply(null, input.subarray(i, i += addition))
}
+ return result
+}
- return str.slice(lead, trail + 1)
+/**
+ * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type
+ * @param {Exclude, 'failure'>} mimeType
+ */
+function minimizeSupportedMimeType (mimeType) {
+ switch (mimeType.essence) {
+ case 'application/ecmascript':
+ case 'application/javascript':
+ case 'application/x-ecmascript':
+ case 'application/x-javascript':
+ case 'text/ecmascript':
+ case 'text/javascript':
+ case 'text/javascript1.0':
+ case 'text/javascript1.1':
+ case 'text/javascript1.2':
+ case 'text/javascript1.3':
+ case 'text/javascript1.4':
+ case 'text/javascript1.5':
+ case 'text/jscript':
+ case 'text/livescript':
+ case 'text/x-ecmascript':
+ case 'text/x-javascript':
+ // 1. If mimeType is a JavaScript MIME type, then return "text/javascript".
+ return 'text/javascript'
+ case 'application/json':
+ case 'text/json':
+ // 2. If mimeType is a JSON MIME type, then return "application/json".
+ return 'application/json'
+ case 'image/svg+xml':
+ // 3. If mimeType’s essence is "image/svg+xml", then return "image/svg+xml".
+ return 'image/svg+xml'
+ case 'text/xml':
+ case 'application/xml':
+ // 4. If mimeType is an XML MIME type, then return "application/xml".
+ return 'application/xml'
+ }
+
+ // 2. If mimeType is a JSON MIME type, then return "application/json".
+ if (mimeType.subtype.endsWith('+json')) {
+ return 'application/json'
+ }
+
+ // 4. If mimeType is an XML MIME type, then return "application/xml".
+ if (mimeType.subtype.endsWith('+xml')) {
+ return 'application/xml'
+ }
+
+ // 5. If mimeType is supported by the user agent, then return mimeType’s essence.
+ // Technically, node doesn't support any mimetypes.
+
+ // 6. Return the empty string.
+ return ''
}
module.exports = {
@@ -24439,111 +27449,80 @@ module.exports = {
stringPercentDecode,
parseMIMEType,
collectAnHTTPQuotedString,
- serializeAMimeType
+ serializeAMimeType,
+ removeChars,
+ removeHTTPWhitespace,
+ minimizeSupportedMimeType,
+ HTTP_TOKEN_CODEPOINTS,
+ isomorphicDecode
}
/***/ }),
-/***/ 8511:
+/***/ 6653:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
-const { types } = __nccwpck_require__(3837)
-const { kState } = __nccwpck_require__(5861)
-const { isBlobLike } = __nccwpck_require__(2538)
-const { webidl } = __nccwpck_require__(1744)
-const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
-const encoder = new TextEncoder()
-
-class File extends Blob {
- constructor (fileBits, fileName, options = {}) {
- // The File constructor is invoked with two or three parameters, depending
- // on whether the optional dictionary parameter is used. When the File()
- // constructor is invoked, user agents must run the following steps:
- webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
-
- fileBits = webidl.converters['sequence'](fileBits)
- fileName = webidl.converters.USVString(fileName)
- options = webidl.converters.FilePropertyBag(options)
- // 1. Let bytes be the result of processing blob parts given fileBits and
- // options.
- // Note: Blob handles this for us
- // 2. Let n be the fileName argument to the constructor.
- const n = fileName
+const { kConnected, kSize } = __nccwpck_require__(6443)
- // 3. Process FilePropertyBag dictionary argument by running the following
- // substeps:
+class CompatWeakRef {
+ constructor (value) {
+ this.value = value
+ }
- // 1. If the type member is provided and is not the empty string, let t
- // be set to the type dictionary member. If t contains any characters
- // outside the range U+0020 to U+007E, then set t to the empty string
- // and return from these substeps.
- // 2. Convert every character in t to ASCII lowercase.
- let t = options.type
- let d
+ deref () {
+ return this.value[kConnected] === 0 && this.value[kSize] === 0
+ ? undefined
+ : this.value
+ }
+}
- // eslint-disable-next-line no-labels
- substep: {
- if (t) {
- t = parseMIMEType(t)
+class CompatFinalizer {
+ constructor (finalizer) {
+ this.finalizer = finalizer
+ }
- if (t === 'failure') {
- t = ''
- // eslint-disable-next-line no-labels
- break substep
+ register (dispatcher, key) {
+ if (dispatcher.on) {
+ dispatcher.on('disconnect', () => {
+ if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
+ this.finalizer(key)
}
-
- t = serializeAMimeType(t).toLowerCase()
- }
-
- // 3. If the lastModified member is provided, let d be set to the
- // lastModified dictionary member. If it is not provided, set d to the
- // current date and time represented as the number of milliseconds since
- // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
- d = options.lastModified
+ })
}
+ }
- // 4. Return a new File object F such that:
- // F refers to the bytes byte sequence.
- // F.size is set to the number of total bytes in bytes.
- // F.name is set to n.
- // F.type is set to t.
- // F.lastModified is set to d.
+ unregister (key) {}
+}
- super(processBlobParts(fileBits, options), { type: t })
- this[kState] = {
- name: n,
- lastModified: d,
- type: t
+module.exports = function () {
+ // FIXME: remove workaround when the Node bug is backported to v18
+ // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
+ if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) {
+ process._rawDebug('Using compatibility WeakRef and FinalizationRegistry')
+ return {
+ WeakRef: CompatWeakRef,
+ FinalizationRegistry: CompatFinalizer
}
}
+ return { WeakRef, FinalizationRegistry }
+}
- get name () {
- webidl.brandCheck(this, File)
- return this[kState].name
- }
+/***/ }),
- get lastModified () {
- webidl.brandCheck(this, File)
+/***/ 7114:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- return this[kState].lastModified
- }
- get type () {
- webidl.brandCheck(this, File)
- return this[kState].type
- }
-}
+const { Blob, File } = __nccwpck_require__(4573)
+const { kState } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+// TODO(@KhafraDev): remove
class FileLike {
constructor (blobLike, fileName, options = {}) {
// TODO: argument idl type check
@@ -24645,176 +27624,530 @@ class FileLike {
}
}
-Object.defineProperties(File.prototype, {
- [Symbol.toStringTag]: {
- value: 'File',
- configurable: true
- },
- name: kEnumerableProperty,
- lastModified: kEnumerableProperty
-})
-
webidl.converters.Blob = webidl.interfaceConverter(Blob)
-webidl.converters.BlobPart = function (V, opts) {
- if (webidl.util.Type(V) === 'Object') {
- if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+// If this function is moved to ./util.js, some tools (such as
+// rollup) will warn about circular dependencies. See:
+// https://github.com/nodejs/undici/issues/1629
+function isFileLike (object) {
+ return (
+ (object instanceof File) ||
+ (
+ object &&
+ (typeof object.stream === 'function' ||
+ typeof object.arrayBuffer === 'function') &&
+ object[Symbol.toStringTag] === 'File'
+ )
+ )
+}
+
+module.exports = { FileLike, isFileLike }
+
+
+/***/ }),
+
+/***/ 116:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3440)
+const { utf8DecodeBytes } = __nccwpck_require__(3168)
+const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(1900)
+const { isFileLike } = __nccwpck_require__(7114)
+const { makeEntry } = __nccwpck_require__(5910)
+const assert = __nccwpck_require__(4589)
+const { File: NodeFile } = __nccwpck_require__(4573)
+
+const File = globalThis.File ?? NodeFile
+
+const formDataNameBuffer = Buffer.from('form-data; name="')
+const filenameBuffer = Buffer.from('; filename')
+const dd = Buffer.from('--')
+const ddcrlf = Buffer.from('--\r\n')
+
+/**
+ * @param {string} chars
+ */
+function isAsciiString (chars) {
+ for (let i = 0; i < chars.length; ++i) {
+ if ((chars.charCodeAt(i) & ~0x7F) !== 0) {
+ return false
}
+ }
+ return true
+}
- if (
- ArrayBuffer.isView(V) ||
- types.isAnyArrayBuffer(V)
- ) {
- return webidl.converters.BufferSource(V, opts)
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary
+ * @param {string} boundary
+ */
+function validateBoundary (boundary) {
+ const length = boundary.length
+
+ // - its length is greater or equal to 27 and lesser or equal to 70, and
+ if (length < 27 || length > 70) {
+ return false
+ }
+
+ // - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or
+ // 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),
+ // 0x2D (-) or 0x5F (_).
+ for (let i = 0; i < length; ++i) {
+ const cp = boundary.charCodeAt(i)
+
+ if (!(
+ (cp >= 0x30 && cp <= 0x39) ||
+ (cp >= 0x41 && cp <= 0x5a) ||
+ (cp >= 0x61 && cp <= 0x7a) ||
+ cp === 0x27 ||
+ cp === 0x2d ||
+ cp === 0x5f
+ )) {
+ return false
}
}
- return webidl.converters.USVString(V, opts)
+ return true
}
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.BlobPart
-)
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser
+ * @param {Buffer} input
+ * @param {ReturnType} mimeType
+ */
+function multipartFormDataParser (input, mimeType) {
+ // 1. Assert: mimeType’s essence is "multipart/form-data".
+ assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')
-// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
-webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
- {
- key: 'lastModified',
- converter: webidl.converters['long long'],
- get defaultValue () {
- return Date.now()
+ const boundaryString = mimeType.parameters.get('boundary')
+
+ // 2. If mimeType’s parameters["boundary"] does not exist, return failure.
+ // Otherwise, let boundary be the result of UTF-8 decoding mimeType’s
+ // parameters["boundary"].
+ if (boundaryString === undefined) {
+ return 'failure'
+ }
+
+ const boundary = Buffer.from(`--${boundaryString}`, 'utf8')
+
+ // 3. Let entry list be an empty entry list.
+ const entryList = []
+
+ // 4. Let position be a pointer to a byte in input, initially pointing at
+ // the first byte.
+ const position = { position: 0 }
+
+ // Note: undici addition, allows leading and trailing CRLFs.
+ while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
+ position.position += 2
+ }
+
+ let trailing = input.length
+
+ while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {
+ trailing -= 2
+ }
+
+ if (trailing !== input.length) {
+ input = input.subarray(0, trailing)
+ }
+
+ // 5. While true:
+ while (true) {
+ // 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D
+ // (`--`) followed by boundary, advance position by 2 + the length of
+ // boundary. Otherwise, return failure.
+ // Note: boundary is padded with 2 dashes already, no need to add 2.
+ if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {
+ position.position += boundary.length
+ } else {
+ return 'failure'
+ }
+
+ // 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A
+ // (`--` followed by CR LF) followed by the end of input, return entry list.
+ // Note: a body does NOT need to end with CRLF. It can end with --.
+ if (
+ (position.position === input.length - 2 && bufferStartsWith(input, dd, position)) ||
+ (position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position))
+ ) {
+ return entryList
+ }
+
+ // 5.3. If position does not point to a sequence of bytes starting with 0x0D
+ // 0x0A (CR LF), return failure.
+ if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ }
+
+ // 5.4. Advance position by 2. (This skips past the newline.)
+ position.position += 2
+
+ // 5.5. Let name, filename and contentType be the result of parsing
+ // multipart/form-data headers on input and position, if the result
+ // is not failure. Otherwise, return failure.
+ const result = parseMultipartFormDataHeaders(input, position)
+
+ if (result === 'failure') {
+ return 'failure'
}
- },
- {
- key: 'type',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'endings',
- converter: (value) => {
- value = webidl.converters.DOMString(value)
- value = value.toLowerCase()
- if (value !== 'native') {
- value = 'transparent'
+ let { name, filename, contentType, encoding } = result
+
+ // 5.6. Advance position by 2. (This skips past the empty line that marks
+ // the end of the headers.)
+ position.position += 2
+
+ // 5.7. Let body be the empty byte sequence.
+ let body
+
+ // 5.8. Body loop: While position is not past the end of input:
+ // TODO: the steps here are completely wrong
+ {
+ const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)
+
+ if (boundaryIndex === -1) {
+ return 'failure'
}
- return value
- },
- defaultValue: 'transparent'
+ body = input.subarray(position.position, boundaryIndex - 4)
+
+ position.position += body.length
+
+ // Note: position must be advanced by the body's length before being
+ // decoded, otherwise the parsing will fail.
+ if (encoding === 'base64') {
+ body = Buffer.from(body.toString(), 'base64')
+ }
+ }
+
+ // 5.9. If position does not point to a sequence of bytes starting with
+ // 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.
+ if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ } else {
+ position.position += 2
+ }
+
+ // 5.10. If filename is not null:
+ let value
+
+ if (filename !== null) {
+ // 5.10.1. If contentType is null, set contentType to "text/plain".
+ contentType ??= 'text/plain'
+
+ // 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.
+
+ // Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.
+ // Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.
+ if (!isAsciiString(contentType)) {
+ contentType = ''
+ }
+
+ // 5.10.3. Let value be a new File object with name filename, type contentType, and body body.
+ value = new File([body], filename, { type: contentType })
+ } else {
+ // 5.11. Otherwise:
+
+ // 5.11.1. Let value be the UTF-8 decoding without BOM of body.
+ value = utf8DecodeBytes(Buffer.from(body))
+ }
+
+ // 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.
+ assert(isUSVString(name))
+ assert((typeof value === 'string' && isUSVString(value)) || isFileLike(value))
+
+ // 5.13. Create an entry with name and value, and append it to entry list.
+ entryList.push(makeEntry(name, value, filename))
}
-])
+}
/**
- * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
- * @param {(NodeJS.TypedArray|Blob|string)[]} parts
- * @param {{ type: string, endings: string }} options
+ * @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers
+ * @param {Buffer} input
+ * @param {{ position: number }} position
*/
-function processBlobParts (parts, options) {
- // 1. Let bytes be an empty sequence of bytes.
- /** @type {NodeJS.TypedArray[]} */
- const bytes = []
+function parseMultipartFormDataHeaders (input, position) {
+ // 1. Let name, filename and contentType be null.
+ let name = null
+ let filename = null
+ let contentType = null
+ let encoding = null
- // 2. For each element in parts:
- for (const element of parts) {
- // 1. If element is a USVString, run the following substeps:
- if (typeof element === 'string') {
- // 1. Let s be element.
- let s = element
+ // 2. While true:
+ while (true) {
+ // 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):
+ if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
+ // 2.1.1. If name is null, return failure.
+ if (name === null) {
+ return 'failure'
+ }
+
+ // 2.1.2. Return name, filename and contentType.
+ return { name, filename, contentType, encoding }
+ }
+
+ // 2.2. Let header name be the result of collecting a sequence of bytes that are
+ // not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.
+ let headerName = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,
+ input,
+ position
+ )
+
+ // 2.3. Remove any HTTP tab or space bytes from the start or end of header name.
+ headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)
+
+ // 2.4. If header name does not match the field-name token production, return failure.
+ if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
+ return 'failure'
+ }
+
+ // 2.5. If the byte at position is not 0x3A (:), return failure.
+ if (input[position.position] !== 0x3a) {
+ return 'failure'
+ }
+
+ // 2.6. Advance position by 1.
+ position.position++
+
+ // 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.
+ // (Do nothing with those bytes.)
+ collectASequenceOfBytes(
+ (char) => char === 0x20 || char === 0x09,
+ input,
+ position
+ )
+
+ // 2.8. Byte-lowercase header name and switch on the result:
+ switch (bufferToLowerCasedHeaderName(headerName)) {
+ case 'content-disposition': {
+ // 1. Set name and filename to null.
+ name = filename = null
+
+ // 2. If position does not point to a sequence of bytes starting with
+ // `form-data; name="`, return failure.
+ if (!bufferStartsWith(input, formDataNameBuffer, position)) {
+ return 'failure'
+ }
+
+ // 3. Advance position so it points at the byte after the next 0x22 (")
+ // byte (the one in the sequence of bytes matched above).
+ position.position += 17
+
+ // 4. Set name to the result of parsing a multipart/form-data name given
+ // input and position, if the result is not failure. Otherwise, return
+ // failure.
+ name = parseMultipartFormDataName(input, position)
+
+ if (name === null) {
+ return 'failure'
+ }
+
+ // 5. If position points to a sequence of bytes starting with `; filename="`:
+ if (bufferStartsWith(input, filenameBuffer, position)) {
+ // Note: undici also handles filename*
+ let check = position.position + filenameBuffer.length
+
+ if (input[check] === 0x2a) {
+ position.position += 1
+ check += 1
+ }
+
+ if (input[check] !== 0x3d || input[check + 1] !== 0x22) { // ="
+ return 'failure'
+ }
- // 2. If the endings member of options is "native", set s
- // to the result of converting line endings to native
- // of element.
- if (options.endings === 'native') {
- s = convertLineEndingsNative(s)
+ // 1. Advance position so it points at the byte after the next 0x22 (") byte
+ // (the one in the sequence of bytes matched above).
+ position.position += 12
+
+ // 2. Set filename to the result of parsing a multipart/form-data name given
+ // input and position, if the result is not failure. Otherwise, return failure.
+ filename = parseMultipartFormDataName(input, position)
+
+ if (filename === null) {
+ return 'failure'
+ }
+ }
+
+ break
}
+ case 'content-type': {
+ // 1. Let header value be the result of collecting a sequence of bytes that are
+ // not 0x0A (LF) or 0x0D (CR), given position.
+ let headerValue = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
+ )
- // 3. Append the result of UTF-8 encoding s to bytes.
- bytes.push(encoder.encode(s))
- } else if (
- types.isAnyArrayBuffer(element) ||
- types.isTypedArray(element)
- ) {
- // 2. If element is a BufferSource, get a copy of the
- // bytes held by the buffer source, and append those
- // bytes to bytes.
- if (!element.buffer) { // ArrayBuffer
- bytes.push(new Uint8Array(element))
- } else {
- bytes.push(
- new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
+ // 2. Remove any HTTP tab or space bytes from the end of header value.
+ headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
+
+ // 3. Set contentType to the isomorphic decoding of header value.
+ contentType = isomorphicDecode(headerValue)
+
+ break
+ }
+ case 'content-transfer-encoding': {
+ let headerValue = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
+ )
+
+ headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
+
+ encoding = isomorphicDecode(headerValue)
+
+ break
+ }
+ default: {
+ // Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.
+ // (Do nothing with those bytes.)
+ collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d,
+ input,
+ position
)
}
- } else if (isBlobLike(element)) {
- // 3. If element is a Blob, append the bytes it represents
- // to bytes.
- bytes.push(element)
}
+
+ // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A
+ // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).
+ if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {
+ return 'failure'
+ } else {
+ position.position += 2
+ }
+ }
+}
+
+/**
+ * @see https://andreubotella.github.io/multipart-form-data/#parse-a-multipart-form-data-name
+ * @param {Buffer} input
+ * @param {{ position: number }} position
+ */
+function parseMultipartFormDataName (input, position) {
+ // 1. Assert: The byte at (position - 1) is 0x22 (").
+ assert(input[position.position - 1] === 0x22)
+
+ // 2. Let name be the result of collecting a sequence of bytes that are not 0x0A (LF), 0x0D (CR) or 0x22 ("), given position.
+ /** @type {string | Buffer} */
+ let name = collectASequenceOfBytes(
+ (char) => char !== 0x0a && char !== 0x0d && char !== 0x22,
+ input,
+ position
+ )
+
+ // 3. If the byte at position is not 0x22 ("), return failure. Otherwise, advance position by 1.
+ if (input[position.position] !== 0x22) {
+ return null // name could be 'failure'
+ } else {
+ position.position++
}
- // 3. Return bytes.
- return bytes
+ // 4. Replace any occurrence of the following subsequences in name with the given byte:
+ // - `%0A`: 0x0A (LF)
+ // - `%0D`: 0x0D (CR)
+ // - `%22`: 0x22 (")
+ name = new TextDecoder().decode(name)
+ .replace(/%0A/ig, '\n')
+ .replace(/%0D/ig, '\r')
+ .replace(/%22/g, '"')
+
+ // 5. Return the UTF-8 decoding without BOM of name.
+ return name
}
/**
- * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
- * @param {string} s
+ * @param {(char: number) => boolean} condition
+ * @param {Buffer} input
+ * @param {{ position: number }} position
*/
-function convertLineEndingsNative (s) {
- // 1. Let native line ending be be the code point U+000A LF.
- let nativeLineEnding = '\n'
+function collectASequenceOfBytes (condition, input, position) {
+ let start = position.position
- // 2. If the underlying platform’s conventions are to
- // represent newlines as a carriage return and line feed
- // sequence, set native line ending to the code point
- // U+000D CR followed by the code point U+000A LF.
- if (process.platform === 'win32') {
- nativeLineEnding = '\r\n'
+ while (start < input.length && condition(input[start])) {
+ ++start
}
- return s.replace(/\r?\n/g, nativeLineEnding)
+ return input.subarray(position.position, (position.position = start))
}
-// If this function is moved to ./util.js, some tools (such as
-// rollup) will warn about circular dependencies. See:
-// https://github.com/nodejs/undici/issues/1629
-function isFileLike (object) {
- return (
- (NativeFile && object instanceof NativeFile) ||
- object instanceof File || (
- object &&
- (typeof object.stream === 'function' ||
- typeof object.arrayBuffer === 'function') &&
- object[Symbol.toStringTag] === 'File'
- )
- )
+/**
+ * @param {Buffer} buf
+ * @param {boolean} leading
+ * @param {boolean} trailing
+ * @param {(charCode: number) => boolean} predicate
+ * @returns {Buffer}
+ */
+function removeChars (buf, leading, trailing, predicate) {
+ let lead = 0
+ let trail = buf.length - 1
+
+ if (leading) {
+ while (lead < buf.length && predicate(buf[lead])) lead++
+ }
+
+ if (trailing) {
+ while (trail > 0 && predicate(buf[trail])) trail--
+ }
+
+ return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)
+}
+
+/**
+ * Checks if {@param buffer} starts with {@param start}
+ * @param {Buffer} buffer
+ * @param {Buffer} start
+ * @param {{ position: number }} position
+ */
+function bufferStartsWith (buffer, start, position) {
+ if (buffer.length < start.length) {
+ return false
+ }
+
+ for (let i = 0; i < start.length; i++) {
+ if (start[i] !== buffer[position.position + i]) {
+ return false
+ }
+ }
+
+ return true
}
-module.exports = { File, FileLike, isFileLike }
+module.exports = {
+ multipartFormDataParser,
+ validateBoundary
+}
/***/ }),
-/***/ 2015:
+/***/ 5910:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
-const { kState } = __nccwpck_require__(5861)
-const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
-const { webidl } = __nccwpck_require__(1744)
-const { Blob, File: NativeFile } = __nccwpck_require__(4300)
+const { isBlobLike, iteratorMixin } = __nccwpck_require__(3168)
+const { kState } = __nccwpck_require__(3627)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { FileLike, isFileLike } = __nccwpck_require__(7114)
+const { webidl } = __nccwpck_require__(5893)
+const { File: NativeFile } = __nccwpck_require__(4573)
+const nodeUtil = __nccwpck_require__(7975)
/** @type {globalThis['File']} */
-const File = NativeFile ?? UndiciFile
+const File = globalThis.File ?? NativeFile
// https://xhr.spec.whatwg.org/#formdata
class FormData {
constructor (form) {
+ webidl.util.markAsUncloneable(this)
+
if (form !== undefined) {
throw webidl.errors.conversionFailed({
prefix: 'FormData constructor',
@@ -24829,7 +28162,8 @@ class FormData {
append (name, value, filename = undefined) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
+ const prefix = 'FormData.append'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
if (arguments.length === 3 && !isBlobLike(value)) {
throw new TypeError(
@@ -24839,12 +28173,12 @@ class FormData {
// 1. Let value be value if given; otherwise blobValue.
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
value = isBlobLike(value)
- ? webidl.converters.Blob(value, { strict: false })
- : webidl.converters.USVString(value)
+ ? webidl.converters.Blob(value, prefix, 'value', { strict: false })
+ : webidl.converters.USVString(value, prefix, 'value')
filename = arguments.length === 3
- ? webidl.converters.USVString(filename)
+ ? webidl.converters.USVString(filename, prefix, 'filename')
: undefined
// 2. Let entry be the result of creating an entry with
@@ -24858,9 +28192,10 @@ class FormData {
delete (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
+ const prefix = 'FormData.delete'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// The delete(name) method steps are to remove all entries whose name
// is name from this’s entry list.
@@ -24870,9 +28205,10 @@ class FormData {
get (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
+ const prefix = 'FormData.get'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// 1. If there is no entry whose name is name in this’s entry list,
// then return null.
@@ -24889,9 +28225,10 @@ class FormData {
getAll (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
+ const prefix = 'FormData.getAll'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// 1. If there is no entry whose name is name in this’s entry list,
// then return the empty list.
@@ -24905,9 +28242,10 @@ class FormData {
has (name) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
+ const prefix = 'FormData.has'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
// The has(name) method steps are to return true if there is an entry
// whose name is name in this’s entry list; otherwise false.
@@ -24917,7 +28255,8 @@ class FormData {
set (name, value, filename = undefined) {
webidl.brandCheck(this, FormData)
- webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
+ const prefix = 'FormData.set'
+ webidl.argumentLengthCheck(arguments, 2, prefix)
if (arguments.length === 3 && !isBlobLike(value)) {
throw new TypeError(
@@ -24930,12 +28269,12 @@ class FormData {
// 1. Let value be value if given; otherwise blobValue.
- name = webidl.converters.USVString(name)
+ name = webidl.converters.USVString(name, prefix, 'name')
value = isBlobLike(value)
- ? webidl.converters.Blob(value, { strict: false })
- : webidl.converters.USVString(value)
+ ? webidl.converters.Blob(value, prefix, 'name', { strict: false })
+ : webidl.converters.USVString(value, prefix, 'name')
filename = arguments.length === 3
- ? toUSVString(filename)
+ ? webidl.converters.USVString(filename, prefix, 'name')
: undefined
// 2. Let entry be the result of creating an entry with name, value, and
@@ -24957,60 +28296,40 @@ class FormData {
}
}
- entries () {
- webidl.brandCheck(this, FormData)
-
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'key+value'
- )
- }
+ [nodeUtil.inspect.custom] (depth, options) {
+ const state = this[kState].reduce((a, b) => {
+ if (a[b.name]) {
+ if (Array.isArray(a[b.name])) {
+ a[b.name].push(b.value)
+ } else {
+ a[b.name] = [a[b.name], b.value]
+ }
+ } else {
+ a[b.name] = b.value
+ }
- keys () {
- webidl.brandCheck(this, FormData)
+ return a
+ }, { __proto__: null })
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'key'
- )
- }
+ options.depth ??= depth
+ options.colors ??= true
- values () {
- webidl.brandCheck(this, FormData)
+ const output = nodeUtil.formatWithOptions(options, state)
- return makeIterator(
- () => this[kState].map(pair => [pair.name, pair.value]),
- 'FormData',
- 'value'
- )
- }
-
- /**
- * @param {(value: string, key: string, self: FormData) => void} callbackFn
- * @param {unknown} thisArg
- */
- forEach (callbackFn, thisArg = globalThis) {
- webidl.brandCheck(this, FormData)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
-
- if (typeof callbackFn !== 'function') {
- throw new TypeError(
- "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
- )
- }
-
- for (const [key, value] of this) {
- callbackFn.apply(thisArg, [value, key, this])
- }
+ // remove [Object null prototype]
+ return `FormData ${output.slice(output.indexOf(']') + 2)}`
}
}
-FormData.prototype[Symbol.iterator] = FormData.prototype.entries
+iteratorMixin('FormData', FormData, kState, 'name', 'value')
Object.defineProperties(FormData.prototype, {
+ append: kEnumerableProperty,
+ delete: kEnumerableProperty,
+ get: kEnumerableProperty,
+ getAll: kEnumerableProperty,
+ has: kEnumerableProperty,
+ set: kEnumerableProperty,
[Symbol.toStringTag]: {
value: 'FormData',
configurable: true
@@ -25026,15 +28345,12 @@ Object.defineProperties(FormData.prototype, {
*/
function makeEntry (name, value, filename) {
// 1. Set name to the result of converting name into a scalar value string.
- // "To convert a string into a scalar value string, replace any surrogates
- // with U+FFFD."
- // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
- name = Buffer.from(name).toString('utf8')
+ // Note: This operation was done by the webidl converter USVString.
// 2. If value is a string, then set value to the result of converting
// value into a scalar value string.
if (typeof value === 'string') {
- value = Buffer.from(value).toString('utf8')
+ // Note: This operation was done by the webidl converter USVString.
} else {
// 3. Otherwise:
@@ -25055,7 +28371,7 @@ function makeEntry (name, value, filename) {
lastModified: value.lastModified
}
- value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
+ value = value instanceof NativeFile
? new File([value], filename, options)
: new FileLike(value, filename, options)
}
@@ -25065,15 +28381,14 @@ function makeEntry (name, value, filename) {
return { name, value }
}
-module.exports = { FormData }
+module.exports = { FormData, makeEntry }
/***/ }),
-/***/ 1246:
+/***/ 1059:
/***/ ((module) => {
-"use strict";
// In case of breaking changes, increase the version
@@ -25118,24 +28433,23 @@ module.exports = {
/***/ }),
-/***/ 554:
+/***/ 660:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
// https://github.com/Ethan-Arrowood/undici-fetch
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const { kGuard } = __nccwpck_require__(5861)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+const { kConstruct } = __nccwpck_require__(6443)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
const {
- makeIterator,
+ iteratorMixin,
isValidHeaderName,
isValidHeaderValue
-} = __nccwpck_require__(2538)
-const { webidl } = __nccwpck_require__(1744)
-const assert = __nccwpck_require__(9491)
+} = __nccwpck_require__(3168)
+const { webidl } = __nccwpck_require__(5893)
+const assert = __nccwpck_require__(4589)
+const util = __nccwpck_require__(7975)
const kHeadersMap = Symbol('headers map')
const kHeadersSortedMap = Symbol('headers map sorted')
@@ -25226,24 +28540,27 @@ function appendHeader (headers, name, value) {
// 3. If headers’s guard is "immutable", then throw a TypeError.
// 4. Otherwise, if headers’s guard is "request" and name is a
// forbidden header name, return.
+ // 5. Otherwise, if headers’s guard is "request-no-cors":
+ // TODO
// Note: undici does not implement forbidden header names
- if (headers[kGuard] === 'immutable') {
+ if (getHeadersGuard(headers) === 'immutable') {
throw new TypeError('immutable')
- } else if (headers[kGuard] === 'request-no-cors') {
- // 5. Otherwise, if headers’s guard is "request-no-cors":
- // TODO
}
// 6. Otherwise, if headers’s guard is "response" and name is a
// forbidden response-header name, return.
// 7. Append (name, value) to headers’s header list.
- return headers[kHeadersList].append(name, value)
+ return getHeadersList(headers).append(name, value, false)
// 8. If headers’s guard is "request-no-cors", then remove
// privileged no-CORS request headers from headers
}
+function compareHeaderName (a, b) {
+ return a[0] < b[0] ? -1 : 1
+}
+
class HeadersList {
/** @type {[string, string][]|null} */
cookies = null
@@ -25259,14 +28576,17 @@ class HeadersList {
}
}
- // https://fetch.spec.whatwg.org/#header-list-contains
- contains (name) {
+ /**
+ * @see https://fetch.spec.whatwg.org/#header-list-contains
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ */
+ contains (name, isLowerCase) {
// A header list list contains a header name name if list
// contains a header whose name is a byte-case-insensitive
// match for name.
- name = name.toLowerCase()
- return this[kHeadersMap].has(name)
+ return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase())
}
clear () {
@@ -25275,13 +28595,18 @@ class HeadersList {
this.cookies = null
}
- // https://fetch.spec.whatwg.org/#concept-header-list-append
- append (name, value) {
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-append
+ * @param {string} name
+ * @param {string} value
+ * @param {boolean} isLowerCase
+ */
+ append (name, value, isLowerCase) {
this[kHeadersSortedMap] = null
// 1. If list contains name, then set name to the first such
// header’s name.
- const lowercaseName = name.toLowerCase()
+ const lowercaseName = isLowerCase ? name : name.toLowerCase()
const exists = this[kHeadersMap].get(lowercaseName)
// 2. Append (name, value) to list.
@@ -25296,15 +28621,19 @@ class HeadersList {
}
if (lowercaseName === 'set-cookie') {
- this.cookies ??= []
- this.cookies.push(value)
+ (this.cookies ??= []).push(value)
}
}
- // https://fetch.spec.whatwg.org/#concept-header-list-set
- set (name, value) {
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-set
+ * @param {string} name
+ * @param {string} value
+ * @param {boolean} isLowerCase
+ */
+ set (name, value, isLowerCase) {
this[kHeadersSortedMap] = null
- const lowercaseName = name.toLowerCase()
+ const lowercaseName = isLowerCase ? name : name.toLowerCase()
if (lowercaseName === 'set-cookie') {
this.cookies = [value]
@@ -25317,11 +28646,14 @@ class HeadersList {
this[kHeadersMap].set(lowercaseName, { name, value })
}
- // https://fetch.spec.whatwg.org/#concept-header-list-delete
- delete (name) {
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-delete
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ */
+ delete (name, isLowerCase) {
this[kHeadersSortedMap] = null
-
- name = name.toLowerCase()
+ if (!isLowerCase) name = name.toLowerCase()
if (name === 'set-cookie') {
this.cookies = null
@@ -25330,20 +28662,23 @@ class HeadersList {
this[kHeadersMap].delete(name)
}
- // https://fetch.spec.whatwg.org/#concept-header-list-get
- get (name) {
- const value = this[kHeadersMap].get(name.toLowerCase())
-
+ /**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-get
+ * @param {string} name
+ * @param {boolean} isLowerCase
+ * @returns {string | null}
+ */
+ get (name, isLowerCase) {
// 1. If list does not contain name, then return null.
// 2. Return the values of all headers in list whose name
// is a byte-case-insensitive match for name,
// separated from each other by 0x2C 0x20, in order.
- return value === undefined ? null : value.value
+ return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null
}
* [Symbol.iterator] () {
// use the lowercased name
- for (const [name, { value }] of this[kHeadersMap]) {
+ for (const { 0: name, 1: { value } } of this[kHeadersMap]) {
yield [name, value]
}
}
@@ -25351,7 +28686,7 @@ class HeadersList {
get entries () {
const headers = {}
- if (this[kHeadersMap].size) {
+ if (this[kHeadersMap].size !== 0) {
for (const { name, value } of this[kHeadersMap].values()) {
headers[name] = value
}
@@ -25359,24 +28694,125 @@ class HeadersList {
return headers
}
+
+ rawValues () {
+ return this[kHeadersMap].values()
+ }
+
+ get entriesList () {
+ const headers = []
+
+ if (this[kHeadersMap].size !== 0) {
+ for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) {
+ if (lowerName === 'set-cookie') {
+ for (const cookie of this.cookies) {
+ headers.push([name, cookie])
+ }
+ } else {
+ headers.push([name, value])
+ }
+ }
+ }
+
+ return headers
+ }
+
+ // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set
+ toSortedArray () {
+ const size = this[kHeadersMap].size
+ const array = new Array(size)
+ // In most cases, you will use the fast-path.
+ // fast-path: Use binary insertion sort for small arrays.
+ if (size <= 32) {
+ if (size === 0) {
+ // If empty, it is an empty array. To avoid the first index assignment.
+ return array
+ }
+ // Improve performance by unrolling loop and avoiding double-loop.
+ // Double-loop-less version of the binary insertion sort.
+ const iterator = this[kHeadersMap][Symbol.iterator]()
+ const firstValue = iterator.next().value
+ // set [name, value] to first index.
+ array[0] = [firstValue[0], firstValue[1].value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(firstValue[1].value !== null)
+ for (
+ let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value;
+ i < size;
+ ++i
+ ) {
+ // get next value
+ value = iterator.next().value
+ // set [name, value] to current index.
+ x = array[i] = [value[0], value[1].value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(x[1] !== null)
+ left = 0
+ right = i
+ // binary search
+ while (left < right) {
+ // middle index
+ pivot = left + ((right - left) >> 1)
+ // compare header name
+ if (array[pivot][0] <= x[0]) {
+ left = pivot + 1
+ } else {
+ right = pivot
+ }
+ }
+ if (i !== pivot) {
+ j = i
+ while (j > left) {
+ array[j] = array[--j]
+ }
+ array[left] = x
+ }
+ }
+ /* c8 ignore next 4 */
+ if (!iterator.next().done) {
+ // This is for debugging and will never be called.
+ throw new TypeError('Unreachable')
+ }
+ return array
+ } else {
+ // This case would be a rare occurrence.
+ // slow-path: fallback
+ let i = 0
+ for (const { 0: name, 1: { value } } of this[kHeadersMap]) {
+ array[i++] = [name, value]
+ // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
+ // 3.2.2. Assert: value is non-null.
+ assert(value !== null)
+ }
+ return array.sort(compareHeaderName)
+ }
+ }
}
// https://fetch.spec.whatwg.org/#headers-class
class Headers {
+ #guard
+ #headersList
+
constructor (init = undefined) {
+ webidl.util.markAsUncloneable(this)
+
if (init === kConstruct) {
return
}
- this[kHeadersList] = new HeadersList()
+
+ this.#headersList = new HeadersList()
// The new Headers(init) constructor steps are:
// 1. Set this’s guard to "none".
- this[kGuard] = 'none'
+ this.#guard = 'none'
// 2. If init is given, then fill this with init.
if (init !== undefined) {
- init = webidl.converters.HeadersInit(init)
+ init = webidl.converters.HeadersInit(init, 'Headers contructor', 'init')
fill(this, init)
}
}
@@ -25385,10 +28821,11 @@ class Headers {
append (name, value) {
webidl.brandCheck(this, Headers)
- webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
+ webidl.argumentLengthCheck(arguments, 2, 'Headers.append')
- name = webidl.converters.ByteString(name)
- value = webidl.converters.ByteString(value)
+ const prefix = 'Headers.append'
+ name = webidl.converters.ByteString(name, prefix, 'name')
+ value = webidl.converters.ByteString(value, prefix, 'value')
return appendHeader(this, name, value)
}
@@ -25397,9 +28834,10 @@ class Headers {
delete (name) {
webidl.brandCheck(this, Headers)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')
- name = webidl.converters.ByteString(name)
+ const prefix = 'Headers.delete'
+ name = webidl.converters.ByteString(name, prefix, 'name')
// 1. If name is not a header name, then throw a TypeError.
if (!isValidHeaderName(name)) {
@@ -25420,36 +28858,35 @@ class Headers {
// 5. Otherwise, if this’s guard is "response" and name is
// a forbidden response-header name, return.
// Note: undici does not implement forbidden header names
- if (this[kGuard] === 'immutable') {
+ if (this.#guard === 'immutable') {
throw new TypeError('immutable')
- } else if (this[kGuard] === 'request-no-cors') {
- // TODO
}
// 6. If this’s header list does not contain name, then
// return.
- if (!this[kHeadersList].contains(name)) {
+ if (!this.#headersList.contains(name, false)) {
return
}
// 7. Delete name from this’s header list.
// 8. If this’s guard is "request-no-cors", then remove
// privileged no-CORS request headers from this.
- this[kHeadersList].delete(name)
+ this.#headersList.delete(name, false)
}
// https://fetch.spec.whatwg.org/#dom-headers-get
get (name) {
webidl.brandCheck(this, Headers)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.get')
- name = webidl.converters.ByteString(name)
+ const prefix = 'Headers.get'
+ name = webidl.converters.ByteString(name, prefix, 'name')
// 1. If name is not a header name, then throw a TypeError.
if (!isValidHeaderName(name)) {
throw webidl.errors.invalidArgument({
- prefix: 'Headers.get',
+ prefix,
value: name,
type: 'header name'
})
@@ -25457,21 +28894,22 @@ class Headers {
// 2. Return the result of getting name from this’s header
// list.
- return this[kHeadersList].get(name)
+ return this.#headersList.get(name, false)
}
// https://fetch.spec.whatwg.org/#dom-headers-has
has (name) {
webidl.brandCheck(this, Headers)
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
+ webidl.argumentLengthCheck(arguments, 1, 'Headers.has')
- name = webidl.converters.ByteString(name)
+ const prefix = 'Headers.has'
+ name = webidl.converters.ByteString(name, prefix, 'name')
// 1. If name is not a header name, then throw a TypeError.
if (!isValidHeaderName(name)) {
throw webidl.errors.invalidArgument({
- prefix: 'Headers.has',
+ prefix,
value: name,
type: 'header name'
})
@@ -25479,17 +28917,18 @@ class Headers {
// 2. Return true if this’s header list contains name;
// otherwise false.
- return this[kHeadersList].contains(name)
+ return this.#headersList.contains(name, false)
}
// https://fetch.spec.whatwg.org/#dom-headers-set
set (name, value) {
webidl.brandCheck(this, Headers)
- webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
+ webidl.argumentLengthCheck(arguments, 2, 'Headers.set')
- name = webidl.converters.ByteString(name)
- value = webidl.converters.ByteString(value)
+ const prefix = 'Headers.set'
+ name = webidl.converters.ByteString(name, prefix, 'name')
+ value = webidl.converters.ByteString(value, prefix, 'value')
// 1. Normalize value.
value = headerValueNormalize(value)
@@ -25498,13 +28937,13 @@ class Headers {
// header value, then throw a TypeError.
if (!isValidHeaderName(name)) {
throw webidl.errors.invalidArgument({
- prefix: 'Headers.set',
+ prefix,
value: name,
type: 'header name'
})
} else if (!isValidHeaderValue(value)) {
throw webidl.errors.invalidArgument({
- prefix: 'Headers.set',
+ prefix,
value,
type: 'header value'
})
@@ -25519,16 +28958,14 @@ class Headers {
// 6. Otherwise, if this’s guard is "response" and name is a
// forbidden response-header name, return.
// Note: undici does not implement forbidden header names
- if (this[kGuard] === 'immutable') {
+ if (this.#guard === 'immutable') {
throw new TypeError('immutable')
- } else if (this[kGuard] === 'request-no-cors') {
- // TODO
}
// 7. Set (name, value) in this’s header list.
// 8. If this’s guard is "request-no-cors", then remove
// privileged no-CORS request headers from this
- this[kHeadersList].set(name, value)
+ this.#headersList.set(name, value, false)
}
// https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
@@ -25539,7 +28976,7 @@ class Headers {
// 2. Return the values of all headers in this’s header list whose name is
// a byte-case-insensitive match for `Set-Cookie`, in order.
- const list = this[kHeadersList].cookies
+ const list = this.#headersList.cookies
if (list) {
return [...list]
@@ -25550,8 +28987,8 @@ class Headers {
// https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
get [kHeadersSortedMap] () {
- if (this[kHeadersList][kHeadersSortedMap]) {
- return this[kHeadersList][kHeadersSortedMap]
+ if (this.#headersList[kHeadersSortedMap]) {
+ return this.#headersList[kHeadersSortedMap]
}
// 1. Let headers be an empty list of headers with the key being the name
@@ -25560,12 +28997,19 @@ class Headers {
// 2. Let names be the result of convert header names to a sorted-lowercase
// set with all the names of the headers in list.
- const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
- const cookies = this[kHeadersList].cookies
+ const names = this.#headersList.toSortedArray()
+
+ const cookies = this.#headersList.cookies
+
+ // fast-path
+ if (cookies === null || cookies.length === 1) {
+ // Note: The non-null assertion of value has already been done by `HeadersList#toSortedArray`
+ return (this.#headersList[kHeadersSortedMap] = names)
+ }
// 3. For each name of names:
for (let i = 0; i < names.length; ++i) {
- const [name, value] = names[i]
+ const { 0: name, 1: value } = names[i]
// 1. If name is `set-cookie`, then:
if (name === 'set-cookie') {
// 1. Let values be a list of all values of headers in list whose name
@@ -25582,95 +29026,47 @@ class Headers {
// 1. Let value be the result of getting name from list.
// 2. Assert: value is non-null.
- assert(value !== null)
+ // Note: This operation was done by `HeadersList#toSortedArray`.
// 3. Append (name, value) to headers.
headers.push([name, value])
}
}
- this[kHeadersList][kHeadersSortedMap] = headers
-
// 4. Return headers.
- return headers
+ return (this.#headersList[kHeadersSortedMap] = headers)
}
- keys () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'key')
- }
+ [util.inspect.custom] (depth, options) {
+ options.depth ??= depth
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'key'
- )
+ return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`
}
- values () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'value')
- }
-
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'value'
- )
+ static getHeadersGuard (o) {
+ return o.#guard
}
- entries () {
- webidl.brandCheck(this, Headers)
-
- if (this[kGuard] === 'immutable') {
- const value = this[kHeadersSortedMap]
- return makeIterator(() => value, 'Headers',
- 'key+value')
- }
-
- return makeIterator(
- () => [...this[kHeadersSortedMap].values()],
- 'Headers',
- 'key+value'
- )
+ static setHeadersGuard (o, guard) {
+ o.#guard = guard
}
- /**
- * @param {(value: string, key: string, self: Headers) => void} callbackFn
- * @param {unknown} thisArg
- */
- forEach (callbackFn, thisArg = globalThis) {
- webidl.brandCheck(this, Headers)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
-
- if (typeof callbackFn !== 'function') {
- throw new TypeError(
- "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
- )
- }
-
- for (const [key, value] of this) {
- callbackFn.apply(thisArg, [value, key, this])
- }
+ static getHeadersList (o) {
+ return o.#headersList
}
- [Symbol.for('nodejs.util.inspect.custom')] () {
- webidl.brandCheck(this, Headers)
-
- return this[kHeadersList]
+ static setHeadersList (o, list) {
+ o.#headersList = list
}
}
-Headers.prototype[Symbol.iterator] = Headers.prototype.entries
+const { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers
+Reflect.deleteProperty(Headers, 'getHeadersGuard')
+Reflect.deleteProperty(Headers, 'setHeadersGuard')
+Reflect.deleteProperty(Headers, 'getHeadersList')
+Reflect.deleteProperty(Headers, 'setHeadersList')
+
+iteratorMixin('Headers', Headers, kHeadersSortedMap, 0, 1)
Object.defineProperties(Headers.prototype, {
append: kEnumerableProperty,
@@ -25679,24 +29075,34 @@ Object.defineProperties(Headers.prototype, {
has: kEnumerableProperty,
set: kEnumerableProperty,
getSetCookie: kEnumerableProperty,
- keys: kEnumerableProperty,
- values: kEnumerableProperty,
- entries: kEnumerableProperty,
- forEach: kEnumerableProperty,
- [Symbol.iterator]: { enumerable: false },
[Symbol.toStringTag]: {
value: 'Headers',
configurable: true
+ },
+ [util.inspect.custom]: {
+ enumerable: false
}
})
-webidl.converters.HeadersInit = function (V) {
+webidl.converters.HeadersInit = function (V, prefix, argument) {
if (webidl.util.Type(V) === 'Object') {
- if (V[Symbol.iterator]) {
- return webidl.converters['sequence>'](V)
+ const iterator = Reflect.get(V, Symbol.iterator)
+
+ // A work-around to ensure we send the properly-cased Headers when V is a Headers object.
+ // Read https://github.com/nodejs/undici/pull/3159#issuecomment-2075537226 before touching, please.
+ if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) { // Headers object
+ try {
+ return getHeadersList(V).entriesList
+ } catch {
+ // fall-through
+ }
+ }
+
+ if (typeof iterator === 'function') {
+ return webidl.converters['sequence>'](V, prefix, argument, iterator.bind(V))
}
- return webidl.converters['record'](V)
+ return webidl.converters['record'](V, prefix, argument)
}
throw webidl.errors.conversionFailed({
@@ -25708,31 +29114,36 @@ webidl.converters.HeadersInit = function (V) {
module.exports = {
fill,
+ // for test.
+ compareHeaderName,
Headers,
- HeadersList
+ HeadersList,
+ getHeadersGuard,
+ setHeadersGuard,
+ setHeadersList,
+ getHeadersList
}
/***/ }),
-/***/ 4881:
+/***/ 4398:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
// https://github.com/Ethan-Arrowood/undici-fetch
const {
- Response,
makeNetworkError,
makeAppropriateNetworkError,
filterResponse,
- makeResponse
-} = __nccwpck_require__(7823)
-const { Headers } = __nccwpck_require__(554)
-const { Request, makeRequest } = __nccwpck_require__(8359)
-const zlib = __nccwpck_require__(9796)
+ makeResponse,
+ fromInnerResponse
+} = __nccwpck_require__(9051)
+const { HeadersList } = __nccwpck_require__(660)
+const { Request, cloneRequest } = __nccwpck_require__(9967)
+const zlib = __nccwpck_require__(8522)
const {
bytesMatch,
makePolicyContainer,
@@ -25761,33 +29172,38 @@ const {
isomorphicEncode,
urlIsLocal,
urlIsHttpHttpsScheme,
- urlHasHttpsScheme
-} = __nccwpck_require__(2538)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const assert = __nccwpck_require__(9491)
-const { safelyExtractBody } = __nccwpck_require__(1472)
+ urlHasHttpsScheme,
+ clampAndCoarsenConnectionTimingInfo,
+ simpleRangeHeaderValue,
+ buildContentRange,
+ createInflate,
+ extractMimeType
+} = __nccwpck_require__(3168)
+const { kState, kDispatcher } = __nccwpck_require__(3627)
+const assert = __nccwpck_require__(4589)
+const { safelyExtractBody, extractBody } = __nccwpck_require__(4492)
const {
redirectStatusSet,
nullBodyStatus,
safeMethodsSet,
requestBodyHeader,
- subresourceSet,
- DOMException
-} = __nccwpck_require__(1037)
-const { kHeadersList } = __nccwpck_require__(2785)
-const EE = __nccwpck_require__(2361)
-const { Readable, pipeline } = __nccwpck_require__(2781)
-const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
-const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
-const { TransformStream } = __nccwpck_require__(5356)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { webidl } = __nccwpck_require__(1744)
-const { STATUS_CODES } = __nccwpck_require__(3685)
+ subresourceSet
+} = __nccwpck_require__(4495)
+const EE = __nccwpck_require__(8474)
+const { Readable, pipeline, finished } = __nccwpck_require__(7075)
+const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3440)
+const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(1900)
+const { getGlobalDispatcher } = __nccwpck_require__(2581)
+const { webidl } = __nccwpck_require__(5893)
+const { STATUS_CODES } = __nccwpck_require__(7067)
const GET_OR_HEAD = ['GET', 'HEAD']
+const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined'
+ ? 'node'
+ : 'undici'
+
/** @type {import('buffer').resolveObjectURL} */
let resolveObjectURL
-let ReadableStream = globalThis.ReadableStream
class Fetch extends EE {
constructor (dispatcher) {
@@ -25797,12 +29213,6 @@ class Fetch extends EE {
this.connection = null
this.dump = false
this.state = 'ongoing'
- // 2 terminated listeners get added per request,
- // but only 1 gets removed. If there are 20 redirects,
- // 21 listeners will be added.
- // See https://github.com/nodejs/undici/issues/1711
- // TODO (fix): Find and fix root cause for leaked listener.
- this.setMaxListeners(21)
}
terminate (reason) {
@@ -25842,12 +29252,16 @@ class Fetch extends EE {
}
}
+function handleFetchDone (response) {
+ finalizeAndReportTiming(response, 'fetch')
+}
+
// https://fetch.spec.whatwg.org/#fetch-method
-function fetch (input, init = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
+function fetch (input, init = undefined) {
+ webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch')
// 1. Let p be a new promise.
- const p = createDeferredPromise()
+ let p = createDeferredPromise()
// 2. Let requestObject be the result of invoking the initial value of
// Request as constructor with input and init as arguments. If this throws
@@ -25887,7 +29301,6 @@ function fetch (input, init = {}) {
let responseObject = null
// 8. Let relevantRealm be this’s relevant Realm.
- const relevantRealm = null
// 9. Let locallyAborted be false.
let locallyAborted = false
@@ -25908,16 +29321,17 @@ function fetch (input, init = {}) {
// 3. Abort controller with requestObject’s signal’s abort reason.
controller.abort(requestObject.signal.reason)
+ const realResponse = responseObject?.deref()
+
// 4. Abort the fetch() call with p, request, responseObject,
// and requestObject’s signal’s abort reason.
- abortFetch(p, request, responseObject, requestObject.signal.reason)
+ abortFetch(p, request, realResponse, requestObject.signal.reason)
}
)
// 12. Let handleFetchDone given response response be to finalize and
// report timing with response, globalObject, and "fetch".
- const handleFetchDone = (response) =>
- finalizeAndReportTiming(response, 'fetch')
+ // see function handleFetchDone
// 13. Set controller to the result of calling fetch given request,
// with processResponseEndOfBody set to handleFetchDone, and processResponse
@@ -25926,7 +29340,7 @@ function fetch (input, init = {}) {
const processResponse = (response) => {
// 1. If locallyAborted is true, terminate these substeps.
if (locallyAborted) {
- return Promise.resolve()
+ return
}
// 2. If response’s aborted flag is set, then:
@@ -25939,36 +29353,30 @@ function fetch (input, init = {}) {
// deserializedError.
abortFetch(p, request, responseObject, controller.serializedAbortReason)
- return Promise.resolve()
+ return
}
// 3. If response is a network error, then reject p with a TypeError
// and terminate these substeps.
if (response.type === 'error') {
- p.reject(
- Object.assign(new TypeError('fetch failed'), { cause: response.error })
- )
- return Promise.resolve()
+ p.reject(new TypeError('fetch failed', { cause: response.error }))
+ return
}
// 4. Set responseObject to the result of creating a Response object,
// given response, "immutable", and relevantRealm.
- responseObject = new Response()
- responseObject[kState] = response
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kHeadersList] = response.headersList
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
+ responseObject = new WeakRef(fromInnerResponse(response, 'immutable'))
// 5. Resolve p with responseObject.
- p.resolve(responseObject)
+ p.resolve(responseObject.deref())
+ p = null
}
controller = fetching({
request,
processResponseEndOfBody: handleFetchDone,
processResponse,
- dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
+ dispatcher: requestObject[kDispatcher] // undici
})
// 14. Return p.
@@ -26031,7 +29439,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {
// global, and cacheState.
markResourceTiming(
timingInfo,
- originalURL,
+ originalURL.href,
initiatorType,
globalThis,
cacheState
@@ -26039,23 +29447,15 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {
}
// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
-function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
- if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
- performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
- }
-}
+const markResourceTiming = performance.markResourceTiming
// https://fetch.spec.whatwg.org/#abort-fetch
function abortFetch (p, request, responseObject, error) {
- // Note: AbortSignal.reason was added in node v17.2.0
- // which would give us an undefined error to reject with.
- // Remove this once node v16 is no longer supported.
- if (!error) {
- error = new DOMException('The operation was aborted.', 'AbortError')
- }
-
// 1. Reject promise with error.
- p.reject(error)
+ if (p) {
+ // We might have already resolved the promise at this stage
+ p.reject(error)
+ }
// 2. If request’s body is not null and is readable, then cancel request’s
// body with error.
@@ -26099,8 +29499,11 @@ function fetching ({
processResponseEndOfBody,
processResponseConsumeBody,
useParallelQueue = false,
- dispatcher // undici
+ dispatcher = getGlobalDispatcher() // undici
}) {
+ // Ensure that the dispatcher is set accordingly
+ assert(dispatcher)
+
// 1. Let taskDestination be null.
let taskDestination = null
@@ -26125,9 +29528,9 @@ function fetching ({
// 5. Let timingInfo be a new fetch timing info whose start time and
// post-redirect start time are the coarsened shared current time given
// crossOriginIsolatedCapability.
- const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
+ const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
const timingInfo = createOpaqueTimingInfo({
- startTime: currenTime
+ startTime: currentTime
})
// 6. Let fetchParams be a new fetch params whose
@@ -26173,8 +29576,7 @@ function fetching ({
// 9. If request’s origin is "client", then set request’s origin to request’s
// client’s origin.
if (request.origin === 'client') {
- // TODO: What if request.client is null?
- request.origin = request.client?.origin
+ request.origin = request.client.origin
}
// 10. If all of the following conditions are true:
@@ -26196,7 +29598,7 @@ function fetching ({
}
// 12. If request’s header list does not contain `Accept`, then:
- if (!request.headersList.contains('accept')) {
+ if (!request.headersList.contains('accept', true)) {
// 1. Let value be `*/*`.
const value = '*/*'
@@ -26213,14 +29615,14 @@ function fetching ({
// TODO
// 3. Append `Accept`/value to request’s header list.
- request.headersList.append('accept', value)
+ request.headersList.append('accept', value, true)
}
// 13. If request’s header list does not contain `Accept-Language`, then
// user agents should append `Accept-Language`/an appropriate value to
// request’s header list.
- if (!request.headersList.contains('accept-language')) {
- request.headersList.append('accept-language', '*')
+ if (!request.headersList.contains('accept-language', true)) {
+ request.headersList.append('accept-language', '*', true)
}
// 14. If request’s priority is null, then use request’s initiator and
@@ -26439,7 +29841,7 @@ async function mainFetch (fetchParams, recursive = false) {
response.type === 'opaque' &&
internalResponse.status === 206 &&
internalResponse.rangeRequested &&
- !request.headers.contains('range')
+ !request.headers.contains('range', true)
) {
response = internalResponse = makeNetworkError()
}
@@ -26524,7 +29926,7 @@ function schemeFetch (fetchParams) {
}
case 'blob:': {
if (!resolveObjectURL) {
- resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
+ resolveObjectURL = (__nccwpck_require__(4573).resolveObjectURL)
}
// 1. Let blobURLEntry be request’s current URL’s blob URL entry.
@@ -26536,38 +29938,118 @@ function schemeFetch (fetchParams) {
return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
}
- const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
+ const blob = resolveObjectURL(blobURLEntry.toString())
// 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
// object is not a Blob object, then return a network error.
- if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
+ if (request.method !== 'GET' || !isBlobLike(blob)) {
return Promise.resolve(makeNetworkError('invalid method'))
}
- // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
- const bodyWithType = safelyExtractBody(blobURLEntryObject)
+ // 3. Let blob be blobURLEntry’s object.
+ // Note: done above
- // 4. Let body be bodyWithType’s body.
- const body = bodyWithType[0]
+ // 4. Let response be a new response.
+ const response = makeResponse()
- // 5. Let length be body’s length, serialized and isomorphic encoded.
- const length = isomorphicEncode(`${body.length}`)
+ // 5. Let fullLength be blob’s size.
+ const fullLength = blob.size
- // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
- const type = bodyWithType[1] ?? ''
+ // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.
+ const serializedFullLength = isomorphicEncode(`${fullLength}`)
- // 7. Return a new response whose status message is `OK`, header list is
- // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
- const response = makeResponse({
- statusText: 'OK',
- headersList: [
- ['content-length', { name: 'Content-Length', value: length }],
- ['content-type', { name: 'Content-Type', value: type }]
- ]
- })
+ // 7. Let type be blob’s type.
+ const type = blob.type
- response.body = body
+ // 8. If request’s header list does not contain `Range`:
+ // 9. Otherwise:
+ if (!request.headersList.contains('range', true)) {
+ // 1. Let bodyWithType be the result of safely extracting blob.
+ // Note: in the FileAPI a blob "object" is a Blob *or* a MediaSource.
+ // In node, this can only ever be a Blob. Therefore we can safely
+ // use extractBody directly.
+ const bodyWithType = extractBody(blob)
+
+ // 2. Set response’s status message to `OK`.
+ response.statusText = 'OK'
+
+ // 3. Set response’s body to bodyWithType’s body.
+ response.body = bodyWithType[0]
+
+ // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».
+ response.headersList.set('content-length', serializedFullLength, true)
+ response.headersList.set('content-type', type, true)
+ } else {
+ // 1. Set response’s range-requested flag.
+ response.rangeRequested = true
+
+ // 2. Let rangeHeader be the result of getting `Range` from request’s header list.
+ const rangeHeader = request.headersList.get('range', true)
+
+ // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true.
+ const rangeValue = simpleRangeHeaderValue(rangeHeader, true)
+
+ // 4. If rangeValue is failure, then return a network error.
+ if (rangeValue === 'failure') {
+ return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
+ }
+
+ // 5. Let (rangeStart, rangeEnd) be rangeValue.
+ let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue
+
+ // 6. If rangeStart is null:
+ // 7. Otherwise:
+ if (rangeStart === null) {
+ // 1. Set rangeStart to fullLength − rangeEnd.
+ rangeStart = fullLength - rangeEnd
+
+ // 2. Set rangeEnd to rangeStart + rangeEnd − 1.
+ rangeEnd = rangeStart + rangeEnd - 1
+ } else {
+ // 1. If rangeStart is greater than or equal to fullLength, then return a network error.
+ if (rangeStart >= fullLength) {
+ return Promise.resolve(makeNetworkError('Range start is greater than the blob\'s size.'))
+ }
+
+ // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set
+ // rangeEnd to fullLength − 1.
+ if (rangeEnd === null || rangeEnd >= fullLength) {
+ rangeEnd = fullLength - 1
+ }
+ }
+
+ // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart,
+ // rangeEnd + 1, and type.
+ const slicedBlob = blob.slice(rangeStart, rangeEnd, type)
+
+ // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob.
+ // Note: same reason as mentioned above as to why we use extractBody
+ const slicedBodyWithType = extractBody(slicedBlob)
+
+ // 10. Set response’s body to slicedBodyWithType’s body.
+ response.body = slicedBodyWithType[0]
+
+ // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.
+ const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`)
+
+ // 12. Let contentRange be the result of invoking build a content range given rangeStart,
+ // rangeEnd, and fullLength.
+ const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength)
+
+ // 13. Set response’s status to 206.
+ response.status = 206
+
+ // 14. Set response’s status message to `Partial Content`.
+ response.statusText = 'Partial Content'
+
+ // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength),
+ // (`Content-Type`, type), (`Content-Range`, contentRange) ».
+ response.headersList.set('content-length', serializedSlicedLength, true)
+ response.headersList.set('content-type', type, true)
+ response.headersList.set('content-range', contentRange, true)
+ }
+ // 10. Return response.
return Promise.resolve(response)
}
case 'data:': {
@@ -26629,92 +30111,128 @@ function finalizeResponse (fetchParams, response) {
// https://fetch.spec.whatwg.org/#fetch-finale
function fetchFinale (fetchParams, response) {
- // 1. If response is a network error, then:
- if (response.type === 'error') {
- // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
- response.urlList = [fetchParams.request.urlList[0]]
-
- // 2. Set response’s timing info to the result of creating an opaque timing
- // info for fetchParams’s timing info.
- response.timingInfo = createOpaqueTimingInfo({
- startTime: fetchParams.timingInfo.startTime
- })
- }
+ // 1. Let timingInfo be fetchParams’s timing info.
+ let timingInfo = fetchParams.timingInfo
- // 2. Let processResponseEndOfBody be the following steps:
+ // 2. If response is not a network error and fetchParams’s request’s client is a secure context,
+ // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting
+ // `Server-Timing` from response’s internal response’s header list.
+ // TODO
+
+ // 3. Let processResponseEndOfBody be the following steps:
const processResponseEndOfBody = () => {
- // 1. Set fetchParams’s request’s done flag.
- fetchParams.request.done = true
+ // 1. Let unsafeEndTime be the unsafe shared current time.
+ const unsafeEndTime = Date.now() // ?
- // If fetchParams’s process response end-of-body is not null,
- // then queue a fetch task to run fetchParams’s process response
- // end-of-body given response with fetchParams’s task destination.
- if (fetchParams.processResponseEndOfBody != null) {
- queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
+ // 2. If fetchParams’s request’s destination is "document", then set fetchParams’s controller’s
+ // full timing info to fetchParams’s timing info.
+ if (fetchParams.request.destination === 'document') {
+ fetchParams.controller.fullTimingInfo = timingInfo
}
- }
- // 3. If fetchParams’s process response is non-null, then queue a fetch task
- // to run fetchParams’s process response given response, with fetchParams’s
- // task destination.
- if (fetchParams.processResponse != null) {
- queueMicrotask(() => fetchParams.processResponse(response))
- }
+ // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:
+ fetchParams.controller.reportTimingSteps = () => {
+ // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.
+ if (fetchParams.request.url.protocol !== 'https:') {
+ return
+ }
- // 4. If response’s body is null, then run processResponseEndOfBody.
- if (response.body == null) {
- processResponseEndOfBody()
- } else {
- // 5. Otherwise:
+ // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global.
+ timingInfo.endTime = unsafeEndTime
+
+ // 3. Let cacheState be response’s cache state.
+ let cacheState = response.cacheState
+
+ // 4. Let bodyInfo be response’s body info.
+ const bodyInfo = response.bodyInfo
+
+ // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an
+ // opaque timing info for timingInfo and set cacheState to the empty string.
+ if (!response.timingAllowPassed) {
+ timingInfo = createOpaqueTimingInfo(timingInfo)
+
+ cacheState = ''
+ }
+
+ // 6. Let responseStatus be 0.
+ let responseStatus = 0
- // 1. Let transformStream be a new a TransformStream.
+ // 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false:
+ if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {
+ // 1. Set responseStatus to response’s status.
+ responseStatus = response.status
- // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
- // enqueues chunk in transformStream.
- const identityTransformAlgorithm = (chunk, controller) => {
- controller.enqueue(chunk)
+ // 2. Let mimeType be the result of extracting a MIME type from response’s header list.
+ const mimeType = extractMimeType(response.headersList)
+
+ // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType.
+ if (mimeType !== 'failure') {
+ bodyInfo.contentType = minimizeSupportedMimeType(mimeType)
+ }
+ }
+
+ // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo,
+ // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo,
+ // and responseStatus.
+ if (fetchParams.request.initiatorType != null) {
+ // TODO: update markresourcetiming
+ markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus)
+ }
}
- // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
- // and flushAlgorithm set to processResponseEndOfBody.
- const transformStream = new TransformStream({
- start () {},
- transform: identityTransformAlgorithm,
- flush: processResponseEndOfBody
- }, {
- size () {
- return 1
+ // 4. Let processResponseEndOfBodyTask be the following steps:
+ const processResponseEndOfBodyTask = () => {
+ // 1. Set fetchParams’s request’s done flag.
+ fetchParams.request.done = true
+
+ // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process
+ // response end-of-body given response.
+ if (fetchParams.processResponseEndOfBody != null) {
+ queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
}
- }, {
- size () {
- return 1
+
+ // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s
+ // global object is fetchParams’s task destination, then run fetchParams’s controller’s report
+ // timing steps given fetchParams’s request’s client’s global object.
+ if (fetchParams.request.initiatorType != null) {
+ fetchParams.controller.reportTimingSteps()
}
- })
+ }
- // 4. Set response’s body to the result of piping response’s body through transformStream.
- response.body = { stream: response.body.stream.pipeThrough(transformStream) }
+ // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination
+ queueMicrotask(() => processResponseEndOfBodyTask())
}
- // 6. If fetchParams’s process response consume body is non-null, then:
- if (fetchParams.processResponseConsumeBody != null) {
- // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
- // process response consume body given response and nullOrBytes.
- const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
+ // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s
+ // process response given response, with fetchParams’s task destination.
+ if (fetchParams.processResponse != null) {
+ queueMicrotask(() => {
+ fetchParams.processResponse(response)
+ fetchParams.processResponse = null
+ })
+ }
- // 2. Let processBodyError be this step: run fetchParams’s process
- // response consume body given response and failure.
- const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
+ // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response.
+ const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)
- // 3. If response’s body is null, then queue a fetch task to run processBody
- // given null, with fetchParams’s task destination.
- if (response.body == null) {
- queueMicrotask(() => processBody(null))
- } else {
- // 4. Otherwise, fully read response’s body given processBody, processBodyError,
- // and fetchParams’s task destination.
- return fullyReadBody(response.body, processBody, processBodyError)
- }
- return Promise.resolve()
+ // 6. If internalResponse’s body is null, then run processResponseEndOfBody.
+ // 7. Otherwise:
+ if (internalResponse.body == null) {
+ processResponseEndOfBody()
+ } else {
+ // mcollina: all the following steps of the specs are skipped.
+ // The internal transform stream is not needed.
+ // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541
+
+ // 1. Let transformStream be a new TransformStream.
+ // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream.
+ // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm
+ // set to processResponseEndOfBody.
+ // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.
+
+ finished(internalResponse.body.stream, () => {
+ processResponseEndOfBody()
+ })
}
}
@@ -26791,7 +30309,7 @@ async function httpFetch (fetchParams) {
// encouraged to, transmit an RST_STREAM frame.
// See, https://github.com/whatwg/fetch/issues/1288
if (request.redirect !== 'manual') {
- fetchParams.controller.connection.destroy()
+ fetchParams.controller.connection.destroy(undefined, false)
}
// 2. Switch on request’s redirect mode:
@@ -26922,14 +30440,14 @@ function httpRedirectFetch (fetchParams, response) {
// delete headerName from request’s header list.
if (!sameOrigin(requestCurrentURL(request), locationURL)) {
// https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
- request.headersList.delete('authorization')
+ request.headersList.delete('authorization', true)
// https://fetch.spec.whatwg.org/#authentication-entries
request.headersList.delete('proxy-authorization', true)
// "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
- request.headersList.delete('cookie')
- request.headersList.delete('host')
+ request.headersList.delete('cookie', true)
+ request.headersList.delete('host', true)
}
// 14. If request’s body is non-null, then set request’s body to the first return
@@ -27004,7 +30522,7 @@ async function httpNetworkOrCacheFetch (
// Otherwise:
// 1. Set httpRequest to a clone of request.
- httpRequest = makeRequest(request)
+ httpRequest = cloneRequest(request)
// 2. Set httpFetchParams to a copy of fetchParams.
httpFetchParams = { ...fetchParams }
@@ -27045,7 +30563,7 @@ async function httpNetworkOrCacheFetch (
// `Content-Length`/contentLengthHeaderValue to httpRequest’s header
// list.
if (contentLengthHeaderValue != null) {
- httpRequest.headersList.append('content-length', contentLengthHeaderValue)
+ httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)
}
// 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
@@ -27061,7 +30579,7 @@ async function httpNetworkOrCacheFetch (
// `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
// to httpRequest’s header list.
if (httpRequest.referrer instanceof URL) {
- httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
+ httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true)
}
// 12. Append a request `Origin` header for httpRequest.
@@ -27073,8 +30591,8 @@ async function httpNetworkOrCacheFetch (
// 14. If httpRequest’s header list does not contain `User-Agent`, then
// user agents should append `User-Agent`/default `User-Agent` value to
// httpRequest’s header list.
- if (!httpRequest.headersList.contains('user-agent')) {
- httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
+ if (!httpRequest.headersList.contains('user-agent', true)) {
+ httpRequest.headersList.append('user-agent', defaultUserAgent)
}
// 15. If httpRequest’s cache mode is "default" and httpRequest’s header
@@ -27083,11 +30601,11 @@ async function httpNetworkOrCacheFetch (
// httpRequest’s cache mode to "no-store".
if (
httpRequest.cache === 'default' &&
- (httpRequest.headersList.contains('if-modified-since') ||
- httpRequest.headersList.contains('if-none-match') ||
- httpRequest.headersList.contains('if-unmodified-since') ||
- httpRequest.headersList.contains('if-match') ||
- httpRequest.headersList.contains('if-range'))
+ (httpRequest.headersList.contains('if-modified-since', true) ||
+ httpRequest.headersList.contains('if-none-match', true) ||
+ httpRequest.headersList.contains('if-unmodified-since', true) ||
+ httpRequest.headersList.contains('if-match', true) ||
+ httpRequest.headersList.contains('if-range', true))
) {
httpRequest.cache = 'no-store'
}
@@ -27099,44 +30617,44 @@ async function httpNetworkOrCacheFetch (
if (
httpRequest.cache === 'no-cache' &&
!httpRequest.preventNoCacheCacheControlHeaderModification &&
- !httpRequest.headersList.contains('cache-control')
+ !httpRequest.headersList.contains('cache-control', true)
) {
- httpRequest.headersList.append('cache-control', 'max-age=0')
+ httpRequest.headersList.append('cache-control', 'max-age=0', true)
}
// 17. If httpRequest’s cache mode is "no-store" or "reload", then:
if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
// 1. If httpRequest’s header list does not contain `Pragma`, then append
// `Pragma`/`no-cache` to httpRequest’s header list.
- if (!httpRequest.headersList.contains('pragma')) {
- httpRequest.headersList.append('pragma', 'no-cache')
+ if (!httpRequest.headersList.contains('pragma', true)) {
+ httpRequest.headersList.append('pragma', 'no-cache', true)
}
// 2. If httpRequest’s header list does not contain `Cache-Control`,
// then append `Cache-Control`/`no-cache` to httpRequest’s header list.
- if (!httpRequest.headersList.contains('cache-control')) {
- httpRequest.headersList.append('cache-control', 'no-cache')
+ if (!httpRequest.headersList.contains('cache-control', true)) {
+ httpRequest.headersList.append('cache-control', 'no-cache', true)
}
}
// 18. If httpRequest’s header list contains `Range`, then append
// `Accept-Encoding`/`identity` to httpRequest’s header list.
- if (httpRequest.headersList.contains('range')) {
- httpRequest.headersList.append('accept-encoding', 'identity')
+ if (httpRequest.headersList.contains('range', true)) {
+ httpRequest.headersList.append('accept-encoding', 'identity', true)
}
// 19. Modify httpRequest’s header list per HTTP. Do not append a given
// header if httpRequest’s header list contains that header’s name.
// TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
- if (!httpRequest.headersList.contains('accept-encoding')) {
+ if (!httpRequest.headersList.contains('accept-encoding', true)) {
if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
- httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
+ httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)
} else {
- httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
+ httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)
}
}
- httpRequest.headersList.delete('host')
+ httpRequest.headersList.delete('host', true)
// 20. If includeCredentials is true, then:
if (includeCredentials) {
@@ -27162,7 +30680,7 @@ async function httpNetworkOrCacheFetch (
// 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
// then:
- if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
+ if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') {
// TODO: cache
}
@@ -27173,7 +30691,7 @@ async function httpNetworkOrCacheFetch (
if (response == null) {
// 1. If httpRequest’s cache mode is "only-if-cached", then return a
// network error.
- if (httpRequest.mode === 'only-if-cached') {
+ if (httpRequest.cache === 'only-if-cached') {
return makeNetworkError('only if cached')
}
@@ -27219,7 +30737,7 @@ async function httpNetworkOrCacheFetch (
// 12. If httpRequest’s header list contains `Range`, then set response’s
// range-requested flag.
- if (httpRequest.headersList.contains('range')) {
+ if (httpRequest.headersList.contains('range', true)) {
response.rangeRequested = true
}
@@ -27306,10 +30824,12 @@ async function httpNetworkFetch (
fetchParams.controller.connection = {
abort: null,
destroyed: false,
- destroy (err) {
+ destroy (err, abort = true) {
if (!this.destroyed) {
this.destroyed = true
- this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
+ if (abort) {
+ this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
+ }
}
}
}
@@ -27500,14 +31020,18 @@ async function httpNetworkFetch (
// 11. Let pullAlgorithm be an action that resumes the ongoing fetch
// if it is suspended.
- const pullAlgorithm = () => {
- fetchParams.controller.resume()
+ const pullAlgorithm = async () => {
+ await fetchParams.controller.resume()
}
// 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
// controller with reason, given reason.
const cancelAlgorithm = (reason) => {
- fetchParams.controller.abort(reason)
+ // If the aborted fetch was already terminated, then we do not
+ // need to do anything.
+ if (!isCancelled(fetchParams)) {
+ fetchParams.controller.abort(reason)
+ }
}
// 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
@@ -27519,13 +31043,8 @@ async function httpNetworkFetch (
// TODO
// 15. Let stream be a new ReadableStream.
- // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
- // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
- // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
+ // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm,
+ // cancelAlgorithm set to cancelAlgorithm.
const stream = new ReadableStream(
{
async start (controller) {
@@ -27536,20 +31055,15 @@ async function httpNetworkFetch (
},
async cancel (reason) {
await cancelAlgorithm(reason)
- }
- },
- {
- highWaterMark: 0,
- size () {
- return 1
- }
+ },
+ type: 'bytes'
}
)
// 17. Run these steps, but abort when the ongoing fetch is terminated:
// 1. Set response’s body to a new body whose stream is stream.
- response.body = { stream }
+ response.body = { stream, source: null, length: null }
// 2. If response is not a network error and request’s cache mode is
// not "no-store", then update response in httpCache for request.
@@ -27568,6 +31082,7 @@ async function httpNetworkFetch (
// 19. Run these steps in parallel:
// 1. Run these steps, but abort when fetchParams is canceled:
+ fetchParams.controller.onAborted = onAborted
fetchParams.controller.on('terminated', onAborted)
fetchParams.controller.resume = async () => {
// 1. While true
@@ -27622,7 +31137,10 @@ async function httpNetworkFetch (
// 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
// into stream.
- fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
+ const buffer = new Uint8Array(bytes)
+ if (buffer.byteLength) {
+ fetchParams.controller.controller.enqueue(buffer)
+ }
// 8. If stream is errored, then terminate the ongoing fetch.
if (isErrored(stream)) {
@@ -27632,7 +31150,7 @@ async function httpNetworkFetch (
// 9. If stream doesn’t need more data ask the user agent to suspend
// the ongoing fetch.
- if (!fetchParams.controller.controller.desiredSize) {
+ if (fetchParams.controller.controller.desiredSize <= 0) {
return
}
}
@@ -27671,7 +31189,7 @@ async function httpNetworkFetch (
// 20. Return response.
return response
- async function dispatch ({ body }) {
+ function dispatch ({ body }) {
const url = requestCurrentURL(request)
/** @type {import('../..').Agent} */
const agent = fetchParams.controller.dispatcher
@@ -27681,7 +31199,7 @@ async function httpNetworkFetch (
path: url.pathname + url.search,
origin: url.origin,
method: request.method,
- body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
+ body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
headers: request.headersList.entries,
maxRedirections: 0,
upgrade: request.mode === 'websocket' ? 'websocket' : undefined
@@ -27694,67 +31212,71 @@ async function httpNetworkFetch (
// TODO (fix): Do we need connection here?
const { connection } = fetchParams.controller
+ // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
+ // connection timing info with connection’s timing info, timingInfo’s post-redirect start
+ // time, and fetchParams’s cross-origin isolated capability.
+ // TODO: implement connection timing
+ timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
+
if (connection.destroyed) {
abort(new DOMException('The operation was aborted.', 'AbortError'))
} else {
fetchParams.controller.on('terminated', abort)
this.abort = connection.abort = abort
}
+
+ // Set timingInfo’s final network-request start time to the coarsened shared current time given
+ // fetchParams’s cross-origin isolated capability.
+ timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
},
- onHeaders (status, headersList, resume, statusText) {
+ onResponseStarted () {
+ // Set timingInfo’s final network-response start time to the coarsened shared current
+ // time given fetchParams’s cross-origin isolated capability, immediately after the
+ // user agent’s HTTP parser receives the first byte of the response (e.g., frame header
+ // bytes for HTTP/2 or response status line for HTTP/1.x).
+ timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
+ },
+
+ onHeaders (status, rawHeaders, resume, statusText) {
if (status < 200) {
return
}
- let codings = []
let location = ''
- const headers = new Headers()
-
- // For H2, the headers are a plain JS object
- // We distinguish between them and iterate accordingly
- if (Array.isArray(headersList)) {
- for (let n = 0; n < headersList.length; n += 2) {
- const key = headersList[n + 0].toString('latin1')
- const val = headersList[n + 1].toString('latin1')
- if (key.toLowerCase() === 'content-encoding') {
- // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
- // "All content-coding values are case-insensitive..."
- codings = val.toLowerCase().split(',').map((x) => x.trim())
- } else if (key.toLowerCase() === 'location') {
- location = val
- }
-
- headers[kHeadersList].append(key, val)
- }
- } else {
- const keys = Object.keys(headersList)
- for (const key of keys) {
- const val = headersList[key]
- if (key.toLowerCase() === 'content-encoding') {
- // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
- // "All content-coding values are case-insensitive..."
- codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
- } else if (key.toLowerCase() === 'location') {
- location = val
- }
+ const headersList = new HeadersList()
- headers[kHeadersList].append(key, val)
- }
+ for (let i = 0; i < rawHeaders.length; i += 2) {
+ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
}
+ location = headersList.get('location', true)
this.body = new Readable({ read: resume })
const decoders = []
- const willFollow = request.redirect === 'follow' &&
- location &&
+ const willFollow = location && request.redirect === 'follow' &&
redirectStatusSet.has(status)
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
- for (const coding of codings) {
+ // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
+ const contentEncoding = headersList.get('content-encoding', true)
+ // "All content-coding values are case-insensitive..."
+ /** @type {string[]} */
+ const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : []
+
+ // Limit the number of content-encodings to prevent resource exhaustion.
+ // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
+ const maxContentEncodings = 5
+ if (codings.length > maxContentEncodings) {
+ reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
+ return true
+ }
+
+ for (let i = codings.length - 1; i >= 0; --i) {
+ const coding = codings[i].trim()
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
if (coding === 'x-gzip' || coding === 'gzip') {
decoders.push(zlib.createGunzip({
@@ -27766,9 +31288,15 @@ async function httpNetworkFetch (
finishFlush: zlib.constants.Z_SYNC_FLUSH
}))
} else if (coding === 'deflate') {
- decoders.push(zlib.createInflate())
+ decoders.push(createInflate({
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+ }))
} else if (coding === 'br') {
- decoders.push(zlib.createBrotliDecompress())
+ decoders.push(zlib.createBrotliDecompress({
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+ }))
} else {
decoders.length = 0
break
@@ -27776,13 +31304,19 @@ async function httpNetworkFetch (
}
}
+ const onError = this.onError.bind(this)
+
resolve({
status,
statusText,
- headersList: headers[kHeadersList],
+ headersList,
body: decoders.length
- ? pipeline(this.body, ...decoders, () => { })
- : this.body.on('error', () => {})
+ ? pipeline(this.body, ...decoders, (err) => {
+ if (err) {
+ this.onError(err)
+ }
+ }).on('error', onError)
+ : this.body.on('error', onError)
})
return true
@@ -27816,6 +31350,10 @@ async function httpNetworkFetch (
fetchParams.controller.off('terminated', this.abort)
}
+ if (fetchParams.controller.onAborted) {
+ fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
+ }
+
fetchParams.controller.ended = true
this.body.push(null)
@@ -27833,24 +31371,21 @@ async function httpNetworkFetch (
reject(error)
},
- onUpgrade (status, headersList, socket) {
+ onUpgrade (status, rawHeaders, socket) {
if (status !== 101) {
return
}
- const headers = new Headers()
+ const headersList = new HeadersList()
- for (let n = 0; n < headersList.length; n += 2) {
- const key = headersList[n + 0].toString('latin1')
- const val = headersList[n + 1].toString('latin1')
-
- headers[kHeadersList].append(key, val)
+ for (let i = 0; i < rawHeaders.length; i += 2) {
+ headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true)
}
resolve({
status,
statusText: STATUS_CODES[status],
- headersList: headers[kHeadersList],
+ headersList,
socket
})
@@ -27871,25 +31406,23 @@ module.exports = {
/***/ }),
-/***/ 8359:
+/***/ 9967:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
/* globals AbortController */
-const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(1472)
-const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
-const { FinalizationRegistry } = __nccwpck_require__(6436)()
-const util = __nccwpck_require__(3983)
+const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(4492)
+const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(660)
+const { FinalizationRegistry } = __nccwpck_require__(6653)()
+const util = __nccwpck_require__(3440)
+const nodeUtil = __nccwpck_require__(7975)
const {
isValidHTTPToken,
sameOrigin,
- normalizeMethod,
- makePolicyContainer,
- normalizeMethodRecord
-} = __nccwpck_require__(2538)
+ environmentSettingsObject
+} = __nccwpck_require__(3168)
const {
forbiddenMethodsSet,
corsSafeListedMethodsSet,
@@ -27899,17 +31432,14 @@ const {
requestCredentials,
requestCache,
requestDuplex
-} = __nccwpck_require__(1037)
-const { kEnumerableProperty } = util
-const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { URLSerializer } = __nccwpck_require__(685)
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
-
-let TransformStream = globalThis.TransformStream
+} = __nccwpck_require__(4495)
+const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util
+const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { kConstruct } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474)
const kAbortController = Symbol('abortController')
@@ -27917,29 +31447,62 @@ const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
signal.removeEventListener('abort', abort)
})
+const dependentControllerMap = new WeakMap()
+
+function buildAbort (acRef) {
+ return abort
+
+ function abort () {
+ const ac = acRef.deref()
+ if (ac !== undefined) {
+ // Currently, there is a problem with FinalizationRegistry.
+ // https://github.com/nodejs/node/issues/49344
+ // https://github.com/nodejs/node/issues/47748
+ // In the case of abort, the first step is to unregister from it.
+ // If the controller can refer to it, it is still registered.
+ // It will be removed in the future.
+ requestFinalizer.unregister(abort)
+
+ // Unsubscribe a listener.
+ // FinalizationRegistry will no longer be called, so this must be done.
+ this.removeEventListener('abort', abort)
+
+ ac.abort(this.reason)
+
+ const controllerList = dependentControllerMap.get(ac.signal)
+
+ if (controllerList !== undefined) {
+ if (controllerList.size !== 0) {
+ for (const ref of controllerList) {
+ const ctrl = ref.deref()
+ if (ctrl !== undefined) {
+ ctrl.abort(this.reason)
+ }
+ }
+ controllerList.clear()
+ }
+ dependentControllerMap.delete(ac.signal)
+ }
+ }
+ }
+}
+
+let patchMethodWarning = false
+
// https://fetch.spec.whatwg.org/#request-class
class Request {
// https://fetch.spec.whatwg.org/#dom-request
constructor (input, init = {}) {
+ webidl.util.markAsUncloneable(this)
if (input === kConstruct) {
return
}
- webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
+ const prefix = 'Request constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- input = webidl.converters.RequestInfo(input)
- init = webidl.converters.RequestInit(init)
-
- // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
- this[kRealm] = {
- settingsObject: {
- baseUrl: getGlobalOrigin(),
- get origin () {
- return this.baseUrl?.origin
- },
- policyContainer: makePolicyContainer()
- }
- }
+ input = webidl.converters.RequestInfo(input, prefix, 'input')
+ init = webidl.converters.RequestInit(init, prefix, 'init')
// 1. Let request be null.
let request = null
@@ -27948,13 +31511,15 @@ class Request {
let fallbackMode = null
// 3. Let baseURL be this’s relevant settings object’s API base URL.
- const baseUrl = this[kRealm].settingsObject.baseUrl
+ const baseUrl = environmentSettingsObject.settingsObject.baseUrl
// 4. Let signal be null.
let signal = null
// 5. If input is a string, then:
if (typeof input === 'string') {
+ this[kDispatcher] = init.dispatcher
+
// 1. Let parsedURL be the result of parsing input with baseURL.
// 2. If parsedURL is failure, then throw a TypeError.
let parsedURL
@@ -27978,6 +31543,8 @@ class Request {
// 5. Set fallbackMode to "cors".
fallbackMode = 'cors'
} else {
+ this[kDispatcher] = init.dispatcher || input[kDispatcher]
+
// 6. Otherwise:
// 7. Assert: input is a Request object.
@@ -27991,7 +31558,7 @@ class Request {
}
// 7. Let origin be this’s relevant settings object’s origin.
- const origin = this[kRealm].settingsObject.origin
+ const origin = environmentSettingsObject.settingsObject.origin
// 8. Let window be "client".
let window = 'client'
@@ -28027,7 +31594,7 @@ class Request {
// unsafe-request flag Set.
unsafeRequest: request.unsafeRequest,
// client This’s relevant settings object.
- client: this[kRealm].settingsObject,
+ client: environmentSettingsObject.settingsObject,
// window window.
window,
// priority request’s priority.
@@ -28116,7 +31683,7 @@ class Request {
// then set request’s referrer to "client".
if (
(parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
- (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
+ (origin && !sameOrigin(parsedReferrer, environmentSettingsObject.settingsObject.baseUrl))
) {
request.referrer = 'client'
} else {
@@ -28192,21 +31759,40 @@ class Request {
// 1. Let method be init["method"].
let method = init.method
- // 2. If method is not a method or method is a forbidden method, then
- // throw a TypeError.
- if (!isValidHTTPToken(method)) {
- throw new TypeError(`'${method}' is not a valid HTTP method.`)
- }
+ const mayBeNormalized = normalizedMethodRecords[method]
+
+ if (mayBeNormalized !== undefined) {
+ // Note: Bypass validation DELETE, GET, HEAD, OPTIONS, POST, PUT, PATCH and these lowercase ones
+ request.method = mayBeNormalized
+ } else {
+ // 2. If method is not a method or method is a forbidden method, then
+ // throw a TypeError.
+ if (!isValidHTTPToken(method)) {
+ throw new TypeError(`'${method}' is not a valid HTTP method.`)
+ }
+
+ const upperCase = method.toUpperCase()
+
+ if (forbiddenMethodsSet.has(upperCase)) {
+ throw new TypeError(`'${method}' HTTP method is unsupported.`)
+ }
+
+ // 3. Normalize method.
+ // https://fetch.spec.whatwg.org/#concept-method-normalize
+ // Note: must be in uppercase
+ method = normalizedMethodRecordsBase[upperCase] ?? method
- if (forbiddenMethodsSet.has(method.toUpperCase())) {
- throw new TypeError(`'${method}' HTTP method is unsupported.`)
+ // 4. Set request’s method to method.
+ request.method = method
}
- // 3. Normalize method.
- method = normalizeMethodRecord[method] ?? normalizeMethod(method)
+ if (!patchMethodWarning && request.method === 'patch') {
+ process.emitWarning('Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.', {
+ code: 'UNDICI-FETCH-patch'
+ })
- // 4. Set request’s method to method.
- request.method = method
+ patchMethodWarning = true
+ }
}
// 26. If init["signal"] exists, then set signal to it.
@@ -28223,7 +31809,6 @@ class Request {
// (https://dom.spec.whatwg.org/#dom-abortsignal-any)
const ac = new AbortController()
this[kSignal] = ac.signal
- this[kSignal][kRealm] = this[kRealm]
// 29. If signal is not null, then make this’s signal follow signal.
if (signal != null) {
@@ -28247,12 +31832,7 @@ class Request {
this[kAbortController] = ac
const acRef = new WeakRef(ac)
- const abort = function () {
- const ac = acRef.deref()
- if (ac !== undefined) {
- ac.abort(this.reason)
- }
- }
+ const abort = buildAbort(acRef)
// Third-party AbortControllers may not work with these.
// See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
@@ -28260,14 +31840,18 @@ class Request {
// If the max amount of listeners is equal to the default, increase it
// This is only available in node >= v19.9.0
if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
- setMaxListeners(100, signal)
+ setMaxListeners(1500, signal)
} else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
- setMaxListeners(100, signal)
+ setMaxListeners(1500, signal)
}
} catch {}
util.addAbortListener(signal, abort)
- requestFinalizer.register(ac, { signal, abort })
+ // The third argument must be a registry key to be unregistered.
+ // Without it, you cannot unregister.
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
+ // abort is used as the unregister key. (because it is unique)
+ requestFinalizer.register(ac, { signal, abort }, abort)
}
}
@@ -28275,9 +31859,8 @@ class Request {
// Realm, whose header list is request’s header list and guard is
// "request".
this[kHeaders] = new Headers(kConstruct)
- this[kHeaders][kHeadersList] = request.headersList
- this[kHeaders][kGuard] = 'request'
- this[kHeaders][kRealm] = this[kRealm]
+ setHeadersList(this[kHeaders], request.headersList)
+ setHeadersGuard(this[kHeaders], 'request')
// 31. If this’s request’s mode is "no-cors", then:
if (mode === 'no-cors') {
@@ -28290,13 +31873,13 @@ class Request {
}
// 2. Set this’s headers’s guard to "request-no-cors".
- this[kHeaders][kGuard] = 'request-no-cors'
+ setHeadersGuard(this[kHeaders], 'request-no-cors')
}
// 32. If init is not empty, then:
if (initHasKey) {
/** @type {HeadersList} */
- const headersList = this[kHeaders][kHeadersList]
+ const headersList = getHeadersList(this[kHeaders])
// 1. Let headers be a copy of this’s headers and its associated header
// list.
// 2. If init["headers"] exists, then set headers to init["headers"].
@@ -28308,8 +31891,8 @@ class Request {
// 4. If headers is a Headers object, then for each header in its header
// list, append header’s name/header’s value to this’s headers.
if (headers instanceof HeadersList) {
- for (const [key, val] of headers) {
- headersList.append(key, val)
+ for (const { name, value } of headers.rawValues()) {
+ headersList.append(name, value, false)
}
// Note: Copy the `set-cookie` meta-data.
headersList.cookies = headers.cookies
@@ -28350,7 +31933,7 @@ class Request {
// 3, If Content-Type is non-null and this’s headers’s header list does
// not contain `Content-Type`, then append `Content-Type`/Content-Type to
// this’s headers.
- if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
+ if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {
this[kHeaders].append('content-type', contentType)
}
}
@@ -28386,17 +31969,13 @@ class Request {
// 40. If initBody is null and inputBody is non-null, then:
if (initBody == null && inputBody != null) {
// 1. If input is unusable, then throw a TypeError.
- if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
+ if (bodyUnusable(input)) {
throw new TypeError(
'Cannot construct a Request with a Request object that has already been used.'
)
}
// 2. Set finalBody to the result of creating a proxy for inputBody.
- if (!TransformStream) {
- TransformStream = (__nccwpck_require__(5356).TransformStream)
- }
-
// https://streams.spec.whatwg.org/#readablestream-create-a-proxy
const identityTransform = new TransformStream()
inputBody.stream.pipeThrough(identityTransform)
@@ -28550,7 +32129,7 @@ class Request {
}
// Returns a boolean indicating whether or not request is for a history
- // navigation (a.k.a. back-foward navigation).
+ // navigation (a.k.a. back-forward navigation).
get isHistoryNavigation () {
webidl.brandCheck(this, Request)
@@ -28592,7 +32171,7 @@ class Request {
webidl.brandCheck(this, Request)
// 1. If this is unusable, then throw a TypeError.
- if (this.bodyUsed || this.body?.locked) {
+ if (bodyUnusable(this)) {
throw new TypeError('unusable')
}
@@ -28601,80 +32180,103 @@ class Request {
// 3. Let clonedRequestObject be the result of creating a Request object,
// given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
- const clonedRequestObject = new Request(kConstruct)
- clonedRequestObject[kState] = clonedRequest
- clonedRequestObject[kRealm] = this[kRealm]
- clonedRequestObject[kHeaders] = new Headers(kConstruct)
- clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
- clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
- clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
-
// 4. Make clonedRequestObject’s signal follow this’s signal.
const ac = new AbortController()
if (this.signal.aborted) {
ac.abort(this.signal.reason)
} else {
+ let list = dependentControllerMap.get(this.signal)
+ if (list === undefined) {
+ list = new Set()
+ dependentControllerMap.set(this.signal, list)
+ }
+ const acRef = new WeakRef(ac)
+ list.add(acRef)
util.addAbortListener(
- this.signal,
- () => {
- ac.abort(this.signal.reason)
- }
+ ac.signal,
+ buildAbort(acRef)
)
}
- clonedRequestObject[kSignal] = ac.signal
// 4. Return clonedRequestObject.
- return clonedRequestObject
+ return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders]))
+ }
+
+ [nodeUtil.inspect.custom] (depth, options) {
+ if (options.depth === null) {
+ options.depth = 2
+ }
+
+ options.colors ??= true
+
+ const properties = {
+ method: this.method,
+ url: this.url,
+ headers: this.headers,
+ destination: this.destination,
+ referrer: this.referrer,
+ referrerPolicy: this.referrerPolicy,
+ mode: this.mode,
+ credentials: this.credentials,
+ cache: this.cache,
+ redirect: this.redirect,
+ integrity: this.integrity,
+ keepalive: this.keepalive,
+ isReloadNavigation: this.isReloadNavigation,
+ isHistoryNavigation: this.isHistoryNavigation,
+ signal: this.signal
+ }
+
+ return `Request ${nodeUtil.formatWithOptions(options, properties)}`
}
}
mixinBody(Request)
+// https://fetch.spec.whatwg.org/#requests
function makeRequest (init) {
- // https://fetch.spec.whatwg.org/#requests
- const request = {
- method: 'GET',
- localURLsOnly: false,
- unsafeRequest: false,
- body: null,
- client: null,
- reservedClient: null,
- replacesClientId: '',
- window: 'client',
- keepalive: false,
- serviceWorkers: 'all',
- initiator: '',
- destination: '',
- priority: null,
- origin: 'client',
- policyContainer: 'client',
- referrer: 'client',
- referrerPolicy: '',
- mode: 'no-cors',
- useCORSPreflightFlag: false,
- credentials: 'same-origin',
- useCredentials: false,
- cache: 'default',
- redirect: 'follow',
- integrity: '',
- cryptoGraphicsNonceMetadata: '',
- parserMetadata: '',
- reloadNavigation: false,
- historyNavigation: false,
- userActivation: false,
- taintedOrigin: false,
- redirectCount: 0,
- responseTainting: 'basic',
- preventNoCacheCacheControlHeaderModification: false,
- done: false,
- timingAllowFailed: false,
- ...init,
+ return {
+ method: init.method ?? 'GET',
+ localURLsOnly: init.localURLsOnly ?? false,
+ unsafeRequest: init.unsafeRequest ?? false,
+ body: init.body ?? null,
+ client: init.client ?? null,
+ reservedClient: init.reservedClient ?? null,
+ replacesClientId: init.replacesClientId ?? '',
+ window: init.window ?? 'client',
+ keepalive: init.keepalive ?? false,
+ serviceWorkers: init.serviceWorkers ?? 'all',
+ initiator: init.initiator ?? '',
+ destination: init.destination ?? '',
+ priority: init.priority ?? null,
+ origin: init.origin ?? 'client',
+ policyContainer: init.policyContainer ?? 'client',
+ referrer: init.referrer ?? 'client',
+ referrerPolicy: init.referrerPolicy ?? '',
+ mode: init.mode ?? 'no-cors',
+ useCORSPreflightFlag: init.useCORSPreflightFlag ?? false,
+ credentials: init.credentials ?? 'same-origin',
+ useCredentials: init.useCredentials ?? false,
+ cache: init.cache ?? 'default',
+ redirect: init.redirect ?? 'follow',
+ integrity: init.integrity ?? '',
+ cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? '',
+ parserMetadata: init.parserMetadata ?? '',
+ reloadNavigation: init.reloadNavigation ?? false,
+ historyNavigation: init.historyNavigation ?? false,
+ userActivation: init.userActivation ?? false,
+ taintedOrigin: init.taintedOrigin ?? false,
+ redirectCount: init.redirectCount ?? 0,
+ responseTainting: init.responseTainting ?? 'basic',
+ preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false,
+ done: init.done ?? false,
+ timingAllowFailed: init.timingAllowFailed ?? false,
+ urlList: init.urlList,
+ url: init.urlList[0],
headersList: init.headersList
? new HeadersList(init.headersList)
: new HeadersList()
}
- request.url = request.urlList[0]
- return request
}
// https://fetch.spec.whatwg.org/#concept-request-clone
@@ -28687,13 +32289,30 @@ function cloneRequest (request) {
// 2. If request’s body is non-null, set newRequest’s body to the
// result of cloning request’s body.
if (request.body != null) {
- newRequest.body = cloneBody(request.body)
+ newRequest.body = cloneBody(newRequest, request.body)
}
// 3. Return newRequest.
return newRequest
}
+/**
+ * @see https://fetch.spec.whatwg.org/#request-create
+ * @param {any} innerRequest
+ * @param {AbortSignal} signal
+ * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard
+ * @returns {Request}
+ */
+function fromInnerRequest (innerRequest, signal, guard) {
+ const request = new Request(kConstruct)
+ request[kState] = innerRequest
+ request[kSignal] = signal
+ request[kHeaders] = new Headers(kConstruct)
+ setHeadersList(request[kHeaders], innerRequest.headersList)
+ setHeadersGuard(request[kHeaders], guard)
+ return request
+}
+
Object.defineProperties(Request.prototype, {
method: kEnumerableProperty,
url: kEnumerableProperty,
@@ -28726,16 +32345,16 @@ webidl.converters.Request = webidl.interfaceConverter(
)
// https://fetch.spec.whatwg.org/#requestinfo
-webidl.converters.RequestInfo = function (V) {
+webidl.converters.RequestInfo = function (V, prefix, argument) {
if (typeof V === 'string') {
- return webidl.converters.USVString(V)
+ return webidl.converters.USVString(V, prefix, argument)
}
if (V instanceof Request) {
- return webidl.converters.Request(V)
+ return webidl.converters.Request(V, prefix, argument)
}
- return webidl.converters.USVString(V)
+ return webidl.converters.USVString(V, prefix, argument)
}
webidl.converters.AbortSignal = webidl.interfaceConverter(
@@ -28805,6 +32424,8 @@ webidl.converters.RequestInit = webidl.dictionaryConverter([
converter: webidl.nullableConverter(
(signal) => webidl.converters.AbortSignal(
signal,
+ 'RequestInit',
+ 'signal',
{ strict: false }
)
)
@@ -28817,23 +32438,27 @@ webidl.converters.RequestInit = webidl.dictionaryConverter([
key: 'duplex',
converter: webidl.converters.DOMString,
allowedValues: requestDuplex
+ },
+ {
+ key: 'dispatcher', // undici specific option
+ converter: webidl.converters.any
}
])
-module.exports = { Request, makeRequest }
+module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
/***/ }),
-/***/ 7823:
+/***/ 9051:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { Headers, HeadersList, fill } = __nccwpck_require__(554)
-const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(1472)
-const util = __nccwpck_require__(3983)
+const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(660)
+const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(4492)
+const util = __nccwpck_require__(3440)
+const nodeUtil = __nccwpck_require__(7975)
const { kEnumerableProperty } = util
const {
isValidReasonPhrase,
@@ -28842,47 +32467,38 @@ const {
isBlobLike,
serializeJavascriptValueToJSONString,
isErrorLike,
- isomorphicEncode
-} = __nccwpck_require__(2538)
+ isomorphicEncode,
+ environmentSettingsObject: relevantRealm
+} = __nccwpck_require__(3168)
const {
redirectStatusSet,
- nullBodyStatus,
- DOMException
-} = __nccwpck_require__(1037)
-const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
-const { webidl } = __nccwpck_require__(1744)
-const { FormData } = __nccwpck_require__(2015)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { URLSerializer } = __nccwpck_require__(685)
-const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { types } = __nccwpck_require__(3837)
-
-const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
+ nullBodyStatus
+} = __nccwpck_require__(4495)
+const { kState, kHeaders } = __nccwpck_require__(3627)
+const { webidl } = __nccwpck_require__(5893)
+const { FormData } = __nccwpck_require__(5910)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { kConstruct } = __nccwpck_require__(6443)
+const assert = __nccwpck_require__(4589)
+const { types } = __nccwpck_require__(7975)
+
const textEncoder = new TextEncoder('utf-8')
// https://fetch.spec.whatwg.org/#response-class
class Response {
// Creates network error Response.
static error () {
- // TODO
- const relevantRealm = { settingsObject: {} }
-
// The static error() method steps are to return the result of creating a
// Response object, given a new network error, "immutable", and this’s
// relevant Realm.
- const responseObject = new Response()
- responseObject[kState] = makeNetworkError()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
+ const responseObject = fromInnerResponse(makeNetworkError(), 'immutable')
+
return responseObject
}
// https://fetch.spec.whatwg.org/#dom-response-json
static json (data, init = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
+ webidl.argumentLengthCheck(arguments, 1, 'Response.json')
if (init !== null) {
init = webidl.converters.ResponseInit(init)
@@ -28898,11 +32514,7 @@ class Response {
// 3. Let responseObject be the result of creating a Response object, given a new response,
// "response", and this’s relevant Realm.
- const relevantRealm = { settingsObject: {} }
- const responseObject = new Response()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kGuard] = 'response'
- responseObject[kHeaders][kRealm] = relevantRealm
+ const responseObject = fromInnerResponse(makeResponse({}), 'response')
// 4. Perform initialize a response given responseObject, init, and (body, "application/json").
initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
@@ -28913,9 +32525,7 @@ class Response {
// Creates a redirect Response that redirects to url with status status.
static redirect (url, status = 302) {
- const relevantRealm = { settingsObject: {} }
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
+ webidl.argumentLengthCheck(arguments, 1, 'Response.redirect')
url = webidl.converters.USVString(url)
status = webidl.converters['unsigned short'](status)
@@ -28926,24 +32536,19 @@ class Response {
// TODO: base-URL?
let parsedURL
try {
- parsedURL = new URL(url, getGlobalOrigin())
+ parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl)
} catch (err) {
- throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
- cause: err
- })
+ throw new TypeError(`Failed to parse URL from ${url}`, { cause: err })
}
// 3. If status is not a redirect status, then throw a RangeError.
if (!redirectStatusSet.has(status)) {
- throw new RangeError('Invalid status code ' + status)
+ throw new RangeError(`Invalid status code ${status}`)
}
// 4. Let responseObject be the result of creating a Response object,
// given a new response, "immutable", and this’s relevant Realm.
- const responseObject = new Response()
- responseObject[kRealm] = relevantRealm
- responseObject[kHeaders][kGuard] = 'immutable'
- responseObject[kHeaders][kRealm] = relevantRealm
+ const responseObject = fromInnerResponse(makeResponse({}), 'immutable')
// 5. Set responseObject’s response’s status to status.
responseObject[kState].status = status
@@ -28952,7 +32557,7 @@ class Response {
const value = isomorphicEncode(URLSerializer(parsedURL))
// 7. Append `Location`/value to responseObject’s response’s header list.
- responseObject[kState].headersList.append('location', value)
+ responseObject[kState].headersList.append('location', value, true)
// 8. Return responseObject.
return responseObject
@@ -28960,15 +32565,17 @@ class Response {
// https://fetch.spec.whatwg.org/#dom-response
constructor (body = null, init = {}) {
+ webidl.util.markAsUncloneable(this)
+ if (body === kConstruct) {
+ return
+ }
+
if (body !== null) {
body = webidl.converters.BodyInit(body)
}
init = webidl.converters.ResponseInit(init)
- // TODO
- this[kRealm] = { settingsObject: {} }
-
// 1. Set this’s response to a new response.
this[kState] = makeResponse({})
@@ -28976,9 +32583,8 @@ class Response {
// Realm, whose header list is this’s response’s header list and guard
// is "response".
this[kHeaders] = new Headers(kConstruct)
- this[kHeaders][kGuard] = 'response'
- this[kHeaders][kHeadersList] = this[kState].headersList
- this[kHeaders][kRealm] = this[kRealm]
+ setHeadersGuard(this[kHeaders], 'response')
+ setHeadersList(this[kHeaders], this[kState].headersList)
// 3. Let bodyWithType be null.
let bodyWithType = null
@@ -29079,7 +32685,7 @@ class Response {
webidl.brandCheck(this, Response)
// 1. If this is unusable, then throw a TypeError.
- if (this.bodyUsed || (this.body && this.body.locked)) {
+ if (bodyUnusable(this)) {
throw webidl.errors.exception({
header: 'Response.clone',
message: 'Body has already been consumed.'
@@ -29089,16 +32695,36 @@ class Response {
// 2. Let clonedResponse be the result of cloning this’s response.
const clonedResponse = cloneResponse(this[kState])
+ // Note: To re-register because of a new stream.
+ if (hasFinalizationRegistry && this[kState].body?.stream) {
+ streamRegistry.register(this, new WeakRef(this[kState].body.stream))
+ }
+
// 3. Return the result of creating a Response object, given
// clonedResponse, this’s headers’s guard, and this’s relevant Realm.
- const clonedResponseObject = new Response()
- clonedResponseObject[kState] = clonedResponse
- clonedResponseObject[kRealm] = this[kRealm]
- clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
- clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
- clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
+ return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders]))
+ }
+
+ [nodeUtil.inspect.custom] (depth, options) {
+ if (options.depth === null) {
+ options.depth = 2
+ }
+
+ options.colors ??= true
- return clonedResponseObject
+ const properties = {
+ status: this.status,
+ statusText: this.statusText,
+ headers: this.headers,
+ body: this.body,
+ bodyUsed: this.bodyUsed,
+ ok: this.ok,
+ redirected: this.redirected,
+ type: this.type,
+ url: this.url
+ }
+
+ return `Response ${nodeUtil.formatWithOptions(options, properties)}`
}
}
@@ -29147,7 +32773,7 @@ function cloneResponse (response) {
// 3. If response’s body is non-null, then set newResponse’s body to the
// result of cloning response’s body.
if (response.body != null) {
- newResponse.body = cloneBody(response.body)
+ newResponse.body = cloneBody(newResponse, response.body)
}
// 4. Return newResponse.
@@ -29166,10 +32792,10 @@ function makeResponse (init) {
cacheState: '',
statusText: '',
...init,
- headersList: init.headersList
- ? new HeadersList(init.headersList)
+ headersList: init?.headersList
+ ? new HeadersList(init?.headersList)
: new HeadersList(),
- urlList: init.urlList ? [...init.urlList] : []
+ urlList: init?.urlList ? [...init.urlList] : []
}
}
@@ -29185,6 +32811,16 @@ function makeNetworkError (reason) {
})
}
+// @see https://fetch.spec.whatwg.org/#concept-network-error
+function isNetworkError (response) {
+ return (
+ // A network error is a response whose type is "error",
+ response.type === 'error' &&
+ // status is 0
+ response.status === 0
+ )
+}
+
function makeFilteredResponse (response, state) {
state = {
internalResponse: response,
@@ -29308,7 +32944,7 @@ function initializeResponse (response, init, body) {
if (nullBodyStatus.includes(response.status)) {
throw webidl.errors.exception({
header: 'Response constructor',
- message: 'Invalid response status code ' + response.status
+ message: `Invalid response status code ${response.status}`
})
}
@@ -29317,12 +32953,37 @@ function initializeResponse (response, init, body) {
// 3. If body's type is non-null and response's header list does not contain
// `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
- if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
- response[kState].headersList.append('content-type', body.type)
+ if (body.type != null && !response[kState].headersList.contains('content-type', true)) {
+ response[kState].headersList.append('content-type', body.type, true)
}
}
}
+/**
+ * @see https://fetch.spec.whatwg.org/#response-create
+ * @param {any} innerResponse
+ * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard
+ * @returns {Response}
+ */
+function fromInnerResponse (innerResponse, guard) {
+ const response = new Response(kConstruct)
+ response[kState] = innerResponse
+ response[kHeaders] = new Headers(kConstruct)
+ setHeadersList(response[kHeaders], innerResponse.headersList)
+ setHeadersGuard(response[kHeaders], guard)
+
+ if (hasFinalizationRegistry && innerResponse.body?.stream) {
+ // If the target (response) is reclaimed, the cleanup callback may be called at some point with
+ // the held value provided for it (innerResponse.body.stream). The held value can be any value:
+ // a primitive or an object, even undefined. If the held value is an object, the registry keeps
+ // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
+ streamRegistry.register(response, new WeakRef(innerResponse.body.stream))
+ }
+
+ return response
+}
+
webidl.converters.ReadableStream = webidl.interfaceConverter(
ReadableStream
)
@@ -29336,34 +32997,34 @@ webidl.converters.URLSearchParams = webidl.interfaceConverter(
)
// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
-webidl.converters.XMLHttpRequestBodyInit = function (V) {
+webidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) {
if (typeof V === 'string') {
- return webidl.converters.USVString(V)
+ return webidl.converters.USVString(V, prefix, name)
}
if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+ return webidl.converters.Blob(V, prefix, name, { strict: false })
}
- if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
- return webidl.converters.BufferSource(V)
+ if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {
+ return webidl.converters.BufferSource(V, prefix, name)
}
if (util.isFormDataLike(V)) {
- return webidl.converters.FormData(V, { strict: false })
+ return webidl.converters.FormData(V, prefix, name, { strict: false })
}
if (V instanceof URLSearchParams) {
- return webidl.converters.URLSearchParams(V)
+ return webidl.converters.URLSearchParams(V, prefix, name)
}
- return webidl.converters.DOMString(V)
+ return webidl.converters.DOMString(V, prefix, name)
}
// https://fetch.spec.whatwg.org/#bodyinit
-webidl.converters.BodyInit = function (V) {
+webidl.converters.BodyInit = function (V, prefix, argument) {
if (V instanceof ReadableStream) {
- return webidl.converters.ReadableStream(V)
+ return webidl.converters.ReadableStream(V, prefix, argument)
}
// Note: the spec doesn't include async iterables,
@@ -29372,19 +33033,19 @@ webidl.converters.BodyInit = function (V) {
return V
}
- return webidl.converters.XMLHttpRequestBodyInit(V)
+ return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument)
}
webidl.converters.ResponseInit = webidl.dictionaryConverter([
{
key: 'status',
converter: webidl.converters['unsigned short'],
- defaultValue: 200
+ defaultValue: () => 200
},
{
key: 'statusText',
converter: webidl.converters.ByteString,
- defaultValue: ''
+ defaultValue: () => ''
},
{
key: 'headers',
@@ -29393,21 +33054,22 @@ webidl.converters.ResponseInit = webidl.dictionaryConverter([
])
module.exports = {
+ isNetworkError,
makeNetworkError,
makeResponse,
makeAppropriateNetworkError,
filterResponse,
Response,
- cloneResponse
+ cloneResponse,
+ fromInnerResponse
}
/***/ }),
-/***/ 5861:
+/***/ 3627:
/***/ ((module) => {
-"use strict";
module.exports = {
@@ -29415,38 +33077,40 @@ module.exports = {
kHeaders: Symbol('headers'),
kSignal: Symbol('signal'),
kState: Symbol('state'),
- kGuard: Symbol('guard'),
- kRealm: Symbol('realm')
+ kDispatcher: Symbol('dispatcher')
}
/***/ }),
-/***/ 2538:
+/***/ 3168:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { performance } = __nccwpck_require__(4074)
-const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
-const assert = __nccwpck_require__(9491)
-const { isUint8Array } = __nccwpck_require__(9830)
+const { Transform } = __nccwpck_require__(7075)
+const zlib = __nccwpck_require__(8522)
+const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(4495)
+const { getGlobalOrigin } = __nccwpck_require__(1059)
+const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(1900)
+const { performance } = __nccwpck_require__(643)
+const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3440)
+const assert = __nccwpck_require__(4589)
+const { isUint8Array } = __nccwpck_require__(3429)
+const { webidl } = __nccwpck_require__(5893)
let supportedHashes = []
// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
-/** @type {import('crypto')|undefined} */
+/** @type {import('crypto')} */
let crypto
-
try {
- crypto = __nccwpck_require__(6113)
+ crypto = __nccwpck_require__(7598)
const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
/* c8 ignore next 3 */
} catch {
+
}
function responseURL (response) {
@@ -29467,11 +33131,17 @@ function responseLocationURL (response, requestFragment) {
// 2. Let location be the result of extracting header list values given
// `Location` and response’s header list.
- let location = response.headersList.get('location')
+ let location = response.headersList.get('location', true)
// 3. If location is a header value, then set location to the result of
// parsing location with response’s URL.
if (location !== null && isValidHeaderValue(location)) {
+ if (!isValidEncodedURL(location)) {
+ // Some websites respond location header in UTF-8 form without encoding them as ASCII
+ // and major browsers redirect them to correctly UTF-8 encoded addresses.
+ // Here, we handle that behavior in the same way.
+ location = normalizeBinaryStringToUtf8(location)
+ }
location = new URL(location, responseURL(response))
}
@@ -29485,6 +33155,35 @@ function responseLocationURL (response, requestFragment) {
return location
}
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2
+ * @param {string} url
+ * @returns {boolean}
+ */
+function isValidEncodedURL (url) {
+ for (let i = 0; i < url.length; ++i) {
+ const code = url.charCodeAt(i)
+
+ if (
+ code > 0x7E || // Non-US-ASCII + DEL
+ code < 0x20 // Control characters NUL - US
+ ) {
+ return false
+ }
+ }
+ return true
+}
+
+/**
+ * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it.
+ * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well.
+ * @param {string} value
+ * @returns {string}
+ */
+function normalizeBinaryStringToUtf8 (value) {
+ return Buffer.from(value, 'binary').toString('utf8')
+}
+
/** @returns {URL} */
function requestCurrentURL (request) {
return request.urlList[request.urlList.length - 1]
@@ -29535,59 +33234,11 @@ function isValidReasonPhrase (statusText) {
return true
}
-/**
- * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
- * @param {number} c
- */
-function isTokenCharCode (c) {
- switch (c) {
- case 0x22:
- case 0x28:
- case 0x29:
- case 0x2c:
- case 0x2f:
- case 0x3a:
- case 0x3b:
- case 0x3c:
- case 0x3d:
- case 0x3e:
- case 0x3f:
- case 0x40:
- case 0x5b:
- case 0x5c:
- case 0x5d:
- case 0x7b:
- case 0x7d:
- // DQUOTE and "(),/:;<=>?@[\]{}"
- return false
- default:
- // VCHAR %x21-7E
- return c >= 0x21 && c <= 0x7e
- }
-}
-
-/**
- * @param {string} characters
- */
-function isValidHTTPToken (characters) {
- if (characters.length === 0) {
- return false
- }
- for (let i = 0; i < characters.length; ++i) {
- if (!isTokenCharCode(characters.charCodeAt(i))) {
- return false
- }
- }
- return true
-}
-
/**
* @see https://fetch.spec.whatwg.org/#header-name
* @param {string} potentialValue
*/
-function isValidHeaderName (potentialValue) {
- return isValidHTTPToken(potentialValue)
-}
+const isValidHeaderName = isValidHTTPToken
/**
* @see https://fetch.spec.whatwg.org/#header-value
@@ -29596,24 +33247,15 @@ function isValidHeaderName (potentialValue) {
function isValidHeaderValue (potentialValue) {
// - Has no leading or trailing HTTP tab or space bytes.
// - Contains no 0x00 (NUL) or HTTP newline bytes.
- if (
- potentialValue.startsWith('\t') ||
- potentialValue.startsWith(' ') ||
- potentialValue.endsWith('\t') ||
- potentialValue.endsWith(' ')
- ) {
- return false
- }
-
- if (
- potentialValue.includes('\0') ||
+ return (
+ potentialValue[0] === '\t' ||
+ potentialValue[0] === ' ' ||
+ potentialValue[potentialValue.length - 1] === '\t' ||
+ potentialValue[potentialValue.length - 1] === ' ' ||
+ potentialValue.includes('\n') ||
potentialValue.includes('\r') ||
- potentialValue.includes('\n')
- ) {
- return false
- }
-
- return true
+ potentialValue.includes('\0')
+ ) === false
}
// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
@@ -29631,7 +33273,7 @@ function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
// 2. Let policy be the empty string.
// 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.
// 4. Return policy.
- const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
+ const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',')
// Note: As the referrer-policy can contain multiple policies
// separated by comma, we need to loop through all of them
@@ -29690,7 +33332,7 @@ function appendFetchMetadata (httpRequest) {
header = httpRequest.mode
// 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
- httpRequest.headersList.set('sec-fetch-mode', header)
+ httpRequest.headersList.set('sec-fetch-mode', header, true)
// https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
// TODO
@@ -29701,16 +33343,26 @@ function appendFetchMetadata (httpRequest) {
// https://fetch.spec.whatwg.org/#append-a-request-origin-header
function appendRequestOriginHeader (request) {
- // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
+ // 1. Let serializedOrigin be the result of byte-serializing a request origin
+ // with request.
+ // TODO: implement "byte-serializing a request origin"
let serializedOrigin = request.origin
- // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
- if (request.responseTainting === 'cors' || request.mode === 'websocket') {
- if (serializedOrigin) {
- request.headersList.append('origin', serializedOrigin)
- }
+ // - "'client' is changed to an origin during fetching."
+ // This doesn't happen in undici (in most cases) because undici, by default,
+ // has no concept of origin.
+ // - request.origin can also be set to request.client.origin (client being
+ // an environment settings object), which is undefined without using
+ // setGlobalOrigin.
+ if (serializedOrigin === 'client' || serializedOrigin === undefined) {
+ return
+ }
+ // 2. If request’s response tainting is "cors" or request’s mode is "websocket",
+ // then append (`Origin`, serializedOrigin) to request’s header list.
// 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
+ if (request.responseTainting === 'cors' || request.mode === 'websocket') {
+ request.headersList.append('origin', serializedOrigin, true)
} else if (request.method !== 'GET' && request.method !== 'HEAD') {
// 1. Switch on request’s referrer policy:
switch (request.referrerPolicy) {
@@ -29721,13 +33373,16 @@ function appendRequestOriginHeader (request) {
case 'no-referrer-when-downgrade':
case 'strict-origin':
case 'strict-origin-when-cross-origin':
- // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`.
+ // If request’s origin is a tuple origin, its scheme is "https", and
+ // request’s current URL’s scheme is not "https", then set
+ // serializedOrigin to `null`.
if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
serializedOrigin = null
}
break
case 'same-origin':
- // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
+ // If request’s origin is not same origin with request’s current URL’s
+ // origin, then set serializedOrigin to `null`.
if (!sameOrigin(request, requestCurrentURL(request))) {
serializedOrigin = null
}
@@ -29736,16 +33391,43 @@ function appendRequestOriginHeader (request) {
// Do nothing.
}
- if (serializedOrigin) {
- // 2. Append (`Origin`, serializedOrigin) to request’s header list.
- request.headersList.append('origin', serializedOrigin)
+ // 2. Append (`Origin`, serializedOrigin) to request’s header list.
+ request.headersList.append('origin', serializedOrigin, true)
+ }
+}
+
+// https://w3c.github.io/hr-time/#dfn-coarsen-time
+function coarsenTime (timestamp, crossOriginIsolatedCapability) {
+ // TODO
+ return timestamp
+}
+
+// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info
+function clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) {
+ if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) {
+ return {
+ domainLookupStartTime: defaultStartTime,
+ domainLookupEndTime: defaultStartTime,
+ connectionStartTime: defaultStartTime,
+ connectionEndTime: defaultStartTime,
+ secureConnectionStartTime: defaultStartTime,
+ ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol
}
}
+
+ return {
+ domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability),
+ domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability),
+ connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability),
+ connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability),
+ secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability),
+ ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol
+ }
}
+// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time
function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
- // TODO
- return performance.now()
+ return coarsenTime(performance.now(), crossOriginIsolatedCapability)
}
// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
@@ -29884,6 +33566,8 @@ function stripURLForReferrer (url, originOnly) {
// 1. Assert: url is a URL.
assert(url instanceof URL)
+ url = new URL(url)
+
// 2. If url’s scheme is a local scheme, then return no referrer.
if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
return 'no-referrer'
@@ -30198,30 +33882,12 @@ function isCancelled (fetchParams) {
fetchParams.controller.state === 'terminated'
}
-const normalizeMethodRecord = {
- delete: 'DELETE',
- DELETE: 'DELETE',
- get: 'GET',
- GET: 'GET',
- head: 'HEAD',
- HEAD: 'HEAD',
- options: 'OPTIONS',
- OPTIONS: 'OPTIONS',
- post: 'POST',
- POST: 'POST',
- put: 'PUT',
- PUT: 'PUT'
-}
-
-// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
-Object.setPrototypeOf(normalizeMethodRecord, null)
-
/**
* @see https://fetch.spec.whatwg.org/#concept-method-normalize
* @param {string} method
*/
function normalizeMethod (method) {
- return normalizeMethodRecord[method.toLowerCase()] ?? method
+ return normalizedMethodRecordsBase[method.toLowerCase()] ?? method
}
// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
@@ -30246,31 +33912,40 @@ const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbo
/**
* @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
- * @param {() => unknown[]} iterator
* @param {string} name name of the instance
- * @param {'key'|'value'|'key+value'} kind
- */
-function makeIterator (iterator, name, kind) {
- const object = {
- index: 0,
- kind,
- target: iterator
- }
+ * @param {symbol} kInternalIterator
+ * @param {string | number} [keyIndex]
+ * @param {string | number} [valueIndex]
+ */
+function createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) {
+ class FastIterableIterator {
+ /** @type {any} */
+ #target
+ /** @type {'key' | 'value' | 'key+value'} */
+ #kind
+ /** @type {number} */
+ #index
+
+ /**
+ * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object
+ * @param {unknown} target
+ * @param {'key' | 'value' | 'key+value'} kind
+ */
+ constructor (target, kind) {
+ this.#target = target
+ this.#kind = kind
+ this.#index = 0
+ }
- const i = {
next () {
// 1. Let interface be the interface for which the iterator prototype object exists.
-
// 2. Let thisValue be the this value.
-
// 3. Let object be ? ToObject(thisValue).
-
// 4. If object is a platform object, then perform a security
// check, passing:
-
// 5. If object is not a default iterator object for interface,
// then throw a TypeError.
- if (Object.getPrototypeOf(this) !== i) {
+ if (typeof this !== 'object' || this === null || !(#target in this)) {
throw new TypeError(
`'next' called on an object that does not implement interface ${name} Iterator.`
)
@@ -30279,8 +33954,8 @@ function makeIterator (iterator, name, kind) {
// 6. Let index be object’s index.
// 7. Let kind be object’s kind.
// 8. Let values be object’s target's value pairs to iterate over.
- const { index, kind, target } = object
- const values = target()
+ const index = this.#index
+ const values = this.#target[kInternalIterator]
// 9. Let len be the length of values.
const len = values.length
@@ -30288,70 +33963,155 @@ function makeIterator (iterator, name, kind) {
// 10. If index is greater than or equal to len, then return
// CreateIterResultObject(undefined, true).
if (index >= len) {
- return { value: undefined, done: true }
+ return {
+ value: undefined,
+ done: true
+ }
}
// 11. Let pair be the entry in values at index index.
- const pair = values[index]
+ const { [keyIndex]: key, [valueIndex]: value } = values[index]
// 12. Set object’s index to index + 1.
- object.index = index + 1
+ this.#index = index + 1
// 13. Return the iterator result for pair and kind.
- return iteratorResult(pair, kind)
- },
- // The class string of an iterator prototype object for a given interface is the
- // result of concatenating the identifier of the interface and the string " Iterator".
- [Symbol.toStringTag]: `${name} Iterator`
- }
-
- // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
- Object.setPrototypeOf(i, esIteratorPrototype)
- // esIteratorPrototype needs to be the prototype of i
- // which is the prototype of an empty object. Yes, it's confusing.
- return Object.setPrototypeOf({}, i)
-}
-
-// https://webidl.spec.whatwg.org/#iterator-result
-function iteratorResult (pair, kind) {
- let result
-
- // 1. Let result be a value determined by the value of kind:
- switch (kind) {
- case 'key': {
- // 1. Let idlKey be pair’s key.
- // 2. Let key be the result of converting idlKey to an
- // ECMAScript value.
- // 3. result is key.
- result = pair[0]
- break
- }
- case 'value': {
- // 1. Let idlValue be pair’s value.
- // 2. Let value be the result of converting idlValue to
- // an ECMAScript value.
- // 3. result is value.
- result = pair[1]
- break
+
+ // https://webidl.spec.whatwg.org/#iterator-result
+
+ // 1. Let result be a value determined by the value of kind:
+ let result
+ switch (this.#kind) {
+ case 'key':
+ // 1. Let idlKey be pair’s key.
+ // 2. Let key be the result of converting idlKey to an
+ // ECMAScript value.
+ // 3. result is key.
+ result = key
+ break
+ case 'value':
+ // 1. Let idlValue be pair’s value.
+ // 2. Let value be the result of converting idlValue to
+ // an ECMAScript value.
+ // 3. result is value.
+ result = value
+ break
+ case 'key+value':
+ // 1. Let idlKey be pair’s key.
+ // 2. Let idlValue be pair’s value.
+ // 3. Let key be the result of converting idlKey to an
+ // ECMAScript value.
+ // 4. Let value be the result of converting idlValue to
+ // an ECMAScript value.
+ // 5. Let array be ! ArrayCreate(2).
+ // 6. Call ! CreateDataProperty(array, "0", key).
+ // 7. Call ! CreateDataProperty(array, "1", value).
+ // 8. result is array.
+ result = [key, value]
+ break
+ }
+
+ // 2. Return CreateIterResultObject(result, false).
+ return {
+ value: result,
+ done: false
+ }
}
- case 'key+value': {
- // 1. Let idlKey be pair’s key.
- // 2. Let idlValue be pair’s value.
- // 3. Let key be the result of converting idlKey to an
- // ECMAScript value.
- // 4. Let value be the result of converting idlValue to
- // an ECMAScript value.
- // 5. Let array be ! ArrayCreate(2).
- // 6. Call ! CreateDataProperty(array, "0", key).
- // 7. Call ! CreateDataProperty(array, "1", value).
- // 8. result is array.
- result = pair
- break
+ }
+
+ // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
+ // @ts-ignore
+ delete FastIterableIterator.prototype.constructor
+
+ Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype)
+
+ Object.defineProperties(FastIterableIterator.prototype, {
+ [Symbol.toStringTag]: {
+ writable: false,
+ enumerable: false,
+ configurable: true,
+ value: `${name} Iterator`
+ },
+ next: { writable: true, enumerable: true, configurable: true }
+ })
+
+ /**
+ * @param {unknown} target
+ * @param {'key' | 'value' | 'key+value'} kind
+ * @returns {IterableIterator}
+ */
+ return function (target, kind) {
+ return new FastIterableIterator(target, kind)
+ }
+}
+
+/**
+ * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
+ * @param {string} name name of the instance
+ * @param {any} object class
+ * @param {symbol} kInternalIterator
+ * @param {string | number} [keyIndex]
+ * @param {string | number} [valueIndex]
+ */
+function iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {
+ const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex)
+
+ const properties = {
+ keys: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function keys () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'key')
+ }
+ },
+ values: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function values () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'value')
+ }
+ },
+ entries: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function entries () {
+ webidl.brandCheck(this, object)
+ return makeIterator(this, 'key+value')
+ }
+ },
+ forEach: {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: function forEach (callbackfn, thisArg = globalThis) {
+ webidl.brandCheck(this, object)
+ webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`)
+ if (typeof callbackfn !== 'function') {
+ throw new TypeError(
+ `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`
+ )
+ }
+ for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) {
+ callbackfn.call(thisArg, value, key, this)
+ }
+ }
}
}
- // 2. Return CreateIterResultObject(result, false).
- return { value: result, done: false }
+ return Object.defineProperties(object.prototype, {
+ ...properties,
+ [Symbol.iterator]: {
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ value: properties.entries.value
+ }
+ })
}
/**
@@ -30383,68 +34143,43 @@ async function fullyReadBody (body, processBody, processBodyError) {
// 5. Read all bytes from reader, given successSteps and errorSteps.
try {
- const result = await readAllBytes(reader)
- successSteps(result)
+ successSteps(await readAllBytes(reader))
} catch (e) {
errorSteps(e)
}
}
-/** @type {ReadableStream} */
-let ReadableStream = globalThis.ReadableStream
-
function isReadableStreamLike (stream) {
- if (!ReadableStream) {
- ReadableStream = (__nccwpck_require__(5356).ReadableStream)
- }
-
return stream instanceof ReadableStream || (
stream[Symbol.toStringTag] === 'ReadableStream' &&
typeof stream.tee === 'function'
)
}
-const MAXIMUM_ARGUMENT_LENGTH = 65535
-
-/**
- * @see https://infra.spec.whatwg.org/#isomorphic-decode
- * @param {number[]|Uint8Array} input
- */
-function isomorphicDecode (input) {
- // 1. To isomorphic decode a byte sequence input, return a string whose code point
- // length is equal to input’s length and whose code points have the same values
- // as the values of input’s bytes, in the same order.
-
- if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
- return String.fromCharCode(...input)
- }
-
- return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
-}
-
/**
* @param {ReadableStreamController} controller
*/
function readableStreamClose (controller) {
try {
controller.close()
+ controller.byobRequest?.respond(0)
} catch (err) {
// TODO: add comment explaining why this error occurs.
- if (!err.message.includes('Controller is already closed')) {
+ if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {
throw err
}
}
}
+const invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/ // eslint-disable-line
+
/**
* @see https://infra.spec.whatwg.org/#isomorphic-encode
* @param {string} input
*/
function isomorphicEncode (input) {
// 1. Assert: input contains no code points greater than U+00FF.
- for (let i = 0; i < input.length; i++) {
- assert(input.charCodeAt(i) <= 0xFF)
- }
+ assert(!invalidIsomorphicEncodeValueRegex.test(input))
// 2. Return a byte sequence whose length is equal to input’s code
// point length and whose bytes have the same values as the
@@ -30497,13 +34232,21 @@ function urlIsLocal (url) {
/**
* @param {string|URL} url
+ * @returns {boolean}
*/
function urlHasHttpsScheme (url) {
- if (typeof url === 'string') {
- return url.startsWith('https:')
- }
-
- return url.protocol === 'https:'
+ return (
+ (
+ typeof url === 'string' &&
+ url[5] === ':' &&
+ url[0] === 'h' &&
+ url[1] === 't' &&
+ url[2] === 't' &&
+ url[3] === 'p' &&
+ url[4] === 's'
+ ) ||
+ url.protocol === 'https:'
+ )
}
/**
@@ -30519,17 +34262,417 @@ function urlIsHttpHttpsScheme (url) {
}
/**
- * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
+ * @see https://fetch.spec.whatwg.org/#simple-range-header-value
+ * @param {string} value
+ * @param {boolean} allowWhitespace
+ */
+function simpleRangeHeaderValue (value, allowWhitespace) {
+ // 1. Let data be the isomorphic decoding of value.
+ // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string,
+ // nothing more. We obviously don't need to do that if value is a string already.
+ const data = value
+
+ // 2. If data does not start with "bytes", then return failure.
+ if (!data.startsWith('bytes')) {
+ return 'failure'
+ }
+
+ // 3. Let position be a position variable for data, initially pointing at the 5th code point of data.
+ const position = { position: 5 }
+
+ // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,
+ // from data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
+ }
+
+ // 5. If the code point at position within data is not U+003D (=), then return failure.
+ if (data.charCodeAt(position.position) !== 0x3D) {
+ return 'failure'
+ }
+
+ // 6. Advance position by 1.
+ position.position++
+
+ // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from
+ // data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
+ }
+
+ // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits,
+ // from data given position.
+ const rangeStart = collectASequenceOfCodePoints(
+ (char) => {
+ const code = char.charCodeAt(0)
+
+ return code >= 0x30 && code <= 0x39
+ },
+ data,
+ position
+ )
+
+ // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the
+ // empty string; otherwise null.
+ const rangeStartValue = rangeStart.length ? Number(rangeStart) : null
+
+ // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space,
+ // from data given position.
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
+ }
+
+ // 11. If the code point at position within data is not U+002D (-), then return failure.
+ if (data.charCodeAt(position.position) !== 0x2D) {
+ return 'failure'
+ }
+
+ // 12. Advance position by 1.
+ position.position++
+
+ // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab
+ // or space, from data given position.
+ // Note from Khafra: its the same step as in #8 again lol
+ if (allowWhitespace) {
+ collectASequenceOfCodePoints(
+ (char) => char === '\t' || char === ' ',
+ data,
+ position
+ )
+ }
+
+ // 14. Let rangeEnd be the result of collecting a sequence of code points that are
+ // ASCII digits, from data given position.
+ // Note from Khafra: you wouldn't guess it, but this is also the same step as #8
+ const rangeEnd = collectASequenceOfCodePoints(
+ (char) => {
+ const code = char.charCodeAt(0)
+
+ return code >= 0x30 && code <= 0x39
+ },
+ data,
+ position
+ )
+
+ // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd
+ // is not the empty string; otherwise null.
+ // Note from Khafra: THE SAME STEP, AGAIN!!!
+ // Note: why interpret as a decimal if we only collect ascii digits?
+ const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null
+
+ // 16. If position is not past the end of data, then return failure.
+ if (position.position < data.length) {
+ return 'failure'
+ }
+
+ // 17. If rangeEndValue and rangeStartValue are null, then return failure.
+ if (rangeEndValue === null && rangeStartValue === null) {
+ return 'failure'
+ }
+
+ // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is
+ // greater than rangeEndValue, then return failure.
+ // Note: ... when can they not be numbers?
+ if (rangeStartValue > rangeEndValue) {
+ return 'failure'
+ }
+
+ // 19. Return (rangeStartValue, rangeEndValue).
+ return { rangeStartValue, rangeEndValue }
+}
+
+/**
+ * @see https://fetch.spec.whatwg.org/#build-a-content-range
+ * @param {number} rangeStart
+ * @param {number} rangeEnd
+ * @param {number} fullLength
+ */
+function buildContentRange (rangeStart, rangeEnd, fullLength) {
+ // 1. Let contentRange be `bytes `.
+ let contentRange = 'bytes '
+
+ // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange.
+ contentRange += isomorphicEncode(`${rangeStart}`)
+
+ // 3. Append 0x2D (-) to contentRange.
+ contentRange += '-'
+
+ // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange.
+ contentRange += isomorphicEncode(`${rangeEnd}`)
+
+ // 5. Append 0x2F (/) to contentRange.
+ contentRange += '/'
+
+ // 6. Append fullLength, serialized and isomorphic encoded to contentRange.
+ contentRange += isomorphicEncode(`${fullLength}`)
+
+ // 7. Return contentRange.
+ return contentRange
+}
+
+// A Stream, which pipes the response to zlib.createInflate() or
+// zlib.createInflateRaw() depending on the first byte of the Buffer.
+// If the lower byte of the first byte is 0x08, then the stream is
+// interpreted as a zlib stream, otherwise it's interpreted as a
+// raw deflate stream.
+class InflateStream extends Transform {
+ #zlibOptions
+
+ /** @param {zlib.ZlibOptions} [zlibOptions] */
+ constructor (zlibOptions) {
+ super()
+ this.#zlibOptions = zlibOptions
+ }
+
+ _transform (chunk, encoding, callback) {
+ if (!this._inflateStream) {
+ if (chunk.length === 0) {
+ callback()
+ return
+ }
+ this._inflateStream = (chunk[0] & 0x0F) === 0x08
+ ? zlib.createInflate(this.#zlibOptions)
+ : zlib.createInflateRaw(this.#zlibOptions)
+
+ this._inflateStream.on('data', this.push.bind(this))
+ this._inflateStream.on('end', () => this.push(null))
+ this._inflateStream.on('error', (err) => this.destroy(err))
+ }
+
+ this._inflateStream.write(chunk, encoding, callback)
+ }
+
+ _final (callback) {
+ if (this._inflateStream) {
+ this._inflateStream.end()
+ this._inflateStream = null
+ }
+ callback()
+ }
+}
+
+/**
+ * @param {zlib.ZlibOptions} [zlibOptions]
+ * @returns {InflateStream}
+ */
+function createInflate (zlibOptions) {
+ return new InflateStream(zlibOptions)
+}
+
+/**
+ * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type
+ * @param {import('./headers').HeadersList} headers
+ */
+function extractMimeType (headers) {
+ // 1. Let charset be null.
+ let charset = null
+
+ // 2. Let essence be null.
+ let essence = null
+
+ // 3. Let mimeType be null.
+ let mimeType = null
+
+ // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers.
+ const values = getDecodeSplit('content-type', headers)
+
+ // 5. If values is null, then return failure.
+ if (values === null) {
+ return 'failure'
+ }
+
+ // 6. For each value of values:
+ for (const value of values) {
+ // 6.1. Let temporaryMimeType be the result of parsing value.
+ const temporaryMimeType = parseMIMEType(value)
+
+ // 6.2. If temporaryMimeType is failure or its essence is "*/*", then continue.
+ if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') {
+ continue
+ }
+
+ // 6.3. Set mimeType to temporaryMimeType.
+ mimeType = temporaryMimeType
+
+ // 6.4. If mimeType’s essence is not essence, then:
+ if (mimeType.essence !== essence) {
+ // 6.4.1. Set charset to null.
+ charset = null
+
+ // 6.4.2. If mimeType’s parameters["charset"] exists, then set charset to
+ // mimeType’s parameters["charset"].
+ if (mimeType.parameters.has('charset')) {
+ charset = mimeType.parameters.get('charset')
+ }
+
+ // 6.4.3. Set essence to mimeType’s essence.
+ essence = mimeType.essence
+ } else if (!mimeType.parameters.has('charset') && charset !== null) {
+ // 6.5. Otherwise, if mimeType’s parameters["charset"] does not exist, and
+ // charset is non-null, set mimeType’s parameters["charset"] to charset.
+ mimeType.parameters.set('charset', charset)
+ }
+ }
+
+ // 7. If mimeType is null, then return failure.
+ if (mimeType == null) {
+ return 'failure'
+ }
+
+ // 8. Return mimeType.
+ return mimeType
+}
+
+/**
+ * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split
+ * @param {string|null} value
+ */
+function gettingDecodingSplitting (value) {
+ // 1. Let input be the result of isomorphic decoding value.
+ const input = value
+
+ // 2. Let position be a position variable for input, initially pointing at the start of input.
+ const position = { position: 0 }
+
+ // 3. Let values be a list of strings, initially empty.
+ const values = []
+
+ // 4. Let temporaryValue be the empty string.
+ let temporaryValue = ''
+
+ // 5. While position is not past the end of input:
+ while (position.position < input.length) {
+ // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (")
+ // or U+002C (,) from input, given position, to temporaryValue.
+ temporaryValue += collectASequenceOfCodePoints(
+ (char) => char !== '"' && char !== ',',
+ input,
+ position
+ )
+
+ // 5.2. If position is not past the end of input, then:
+ if (position.position < input.length) {
+ // 5.2.1. If the code point at position within input is U+0022 ("), then:
+ if (input.charCodeAt(position.position) === 0x22) {
+ // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue.
+ temporaryValue += collectAnHTTPQuotedString(
+ input,
+ position
+ )
+
+ // 5.2.1.2. If position is not past the end of input, then continue.
+ if (position.position < input.length) {
+ continue
+ }
+ } else {
+ // 5.2.2. Otherwise:
+
+ // 5.2.2.1. Assert: the code point at position within input is U+002C (,).
+ assert(input.charCodeAt(position.position) === 0x2C)
+
+ // 5.2.2.2. Advance position by 1.
+ position.position++
+ }
+ }
+
+ // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue.
+ temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20)
+
+ // 5.4. Append temporaryValue to values.
+ values.push(temporaryValue)
+
+ // 5.6. Set temporaryValue to the empty string.
+ temporaryValue = ''
+ }
+
+ // 6. Return values.
+ return values
+}
+
+/**
+ * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split
+ * @param {string} name lowercase header name
+ * @param {import('./headers').HeadersList} list
*/
-const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
+function getDecodeSplit (name, list) {
+ // 1. Let value be the result of getting name from list.
+ const value = list.get(name, true)
+
+ // 2. If value is null, then return null.
+ if (value === null) {
+ return null
+ }
+
+ // 3. Return the result of getting, decoding, and splitting value.
+ return gettingDecodingSplitting(value)
+}
+
+const textDecoder = new TextDecoder()
+
+/**
+ * @see https://encoding.spec.whatwg.org/#utf-8-decode
+ * @param {Buffer} buffer
+ */
+function utf8DecodeBytes (buffer) {
+ if (buffer.length === 0) {
+ return ''
+ }
+
+ // 1. Let buffer be the result of peeking three bytes from
+ // ioQueue, converted to a byte sequence.
+
+ // 2. If buffer is 0xEF 0xBB 0xBF, then read three
+ // bytes from ioQueue. (Do nothing with those bytes.)
+ if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
+ buffer = buffer.subarray(3)
+ }
+
+ // 3. Process a queue with an instance of UTF-8’s
+ // decoder, ioQueue, output, and "replacement".
+ const output = textDecoder.decode(buffer)
+
+ // 4. Return output.
+ return output
+}
+
+class EnvironmentSettingsObjectBase {
+ get baseUrl () {
+ return getGlobalOrigin()
+ }
+
+ get origin () {
+ return this.baseUrl?.origin
+ }
+
+ policyContainer = makePolicyContainer()
+}
+
+class EnvironmentSettingsObject {
+ settingsObject = new EnvironmentSettingsObjectBase()
+}
+
+const environmentSettingsObject = new EnvironmentSettingsObject()
module.exports = {
isAborted,
isCancelled,
+ isValidEncodedURL,
createDeferredPromise,
ReadableStreamFrom,
- toUSVString,
tryUpgradeRequestToAPotentiallyTrustworthyURL,
+ clampAndCoarsenConnectionTimingInfo,
coarsenedSharedCurrentTime,
determineRequestsReferrer,
makePolicyContainer,
@@ -30552,38 +34695,43 @@ module.exports = {
sameOrigin,
normalizeMethod,
serializeJavascriptValueToJSONString,
- makeIterator,
+ iteratorMixin,
+ createIterator,
isValidHeaderName,
isValidHeaderValue,
- hasOwn,
isErrorLike,
fullyReadBody,
bytesMatch,
isReadableStreamLike,
readableStreamClose,
isomorphicEncode,
- isomorphicDecode,
urlIsLocal,
urlHasHttpsScheme,
urlIsHttpHttpsScheme,
readAllBytes,
- normalizeMethodRecord,
- parseMetadata
+ simpleRangeHeaderValue,
+ buildContentRange,
+ parseMetadata,
+ createInflate,
+ extractMimeType,
+ getDecodeSplit,
+ utf8DecodeBytes,
+ environmentSettingsObject
}
/***/ }),
-/***/ 1744:
+/***/ 5893:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { types } = __nccwpck_require__(3837)
-const { hasOwn, toUSVString } = __nccwpck_require__(2538)
+const { types, inspect } = __nccwpck_require__(7975)
+const { markAsUncloneable } = __nccwpck_require__(5919)
+const { toUSVString } = __nccwpck_require__(3440)
-/** @type {import('../../types/webidl').Webidl} */
+/** @type {import('../../../types/webidl').Webidl} */
const webidl = {}
webidl.converters = {}
webidl.util = {}
@@ -30613,11 +34761,19 @@ webidl.errors.invalidArgument = function (context) {
}
// https://webidl.spec.whatwg.org/#implements
-webidl.brandCheck = function (V, I, opts = undefined) {
- if (opts?.strict !== false && !(V instanceof I)) {
- throw new TypeError('Illegal invocation')
+webidl.brandCheck = function (V, I, opts) {
+ if (opts?.strict !== false) {
+ if (!(V instanceof I)) {
+ const err = new TypeError('Illegal invocation')
+ err.code = 'ERR_INVALID_THIS' // node compat.
+ throw err
+ }
} else {
- return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
+ if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {
+ const err = new TypeError('Illegal invocation')
+ err.code = 'ERR_INVALID_THIS' // node compat.
+ throw err
+ }
}
}
@@ -30626,7 +34782,7 @@ webidl.argumentLengthCheck = function ({ length }, min, ctx) {
throw webidl.errors.exception({
message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
`but${length ? ' only' : ''} ${length} found.`,
- ...ctx
+ header: ctx
})
}
}
@@ -30658,8 +34814,9 @@ webidl.util.Type = function (V) {
}
}
+webidl.util.markAsUncloneable = markAsUncloneable || (() => {})
// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
-webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
+webidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {
let upperBound
let lowerBound
@@ -30703,7 +34860,7 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
// 6. If the conversion is to an IDL type associated
// with the [EnforceRange] extended attribute, then:
- if (opts.enforceRange === true) {
+ if (opts?.enforceRange === true) {
// 1. If x is NaN, +∞, or −∞, then throw a TypeError.
if (
Number.isNaN(x) ||
@@ -30712,7 +34869,7 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
) {
throw webidl.errors.exception({
header: 'Integer conversion',
- message: `Could not convert ${V} to an integer.`
+ message: `Could not convert ${webidl.util.Stringify(V)} to an integer.`
})
}
@@ -30735,7 +34892,7 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
// 7. If x is not NaN and the conversion is to an IDL
// type associated with the [Clamp] extended
// attribute, then:
- if (!Number.isNaN(x) && opts.clamp === true) {
+ if (!Number.isNaN(x) && opts?.clamp === true) {
// 1. Set x to min(max(x, lowerBound), upperBound).
x = Math.min(Math.max(x, lowerBound), upperBound)
@@ -30792,21 +34949,37 @@ webidl.util.IntegerPart = function (n) {
return r
}
+webidl.util.Stringify = function (V) {
+ const type = webidl.util.Type(V)
+
+ switch (type) {
+ case 'Symbol':
+ return `Symbol(${V.description})`
+ case 'Object':
+ return inspect(V)
+ case 'String':
+ return `"${V}"`
+ default:
+ return `${V}`
+ }
+}
+
// https://webidl.spec.whatwg.org/#es-sequence
webidl.sequenceConverter = function (converter) {
- return (V) => {
+ return (V, prefix, argument, Iterable) => {
// 1. If Type(V) is not Object, throw a TypeError.
if (webidl.util.Type(V) !== 'Object') {
throw webidl.errors.exception({
- header: 'Sequence',
- message: `Value of type ${webidl.util.Type(V)} is not an Object.`
+ header: prefix,
+ message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.`
})
}
// 2. Let method be ? GetMethod(V, @@iterator).
/** @type {Generator} */
- const method = V?.[Symbol.iterator]?.()
+ const method = typeof Iterable === 'function' ? Iterable() : V?.[Symbol.iterator]?.()
const seq = []
+ let index = 0
// 3. If method is undefined, throw a TypeError.
if (
@@ -30814,8 +34987,8 @@ webidl.sequenceConverter = function (converter) {
typeof method.next !== 'function'
) {
throw webidl.errors.exception({
- header: 'Sequence',
- message: 'Object is not an iterator.'
+ header: prefix,
+ message: `${argument} is not iterable.`
})
}
@@ -30827,7 +35000,7 @@ webidl.sequenceConverter = function (converter) {
break
}
- seq.push(converter(value))
+ seq.push(converter(value, prefix, `${argument}[${index++}]`))
}
return seq
@@ -30836,12 +35009,12 @@ webidl.sequenceConverter = function (converter) {
// https://webidl.spec.whatwg.org/#es-to-record
webidl.recordConverter = function (keyConverter, valueConverter) {
- return (O) => {
+ return (O, prefix, argument) => {
// 1. If Type(O) is not Object, throw a TypeError.
if (webidl.util.Type(O) !== 'Object') {
throw webidl.errors.exception({
- header: 'Record',
- message: `Value of type ${webidl.util.Type(O)} is not an Object.`
+ header: prefix,
+ message: `${argument} ("${webidl.util.Type(O)}") is not an Object.`
})
}
@@ -30849,16 +35022,16 @@ webidl.recordConverter = function (keyConverter, valueConverter) {
const result = {}
if (!types.isProxy(O)) {
- // Object.keys only returns enumerable properties
- const keys = Object.keys(O)
+ // 1. Let desc be ? O.[[GetOwnProperty]](key).
+ const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]
for (const key of keys) {
// 1. Let typedKey be key converted to an IDL value of type K.
- const typedKey = keyConverter(key)
+ const typedKey = keyConverter(key, prefix, argument)
// 2. Let value be ? Get(O, key).
// 3. Let typedValue be value converted to an IDL value of type V.
- const typedValue = valueConverter(O[key])
+ const typedValue = valueConverter(O[key], prefix, argument)
// 4. Set result[typedKey] to typedValue.
result[typedKey] = typedValue
@@ -30879,11 +35052,11 @@ webidl.recordConverter = function (keyConverter, valueConverter) {
// 2. If desc is not undefined and desc.[[Enumerable]] is true:
if (desc?.enumerable) {
// 1. Let typedKey be key converted to an IDL value of type K.
- const typedKey = keyConverter(key)
+ const typedKey = keyConverter(key, prefix, argument)
// 2. Let value be ? Get(O, key).
// 3. Let typedValue be value converted to an IDL value of type V.
- const typedValue = valueConverter(O[key])
+ const typedValue = valueConverter(O[key], prefix, argument)
// 4. Set result[typedKey] to typedValue.
result[typedKey] = typedValue
@@ -30896,11 +35069,11 @@ webidl.recordConverter = function (keyConverter, valueConverter) {
}
webidl.interfaceConverter = function (i) {
- return (V, opts = {}) => {
- if (opts.strict !== false && !(V instanceof i)) {
+ return (V, prefix, argument, opts) => {
+ if (opts?.strict !== false && !(V instanceof i)) {
throw webidl.errors.exception({
- header: i.name,
- message: `Expected ${V} to be an instance of ${i.name}.`
+ header: prefix,
+ message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i.name}.`
})
}
@@ -30909,7 +35082,7 @@ webidl.interfaceConverter = function (i) {
}
webidl.dictionaryConverter = function (converters) {
- return (dictionary) => {
+ return (dictionary, prefix, argument) => {
const type = webidl.util.Type(dictionary)
const dict = {}
@@ -30917,7 +35090,7 @@ webidl.dictionaryConverter = function (converters) {
return dict
} else if (type !== 'Object') {
throw webidl.errors.exception({
- header: 'Dictionary',
+ header: prefix,
message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
})
}
@@ -30926,35 +35099,35 @@ webidl.dictionaryConverter = function (converters) {
const { key, defaultValue, required, converter } = options
if (required === true) {
- if (!hasOwn(dictionary, key)) {
+ if (!Object.hasOwn(dictionary, key)) {
throw webidl.errors.exception({
- header: 'Dictionary',
+ header: prefix,
message: `Missing required key "${key}".`
})
}
}
let value = dictionary[key]
- const hasDefault = hasOwn(options, 'defaultValue')
+ const hasDefault = Object.hasOwn(options, 'defaultValue')
// Only use defaultValue if value is undefined and
// a defaultValue options was provided.
if (hasDefault && value !== null) {
- value = value ?? defaultValue
+ value ??= defaultValue()
}
// A key can be optional and have no default value.
// When this happens, do not perform a conversion,
// and do not assign the key a value.
if (required || hasDefault || value !== undefined) {
- value = converter(value)
+ value = converter(value, prefix, `${argument}.${key}`)
if (
options.allowedValues &&
!options.allowedValues.includes(value)
) {
throw webidl.errors.exception({
- header: 'Dictionary',
+ header: prefix,
message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
})
}
@@ -30968,28 +35141,31 @@ webidl.dictionaryConverter = function (converters) {
}
webidl.nullableConverter = function (converter) {
- return (V) => {
+ return (V, prefix, argument) => {
if (V === null) {
return V
}
- return converter(V)
+ return converter(V, prefix, argument)
}
}
// https://webidl.spec.whatwg.org/#es-DOMString
-webidl.converters.DOMString = function (V, opts = {}) {
+webidl.converters.DOMString = function (V, prefix, argument, opts) {
// 1. If V is null and the conversion is to an IDL type
// associated with the [LegacyNullToEmptyString]
// extended attribute, then return the DOMString value
// that represents the empty string.
- if (V === null && opts.legacyNullToEmptyString) {
+ if (V === null && opts?.legacyNullToEmptyString) {
return ''
}
// 2. Let x be ? ToString(V).
if (typeof V === 'symbol') {
- throw new TypeError('Could not convert argument of type symbol to string.')
+ throw webidl.errors.exception({
+ header: prefix,
+ message: `${argument} is a symbol, which cannot be converted to a DOMString.`
+ })
}
// 3. Return the IDL DOMString value that represents the
@@ -30999,10 +35175,10 @@ webidl.converters.DOMString = function (V, opts = {}) {
}
// https://webidl.spec.whatwg.org/#es-ByteString
-webidl.converters.ByteString = function (V) {
+webidl.converters.ByteString = function (V, prefix, argument) {
// 1. Let x be ? ToString(V).
// Note: DOMString converter perform ? ToString(V)
- const x = webidl.converters.DOMString(V)
+ const x = webidl.converters.DOMString(V, prefix, argument)
// 2. If the value of any element of x is greater than
// 255, then throw a TypeError.
@@ -31022,6 +35198,7 @@ webidl.converters.ByteString = function (V) {
}
// https://webidl.spec.whatwg.org/#es-USVString
+// TODO: rewrite this so we can control the errors thrown
webidl.converters.USVString = toUSVString
// https://webidl.spec.whatwg.org/#es-boolean
@@ -31040,9 +35217,9 @@ webidl.converters.any = function (V) {
}
// https://webidl.spec.whatwg.org/#es-long-long
-webidl.converters['long long'] = function (V) {
+webidl.converters['long long'] = function (V, prefix, argument) {
// 1. Let x be ? ConvertToInt(V, 64, "signed").
- const x = webidl.util.ConvertToInt(V, 64, 'signed')
+ const x = webidl.util.ConvertToInt(V, 64, 'signed', undefined, prefix, argument)
// 2. Return the IDL long long value that represents
// the same numeric value as x.
@@ -31050,9 +35227,9 @@ webidl.converters['long long'] = function (V) {
}
// https://webidl.spec.whatwg.org/#es-unsigned-long-long
-webidl.converters['unsigned long long'] = function (V) {
+webidl.converters['unsigned long long'] = function (V, prefix, argument) {
// 1. Let x be ? ConvertToInt(V, 64, "unsigned").
- const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
+ const x = webidl.util.ConvertToInt(V, 64, 'unsigned', undefined, prefix, argument)
// 2. Return the IDL unsigned long long value that
// represents the same numeric value as x.
@@ -31060,9 +35237,9 @@ webidl.converters['unsigned long long'] = function (V) {
}
// https://webidl.spec.whatwg.org/#es-unsigned-long
-webidl.converters['unsigned long'] = function (V) {
+webidl.converters['unsigned long'] = function (V, prefix, argument) {
// 1. Let x be ? ConvertToInt(V, 32, "unsigned").
- const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
+ const x = webidl.util.ConvertToInt(V, 32, 'unsigned', undefined, prefix, argument)
// 2. Return the IDL unsigned long value that
// represents the same numeric value as x.
@@ -31070,9 +35247,9 @@ webidl.converters['unsigned long'] = function (V) {
}
// https://webidl.spec.whatwg.org/#es-unsigned-short
-webidl.converters['unsigned short'] = function (V, opts) {
+webidl.converters['unsigned short'] = function (V, prefix, argument, opts) {
// 1. Let x be ? ConvertToInt(V, 16, "unsigned").
- const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
+ const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts, prefix, argument)
// 2. Return the IDL unsigned short value that represents
// the same numeric value as x.
@@ -31080,7 +35257,7 @@ webidl.converters['unsigned short'] = function (V, opts) {
}
// https://webidl.spec.whatwg.org/#idl-ArrayBuffer
-webidl.converters.ArrayBuffer = function (V, opts = {}) {
+webidl.converters.ArrayBuffer = function (V, prefix, argument, opts) {
// 1. If Type(V) is not Object, or V does not have an
// [[ArrayBufferData]] internal slot, then throw a
// TypeError.
@@ -31091,8 +35268,8 @@ webidl.converters.ArrayBuffer = function (V, opts = {}) {
!types.isAnyArrayBuffer(V)
) {
throw webidl.errors.conversionFailed({
- prefix: `${V}`,
- argument: `${V}`,
+ prefix,
+ argument: `${argument} ("${webidl.util.Stringify(V)}")`,
types: ['ArrayBuffer']
})
}
@@ -31101,7 +35278,7 @@ webidl.converters.ArrayBuffer = function (V, opts = {}) {
// with the [AllowShared] extended attribute, and
// IsSharedArrayBuffer(V) is true, then throw a
// TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V)) {
throw webidl.errors.exception({
header: 'ArrayBuffer',
message: 'SharedArrayBuffer is not allowed.'
@@ -31112,14 +35289,19 @@ webidl.converters.ArrayBuffer = function (V, opts = {}) {
// with the [AllowResizable] extended attribute, and
// IsResizableArrayBuffer(V) is true, then throw a
// TypeError.
- // Note: resizable ArrayBuffers are currently a proposal.
+ if (V.resizable || V.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
+ }
// 4. Return the IDL ArrayBuffer value that is a
// reference to the same object as V.
return V
}
-webidl.converters.TypedArray = function (V, T, opts = {}) {
+webidl.converters.TypedArray = function (V, T, prefix, name, opts) {
// 1. Let T be the IDL type V is being converted to.
// 2. If Type(V) is not Object, or V does not have a
@@ -31131,8 +35313,8 @@ webidl.converters.TypedArray = function (V, T, opts = {}) {
V.constructor.name !== T.name
) {
throw webidl.errors.conversionFailed({
- prefix: `${T.name}`,
- argument: `${V}`,
+ prefix,
+ argument: `${name} ("${webidl.util.Stringify(V)}")`,
types: [T.name]
})
}
@@ -31141,7 +35323,7 @@ webidl.converters.TypedArray = function (V, T, opts = {}) {
// with the [AllowShared] extended attribute, and
// IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
// true, then throw a TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
throw webidl.errors.exception({
header: 'ArrayBuffer',
message: 'SharedArrayBuffer is not allowed.'
@@ -31152,20 +35334,25 @@ webidl.converters.TypedArray = function (V, T, opts = {}) {
// with the [AllowResizable] extended attribute, and
// IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
// true, then throw a TypeError.
- // Note: resizable array buffers are currently a proposal
+ if (V.buffer.resizable || V.buffer.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
+ }
// 5. Return the IDL value of type T that is a reference
// to the same object as V.
return V
}
-webidl.converters.DataView = function (V, opts = {}) {
+webidl.converters.DataView = function (V, prefix, name, opts) {
// 1. If Type(V) is not Object, or V does not have a
// [[DataView]] internal slot, then throw a TypeError.
if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
throw webidl.errors.exception({
- header: 'DataView',
- message: 'Object is not a DataView.'
+ header: prefix,
+ message: `${name} is not a DataView.`
})
}
@@ -31173,7 +35360,7 @@ webidl.converters.DataView = function (V, opts = {}) {
// with the [AllowShared] extended attribute, and
// IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
// then throw a TypeError.
- if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
+ if (opts?.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
throw webidl.errors.exception({
header: 'ArrayBuffer',
message: 'SharedArrayBuffer is not allowed.'
@@ -31184,7 +35371,12 @@ webidl.converters.DataView = function (V, opts = {}) {
// with the [AllowResizable] extended attribute, and
// IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
// true, then throw a TypeError.
- // Note: resizable ArrayBuffers are currently a proposal
+ if (V.buffer.resizable || V.buffer.growable) {
+ throw webidl.errors.exception({
+ header: 'ArrayBuffer',
+ message: 'Received a resizable ArrayBuffer.'
+ })
+ }
// 4. Return the IDL DataView value that is a reference
// to the same object as V.
@@ -31192,20 +35384,24 @@ webidl.converters.DataView = function (V, opts = {}) {
}
// https://webidl.spec.whatwg.org/#BufferSource
-webidl.converters.BufferSource = function (V, opts = {}) {
+webidl.converters.BufferSource = function (V, prefix, name, opts) {
if (types.isAnyArrayBuffer(V)) {
- return webidl.converters.ArrayBuffer(V, opts)
+ return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false })
}
if (types.isTypedArray(V)) {
- return webidl.converters.TypedArray(V, V.constructor)
+ return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false })
}
if (types.isDataView(V)) {
- return webidl.converters.DataView(V, opts)
+ return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false })
}
- throw new TypeError(`Could not convert ${V} to a BufferSource.`)
+ throw webidl.errors.conversionFailed({
+ prefix,
+ argument: `${name} ("${webidl.util.Stringify(V)}")`,
+ types: ['BufferSource']
+ })
}
webidl.converters['sequence'] = webidl.sequenceConverter(
@@ -31228,10 +35424,9 @@ module.exports = {
/***/ }),
-/***/ 4854:
+/***/ 2607:
/***/ ((module) => {
-"use strict";
/**
@@ -31526,26 +35721,25 @@ module.exports = {
/***/ }),
-/***/ 1446:
+/***/ 8355:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
const {
staticPropertyDescriptors,
readOperation,
fireAProgressEvent
-} = __nccwpck_require__(7530)
+} = __nccwpck_require__(3610)
const {
kState,
kError,
kResult,
kEvents,
kAborted
-} = __nccwpck_require__(9054)
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
+} = __nccwpck_require__(961)
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
class FileReader extends EventTarget {
constructor () {
@@ -31571,7 +35765,7 @@ class FileReader extends EventTarget {
readAsArrayBuffer (blob) {
webidl.brandCheck(this, FileReader)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsArrayBuffer')
blob = webidl.converters.Blob(blob, { strict: false })
@@ -31587,7 +35781,7 @@ class FileReader extends EventTarget {
readAsBinaryString (blob) {
webidl.brandCheck(this, FileReader)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsBinaryString')
blob = webidl.converters.Blob(blob, { strict: false })
@@ -31604,12 +35798,12 @@ class FileReader extends EventTarget {
readAsText (blob, encoding = undefined) {
webidl.brandCheck(this, FileReader)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsText')
blob = webidl.converters.Blob(blob, { strict: false })
if (encoding !== undefined) {
- encoding = webidl.converters.DOMString(encoding)
+ encoding = webidl.converters.DOMString(encoding, 'FileReader.readAsText', 'encoding')
}
// The readAsText(blob, encoding) method, when invoked,
@@ -31624,7 +35818,7 @@ class FileReader extends EventTarget {
readAsDataURL (blob) {
webidl.brandCheck(this, FileReader)
- webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
+ webidl.argumentLengthCheck(arguments, 1, 'FileReader.readAsDataURL')
blob = webidl.converters.Blob(blob, { strict: false })
@@ -31726,12143 +35920,17594 @@ class FileReader extends EventTarget {
}
}
- get onerror () {
- webidl.brandCheck(this, FileReader)
+ get onerror () {
+ webidl.brandCheck(this, FileReader)
+
+ return this[kEvents].error
+ }
+
+ set onerror (fn) {
+ webidl.brandCheck(this, FileReader)
+
+ if (this[kEvents].error) {
+ this.removeEventListener('error', this[kEvents].error)
+ }
+
+ if (typeof fn === 'function') {
+ this[kEvents].error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this[kEvents].error = null
+ }
+ }
+
+ get onloadstart () {
+ webidl.brandCheck(this, FileReader)
+
+ return this[kEvents].loadstart
+ }
+
+ set onloadstart (fn) {
+ webidl.brandCheck(this, FileReader)
+
+ if (this[kEvents].loadstart) {
+ this.removeEventListener('loadstart', this[kEvents].loadstart)
+ }
+
+ if (typeof fn === 'function') {
+ this[kEvents].loadstart = fn
+ this.addEventListener('loadstart', fn)
+ } else {
+ this[kEvents].loadstart = null
+ }
+ }
+
+ get onprogress () {
+ webidl.brandCheck(this, FileReader)
+
+ return this[kEvents].progress
+ }
+
+ set onprogress (fn) {
+ webidl.brandCheck(this, FileReader)
+
+ if (this[kEvents].progress) {
+ this.removeEventListener('progress', this[kEvents].progress)
+ }
+
+ if (typeof fn === 'function') {
+ this[kEvents].progress = fn
+ this.addEventListener('progress', fn)
+ } else {
+ this[kEvents].progress = null
+ }
+ }
+
+ get onload () {
+ webidl.brandCheck(this, FileReader)
+
+ return this[kEvents].load
+ }
+
+ set onload (fn) {
+ webidl.brandCheck(this, FileReader)
+
+ if (this[kEvents].load) {
+ this.removeEventListener('load', this[kEvents].load)
+ }
+
+ if (typeof fn === 'function') {
+ this[kEvents].load = fn
+ this.addEventListener('load', fn)
+ } else {
+ this[kEvents].load = null
+ }
+ }
+
+ get onabort () {
+ webidl.brandCheck(this, FileReader)
+
+ return this[kEvents].abort
+ }
+
+ set onabort (fn) {
+ webidl.brandCheck(this, FileReader)
+
+ if (this[kEvents].abort) {
+ this.removeEventListener('abort', this[kEvents].abort)
+ }
+
+ if (typeof fn === 'function') {
+ this[kEvents].abort = fn
+ this.addEventListener('abort', fn)
+ } else {
+ this[kEvents].abort = null
+ }
+ }
+}
+
+// https://w3c.github.io/FileAPI/#dom-filereader-empty
+FileReader.EMPTY = FileReader.prototype.EMPTY = 0
+// https://w3c.github.io/FileAPI/#dom-filereader-loading
+FileReader.LOADING = FileReader.prototype.LOADING = 1
+// https://w3c.github.io/FileAPI/#dom-filereader-done
+FileReader.DONE = FileReader.prototype.DONE = 2
+
+Object.defineProperties(FileReader.prototype, {
+ EMPTY: staticPropertyDescriptors,
+ LOADING: staticPropertyDescriptors,
+ DONE: staticPropertyDescriptors,
+ readAsArrayBuffer: kEnumerableProperty,
+ readAsBinaryString: kEnumerableProperty,
+ readAsText: kEnumerableProperty,
+ readAsDataURL: kEnumerableProperty,
+ abort: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ result: kEnumerableProperty,
+ error: kEnumerableProperty,
+ onloadstart: kEnumerableProperty,
+ onprogress: kEnumerableProperty,
+ onload: kEnumerableProperty,
+ onabort: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onloadend: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'FileReader',
+ writable: false,
+ enumerable: false,
+ configurable: true
+ }
+})
+
+Object.defineProperties(FileReader, {
+ EMPTY: staticPropertyDescriptors,
+ LOADING: staticPropertyDescriptors,
+ DONE: staticPropertyDescriptors
+})
+
+module.exports = {
+ FileReader
+}
+
+
+/***/ }),
+
+/***/ 8573:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { webidl } = __nccwpck_require__(5893)
+
+const kState = Symbol('ProgressEvent state')
+
+/**
+ * @see https://xhr.spec.whatwg.org/#progressevent
+ */
+class ProgressEvent extends Event {
+ constructor (type, eventInitDict = {}) {
+ type = webidl.converters.DOMString(type, 'ProgressEvent constructor', 'type')
+ eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
+
+ super(type, eventInitDict)
+
+ this[kState] = {
+ lengthComputable: eventInitDict.lengthComputable,
+ loaded: eventInitDict.loaded,
+ total: eventInitDict.total
+ }
+ }
+
+ get lengthComputable () {
+ webidl.brandCheck(this, ProgressEvent)
+
+ return this[kState].lengthComputable
+ }
+
+ get loaded () {
+ webidl.brandCheck(this, ProgressEvent)
+
+ return this[kState].loaded
+ }
+
+ get total () {
+ webidl.brandCheck(this, ProgressEvent)
+
+ return this[kState].total
+ }
+}
+
+webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
+ {
+ key: 'lengthComputable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'loaded',
+ converter: webidl.converters['unsigned long long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'total',
+ converter: webidl.converters['unsigned long long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'bubbles',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'cancelable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'composed',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ }
+])
+
+module.exports = {
+ ProgressEvent
+}
+
+
+/***/ }),
+
+/***/ 961:
+/***/ ((module) => {
+
+
+
+module.exports = {
+ kState: Symbol('FileReader state'),
+ kResult: Symbol('FileReader result'),
+ kError: Symbol('FileReader error'),
+ kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
+ kEvents: Symbol('FileReader events'),
+ kAborted: Symbol('FileReader aborted')
+}
+
+
+/***/ }),
+
+/***/ 3610:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const {
+ kState,
+ kError,
+ kResult,
+ kAborted,
+ kLastProgressEventFired
+} = __nccwpck_require__(961)
+const { ProgressEvent } = __nccwpck_require__(8573)
+const { getEncoding } = __nccwpck_require__(2607)
+const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(1900)
+const { types } = __nccwpck_require__(7975)
+const { StringDecoder } = __nccwpck_require__(3193)
+const { btoa } = __nccwpck_require__(4573)
+
+/** @type {PropertyDescriptor} */
+const staticPropertyDescriptors = {
+ enumerable: true,
+ writable: false,
+ configurable: false
+}
+
+/**
+ * @see https://w3c.github.io/FileAPI/#readOperation
+ * @param {import('./filereader').FileReader} fr
+ * @param {import('buffer').Blob} blob
+ * @param {string} type
+ * @param {string?} encodingName
+ */
+function readOperation (fr, blob, type, encodingName) {
+ // 1. If fr’s state is "loading", throw an InvalidStateError
+ // DOMException.
+ if (fr[kState] === 'loading') {
+ throw new DOMException('Invalid state', 'InvalidStateError')
+ }
+
+ // 2. Set fr’s state to "loading".
+ fr[kState] = 'loading'
+
+ // 3. Set fr’s result to null.
+ fr[kResult] = null
+
+ // 4. Set fr’s error to null.
+ fr[kError] = null
+
+ // 5. Let stream be the result of calling get stream on blob.
+ /** @type {import('stream/web').ReadableStream} */
+ const stream = blob.stream()
+
+ // 6. Let reader be the result of getting a reader from stream.
+ const reader = stream.getReader()
+
+ // 7. Let bytes be an empty byte sequence.
+ /** @type {Uint8Array[]} */
+ const bytes = []
+
+ // 8. Let chunkPromise be the result of reading a chunk from
+ // stream with reader.
+ let chunkPromise = reader.read()
+
+ // 9. Let isFirstChunk be true.
+ let isFirstChunk = true
+
+ // 10. In parallel, while true:
+ // Note: "In parallel" just means non-blocking
+ // Note 2: readOperation itself cannot be async as double
+ // reading the body would then reject the promise, instead
+ // of throwing an error.
+ ;(async () => {
+ while (!fr[kAborted]) {
+ // 1. Wait for chunkPromise to be fulfilled or rejected.
+ try {
+ const { done, value } = await chunkPromise
+
+ // 2. If chunkPromise is fulfilled, and isFirstChunk is
+ // true, queue a task to fire a progress event called
+ // loadstart at fr.
+ if (isFirstChunk && !fr[kAborted]) {
+ queueMicrotask(() => {
+ fireAProgressEvent('loadstart', fr)
+ })
+ }
+
+ // 3. Set isFirstChunk to false.
+ isFirstChunk = false
+
+ // 4. If chunkPromise is fulfilled with an object whose
+ // done property is false and whose value property is
+ // a Uint8Array object, run these steps:
+ if (!done && types.isUint8Array(value)) {
+ // 1. Let bs be the byte sequence represented by the
+ // Uint8Array object.
+
+ // 2. Append bs to bytes.
+ bytes.push(value)
+
+ // 3. If roughly 50ms have passed since these steps
+ // were last invoked, queue a task to fire a
+ // progress event called progress at fr.
+ if (
+ (
+ fr[kLastProgressEventFired] === undefined ||
+ Date.now() - fr[kLastProgressEventFired] >= 50
+ ) &&
+ !fr[kAborted]
+ ) {
+ fr[kLastProgressEventFired] = Date.now()
+ queueMicrotask(() => {
+ fireAProgressEvent('progress', fr)
+ })
+ }
+
+ // 4. Set chunkPromise to the result of reading a
+ // chunk from stream with reader.
+ chunkPromise = reader.read()
+ } else if (done) {
+ // 5. Otherwise, if chunkPromise is fulfilled with an
+ // object whose done property is true, queue a task
+ // to run the following steps and abort this algorithm:
+ queueMicrotask(() => {
+ // 1. Set fr’s state to "done".
+ fr[kState] = 'done'
+
+ // 2. Let result be the result of package data given
+ // bytes, type, blob’s type, and encodingName.
+ try {
+ const result = packageData(bytes, type, blob.type, encodingName)
+
+ // 4. Else:
+
+ if (fr[kAborted]) {
+ return
+ }
+
+ // 1. Set fr’s result to result.
+ fr[kResult] = result
+
+ // 2. Fire a progress event called load at the fr.
+ fireAProgressEvent('load', fr)
+ } catch (error) {
+ // 3. If package data threw an exception error:
+
+ // 1. Set fr’s error to error.
+ fr[kError] = error
+
+ // 2. Fire a progress event called error at fr.
+ fireAProgressEvent('error', fr)
+ }
+
+ // 5. If fr’s state is not "loading", fire a progress
+ // event called loadend at the fr.
+ if (fr[kState] !== 'loading') {
+ fireAProgressEvent('loadend', fr)
+ }
+ })
+
+ break
+ }
+ } catch (error) {
+ if (fr[kAborted]) {
+ return
+ }
+
+ // 6. Otherwise, if chunkPromise is rejected with an
+ // error error, queue a task to run the following
+ // steps and abort this algorithm:
+ queueMicrotask(() => {
+ // 1. Set fr’s state to "done".
+ fr[kState] = 'done'
+
+ // 2. Set fr’s error to error.
+ fr[kError] = error
+
+ // 3. Fire a progress event called error at fr.
+ fireAProgressEvent('error', fr)
+
+ // 4. If fr’s state is not "loading", fire a progress
+ // event called loadend at fr.
+ if (fr[kState] !== 'loading') {
+ fireAProgressEvent('loadend', fr)
+ }
+ })
+
+ break
+ }
+ }
+ })()
+}
+
+/**
+ * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
+ * @see https://dom.spec.whatwg.org/#concept-event-fire
+ * @param {string} e The name of the event
+ * @param {import('./filereader').FileReader} reader
+ */
+function fireAProgressEvent (e, reader) {
+ // The progress event e does not bubble. e.bubbles must be false
+ // The progress event e is NOT cancelable. e.cancelable must be false
+ const event = new ProgressEvent(e, {
+ bubbles: false,
+ cancelable: false
+ })
+
+ reader.dispatchEvent(event)
+}
+
+/**
+ * @see https://w3c.github.io/FileAPI/#blob-package-data
+ * @param {Uint8Array[]} bytes
+ * @param {string} type
+ * @param {string?} mimeType
+ * @param {string?} encodingName
+ */
+function packageData (bytes, type, mimeType, encodingName) {
+ // 1. A Blob has an associated package data algorithm, given
+ // bytes, a type, a optional mimeType, and a optional
+ // encodingName, which switches on type and runs the
+ // associated steps:
+
+ switch (type) {
+ case 'DataURL': {
+ // 1. Return bytes as a DataURL [RFC2397] subject to
+ // the considerations below:
+ // * Use mimeType as part of the Data URL if it is
+ // available in keeping with the Data URL
+ // specification [RFC2397].
+ // * If mimeType is not available return a Data URL
+ // without a media-type. [RFC2397].
+
+ // https://datatracker.ietf.org/doc/html/rfc2397#section-3
+ // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
+ // mediatype := [ type "/" subtype ] *( ";" parameter )
+ // data := *urlchar
+ // parameter := attribute "=" value
+ let dataURL = 'data:'
+
+ const parsed = parseMIMEType(mimeType || 'application/octet-stream')
+
+ if (parsed !== 'failure') {
+ dataURL += serializeAMimeType(parsed)
+ }
+
+ dataURL += ';base64,'
- return this[kEvents].error
- }
+ const decoder = new StringDecoder('latin1')
- set onerror (fn) {
- webidl.brandCheck(this, FileReader)
+ for (const chunk of bytes) {
+ dataURL += btoa(decoder.write(chunk))
+ }
- if (this[kEvents].error) {
- this.removeEventListener('error', this[kEvents].error)
- }
+ dataURL += btoa(decoder.end())
- if (typeof fn === 'function') {
- this[kEvents].error = fn
- this.addEventListener('error', fn)
- } else {
- this[kEvents].error = null
+ return dataURL
}
- }
+ case 'Text': {
+ // 1. Let encoding be failure
+ let encoding = 'failure'
- get onloadstart () {
- webidl.brandCheck(this, FileReader)
+ // 2. If the encodingName is present, set encoding to the
+ // result of getting an encoding from encodingName.
+ if (encodingName) {
+ encoding = getEncoding(encodingName)
+ }
- return this[kEvents].loadstart
- }
+ // 3. If encoding is failure, and mimeType is present:
+ if (encoding === 'failure' && mimeType) {
+ // 1. Let type be the result of parse a MIME type
+ // given mimeType.
+ const type = parseMIMEType(mimeType)
- set onloadstart (fn) {
- webidl.brandCheck(this, FileReader)
+ // 2. If type is not failure, set encoding to the result
+ // of getting an encoding from type’s parameters["charset"].
+ if (type !== 'failure') {
+ encoding = getEncoding(type.parameters.get('charset'))
+ }
+ }
- if (this[kEvents].loadstart) {
- this.removeEventListener('loadstart', this[kEvents].loadstart)
- }
+ // 4. If encoding is failure, then set encoding to UTF-8.
+ if (encoding === 'failure') {
+ encoding = 'UTF-8'
+ }
- if (typeof fn === 'function') {
- this[kEvents].loadstart = fn
- this.addEventListener('loadstart', fn)
- } else {
- this[kEvents].loadstart = null
+ // 5. Decode bytes using fallback encoding encoding, and
+ // return the result.
+ return decode(bytes, encoding)
}
- }
+ case 'ArrayBuffer': {
+ // Return a new ArrayBuffer whose contents are bytes.
+ const sequence = combineByteSequences(bytes)
- get onprogress () {
- webidl.brandCheck(this, FileReader)
+ return sequence.buffer
+ }
+ case 'BinaryString': {
+ // Return bytes as a binary string, in which every byte
+ // is represented by a code unit of equal value [0..255].
+ let binaryString = ''
- return this[kEvents].progress
- }
+ const decoder = new StringDecoder('latin1')
- set onprogress (fn) {
- webidl.brandCheck(this, FileReader)
+ for (const chunk of bytes) {
+ binaryString += decoder.write(chunk)
+ }
- if (this[kEvents].progress) {
- this.removeEventListener('progress', this[kEvents].progress)
- }
+ binaryString += decoder.end()
- if (typeof fn === 'function') {
- this[kEvents].progress = fn
- this.addEventListener('progress', fn)
- } else {
- this[kEvents].progress = null
+ return binaryString
}
}
+}
- get onload () {
- webidl.brandCheck(this, FileReader)
+/**
+ * @see https://encoding.spec.whatwg.org/#decode
+ * @param {Uint8Array[]} ioQueue
+ * @param {string} encoding
+ */
+function decode (ioQueue, encoding) {
+ const bytes = combineByteSequences(ioQueue)
- return this[kEvents].load
- }
+ // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
+ const BOMEncoding = BOMSniffing(bytes)
- set onload (fn) {
- webidl.brandCheck(this, FileReader)
+ let slice = 0
- if (this[kEvents].load) {
- this.removeEventListener('load', this[kEvents].load)
- }
+ // 2. If BOMEncoding is non-null:
+ if (BOMEncoding !== null) {
+ // 1. Set encoding to BOMEncoding.
+ encoding = BOMEncoding
- if (typeof fn === 'function') {
- this[kEvents].load = fn
- this.addEventListener('load', fn)
- } else {
- this[kEvents].load = null
- }
+ // 2. Read three bytes from ioQueue, if BOMEncoding is
+ // UTF-8; otherwise read two bytes.
+ // (Do nothing with those bytes.)
+ slice = BOMEncoding === 'UTF-8' ? 3 : 2
}
- get onabort () {
- webidl.brandCheck(this, FileReader)
+ // 3. Process a queue with an instance of encoding’s
+ // decoder, ioQueue, output, and "replacement".
- return this[kEvents].abort
- }
+ // 4. Return output.
- set onabort (fn) {
- webidl.brandCheck(this, FileReader)
+ const sliced = bytes.slice(slice)
+ return new TextDecoder(encoding).decode(sliced)
+}
- if (this[kEvents].abort) {
- this.removeEventListener('abort', this[kEvents].abort)
- }
+/**
+ * @see https://encoding.spec.whatwg.org/#bom-sniff
+ * @param {Uint8Array} ioQueue
+ */
+function BOMSniffing (ioQueue) {
+ // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
+ // converted to a byte sequence.
+ const [a, b, c] = ioQueue
- if (typeof fn === 'function') {
- this[kEvents].abort = fn
- this.addEventListener('abort', fn)
- } else {
- this[kEvents].abort = null
- }
+ // 2. For each of the rows in the table below, starting with
+ // the first one and going down, if BOM starts with the
+ // bytes given in the first column, then return the
+ // encoding given in the cell in the second column of that
+ // row. Otherwise, return null.
+ if (a === 0xEF && b === 0xBB && c === 0xBF) {
+ return 'UTF-8'
+ } else if (a === 0xFE && b === 0xFF) {
+ return 'UTF-16BE'
+ } else if (a === 0xFF && b === 0xFE) {
+ return 'UTF-16LE'
}
+
+ return null
}
-// https://w3c.github.io/FileAPI/#dom-filereader-empty
-FileReader.EMPTY = FileReader.prototype.EMPTY = 0
-// https://w3c.github.io/FileAPI/#dom-filereader-loading
-FileReader.LOADING = FileReader.prototype.LOADING = 1
-// https://w3c.github.io/FileAPI/#dom-filereader-done
-FileReader.DONE = FileReader.prototype.DONE = 2
+/**
+ * @param {Uint8Array[]} sequences
+ */
+function combineByteSequences (sequences) {
+ const size = sequences.reduce((a, b) => {
+ return a + b.byteLength
+ }, 0)
-Object.defineProperties(FileReader.prototype, {
- EMPTY: staticPropertyDescriptors,
- LOADING: staticPropertyDescriptors,
- DONE: staticPropertyDescriptors,
- readAsArrayBuffer: kEnumerableProperty,
- readAsBinaryString: kEnumerableProperty,
- readAsText: kEnumerableProperty,
- readAsDataURL: kEnumerableProperty,
- abort: kEnumerableProperty,
- readyState: kEnumerableProperty,
- result: kEnumerableProperty,
- error: kEnumerableProperty,
- onloadstart: kEnumerableProperty,
- onprogress: kEnumerableProperty,
- onload: kEnumerableProperty,
- onabort: kEnumerableProperty,
- onerror: kEnumerableProperty,
- onloadend: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'FileReader',
- writable: false,
- enumerable: false,
- configurable: true
- }
-})
+ let offset = 0
-Object.defineProperties(FileReader, {
- EMPTY: staticPropertyDescriptors,
- LOADING: staticPropertyDescriptors,
- DONE: staticPropertyDescriptors
-})
+ return sequences.reduce((a, b) => {
+ a.set(b, offset)
+ offset += b.byteLength
+ return a
+ }, new Uint8Array(size))
+}
module.exports = {
- FileReader
+ staticPropertyDescriptors,
+ readOperation,
+ fireAProgressEvent
}
/***/ }),
-/***/ 5504:
+/***/ 6897:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { webidl } = __nccwpck_require__(1744)
+const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(736)
+const {
+ kReadyState,
+ kSentClose,
+ kByteParser,
+ kReceivedClose,
+ kResponse
+} = __nccwpck_require__(1216)
+const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(8625)
+const { channels } = __nccwpck_require__(2414)
+const { CloseEvent } = __nccwpck_require__(5188)
+const { makeRequest } = __nccwpck_require__(9967)
+const { fetching } = __nccwpck_require__(4398)
+const { Headers, getHeadersList } = __nccwpck_require__(660)
+const { getDecodeSplit } = __nccwpck_require__(3168)
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+
+/** @type {import('crypto')} */
+let crypto
+try {
+ crypto = __nccwpck_require__(7598)
+/* c8 ignore next 3 */
+} catch {
-const kState = Symbol('ProgressEvent state')
+}
/**
- * @see https://xhr.spec.whatwg.org/#progressevent
+ * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
+ * @param {URL} url
+ * @param {string|string[]} protocols
+ * @param {import('./websocket').WebSocket} ws
+ * @param {(response: any, extensions: string[] | undefined) => void} onEstablish
+ * @param {Partial} options
*/
-class ProgressEvent extends Event {
- constructor (type, eventInitDict = {}) {
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
+function establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) {
+ // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
+ // scheme is "ws", and to "https" otherwise.
+ const requestURL = url
- super(type, eventInitDict)
+ requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
- this[kState] = {
- lengthComputable: eventInitDict.lengthComputable,
- loaded: eventInitDict.loaded,
- total: eventInitDict.total
- }
- }
+ // 2. Let request be a new request, whose URL is requestURL, client is client,
+ // service-workers mode is "none", referrer is "no-referrer", mode is
+ // "websocket", credentials mode is "include", cache mode is "no-store" ,
+ // and redirect mode is "error".
+ const request = makeRequest({
+ urlList: [requestURL],
+ client,
+ serviceWorkers: 'none',
+ referrer: 'no-referrer',
+ mode: 'websocket',
+ credentials: 'include',
+ cache: 'no-store',
+ redirect: 'error'
+ })
- get lengthComputable () {
- webidl.brandCheck(this, ProgressEvent)
+ // Note: undici extension, allow setting custom headers.
+ if (options.headers) {
+ const headersList = getHeadersList(new Headers(options.headers))
- return this[kState].lengthComputable
+ request.headersList = headersList
}
- get loaded () {
- webidl.brandCheck(this, ProgressEvent)
+ // 3. Append (`Upgrade`, `websocket`) to request’s header list.
+ // 4. Append (`Connection`, `Upgrade`) to request’s header list.
+ // Note: both of these are handled by undici currently.
+ // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
- return this[kState].loaded
- }
+ // 5. Let keyValue be a nonce consisting of a randomly selected
+ // 16-byte value that has been forgiving-base64-encoded and
+ // isomorphic encoded.
+ const keyValue = crypto.randomBytes(16).toString('base64')
- get total () {
- webidl.brandCheck(this, ProgressEvent)
+ // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
+ // header list.
+ request.headersList.append('sec-websocket-key', keyValue)
- return this[kState].total
- }
-}
+ // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
+ // header list.
+ request.headersList.append('sec-websocket-version', '13')
-webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
- {
- key: 'lengthComputable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'loaded',
- converter: webidl.converters['unsigned long long'],
- defaultValue: 0
- },
- {
- key: 'total',
- converter: webidl.converters['unsigned long long'],
- defaultValue: 0
- },
- {
- key: 'bubbles',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'cancelable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'composed',
- converter: webidl.converters.boolean,
- defaultValue: false
+ // 8. For each protocol in protocols, combine
+ // (`Sec-WebSocket-Protocol`, protocol) in request’s header
+ // list.
+ for (const protocol of protocols) {
+ request.headersList.append('sec-websocket-protocol', protocol)
}
-])
-module.exports = {
- ProgressEvent
-}
+ // 9. Let permessageDeflate be a user-agent defined
+ // "permessage-deflate" extension header value.
+ // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
+ const permessageDeflate = 'permessage-deflate; client_max_window_bits'
+ // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
+ // request’s header list.
+ request.headersList.append('sec-websocket-extensions', permessageDeflate)
-/***/ }),
+ // 11. Fetch request with useParallelQueue set to true, and
+ // processResponse given response being these steps:
+ const controller = fetching({
+ request,
+ useParallelQueue: true,
+ dispatcher: options.dispatcher,
+ processResponse (response) {
+ // 1. If response is a network error or its status is not 101,
+ // fail the WebSocket connection.
+ if (response.type === 'error' || response.status !== 101) {
+ failWebsocketConnection(ws, 'Received network error or non-101 status code.')
+ return
+ }
-/***/ 9054:
-/***/ ((module) => {
+ // 2. If protocols is not the empty list and extracting header
+ // list values given `Sec-WebSocket-Protocol` and response’s
+ // header list results in null, failure, or the empty byte
+ // sequence, then fail the WebSocket connection.
+ if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
+ failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
+ return
+ }
-"use strict";
+ // 3. Follow the requirements stated step 2 to step 6, inclusive,
+ // of the last set of steps in section 4.1 of The WebSocket
+ // Protocol to validate response. This either results in fail
+ // the WebSocket connection or the WebSocket connection is
+ // established.
+ // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
+ // header field contains a value that is not an ASCII case-
+ // insensitive match for the value "websocket", the client MUST
+ // _Fail the WebSocket Connection_.
+ if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
+ failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
+ return
+ }
-module.exports = {
- kState: Symbol('FileReader state'),
- kResult: Symbol('FileReader result'),
- kError: Symbol('FileReader error'),
- kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
- kEvents: Symbol('FileReader events'),
- kAborted: Symbol('FileReader aborted')
-}
+ // 3. If the response lacks a |Connection| header field or the
+ // |Connection| header field doesn't contain a token that is an
+ // ASCII case-insensitive match for the value "Upgrade", the client
+ // MUST _Fail the WebSocket Connection_.
+ if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
+ failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
+ return
+ }
+ // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
+ // the |Sec-WebSocket-Accept| contains a value other than the
+ // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
+ // Key| (as a string, not base64-decoded) with the string "258EAFA5-
+ // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
+ // trailing whitespace, the client MUST _Fail the WebSocket
+ // Connection_.
+ const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
+ const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
+ if (secWSAccept !== digest) {
+ failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
+ return
+ }
-/***/ }),
+ // 5. If the response includes a |Sec-WebSocket-Extensions| header
+ // field and this header field indicates the use of an extension
+ // that was not present in the client's handshake (the server has
+ // indicated an extension not requested by the client), the client
+ // MUST _Fail the WebSocket Connection_. (The parsing of this
+ // header field to determine which extensions are requested is
+ // discussed in Section 9.1.)
+ const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
+ let extensions
-/***/ 7530:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (secExtension !== null) {
+ extensions = parseExtensions(secExtension)
+
+ if (!extensions.has('permessage-deflate')) {
+ failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.')
+ return
+ }
+ }
+
+ // 6. If the response includes a |Sec-WebSocket-Protocol| header field
+ // and this header field indicates the use of a subprotocol that was
+ // not present in the client's handshake (the server has indicated a
+ // subprotocol not requested by the client), the client MUST _Fail
+ // the WebSocket Connection_.
+ const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
-"use strict";
+ if (secProtocol !== null) {
+ const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList)
+ // The client can request that the server use a specific subprotocol by
+ // including the |Sec-WebSocket-Protocol| field in its handshake. If it
+ // is specified, the server needs to include the same field and one of
+ // the selected subprotocol values in its response for the connection to
+ // be established.
+ if (!requestProtocols.includes(secProtocol)) {
+ failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
+ return
+ }
+ }
-const {
- kState,
- kError,
- kResult,
- kAborted,
- kLastProgressEventFired
-} = __nccwpck_require__(9054)
-const { ProgressEvent } = __nccwpck_require__(5504)
-const { getEncoding } = __nccwpck_require__(4854)
-const { DOMException } = __nccwpck_require__(1037)
-const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
-const { types } = __nccwpck_require__(3837)
-const { StringDecoder } = __nccwpck_require__(1576)
-const { btoa } = __nccwpck_require__(4300)
+ response.socket.on('data', onSocketData)
+ response.socket.on('close', onSocketClose)
+ response.socket.on('error', onSocketError)
-/** @type {PropertyDescriptor} */
-const staticPropertyDescriptors = {
- enumerable: true,
- writable: false,
- configurable: false
+ if (channels.open.hasSubscribers) {
+ channels.open.publish({
+ address: response.socket.address(),
+ protocol: secProtocol,
+ extensions: secExtension
+ })
+ }
+
+ onEstablish(response, extensions)
+ }
+ })
+
+ return controller
+}
+
+function closeWebSocketConnection (ws, code, reason, reasonByteLength) {
+ if (isClosing(ws) || isClosed(ws)) {
+ // If this's ready state is CLOSING (2) or CLOSED (3)
+ // Do nothing.
+ } else if (!isEstablished(ws)) {
+ // If the WebSocket connection is not yet established
+ // Fail the WebSocket connection and set this's ready state
+ // to CLOSING (2).
+ failWebsocketConnection(ws, 'Connection was closed before it was established.')
+ ws[kReadyState] = states.CLOSING
+ } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) {
+ // If the WebSocket closing handshake has not yet been started
+ // Start the WebSocket closing handshake and set this's ready
+ // state to CLOSING (2).
+ // - If neither code nor reason is present, the WebSocket Close
+ // message must not have a body.
+ // - If code is present, then the status code to use in the
+ // WebSocket Close message must be the integer given by code.
+ // - If reason is also present, then reasonBytes must be
+ // provided in the Close message after the status code.
+
+ ws[kSentClose] = sentCloseFrameState.PROCESSING
+
+ const frame = new WebsocketFrameSend()
+
+ // If neither code nor reason is present, the WebSocket Close
+ // message must not have a body.
+
+ // If code is present, then the status code to use in the
+ // WebSocket Close message must be the integer given by code.
+ if (code !== undefined && reason === undefined) {
+ frame.frameData = Buffer.allocUnsafe(2)
+ frame.frameData.writeUInt16BE(code, 0)
+ } else if (code !== undefined && reason !== undefined) {
+ // If reason is also present, then reasonBytes must be
+ // provided in the Close message after the status code.
+ frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
+ frame.frameData.writeUInt16BE(code, 0)
+ // the body MAY contain UTF-8-encoded data with value /reason/
+ frame.frameData.write(reason, 2, 'utf-8')
+ } else {
+ frame.frameData = emptyBuffer
+ }
+
+ /** @type {import('stream').Duplex} */
+ const socket = ws[kResponse].socket
+
+ socket.write(frame.createFrame(opcodes.CLOSE))
+
+ ws[kSentClose] = sentCloseFrameState.SENT
+
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ ws[kReadyState] = states.CLOSING
+ } else {
+ // Otherwise
+ // Set this's ready state to CLOSING (2).
+ ws[kReadyState] = states.CLOSING
+ }
}
/**
- * @see https://w3c.github.io/FileAPI/#readOperation
- * @param {import('./filereader').FileReader} fr
- * @param {import('buffer').Blob} blob
- * @param {string} type
- * @param {string?} encodingName
+ * @param {Buffer} chunk
*/
-function readOperation (fr, blob, type, encodingName) {
- // 1. If fr’s state is "loading", throw an InvalidStateError
- // DOMException.
- if (fr[kState] === 'loading') {
- throw new DOMException('Invalid state', 'InvalidStateError')
+function onSocketData (chunk) {
+ if (!this.ws[kByteParser].write(chunk)) {
+ this.pause()
}
+}
- // 2. Set fr’s state to "loading".
- fr[kState] = 'loading'
+/**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
+ */
+function onSocketClose () {
+ const { ws } = this
+ const { [kResponse]: response } = ws
- // 3. Set fr’s result to null.
- fr[kResult] = null
+ response.socket.off('data', onSocketData)
+ response.socket.off('close', onSocketClose)
+ response.socket.off('error', onSocketError)
- // 4. Set fr’s error to null.
- fr[kError] = null
+ // If the TCP connection was closed after the
+ // WebSocket closing handshake was completed, the WebSocket connection
+ // is said to have been closed _cleanly_.
+ const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]
+
+ let code = 1005
+ let reason = ''
+
+ const result = ws[kByteParser].closingInfo
+
+ if (result && !result.error) {
+ code = result.code ?? 1005
+ reason = result.reason
+ } else if (!ws[kReceivedClose]) {
+ // If _The WebSocket
+ // Connection is Closed_ and no Close control frame was received by the
+ // endpoint (such as could occur if the underlying transport connection
+ // is lost), _The WebSocket Connection Close Code_ is considered to be
+ // 1006.
+ code = 1006
+ }
+
+ // 1. Change the ready state to CLOSED (3).
+ ws[kReadyState] = states.CLOSED
+
+ // 2. If the user agent was required to fail the WebSocket
+ // connection, or if the WebSocket connection was closed
+ // after being flagged as full, fire an event named error
+ // at the WebSocket object.
+ // TODO
- // 5. Let stream be the result of calling get stream on blob.
- /** @type {import('stream/web').ReadableStream} */
- const stream = blob.stream()
+ // 3. Fire an event named close at the WebSocket object,
+ // using CloseEvent, with the wasClean attribute
+ // initialized to true if the connection closed cleanly
+ // and false otherwise, the code attribute initialized to
+ // the WebSocket connection close code, and the reason
+ // attribute initialized to the result of applying UTF-8
+ // decode without BOM to the WebSocket connection close
+ // reason.
+ // TODO: process.nextTick
+ fireEvent('close', ws, (type, init) => new CloseEvent(type, init), {
+ wasClean, code, reason
+ })
- // 6. Let reader be the result of getting a reader from stream.
- const reader = stream.getReader()
+ if (channels.close.hasSubscribers) {
+ channels.close.publish({
+ websocket: ws,
+ code,
+ reason
+ })
+ }
+}
- // 7. Let bytes be an empty byte sequence.
- /** @type {Uint8Array[]} */
- const bytes = []
+function onSocketError (error) {
+ const { ws } = this
- // 8. Let chunkPromise be the result of reading a chunk from
- // stream with reader.
- let chunkPromise = reader.read()
+ ws[kReadyState] = states.CLOSING
- // 9. Let isFirstChunk be true.
- let isFirstChunk = true
+ if (channels.socketError.hasSubscribers) {
+ channels.socketError.publish(error)
+ }
- // 10. In parallel, while true:
- // Note: "In parallel" just means non-blocking
- // Note 2: readOperation itself cannot be async as double
- // reading the body would then reject the promise, instead
- // of throwing an error.
- ;(async () => {
- while (!fr[kAborted]) {
- // 1. Wait for chunkPromise to be fulfilled or rejected.
- try {
- const { done, value } = await chunkPromise
+ this.destroy()
+}
- // 2. If chunkPromise is fulfilled, and isFirstChunk is
- // true, queue a task to fire a progress event called
- // loadstart at fr.
- if (isFirstChunk && !fr[kAborted]) {
- queueMicrotask(() => {
- fireAProgressEvent('loadstart', fr)
- })
- }
+module.exports = {
+ establishWebSocketConnection,
+ closeWebSocketConnection
+}
- // 3. Set isFirstChunk to false.
- isFirstChunk = false
- // 4. If chunkPromise is fulfilled with an object whose
- // done property is false and whose value property is
- // a Uint8Array object, run these steps:
- if (!done && types.isUint8Array(value)) {
- // 1. Let bs be the byte sequence represented by the
- // Uint8Array object.
+/***/ }),
- // 2. Append bs to bytes.
- bytes.push(value)
+/***/ 736:
+/***/ ((module) => {
- // 3. If roughly 50ms have passed since these steps
- // were last invoked, queue a task to fire a
- // progress event called progress at fr.
- if (
- (
- fr[kLastProgressEventFired] === undefined ||
- Date.now() - fr[kLastProgressEventFired] >= 50
- ) &&
- !fr[kAborted]
- ) {
- fr[kLastProgressEventFired] = Date.now()
- queueMicrotask(() => {
- fireAProgressEvent('progress', fr)
- })
- }
- // 4. Set chunkPromise to the result of reading a
- // chunk from stream with reader.
- chunkPromise = reader.read()
- } else if (done) {
- // 5. Otherwise, if chunkPromise is fulfilled with an
- // object whose done property is true, queue a task
- // to run the following steps and abort this algorithm:
- queueMicrotask(() => {
- // 1. Set fr’s state to "done".
- fr[kState] = 'done'
- // 2. Let result be the result of package data given
- // bytes, type, blob’s type, and encodingName.
- try {
- const result = packageData(bytes, type, blob.type, encodingName)
+// This is a Globally Unique Identifier unique used
+// to validate that the endpoint accepts websocket
+// connections.
+// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
+const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
- // 4. Else:
+/** @type {PropertyDescriptor} */
+const staticPropertyDescriptors = {
+ enumerable: true,
+ writable: false,
+ configurable: false
+}
- if (fr[kAborted]) {
- return
- }
+const states = {
+ CONNECTING: 0,
+ OPEN: 1,
+ CLOSING: 2,
+ CLOSED: 3
+}
- // 1. Set fr’s result to result.
- fr[kResult] = result
+const sentCloseFrameState = {
+ NOT_SENT: 0,
+ PROCESSING: 1,
+ SENT: 2
+}
- // 2. Fire a progress event called load at the fr.
- fireAProgressEvent('load', fr)
- } catch (error) {
- // 3. If package data threw an exception error:
+const opcodes = {
+ CONTINUATION: 0x0,
+ TEXT: 0x1,
+ BINARY: 0x2,
+ CLOSE: 0x8,
+ PING: 0x9,
+ PONG: 0xA
+}
- // 1. Set fr’s error to error.
- fr[kError] = error
+const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
- // 2. Fire a progress event called error at fr.
- fireAProgressEvent('error', fr)
- }
+const parserStates = {
+ INFO: 0,
+ PAYLOADLENGTH_16: 2,
+ PAYLOADLENGTH_64: 3,
+ READ_DATA: 4
+}
- // 5. If fr’s state is not "loading", fire a progress
- // event called loadend at the fr.
- if (fr[kState] !== 'loading') {
- fireAProgressEvent('loadend', fr)
- }
- })
+const emptyBuffer = Buffer.allocUnsafe(0)
- break
- }
- } catch (error) {
- if (fr[kAborted]) {
- return
- }
+const sendHints = {
+ string: 1,
+ typedArray: 2,
+ arrayBuffer: 3,
+ blob: 4
+}
- // 6. Otherwise, if chunkPromise is rejected with an
- // error error, queue a task to run the following
- // steps and abort this algorithm:
- queueMicrotask(() => {
- // 1. Set fr’s state to "done".
- fr[kState] = 'done'
+module.exports = {
+ uid,
+ sentCloseFrameState,
+ staticPropertyDescriptors,
+ states,
+ opcodes,
+ maxUnsigned16Bit,
+ parserStates,
+ emptyBuffer,
+ sendHints
+}
- // 2. Set fr’s error to error.
- fr[kError] = error
- // 3. Fire a progress event called error at fr.
- fireAProgressEvent('error', fr)
+/***/ }),
- // 4. If fr’s state is not "loading", fire a progress
- // event called loadend at fr.
- if (fr[kState] !== 'loading') {
- fireAProgressEvent('loadend', fr)
- }
- })
+/***/ 5188:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- break
- }
- }
- })()
-}
-/**
- * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
- * @see https://dom.spec.whatwg.org/#concept-event-fire
- * @param {string} e The name of the event
- * @param {import('./filereader').FileReader} reader
- */
-function fireAProgressEvent (e, reader) {
- // The progress event e does not bubble. e.bubbles must be false
- // The progress event e is NOT cancelable. e.cancelable must be false
- const event = new ProgressEvent(e, {
- bubbles: false,
- cancelable: false
- })
- reader.dispatchEvent(event)
-}
+const { webidl } = __nccwpck_require__(5893)
+const { kEnumerableProperty } = __nccwpck_require__(3440)
+const { kConstruct } = __nccwpck_require__(6443)
+const { MessagePort } = __nccwpck_require__(5919)
/**
- * @see https://w3c.github.io/FileAPI/#blob-package-data
- * @param {Uint8Array[]} bytes
- * @param {string} type
- * @param {string?} mimeType
- * @param {string?} encodingName
+ * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
*/
-function packageData (bytes, type, mimeType, encodingName) {
- // 1. A Blob has an associated package data algorithm, given
- // bytes, a type, a optional mimeType, and a optional
- // encodingName, which switches on type and runs the
- // associated steps:
+class MessageEvent extends Event {
+ #eventInit
- switch (type) {
- case 'DataURL': {
- // 1. Return bytes as a DataURL [RFC2397] subject to
- // the considerations below:
- // * Use mimeType as part of the Data URL if it is
- // available in keeping with the Data URL
- // specification [RFC2397].
- // * If mimeType is not available return a Data URL
- // without a media-type. [RFC2397].
+ constructor (type, eventInitDict = {}) {
+ if (type === kConstruct) {
+ super(arguments[1], arguments[2])
+ webidl.util.markAsUncloneable(this)
+ return
+ }
- // https://datatracker.ietf.org/doc/html/rfc2397#section-3
- // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
- // mediatype := [ type "/" subtype ] *( ";" parameter )
- // data := *urlchar
- // parameter := attribute "=" value
- let dataURL = 'data:'
+ const prefix = 'MessageEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- const parsed = parseMIMEType(mimeType || 'application/octet-stream')
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')
- if (parsed !== 'failure') {
- dataURL += serializeAMimeType(parsed)
- }
+ super(type, eventInitDict)
- dataURL += ';base64,'
+ this.#eventInit = eventInitDict
+ webidl.util.markAsUncloneable(this)
+ }
- const decoder = new StringDecoder('latin1')
+ get data () {
+ webidl.brandCheck(this, MessageEvent)
- for (const chunk of bytes) {
- dataURL += btoa(decoder.write(chunk))
- }
+ return this.#eventInit.data
+ }
- dataURL += btoa(decoder.end())
+ get origin () {
+ webidl.brandCheck(this, MessageEvent)
- return dataURL
- }
- case 'Text': {
- // 1. Let encoding be failure
- let encoding = 'failure'
+ return this.#eventInit.origin
+ }
- // 2. If the encodingName is present, set encoding to the
- // result of getting an encoding from encodingName.
- if (encodingName) {
- encoding = getEncoding(encodingName)
- }
+ get lastEventId () {
+ webidl.brandCheck(this, MessageEvent)
- // 3. If encoding is failure, and mimeType is present:
- if (encoding === 'failure' && mimeType) {
- // 1. Let type be the result of parse a MIME type
- // given mimeType.
- const type = parseMIMEType(mimeType)
+ return this.#eventInit.lastEventId
+ }
- // 2. If type is not failure, set encoding to the result
- // of getting an encoding from type’s parameters["charset"].
- if (type !== 'failure') {
- encoding = getEncoding(type.parameters.get('charset'))
- }
- }
+ get source () {
+ webidl.brandCheck(this, MessageEvent)
- // 4. If encoding is failure, then set encoding to UTF-8.
- if (encoding === 'failure') {
- encoding = 'UTF-8'
- }
+ return this.#eventInit.source
+ }
- // 5. Decode bytes using fallback encoding encoding, and
- // return the result.
- return decode(bytes, encoding)
- }
- case 'ArrayBuffer': {
- // Return a new ArrayBuffer whose contents are bytes.
- const sequence = combineByteSequences(bytes)
+ get ports () {
+ webidl.brandCheck(this, MessageEvent)
- return sequence.buffer
+ if (!Object.isFrozen(this.#eventInit.ports)) {
+ Object.freeze(this.#eventInit.ports)
}
- case 'BinaryString': {
- // Return bytes as a binary string, in which every byte
- // is represented by a code unit of equal value [0..255].
- let binaryString = ''
- const decoder = new StringDecoder('latin1')
+ return this.#eventInit.ports
+ }
- for (const chunk of bytes) {
- binaryString += decoder.write(chunk)
- }
+ initMessageEvent (
+ type,
+ bubbles = false,
+ cancelable = false,
+ data = null,
+ origin = '',
+ lastEventId = '',
+ source = null,
+ ports = []
+ ) {
+ webidl.brandCheck(this, MessageEvent)
- binaryString += decoder.end()
+ webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')
- return binaryString
- }
+ return new MessageEvent(type, {
+ bubbles, cancelable, data, origin, lastEventId, source, ports
+ })
+ }
+
+ static createFastMessageEvent (type, init) {
+ const messageEvent = new MessageEvent(kConstruct, type, init)
+ messageEvent.#eventInit = init
+ messageEvent.#eventInit.data ??= null
+ messageEvent.#eventInit.origin ??= ''
+ messageEvent.#eventInit.lastEventId ??= ''
+ messageEvent.#eventInit.source ??= null
+ messageEvent.#eventInit.ports ??= []
+ return messageEvent
}
}
+const { createFastMessageEvent } = MessageEvent
+delete MessageEvent.createFastMessageEvent
+
/**
- * @see https://encoding.spec.whatwg.org/#decode
- * @param {Uint8Array[]} ioQueue
- * @param {string} encoding
+ * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
*/
-function decode (ioQueue, encoding) {
- const bytes = combineByteSequences(ioQueue)
+class CloseEvent extends Event {
+ #eventInit
- // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
- const BOMEncoding = BOMSniffing(bytes)
+ constructor (type, eventInitDict = {}) {
+ const prefix = 'CloseEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- let slice = 0
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
- // 2. If BOMEncoding is non-null:
- if (BOMEncoding !== null) {
- // 1. Set encoding to BOMEncoding.
- encoding = BOMEncoding
+ super(type, eventInitDict)
- // 2. Read three bytes from ioQueue, if BOMEncoding is
- // UTF-8; otherwise read two bytes.
- // (Do nothing with those bytes.)
- slice = BOMEncoding === 'UTF-8' ? 3 : 2
+ this.#eventInit = eventInitDict
+ webidl.util.markAsUncloneable(this)
}
- // 3. Process a queue with an instance of encoding’s
- // decoder, ioQueue, output, and "replacement".
-
- // 4. Return output.
-
- const sliced = bytes.slice(slice)
- return new TextDecoder(encoding).decode(sliced)
-}
-
-/**
- * @see https://encoding.spec.whatwg.org/#bom-sniff
- * @param {Uint8Array} ioQueue
- */
-function BOMSniffing (ioQueue) {
- // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
- // converted to a byte sequence.
- const [a, b, c] = ioQueue
+ get wasClean () {
+ webidl.brandCheck(this, CloseEvent)
- // 2. For each of the rows in the table below, starting with
- // the first one and going down, if BOM starts with the
- // bytes given in the first column, then return the
- // encoding given in the cell in the second column of that
- // row. Otherwise, return null.
- if (a === 0xEF && b === 0xBB && c === 0xBF) {
- return 'UTF-8'
- } else if (a === 0xFE && b === 0xFF) {
- return 'UTF-16BE'
- } else if (a === 0xFF && b === 0xFE) {
- return 'UTF-16LE'
+ return this.#eventInit.wasClean
}
- return null
-}
+ get code () {
+ webidl.brandCheck(this, CloseEvent)
-/**
- * @param {Uint8Array[]} sequences
- */
-function combineByteSequences (sequences) {
- const size = sequences.reduce((a, b) => {
- return a + b.byteLength
- }, 0)
+ return this.#eventInit.code
+ }
- let offset = 0
+ get reason () {
+ webidl.brandCheck(this, CloseEvent)
- return sequences.reduce((a, b) => {
- a.set(b, offset)
- offset += b.byteLength
- return a
- }, new Uint8Array(size))
+ return this.#eventInit.reason
+ }
}
-module.exports = {
- staticPropertyDescriptors,
- readOperation,
- fireAProgressEvent
-}
+// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
+class ErrorEvent extends Event {
+ #eventInit
+ constructor (type, eventInitDict) {
+ const prefix = 'ErrorEvent constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
-/***/ }),
+ super(type, eventInitDict)
+ webidl.util.markAsUncloneable(this)
-/***/ 1892:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ type = webidl.converters.DOMString(type, prefix, 'type')
+ eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
-"use strict";
+ this.#eventInit = eventInitDict
+ }
+ get message () {
+ webidl.brandCheck(this, ErrorEvent)
-// We include a version number for the Dispatcher API. In case of breaking changes,
-// this version number must be increased to avoid conflicts.
-const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const Agent = __nccwpck_require__(7890)
+ return this.#eventInit.message
+ }
-if (getGlobalDispatcher() === undefined) {
- setGlobalDispatcher(new Agent())
-}
+ get filename () {
+ webidl.brandCheck(this, ErrorEvent)
-function setGlobalDispatcher (agent) {
- if (!agent || typeof agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument agent must implement Agent')
+ return this.#eventInit.filename
}
- Object.defineProperty(globalThis, globalDispatcher, {
- value: agent,
- writable: true,
- enumerable: false,
- configurable: false
- })
-}
-function getGlobalDispatcher () {
- return globalThis[globalDispatcher]
-}
+ get lineno () {
+ webidl.brandCheck(this, ErrorEvent)
-module.exports = {
- setGlobalDispatcher,
- getGlobalDispatcher
-}
+ return this.#eventInit.lineno
+ }
+
+ get colno () {
+ webidl.brandCheck(this, ErrorEvent)
+ return this.#eventInit.colno
+ }
-/***/ }),
+ get error () {
+ webidl.brandCheck(this, ErrorEvent)
-/***/ 6930:
-/***/ ((module) => {
+ return this.#eventInit.error
+ }
+}
-"use strict";
+Object.defineProperties(MessageEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'MessageEvent',
+ configurable: true
+ },
+ data: kEnumerableProperty,
+ origin: kEnumerableProperty,
+ lastEventId: kEnumerableProperty,
+ source: kEnumerableProperty,
+ ports: kEnumerableProperty,
+ initMessageEvent: kEnumerableProperty
+})
+Object.defineProperties(CloseEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'CloseEvent',
+ configurable: true
+ },
+ reason: kEnumerableProperty,
+ code: kEnumerableProperty,
+ wasClean: kEnumerableProperty
+})
-module.exports = class DecoratorHandler {
- constructor (handler) {
- this.handler = handler
- }
+Object.defineProperties(ErrorEvent.prototype, {
+ [Symbol.toStringTag]: {
+ value: 'ErrorEvent',
+ configurable: true
+ },
+ message: kEnumerableProperty,
+ filename: kEnumerableProperty,
+ lineno: kEnumerableProperty,
+ colno: kEnumerableProperty,
+ error: kEnumerableProperty
+})
- onConnect (...args) {
- return this.handler.onConnect(...args)
- }
+webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
- onError (...args) {
- return this.handler.onError(...args)
- }
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.MessagePort
+)
- onUpgrade (...args) {
- return this.handler.onUpgrade(...args)
+const eventInit = [
+ {
+ key: 'bubbles',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'cancelable',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'composed',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
}
+]
- onHeaders (...args) {
- return this.handler.onHeaders(...args)
+webidl.converters.MessageEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'data',
+ converter: webidl.converters.any,
+ defaultValue: () => null
+ },
+ {
+ key: 'origin',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'lastEventId',
+ converter: webidl.converters.DOMString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'source',
+ // Node doesn't implement WindowProxy or ServiceWorker, so the only
+ // valid value for source is a MessagePort.
+ converter: webidl.nullableConverter(webidl.converters.MessagePort),
+ defaultValue: () => null
+ },
+ {
+ key: 'ports',
+ converter: webidl.converters['sequence'],
+ defaultValue: () => new Array(0)
}
+])
- onData (...args) {
- return this.handler.onData(...args)
+webidl.converters.CloseEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'wasClean',
+ converter: webidl.converters.boolean,
+ defaultValue: () => false
+ },
+ {
+ key: 'code',
+ converter: webidl.converters['unsigned short'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'reason',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
}
+])
- onComplete (...args) {
- return this.handler.onComplete(...args)
+webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
+ ...eventInit,
+ {
+ key: 'message',
+ converter: webidl.converters.DOMString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'filename',
+ converter: webidl.converters.USVString,
+ defaultValue: () => ''
+ },
+ {
+ key: 'lineno',
+ converter: webidl.converters['unsigned long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'colno',
+ converter: webidl.converters['unsigned long'],
+ defaultValue: () => 0
+ },
+ {
+ key: 'error',
+ converter: webidl.converters.any
}
+])
- onBodySent (...args) {
- return this.handler.onBodySent(...args)
- }
+module.exports = {
+ MessageEvent,
+ CloseEvent,
+ ErrorEvent,
+ createFastMessageEvent
}
/***/ }),
-/***/ 2860:
+/***/ 3264:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-
-
-const util = __nccwpck_require__(3983)
-const { kBodyUsed } = __nccwpck_require__(2785)
-const assert = __nccwpck_require__(9491)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const EE = __nccwpck_require__(2361)
-
-const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
-
-const kBody = Symbol('body')
-
-class BodyAsyncIterable {
- constructor (body) {
- this[kBody] = body
- this[kBodyUsed] = false
- }
-
- async * [Symbol.asyncIterator] () {
- assert(!this[kBodyUsed], 'disturbed')
- this[kBodyUsed] = true
- yield * this[kBody]
- }
-}
-class RedirectHandler {
- constructor (dispatch, maxRedirections, opts, handler) {
- if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
- throw new InvalidArgumentError('maxRedirections must be a positive number')
- }
- util.validateHandler(handler, opts.method, opts.upgrade)
+const { maxUnsigned16Bit } = __nccwpck_require__(736)
- this.dispatch = dispatch
- this.location = null
- this.abort = null
- this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
- this.maxRedirections = maxRedirections
- this.handler = handler
- this.history = []
+const BUFFER_SIZE = 16386
- if (util.isStream(this.opts.body)) {
- // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
- // so that it can be dispatched again?
- // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
- if (util.bodyLength(this.opts.body) === 0) {
- this.opts.body
- .on('data', function () {
- assert(false)
- })
- }
+/** @type {import('crypto')} */
+let crypto
+let buffer = null
+let bufIdx = BUFFER_SIZE
- if (typeof this.opts.body.readableDidRead !== 'boolean') {
- this.opts.body[kBodyUsed] = false
- EE.prototype.on.call(this.opts.body, 'data', function () {
- this[kBodyUsed] = true
- })
+try {
+ crypto = __nccwpck_require__(7598)
+/* c8 ignore next 3 */
+} catch {
+ crypto = {
+ // not full compatibility, but minimum.
+ randomFillSync: function randomFillSync (buffer, _offset, _size) {
+ for (let i = 0; i < buffer.length; ++i) {
+ buffer[i] = Math.random() * 255 | 0
}
- } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
- // TODO (fix): We can't access ReadableStream internal state
- // to determine whether or not it has been disturbed. This is just
- // a workaround.
- this.opts.body = new BodyAsyncIterable(this.opts.body)
- } else if (
- this.opts.body &&
- typeof this.opts.body !== 'string' &&
- !ArrayBuffer.isView(this.opts.body) &&
- util.isIterable(this.opts.body)
- ) {
- // TODO: Should we allow re-using iterable if !this.opts.idempotent
- // or through some other flag?
- this.opts.body = new BodyAsyncIterable(this.opts.body)
+ return buffer
}
}
+}
- onConnect (abort) {
- this.abort = abort
- this.handler.onConnect(abort, { history: this.history })
- }
-
- onUpgrade (statusCode, headers, socket) {
- this.handler.onUpgrade(statusCode, headers, socket)
+function generateMask () {
+ if (bufIdx === BUFFER_SIZE) {
+ bufIdx = 0
+ crypto.randomFillSync((buffer ??= Buffer.allocUnsafe(BUFFER_SIZE)), 0, BUFFER_SIZE)
}
+ return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]
+}
- onError (error) {
- this.handler.onError(error)
+class WebsocketFrameSend {
+ /**
+ * @param {Buffer|undefined} data
+ */
+ constructor (data) {
+ this.frameData = data
}
- onHeaders (statusCode, headers, resume, statusText) {
- this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
- ? null
- : parseLocation(statusCode, headers)
-
- if (this.opts.origin) {
- this.history.push(new URL(this.opts.path, this.opts.origin))
- }
-
- if (!this.location) {
- return this.handler.onHeaders(statusCode, headers, resume, statusText)
- }
-
- const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
- const path = search ? `${pathname}${search}` : pathname
+ createFrame (opcode) {
+ const frameData = this.frameData
+ const maskKey = generateMask()
+ const bodyLength = frameData?.byteLength ?? 0
- // Remove headers referring to the original URL.
- // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
- // https://tools.ietf.org/html/rfc7231#section-6.4
- this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
- this.opts.path = path
- this.opts.origin = origin
- this.opts.maxRedirections = 0
- this.opts.query = null
+ /** @type {number} */
+ let payloadLength = bodyLength // 0-125
+ let offset = 6
- // https://tools.ietf.org/html/rfc7231#section-6.4.4
- // In case of HTTP 303, always replace method to be either HEAD or GET
- if (statusCode === 303 && this.opts.method !== 'HEAD') {
- this.opts.method = 'GET'
- this.opts.body = null
+ if (bodyLength > maxUnsigned16Bit) {
+ offset += 8 // payload length is next 8 bytes
+ payloadLength = 127
+ } else if (bodyLength > 125) {
+ offset += 2 // payload length is next 2 bytes
+ payloadLength = 126
}
- }
- onData (chunk) {
- if (this.location) {
- /*
- https://tools.ietf.org/html/rfc7231#section-6.4
+ const buffer = Buffer.allocUnsafe(bodyLength + offset)
- TLDR: undici always ignores 3xx response bodies.
+ // Clear first 2 bytes, everything else is overwritten
+ buffer[0] = buffer[1] = 0
+ buffer[0] |= 0x80 // FIN
+ buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
- Redirection is used to serve the requested resource from another URL, so it is assumes that
- no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
+ /*! ws. MIT License. Einar Otto Stangvik */
+ buffer[offset - 4] = maskKey[0]
+ buffer[offset - 3] = maskKey[1]
+ buffer[offset - 2] = maskKey[2]
+ buffer[offset - 1] = maskKey[3]
- For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
- (which means it's optional and not mandated) contain just an hyperlink to the value of
- the Location response header, so the body can be ignored safely.
+ buffer[1] = payloadLength
- For status 300, which is "Multiple Choices", the spec mentions both generating a Location
- response header AND a response body with the other possible location to follow.
- Since the spec explicitily chooses not to specify a format for such body and leave it to
- servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
- */
- } else {
- return this.handler.onData(chunk)
+ if (payloadLength === 126) {
+ buffer.writeUInt16BE(bodyLength, 2)
+ } else if (payloadLength === 127) {
+ // Clear extended payload length
+ buffer[2] = buffer[3] = 0
+ buffer.writeUIntBE(bodyLength, 4, 6)
}
- }
- onComplete (trailers) {
- if (this.location) {
- /*
- https://tools.ietf.org/html/rfc7231#section-6.4
-
- TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
- and neither are useful if present.
-
- See comment on onData method above for more detailed informations.
- */
-
- this.location = null
- this.abort = null
+ buffer[1] |= 0x80 // MASK
- this.dispatch(this.opts, this)
- } else {
- this.handler.onComplete(trailers)
+ // mask body
+ for (let i = 0; i < bodyLength; ++i) {
+ buffer[offset + i] = frameData[i] ^ maskKey[i & 3]
}
- }
- onBodySent (chunk) {
- if (this.handler.onBodySent) {
- this.handler.onBodySent(chunk)
- }
+ return buffer
}
}
-function parseLocation (statusCode, headers) {
- if (redirectableStatusCodes.indexOf(statusCode) === -1) {
- return null
- }
-
- for (let i = 0; i < headers.length; i += 2) {
- if (headers[i].toString().toLowerCase() === 'location') {
- return headers[i + 1]
- }
- }
+module.exports = {
+ WebsocketFrameSend
}
-// https://tools.ietf.org/html/rfc7231#section-6.4.4
-function shouldRemoveHeader (header, removeContent, unknownOrigin) {
- if (header.length === 4) {
- return util.headerNameToString(header) === 'host'
- }
- if (removeContent && util.headerNameToString(header).startsWith('content-')) {
- return true
- }
- if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
- const name = util.headerNameToString(header)
- return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
- }
- return false
-}
-// https://tools.ietf.org/html/rfc7231#section-6.4
-function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
- const ret = []
- if (Array.isArray(headers)) {
- for (let i = 0; i < headers.length; i += 2) {
- if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
- ret.push(headers[i], headers[i + 1])
- }
- }
- } else if (headers && typeof headers === 'object') {
- for (const key of Object.keys(headers)) {
- if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
- ret.push(key, headers[key])
- }
- }
- } else {
- assert(headers == null, 'headers must be an object or an array')
- }
- return ret
-}
+/***/ }),
-module.exports = RedirectHandler
+/***/ 9469:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/***/ }),
-/***/ 2286:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522)
+const { isValidClientWindowBits } = __nccwpck_require__(8625)
+const { MessageSizeExceededError } = __nccwpck_require__(8707)
-const assert = __nccwpck_require__(9491)
+const tail = Buffer.from([0x00, 0x00, 0xff, 0xff])
+const kBuffer = Symbol('kBuffer')
+const kLength = Symbol('kLength')
-const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
-const { RequestRetryError } = __nccwpck_require__(8045)
-const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
+class PerMessageDeflate {
+ /** @type {import('node:zlib').InflateRaw} */
+ #inflate
-function calculateRetryAfterHeader (retryAfter) {
- const current = Date.now()
- const diff = new Date(retryAfter).getTime() - current
+ #options = {}
- return diff
-}
+ #maxPayloadSize = 0
-class RetryHandler {
- constructor (opts, handlers) {
- const { retryOptions, ...dispatchOpts } = opts
- const {
- // Retry scoped
- retry: retryFn,
- maxRetries,
- maxTimeout,
- minTimeout,
- timeoutFactor,
- // Response scoped
- methods,
- errorCodes,
- retryAfter,
- statusCodes
- } = retryOptions ?? {}
+ /**
+ * @param {Map} extensions
+ */
+ constructor (extensions, options) {
+ this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover')
+ this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits')
- this.dispatch = handlers.dispatch
- this.handler = handlers.handler
- this.opts = dispatchOpts
- this.abort = null
- this.aborted = false
- this.retryOpts = {
- retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
- retryAfter: retryAfter ?? true,
- maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
- timeout: minTimeout ?? 500, // .5s
- timeoutFactor: timeoutFactor ?? 2,
- maxRetries: maxRetries ?? 5,
- // What errors we should retry
- methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
- // Indicates which errors to retry
- statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
- // List of errors to retry
- errorCodes: errorCodes ?? [
- 'ECONNRESET',
- 'ECONNREFUSED',
- 'ENOTFOUND',
- 'ENETDOWN',
- 'ENETUNREACH',
- 'EHOSTDOWN',
- 'EHOSTUNREACH',
- 'EPIPE'
- ]
- }
+ this.#maxPayloadSize = options.maxPayloadSize
+ }
- this.retryCount = 0
- this.start = 0
- this.end = null
- this.etag = null
- this.resume = null
+ /**
+ * Decompress a compressed payload.
+ * @param {Buffer} chunk Compressed data
+ * @param {boolean} fin Final fragment flag
+ * @param {Function} callback Callback function
+ */
+ decompress (chunk, fin, callback) {
+ // An endpoint uses the following algorithm to decompress a message.
+ // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the
+ // payload of the message.
+ // 2. Decompress the resulting data using DEFLATE.
+ if (!this.#inflate) {
+ let windowBits = Z_DEFAULT_WINDOWBITS
+
+ if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS
+ if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) {
+ callback(new Error('Invalid server_max_window_bits'))
+ return
+ }
- // Handle possible onConnect duplication
- this.handler.onConnect(reason => {
- this.aborted = true
- if (this.abort) {
- this.abort(reason)
- } else {
- this.reason = reason
+ windowBits = Number.parseInt(this.#options.serverMaxWindowBits)
}
- })
- }
- onRequestSent () {
- if (this.handler.onRequestSent) {
- this.handler.onRequestSent()
- }
- }
+ try {
+ this.#inflate = createInflateRaw({ windowBits })
+ } catch (err) {
+ callback(err)
+ return
+ }
+ this.#inflate[kBuffer] = []
+ this.#inflate[kLength] = 0
- onUpgrade (statusCode, headers, socket) {
- if (this.handler.onUpgrade) {
- this.handler.onUpgrade(statusCode, headers, socket)
+ this.#inflate.on('data', (data) => {
+ this.#inflate[kLength] += data.length
+
+ if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
+ callback(new MessageSizeExceededError())
+ this.#inflate.removeAllListeners()
+ this.#inflate = null
+ return
+ }
+
+ this.#inflate[kBuffer].push(data)
+ })
+
+ this.#inflate.on('error', (err) => {
+ this.#inflate = null
+ callback(err)
+ })
}
- }
- onConnect (abort) {
- if (this.aborted) {
- abort(this.reason)
- } else {
- this.abort = abort
+ this.#inflate.write(chunk)
+ if (fin) {
+ this.#inflate.write(tail)
}
- }
- onBodySent (chunk) {
- if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
- }
+ this.#inflate.flush(() => {
+ if (!this.#inflate) {
+ return
+ }
- static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
- const { statusCode, code, headers } = err
- const { method, retryOptions } = opts
- const {
- maxRetries,
- timeout,
- maxTimeout,
- timeoutFactor,
- statusCodes,
- errorCodes,
- methods
- } = retryOptions
- let { counter, currentTimeout } = state
+ const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength])
- currentTimeout =
- currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
+ this.#inflate[kBuffer].length = 0
+ this.#inflate[kLength] = 0
- // Any code that is not a Undici's originated and allowed to retry
- if (
- code &&
- code !== 'UND_ERR_REQ_RETRY' &&
- code !== 'UND_ERR_SOCKET' &&
- !errorCodes.includes(code)
- ) {
- cb(err)
- return
- }
+ callback(null, full)
+ })
+ }
+}
- // If a set of method are provided and the current method is not in the list
- if (Array.isArray(methods) && !methods.includes(method)) {
- cb(err)
- return
- }
+module.exports = { PerMessageDeflate }
- // If a set of status code are provided and the current status code is not in the list
- if (
- statusCode != null &&
- Array.isArray(statusCodes) &&
- !statusCodes.includes(statusCode)
- ) {
- cb(err)
- return
- }
- // If we reached the max number of retries
- if (counter > maxRetries) {
- cb(err)
- return
- }
+/***/ }),
- let retryAfterHeader = headers != null && headers['retry-after']
- if (retryAfterHeader) {
- retryAfterHeader = Number(retryAfterHeader)
- retryAfterHeader = isNaN(retryAfterHeader)
- ? calculateRetryAfterHeader(retryAfterHeader)
- : retryAfterHeader * 1e3 // Retry-After is in seconds
- }
+/***/ 1652:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const retryTimeout =
- retryAfterHeader > 0
- ? Math.min(retryAfterHeader, maxTimeout)
- : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
- state.currentTimeout = retryTimeout
- setTimeout(() => cb(null), retryTimeout)
- }
+const { Writable } = __nccwpck_require__(7075)
+const assert = __nccwpck_require__(4589)
+const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(736)
+const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(1216)
+const { channels } = __nccwpck_require__(2414)
+const {
+ isValidStatusCode,
+ isValidOpcode,
+ failWebsocketConnection,
+ websocketMessageReceived,
+ utf8Decode,
+ isControlFrame,
+ isTextBinaryFrame,
+ isContinuationFrame
+} = __nccwpck_require__(8625)
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+const { closeWebSocketConnection } = __nccwpck_require__(6897)
+const { PerMessageDeflate } = __nccwpck_require__(9469)
+const { MessageSizeExceededError } = __nccwpck_require__(8707)
+
+function failWebsocketConnectionWithCode (ws, code, reason) {
+ closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason))
+ failWebsocketConnection(ws, reason)
+}
- onHeaders (statusCode, rawHeaders, resume, statusMessage) {
- const headers = parseHeaders(rawHeaders)
+// This code was influenced by ws released under the MIT license.
+// Copyright (c) 2011 Einar Otto Stangvik
+// Copyright (c) 2013 Arnout Kazemier and contributors
+// Copyright (c) 2016 Luigi Pinca and contributors
- this.retryCount += 1
+class ByteParser extends Writable {
+ #buffers = []
+ #fragmentsBytes = 0
+ #byteOffset = 0
+ #loop = false
- if (statusCode >= 300) {
- this.abort(
- new RequestRetryError('Request failed', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
+ #state = parserStates.INFO
- // Checkpoint for resume from where we left it
- if (this.resume != null) {
- this.resume = null
+ #info = {}
+ #fragments = []
- if (statusCode !== 206) {
- return true
- }
+ /** @type {Map} */
+ #extensions
- const contentRange = parseRangeHeader(headers['content-range'])
- // If no content range
- if (!contentRange) {
- this.abort(
- new RequestRetryError('Content-Range mismatch', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
+ /** @type {number} */
+ #maxFragments
- // Let's start with a weak etag check
- if (this.etag != null && this.etag !== headers.etag) {
- this.abort(
- new RequestRetryError('ETag mismatch', statusCode, {
- headers,
- count: this.retryCount
- })
- )
- return false
- }
+ /** @type {number} */
+ #maxPayloadSize
- const { start, size, end = size } = contentRange
+ /**
+ * @param {import('./websocket').WebSocket} ws
+ * @param {Map|null} extensions
+ * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]
+ */
+ constructor (ws, extensions, options = {}) {
+ super()
- assert(this.start === start, 'content-range mismatch')
- assert(this.end == null || this.end === end, 'content-range mismatch')
+ this.ws = ws
+ this.#extensions = extensions == null ? new Map() : extensions
+ this.#maxFragments = options.maxFragments ?? 0
+ this.#maxPayloadSize = options.maxPayloadSize ?? 0
- this.resume = resume
- return true
+ if (this.#extensions.has('permessage-deflate')) {
+ this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))
}
+ }
- if (this.end == null) {
- if (statusCode === 206) {
- // First time we receive 206
- const range = parseRangeHeader(headers['content-range'])
+ /**
+ * @param {Buffer} chunk
+ * @param {() => void} callback
+ */
+ _write (chunk, _, callback) {
+ this.#buffers.push(chunk)
+ this.#byteOffset += chunk.length
+ this.#loop = true
- if (range == null) {
- return this.handler.onHeaders(
- statusCode,
- rawHeaders,
- resume,
- statusMessage
- )
- }
+ this.run(callback)
+ }
- const { start, size, end = size } = range
+ #validatePayloadLength () {
+ if (
+ this.#maxPayloadSize > 0 &&
+ !isControlFrame(this.#info.opcode) &&
+ this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize
+ ) {
+ failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size')
+ return false
+ }
- assert(
- start != null && Number.isFinite(start) && this.start !== start,
- 'content-range mismatch'
- )
- assert(Number.isFinite(start))
- assert(
- end != null && Number.isFinite(end) && this.end !== end,
- 'invalid content-length'
- )
+ return true
+ }
- this.start = start
- this.end = end
- }
+ /**
+ * Runs whenever a new chunk is received.
+ * Callback is called whenever there are no more chunks buffering,
+ * or not enough bytes are buffered to parse.
+ */
+ run (callback) {
+ while (this.#loop) {
+ if (this.#state === parserStates.INFO) {
+ // If there aren't enough bytes to parse the payload length, etc.
+ if (this.#byteOffset < 2) {
+ return callback()
+ }
- // We make our best to checkpoint the body for further range headers
- if (this.end == null) {
- const contentLength = headers['content-length']
- this.end = contentLength != null ? Number(contentLength) : null
- }
+ const buffer = this.consume(2)
+ const fin = (buffer[0] & 0x80) !== 0
+ const opcode = buffer[0] & 0x0F
+ const masked = (buffer[1] & 0x80) === 0x80
- assert(Number.isFinite(this.start))
- assert(
- this.end == null || Number.isFinite(this.end),
- 'invalid content-length'
- )
+ const fragmented = !fin && opcode !== opcodes.CONTINUATION
+ const payloadLength = buffer[1] & 0x7F
- this.resume = resume
- this.etag = headers.etag != null ? headers.etag : null
+ const rsv1 = buffer[0] & 0x40
+ const rsv2 = buffer[0] & 0x20
+ const rsv3 = buffer[0] & 0x10
- return this.handler.onHeaders(
- statusCode,
- rawHeaders,
- resume,
- statusMessage
- )
- }
+ if (!isValidOpcode(opcode)) {
+ failWebsocketConnection(this.ws, 'Invalid opcode received')
+ return callback()
+ }
- const err = new RequestRetryError('Request failed', statusCode, {
- headers,
- count: this.retryCount
- })
+ if (masked) {
+ failWebsocketConnection(this.ws, 'Frame cannot be masked')
+ return callback()
+ }
- this.abort(err)
+ // MUST be 0 unless an extension is negotiated that defines meanings
+ // for non-zero values. If a nonzero value is received and none of
+ // the negotiated extensions defines the meaning of such a nonzero
+ // value, the receiving endpoint MUST _Fail the WebSocket
+ // Connection_.
+ // This document allocates the RSV1 bit of the WebSocket header for
+ // PMCEs and calls the bit the "Per-Message Compressed" bit. On a
+ // WebSocket connection where a PMCE is in use, this bit indicates
+ // whether a message is compressed or not.
+ if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {
+ failWebsocketConnection(this.ws, 'Expected RSV1 to be clear.')
+ return
+ }
- return false
- }
+ if (rsv2 !== 0 || rsv3 !== 0) {
+ failWebsocketConnection(this.ws, 'RSV1, RSV2, RSV3 must be clear')
+ return
+ }
- onData (chunk) {
- this.start += chunk.length
+ if (fragmented && !isTextBinaryFrame(opcode)) {
+ // Only text and binary frames can be fragmented
+ failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
+ return
+ }
- return this.handler.onData(chunk)
- }
+ // If we are already parsing a text/binary frame and do not receive either
+ // a continuation frame or close frame, fail the connection.
+ if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
+ failWebsocketConnection(this.ws, 'Expected continuation frame')
+ return
+ }
- onComplete (rawTrailers) {
- this.retryCount = 0
- return this.handler.onComplete(rawTrailers)
- }
+ if (this.#info.fragmented && fragmented) {
+ // A fragmented frame can't be fragmented itself
+ failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
+ return
+ }
- onError (err) {
- if (this.aborted || isDisturbed(this.opts.body)) {
- return this.handler.onError(err)
- }
+ // "All control frames MUST have a payload length of 125 bytes or less
+ // and MUST NOT be fragmented."
+ if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
+ failWebsocketConnection(this.ws, 'Control frame either too large or fragmented')
+ return
+ }
- this.retryOpts.retry(
- err,
- {
- state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
- opts: { retryOptions: this.retryOpts, ...this.opts }
- },
- onRetry.bind(this)
- )
+ if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
+ failWebsocketConnection(this.ws, 'Unexpected continuation frame')
+ return
+ }
- function onRetry (err) {
- if (err != null || this.aborted || isDisturbed(this.opts.body)) {
- return this.handler.onError(err)
- }
+ if (payloadLength <= 125) {
+ this.#info.payloadLength = payloadLength
+ this.#state = parserStates.READ_DATA
- if (this.start !== 0) {
- this.opts = {
- ...this.opts,
- headers: {
- ...this.opts.headers,
- range: `bytes=${this.start}-${this.end ?? ''}`
+ if (!this.#validatePayloadLength()) {
+ return
}
+ } else if (payloadLength === 126) {
+ this.#state = parserStates.PAYLOADLENGTH_16
+ } else if (payloadLength === 127) {
+ this.#state = parserStates.PAYLOADLENGTH_64
}
- }
- try {
- this.dispatch(this.opts, this)
- } catch (err) {
- this.handler.onError(err)
- }
- }
- }
-}
+ if (isTextBinaryFrame(opcode)) {
+ this.#info.binaryType = opcode
+ this.#info.compressed = rsv1 !== 0
+ }
-module.exports = RetryHandler
+ this.#info.opcode = opcode
+ this.#info.masked = masked
+ this.#info.fin = fin
+ this.#info.fragmented = fragmented
+ } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
+ if (this.#byteOffset < 2) {
+ return callback()
+ }
+ const buffer = this.consume(2)
-/***/ }),
+ this.#info.payloadLength = buffer.readUInt16BE(0)
+ this.#state = parserStates.READ_DATA
-/***/ 8861:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (!this.#validatePayloadLength()) {
+ return
+ }
+ } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
+ if (this.#byteOffset < 8) {
+ return callback()
+ }
-"use strict";
+ const buffer = this.consume(8)
+ const upper = buffer.readUInt32BE(0)
+ const lower = buffer.readUInt32BE(4)
+ // 2^31 is the maximum bytes an arraybuffer can contain
+ // on 32-bit systems. Although, on 64-bit systems, this is
+ // 2^53-1 bytes.
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
+ // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
+ // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
+ if (upper !== 0 || lower > 2 ** 31 - 1) {
+ failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
+ return
+ }
-const RedirectHandler = __nccwpck_require__(2860)
+ this.#info.payloadLength = lower
+ this.#state = parserStates.READ_DATA
-function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
- return (dispatch) => {
- return function Intercept (opts, handler) {
- const { maxRedirections = defaultMaxRedirections } = opts
+ if (!this.#validatePayloadLength()) {
+ return
+ }
+ } else if (this.#state === parserStates.READ_DATA) {
+ if (this.#byteOffset < this.#info.payloadLength) {
+ return callback()
+ }
- if (!maxRedirections) {
- return dispatch(opts, handler)
- }
+ const body = this.consume(this.#info.payloadLength)
- const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
- opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
- return dispatch(opts, redirectHandler)
- }
- }
-}
+ if (isControlFrame(this.#info.opcode)) {
+ this.#loop = this.parseControlFrame(body)
+ this.#state = parserStates.INFO
+ } else {
+ if (!this.#info.compressed) {
+ if (!this.writeFragments(body)) {
+ return
+ }
-module.exports = createRedirectInterceptor
+ if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
+ failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)
+ return
+ }
+ // If the frame is not fragmented, a message has been received.
+ // If the frame is fragmented, it will terminate with a fin bit set
+ // and an opcode of 0 (continuation), therefore we handle that when
+ // parsing continuation frames, not here.
+ if (!this.#info.fragmented && this.#info.fin) {
+ websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())
+ }
-/***/ }),
+ this.#state = parserStates.INFO
+ } else {
+ this.#extensions.get('permessage-deflate').decompress(
+ body,
+ this.#info.fin,
+ (error, data) => {
+ if (error) {
+ const code = error instanceof MessageSizeExceededError ? 1009 : 1007
+ failWebsocketConnectionWithCode(this.ws, code, error.message)
+ return
+ }
-/***/ 953:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ if (!this.writeFragments(data)) {
+ return
+ }
-"use strict";
+ if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
+ failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message)
+ return
+ }
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
-const utils_1 = __nccwpck_require__(1891);
-// C headers
-var ERROR;
-(function (ERROR) {
- ERROR[ERROR["OK"] = 0] = "OK";
- ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
- ERROR[ERROR["STRICT"] = 2] = "STRICT";
- ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
- ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
- ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
- ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
- ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
- ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
- ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
- ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
- ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
- ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
- ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
- ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
- ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
- ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
- ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
- ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
- ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
- ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
- ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
- ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
- ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
- ERROR[ERROR["USER"] = 24] = "USER";
-})(ERROR = exports.ERROR || (exports.ERROR = {}));
-var TYPE;
-(function (TYPE) {
- TYPE[TYPE["BOTH"] = 0] = "BOTH";
- TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
- TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
-})(TYPE = exports.TYPE || (exports.TYPE = {}));
-var FLAGS;
-(function (FLAGS) {
- FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
- FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
- FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
- FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
- FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
- FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
- FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
- FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
- // 1 << 8 is unused
- FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
-})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
-var LENIENT_FLAGS;
-(function (LENIENT_FLAGS) {
- LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
- LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
- LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
-})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
-var METHODS;
-(function (METHODS) {
- METHODS[METHODS["DELETE"] = 0] = "DELETE";
- METHODS[METHODS["GET"] = 1] = "GET";
- METHODS[METHODS["HEAD"] = 2] = "HEAD";
- METHODS[METHODS["POST"] = 3] = "POST";
- METHODS[METHODS["PUT"] = 4] = "PUT";
- /* pathological */
- METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
- METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
- METHODS[METHODS["TRACE"] = 7] = "TRACE";
- /* WebDAV */
- METHODS[METHODS["COPY"] = 8] = "COPY";
- METHODS[METHODS["LOCK"] = 9] = "LOCK";
- METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
- METHODS[METHODS["MOVE"] = 11] = "MOVE";
- METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
- METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
- METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
- METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
- METHODS[METHODS["BIND"] = 16] = "BIND";
- METHODS[METHODS["REBIND"] = 17] = "REBIND";
- METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
- METHODS[METHODS["ACL"] = 19] = "ACL";
- /* subversion */
- METHODS[METHODS["REPORT"] = 20] = "REPORT";
- METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
- METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
- METHODS[METHODS["MERGE"] = 23] = "MERGE";
- /* upnp */
- METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
- METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
- METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
- METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
- /* RFC-5789 */
- METHODS[METHODS["PATCH"] = 28] = "PATCH";
- METHODS[METHODS["PURGE"] = 29] = "PURGE";
- /* CalDAV */
- METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
- /* RFC-2068, section 19.6.1.2 */
- METHODS[METHODS["LINK"] = 31] = "LINK";
- METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
- /* icecast */
- METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
- /* RFC-7540, section 11.6 */
- METHODS[METHODS["PRI"] = 34] = "PRI";
- /* RFC-2326 RTSP */
- METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
- METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
- METHODS[METHODS["SETUP"] = 37] = "SETUP";
- METHODS[METHODS["PLAY"] = 38] = "PLAY";
- METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
- METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
- METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
- METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
- METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
- METHODS[METHODS["RECORD"] = 44] = "RECORD";
- /* RAOP */
- METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
-})(METHODS = exports.METHODS || (exports.METHODS = {}));
-exports.METHODS_HTTP = [
- METHODS.DELETE,
- METHODS.GET,
- METHODS.HEAD,
- METHODS.POST,
- METHODS.PUT,
- METHODS.CONNECT,
- METHODS.OPTIONS,
- METHODS.TRACE,
- METHODS.COPY,
- METHODS.LOCK,
- METHODS.MKCOL,
- METHODS.MOVE,
- METHODS.PROPFIND,
- METHODS.PROPPATCH,
- METHODS.SEARCH,
- METHODS.UNLOCK,
- METHODS.BIND,
- METHODS.REBIND,
- METHODS.UNBIND,
- METHODS.ACL,
- METHODS.REPORT,
- METHODS.MKACTIVITY,
- METHODS.CHECKOUT,
- METHODS.MERGE,
- METHODS['M-SEARCH'],
- METHODS.NOTIFY,
- METHODS.SUBSCRIBE,
- METHODS.UNSUBSCRIBE,
- METHODS.PATCH,
- METHODS.PURGE,
- METHODS.MKCALENDAR,
- METHODS.LINK,
- METHODS.UNLINK,
- METHODS.PRI,
- // TODO(indutny): should we allow it with HTTP?
- METHODS.SOURCE,
-];
-exports.METHODS_ICE = [
- METHODS.SOURCE,
-];
-exports.METHODS_RTSP = [
- METHODS.OPTIONS,
- METHODS.DESCRIBE,
- METHODS.ANNOUNCE,
- METHODS.SETUP,
- METHODS.PLAY,
- METHODS.PAUSE,
- METHODS.TEARDOWN,
- METHODS.GET_PARAMETER,
- METHODS.SET_PARAMETER,
- METHODS.REDIRECT,
- METHODS.RECORD,
- METHODS.FLUSH,
- // For AirPlay
- METHODS.GET,
- METHODS.POST,
-];
-exports.METHOD_MAP = utils_1.enumToMap(METHODS);
-exports.H_METHOD_MAP = {};
-Object.keys(exports.METHOD_MAP).forEach((key) => {
- if (/^H/.test(key)) {
- exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
+ if (!this.#info.fin) {
+ this.#state = parserStates.INFO
+ this.#loop = true
+ this.run(callback)
+ return
+ }
+
+ websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments())
+
+ this.#loop = true
+ this.#state = parserStates.INFO
+ this.run(callback)
+ }
+ )
+
+ this.#loop = false
+ break
+ }
+ }
+ }
}
-});
-var FINISH;
-(function (FINISH) {
- FINISH[FINISH["SAFE"] = 0] = "SAFE";
- FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
- FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
-})(FINISH = exports.FINISH || (exports.FINISH = {}));
-exports.ALPHA = [];
-for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
- // Upper case
- exports.ALPHA.push(String.fromCharCode(i));
- // Lower case
- exports.ALPHA.push(String.fromCharCode(i + 0x20));
-}
-exports.NUM_MAP = {
- 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
- 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
-};
-exports.HEX_MAP = {
- 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
- 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
- A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
- a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
-};
-exports.NUM = [
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-];
-exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
-exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
-exports.USERINFO_CHARS = exports.ALPHANUM
- .concat(exports.MARK)
- .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
-// TODO(indutny): use RFC
-exports.STRICT_URL_CHAR = [
- '!', '"', '$', '%', '&', '\'',
- '(', ')', '*', '+', ',', '-', '.', '/',
- ':', ';', '<', '=', '>',
- '@', '[', '\\', ']', '^', '_',
- '`',
- '{', '|', '}', '~',
-].concat(exports.ALPHANUM);
-exports.URL_CHAR = exports.STRICT_URL_CHAR
- .concat(['\t', '\f']);
-// All characters with 0x80 bit set to 1
-for (let i = 0x80; i <= 0xff; i++) {
- exports.URL_CHAR.push(i);
-}
-exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
-/* Tokens as defined by rfc 2616. Also lowercases them.
- * token = 1*
- * separators = "(" | ")" | "<" | ">" | "@"
- * | "," | ";" | ":" | "\" | <">
- * | "/" | "[" | "]" | "?" | "="
- * | "{" | "}" | SP | HT
- */
-exports.STRICT_TOKEN = [
- '!', '#', '$', '%', '&', '\'',
- '*', '+', '-', '.',
- '^', '_', '`',
- '|', '~',
-].concat(exports.ALPHANUM);
-exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
-/*
- * Verify that a char is a valid visible (printable) US-ASCII
- * character or %x80-FF
- */
-exports.HEADER_CHARS = ['\t'];
-for (let i = 32; i <= 255; i++) {
- if (i !== 127) {
- exports.HEADER_CHARS.push(i);
+ }
+
+ /**
+ * Take n bytes from the buffered Buffers
+ * @param {number} n
+ * @returns {Buffer}
+ */
+ consume (n) {
+ if (n > this.#byteOffset) {
+ throw new Error('Called consume() before buffers satiated.')
+ } else if (n === 0) {
+ return emptyBuffer
}
-}
-// ',' = \x44
-exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
-exports.MAJOR = exports.NUM_MAP;
-exports.MINOR = exports.MAJOR;
-var HEADER_STATE;
-(function (HEADER_STATE) {
- HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
- HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
- HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
- HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
- HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
- HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
- HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
- HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
- HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
-})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
-exports.SPECIAL_HEADERS = {
- 'connection': HEADER_STATE.CONNECTION,
- 'content-length': HEADER_STATE.CONTENT_LENGTH,
- 'proxy-connection': HEADER_STATE.CONNECTION,
- 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
- 'upgrade': HEADER_STATE.UPGRADE,
-};
-//# sourceMappingURL=constants.js.map
-/***/ }),
+ if (this.#buffers[0].length === n) {
+ this.#byteOffset -= this.#buffers[0].length
+ return this.#buffers.shift()
+ }
+
+ const buffer = Buffer.allocUnsafe(n)
+ let offset = 0
+
+ while (offset !== n) {
+ const next = this.#buffers[0]
+ const { length } = next
+
+ if (length + offset === n) {
+ buffer.set(this.#buffers.shift(), offset)
+ break
+ } else if (length + offset > n) {
+ buffer.set(next.subarray(0, n - offset), offset)
+ this.#buffers[0] = next.subarray(n - offset)
+ break
+ } else {
+ buffer.set(this.#buffers.shift(), offset)
+ offset += next.length
+ }
+ }
-/***/ 1145:
-/***/ ((module) => {
+ this.#byteOffset -= n
-module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACR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QFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQ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tBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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E2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgA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kVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8='
+ return buffer
+ }
+ writeFragments (fragment) {
+ if (
+ this.#maxFragments > 0 &&
+ this.#fragments.length === this.#maxFragments
+ ) {
+ failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments')
+ return false
+ }
-/***/ }),
+ this.#fragmentsBytes += fragment.length
+ this.#fragments.push(fragment)
+ return true
+ }
-/***/ 5627:
-/***/ ((module) => {
+ consumeFragments () {
+ const fragments = this.#fragments
-module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfb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B/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwG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RAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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DeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBG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FCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgI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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
+ if (fragments.length === 1) {
+ this.#fragmentsBytes = 0
+ return fragments.shift()
+ }
+ const output = Buffer.concat(fragments, this.#fragmentsBytes)
+ this.#fragments = []
+ this.#fragmentsBytes = 0
-/***/ }),
+ return output
+ }
-/***/ 1891:
-/***/ ((__unused_webpack_module, exports) => {
+ parseCloseBody (data) {
+ assert(data.length !== 1)
-"use strict";
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
+ /** @type {number|undefined} */
+ let code
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.enumToMap = void 0;
-function enumToMap(obj) {
- const res = {};
- Object.keys(obj).forEach((key) => {
- const value = obj[key];
- if (typeof value === 'number') {
- res[key] = value;
- }
- });
- return res;
-}
-exports.enumToMap = enumToMap;
-//# sourceMappingURL=utils.js.map
+ if (data.length >= 2) {
+ // _The WebSocket Connection Close Code_ is
+ // defined as the status code (Section 7.4) contained in the first Close
+ // control frame received by the application
+ code = data.readUInt16BE(0)
+ }
-/***/ }),
+ if (code !== undefined && !isValidStatusCode(code)) {
+ return { code: 1002, reason: 'Invalid status code', error: true }
+ }
-/***/ 6771:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
+ /** @type {Buffer} */
+ let reason = data.subarray(2)
-"use strict";
+ // Remove BOM
+ if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
+ reason = reason.subarray(3)
+ }
+ try {
+ reason = utf8Decode(reason)
+ } catch {
+ return { code: 1007, reason: 'Invalid UTF-8', error: true }
+ }
-const { kClients } = __nccwpck_require__(2785)
-const Agent = __nccwpck_require__(7890)
-const {
- kAgent,
- kMockAgentSet,
- kMockAgentGet,
- kDispatches,
- kIsMockActive,
- kNetConnect,
- kGetNetConnect,
- kOptions,
- kFactory
-} = __nccwpck_require__(4347)
-const MockClient = __nccwpck_require__(8687)
-const MockPool = __nccwpck_require__(6193)
-const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
-const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
-const Dispatcher = __nccwpck_require__(412)
-const Pluralizer = __nccwpck_require__(8891)
-const PendingInterceptorsFormatter = __nccwpck_require__(6823)
-
-class FakeWeakRef {
- constructor (value) {
- this.value = value
+ return { code, reason, error: false }
}
- deref () {
- return this.value
- }
-}
+ /**
+ * Parses control frames.
+ * @param {Buffer} body
+ */
+ parseControlFrame (body) {
+ const { opcode, payloadLength } = this.#info
-class MockAgent extends Dispatcher {
- constructor (opts) {
- super(opts)
+ if (opcode === opcodes.CLOSE) {
+ if (payloadLength === 1) {
+ failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
+ return false
+ }
- this[kNetConnect] = true
- this[kIsMockActive] = true
+ this.#info.closeInfo = this.parseCloseBody(body)
- // Instantiate Agent and encapsulate
- if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
- }
- const agent = opts && opts.agent ? opts.agent : new Agent(opts)
- this[kAgent] = agent
+ if (this.#info.closeInfo.error) {
+ const { code, reason } = this.#info.closeInfo
- this[kClients] = agent[kClients]
- this[kOptions] = buildMockOptions(opts)
- }
+ closeWebSocketConnection(this.ws, code, reason, reason.length)
+ failWebsocketConnection(this.ws, reason)
+ return false
+ }
- get (origin) {
- let dispatcher = this[kMockAgentGet](origin)
+ if (this.ws[kSentClose] !== sentCloseFrameState.SENT) {
+ // If an endpoint receives a Close frame and did not previously send a
+ // Close frame, the endpoint MUST send a Close frame in response. (When
+ // sending a Close frame in response, the endpoint typically echos the
+ // status code it received.)
+ let body = emptyBuffer
+ if (this.#info.closeInfo.code) {
+ body = Buffer.allocUnsafe(2)
+ body.writeUInt16BE(this.#info.closeInfo.code, 0)
+ }
+ const closeFrame = new WebsocketFrameSend(body)
- if (!dispatcher) {
- dispatcher = this[kFactory](origin)
- this[kMockAgentSet](origin, dispatcher)
- }
- return dispatcher
- }
+ this.ws[kResponse].socket.write(
+ closeFrame.createFrame(opcodes.CLOSE),
+ (err) => {
+ if (!err) {
+ this.ws[kSentClose] = sentCloseFrameState.SENT
+ }
+ }
+ )
+ }
- dispatch (opts, handler) {
- // Call MockAgent.get to perform additional setup before dispatching as normal
- this.get(opts.origin)
- return this[kAgent].dispatch(opts, handler)
- }
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ this.ws[kReadyState] = states.CLOSING
+ this.ws[kReceivedClose] = true
- async close () {
- await this[kAgent].close()
- this[kClients].clear()
- }
+ return false
+ } else if (opcode === opcodes.PING) {
+ // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
+ // response, unless it already received a Close frame.
+ // A Pong frame sent in response to a Ping frame must have identical
+ // "Application data"
- deactivate () {
- this[kIsMockActive] = false
- }
+ if (!this.ws[kReceivedClose]) {
+ const frame = new WebsocketFrameSend(body)
- activate () {
- this[kIsMockActive] = true
- }
+ this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
- enableNetConnect (matcher) {
- if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
- if (Array.isArray(this[kNetConnect])) {
- this[kNetConnect].push(matcher)
- } else {
- this[kNetConnect] = [matcher]
+ if (channels.ping.hasSubscribers) {
+ channels.ping.publish({
+ payload: body
+ })
+ }
+ }
+ } else if (opcode === opcodes.PONG) {
+ // A Pong frame MAY be sent unsolicited. This serves as a
+ // unidirectional heartbeat. A response to an unsolicited Pong frame is
+ // not expected.
+
+ if (channels.pong.hasSubscribers) {
+ channels.pong.publish({
+ payload: body
+ })
}
- } else if (typeof matcher === 'undefined') {
- this[kNetConnect] = true
- } else {
- throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
}
- }
- disableNetConnect () {
- this[kNetConnect] = false
+ return true
}
- // This is required to bypass issues caused by using global symbols - see:
- // https://github.com/nodejs/undici/issues/1447
- get isMockActive () {
- return this[kIsMockActive]
+ get closingInfo () {
+ return this.#info.closeInfo
}
+}
- [kMockAgentSet] (origin, dispatcher) {
- this[kClients].set(origin, new FakeWeakRef(dispatcher))
- }
+module.exports = {
+ ByteParser
+}
- [kFactory] (origin) {
- const mockOptions = Object.assign({ agent: this }, this[kOptions])
- return this[kOptions] && this[kOptions].connections === 1
- ? new MockClient(origin, mockOptions)
- : new MockPool(origin, mockOptions)
+
+/***/ }),
+
+/***/ 3900:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+
+
+const { WebsocketFrameSend } = __nccwpck_require__(3264)
+const { opcodes, sendHints } = __nccwpck_require__(736)
+const FixedQueue = __nccwpck_require__(4660)
+
+/** @type {typeof Uint8Array} */
+const FastBuffer = Buffer[Symbol.species]
+
+/**
+ * @typedef {object} SendQueueNode
+ * @property {Promise | null} promise
+ * @property {((...args: any[]) => any)} callback
+ * @property {Buffer | null} frame
+ */
+
+class SendQueue {
+ /**
+ * @type {FixedQueue}
+ */
+ #queue = new FixedQueue()
+
+ /**
+ * @type {boolean}
+ */
+ #running = false
+
+ /** @type {import('node:net').Socket} */
+ #socket
+
+ constructor (socket) {
+ this.#socket = socket
}
- [kMockAgentGet] (origin) {
- // First check if we can immediately find it
- const ref = this[kClients].get(origin)
- if (ref) {
- return ref.deref()
+ add (item, cb, hint) {
+ if (hint !== sendHints.blob) {
+ const frame = createFrame(item, hint)
+ if (!this.#running) {
+ // fast-path
+ this.#socket.write(frame, cb)
+ } else {
+ /** @type {SendQueueNode} */
+ const node = {
+ promise: null,
+ callback: cb,
+ frame
+ }
+ this.#queue.push(node)
+ }
+ return
}
- // If the origin is not a string create a dummy parent pool and return to user
- if (typeof origin !== 'string') {
- const dispatcher = this[kFactory]('http://localhost:9999')
- this[kMockAgentSet](origin, dispatcher)
- return dispatcher
+ /** @type {SendQueueNode} */
+ const node = {
+ promise: item.arrayBuffer().then((ab) => {
+ node.promise = null
+ node.frame = createFrame(ab, hint)
+ }),
+ callback: cb,
+ frame: null
}
- // If we match, create a pool and assign the same dispatches
- for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
- const nonExplicitDispatcher = nonExplicitRef.deref()
- if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
- const dispatcher = this[kFactory](origin)
- this[kMockAgentSet](origin, dispatcher)
- dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
- return dispatcher
- }
+ this.#queue.push(node)
+
+ if (!this.#running) {
+ this.#run()
}
}
- [kGetNetConnect] () {
- return this[kNetConnect]
+ async #run () {
+ this.#running = true
+ const queue = this.#queue
+ while (!queue.isEmpty()) {
+ const node = queue.shift()
+ // wait pending promise
+ if (node.promise !== null) {
+ await node.promise
+ }
+ // write
+ this.#socket.write(node.frame, node.callback)
+ // cleanup
+ node.callback = node.frame = null
+ }
+ this.#running = false
}
+}
- pendingInterceptors () {
- const mockAgentClients = this[kClients]
+function createFrame (data, hint) {
+ return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY)
+}
- return Array.from(mockAgentClients.entries())
- .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
- .filter(({ pending }) => pending)
+function toBuffer (data, hint) {
+ switch (hint) {
+ case sendHints.string:
+ return Buffer.from(data)
+ case sendHints.arrayBuffer:
+ case sendHints.blob:
+ return new FastBuffer(data)
+ case sendHints.typedArray:
+ return new FastBuffer(data.buffer, data.byteOffset, data.byteLength)
}
+}
- assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
- const pending = this.pendingInterceptors()
+module.exports = { SendQueue }
- if (pending.length === 0) {
- return
- }
- const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
+/***/ }),
- throw new UndiciError(`
-${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
+/***/ 1216:
+/***/ ((module) => {
-${pendingInterceptorsFormatter.format(pending)}
-`.trim())
- }
-}
-module.exports = MockAgent
+
+module.exports = {
+ kWebSocketURL: Symbol('url'),
+ kReadyState: Symbol('ready state'),
+ kController: Symbol('controller'),
+ kResponse: Symbol('response'),
+ kBinaryType: Symbol('binary type'),
+ kSentClose: Symbol('sent close'),
+ kReceivedClose: Symbol('received close'),
+ kByteParser: Symbol('byte parser')
+}
/***/ }),
-/***/ 8687:
+/***/ 8625:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { promisify } = __nccwpck_require__(3837)
-const Client = __nccwpck_require__(3598)
-const { buildMockDispatch } = __nccwpck_require__(9323)
-const {
- kDispatches,
- kMockAgent,
- kClose,
- kOriginalClose,
- kOrigin,
- kOriginalDispatch,
- kConnected
-} = __nccwpck_require__(4347)
-const { MockInterceptor } = __nccwpck_require__(410)
-const Symbols = __nccwpck_require__(2785)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
+const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(1216)
+const { states, opcodes } = __nccwpck_require__(736)
+const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(5188)
+const { isUtf8 } = __nccwpck_require__(4573)
+const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(1900)
+
+/* globals Blob */
/**
- * MockClient provides an API that extends the Client to influence the mockDispatches.
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
*/
-class MockClient extends Client {
- constructor (origin, opts) {
- super(origin, opts)
+function isConnecting (ws) {
+ // If the WebSocket connection is not yet established, and the connection
+ // is not yet closed, then the WebSocket connection is in the CONNECTING state.
+ return ws[kReadyState] === states.CONNECTING
+}
- if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isEstablished (ws) {
+ // If the server's response is validated as provided for above, it is
+ // said that _The WebSocket Connection is Established_ and that the
+ // WebSocket Connection is in the OPEN state.
+ return ws[kReadyState] === states.OPEN
+}
+
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isClosing (ws) {
+ // Upon either sending or receiving a Close control frame, it is said
+ // that _The WebSocket Closing Handshake is Started_ and that the
+ // WebSocket connection is in the CLOSING state.
+ return ws[kReadyState] === states.CLOSING
+}
+
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @returns {boolean}
+ */
+function isClosed (ws) {
+ return ws[kReadyState] === states.CLOSED
+}
+
+/**
+ * @see https://dom.spec.whatwg.org/#concept-event-fire
+ * @param {string} e
+ * @param {EventTarget} target
+ * @param {(...args: ConstructorParameters) => Event} eventFactory
+ * @param {EventInit | undefined} eventInitDict
+ */
+function fireEvent (e, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) {
+ // 1. If eventConstructor is not given, then let eventConstructor be Event.
+
+ // 2. Let event be the result of creating an event given eventConstructor,
+ // in the relevant realm of target.
+ // 3. Initialize event’s type attribute to e.
+ const event = eventFactory(e, eventInitDict)
+
+ // 4. Initialize any other IDL attributes of event as described in the
+ // invocation of this algorithm.
+
+ // 5. Return the result of dispatching event at target, with legacy target
+ // override flag set if set.
+ target.dispatchEvent(event)
+}
+
+/**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ * @param {import('./websocket').WebSocket} ws
+ * @param {number} type Opcode
+ * @param {Buffer} data application data
+ */
+function websocketMessageReceived (ws, type, data) {
+ // 1. If ready state is not OPEN (1), then return.
+ if (ws[kReadyState] !== states.OPEN) {
+ return
+ }
+
+ // 2. Let dataForEvent be determined by switching on type and binary type:
+ let dataForEvent
+
+ if (type === opcodes.TEXT) {
+ // -> type indicates that the data is Text
+ // a new DOMString containing data
+ try {
+ dataForEvent = utf8Decode(data)
+ } catch {
+ failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
+ return
+ }
+ } else if (type === opcodes.BINARY) {
+ if (ws[kBinaryType] === 'blob') {
+ // -> type indicates that the data is Binary and binary type is "blob"
+ // a new Blob object, created in the relevant Realm of the WebSocket
+ // object, that represents data as its raw data
+ dataForEvent = new Blob([data])
+ } else {
+ // -> type indicates that the data is Binary and binary type is "arraybuffer"
+ // a new ArrayBuffer object, created in the relevant Realm of the
+ // WebSocket object, whose contents are data
+ dataForEvent = toArrayBuffer(data)
}
+ }
- this[kMockAgent] = opts.agent
- this[kOrigin] = origin
- this[kDispatches] = []
- this[kConnected] = 1
- this[kOriginalDispatch] = this.dispatch
- this[kOriginalClose] = this.close.bind(this)
+ // 3. Fire an event named message at the WebSocket object, using MessageEvent,
+ // with the origin attribute initialized to the serialization of the WebSocket
+ // object’s url's origin, and the data attribute initialized to dataForEvent.
+ fireEvent('message', ws, createFastMessageEvent, {
+ origin: ws[kWebSocketURL].origin,
+ data: dataForEvent
+ })
+}
- this.dispatch = buildMockDispatch.call(this)
- this.close = this[kClose]
+function toArrayBuffer (buffer) {
+ if (buffer.byteLength === buffer.buffer.byteLength) {
+ return buffer.buffer
}
+ return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)
+}
- get [Symbols.kConnected] () {
- return this[kConnected]
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455
+ * @see https://datatracker.ietf.org/doc/html/rfc2616
+ * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
+ * @param {string} protocol
+ */
+function isValidSubprotocol (protocol) {
+ // If present, this value indicates one
+ // or more comma-separated subprotocol the client wishes to speak,
+ // ordered by preference. The elements that comprise this value
+ // MUST be non-empty strings with characters in the range U+0021 to
+ // U+007E not including separator characters as defined in
+ // [RFC2616] and MUST all be unique strings.
+ if (protocol.length === 0) {
+ return false
}
- /**
- * Sets up the base interceptor for mocking replies from undici.
- */
- intercept (opts) {
- return new MockInterceptor(opts, this[kDispatches])
+ for (let i = 0; i < protocol.length; ++i) {
+ const code = protocol.charCodeAt(i)
+
+ if (
+ code < 0x21 || // CTL, contains SP (0x20) and HT (0x09)
+ code > 0x7E ||
+ code === 0x22 || // "
+ code === 0x28 || // (
+ code === 0x29 || // )
+ code === 0x2C || // ,
+ code === 0x2F || // /
+ code === 0x3A || // :
+ code === 0x3B || // ;
+ code === 0x3C || // <
+ code === 0x3D || // =
+ code === 0x3E || // >
+ code === 0x3F || // ?
+ code === 0x40 || // @
+ code === 0x5B || // [
+ code === 0x5C || // \
+ code === 0x5D || // ]
+ code === 0x7B || // {
+ code === 0x7D // }
+ ) {
+ return false
+ }
}
- async [kClose] () {
- await promisify(this[kOriginalClose])()
- this[kConnected] = 0
- this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ return true
+}
+
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
+ * @param {number} code
+ */
+function isValidStatusCode (code) {
+ if (code >= 1000 && code < 1015) {
+ return (
+ code !== 1004 && // reserved
+ code !== 1005 && // "MUST NOT be set as a status code"
+ code !== 1006 // "MUST NOT be set as a status code"
+ )
}
+
+ return code >= 3000 && code <= 4999
}
-module.exports = MockClient
+/**
+ * @param {import('./websocket').WebSocket} ws
+ * @param {string|undefined} reason
+ */
+function failWebsocketConnection (ws, reason) {
+ const { [kController]: controller, [kResponse]: response } = ws
+ controller.abort()
-/***/ }),
+ if (response?.socket && !response.socket.destroyed) {
+ response.socket.destroy()
+ }
-/***/ 888:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (reason) {
+ // TODO: process.nextTick
+ fireEvent('error', ws, (type, init) => new ErrorEvent(type, init), {
+ error: new Error(reason),
+ message: reason
+ })
+ }
+}
+
+/**
+ * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5
+ * @param {number} opcode
+ */
+function isControlFrame (opcode) {
+ return (
+ opcode === opcodes.CLOSE ||
+ opcode === opcodes.PING ||
+ opcode === opcodes.PONG
+ )
+}
-"use strict";
+function isContinuationFrame (opcode) {
+ return opcode === opcodes.CONTINUATION
+}
+function isTextBinaryFrame (opcode) {
+ return opcode === opcodes.TEXT || opcode === opcodes.BINARY
+}
-const { UndiciError } = __nccwpck_require__(8045)
+function isValidOpcode (opcode) {
+ return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode)
+}
-class MockNotMatchedError extends UndiciError {
- constructor (message) {
- super(message)
- Error.captureStackTrace(this, MockNotMatchedError)
- this.name = 'MockNotMatchedError'
- this.message = message || 'The request does not match any registered mock dispatches'
- this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
+/**
+ * Parses a Sec-WebSocket-Extensions header value.
+ * @param {string} extensions
+ * @returns {Map}
+ */
+// TODO(@Uzlopak, @KhafraDev): make compliant https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
+function parseExtensions (extensions) {
+ const position = { position: 0 }
+ const extensionList = new Map()
+
+ while (position.position < extensions.length) {
+ const pair = collectASequenceOfCodePointsFast(';', extensions, position)
+ const [name, value = ''] = pair.split('=')
+
+ extensionList.set(
+ removeHTTPWhitespace(name, true, false),
+ removeHTTPWhitespace(value, false, true)
+ )
+
+ position.position++
+ }
+
+ return extensionList
+}
+
+/**
+ * @see https://www.rfc-editor.org/rfc/rfc7692#section-7.1.2.2
+ * @description "client-max-window-bits = 1*DIGIT"
+ * @param {string} value
+ */
+function isValidClientWindowBits (value) {
+ // Must have at least one character
+ if (value.length === 0) {
+ return false
+ }
+
+ // Check all characters are ASCII digits
+ for (let i = 0; i < value.length; i++) {
+ const byte = value.charCodeAt(i)
+
+ if (byte < 0x30 || byte > 0x39) {
+ return false
+ }
}
+
+ // Check numeric range: zlib requires windowBits in range 8-15
+ const num = Number.parseInt(value, 10)
+ return num >= 8 && num <= 15
}
+// https://nodejs.org/api/intl.html#detecting-internationalization-support
+const hasIntl = typeof process.versions.icu === 'string'
+const fatalDecoder = hasIntl ? new TextDecoder('utf-8', { fatal: true }) : undefined
+
+/**
+ * Converts a Buffer to utf-8, even on platforms without icu.
+ * @param {Buffer} buffer
+ */
+const utf8Decode = hasIntl
+ ? fatalDecoder.decode.bind(fatalDecoder)
+ : function (buffer) {
+ if (isUtf8(buffer)) {
+ return buffer.toString('utf-8')
+ }
+ throw new TypeError('Invalid utf-8 received.')
+ }
+
module.exports = {
- MockNotMatchedError
+ isConnecting,
+ isEstablished,
+ isClosing,
+ isClosed,
+ fireEvent,
+ isValidSubprotocol,
+ isValidStatusCode,
+ failWebsocketConnection,
+ websocketMessageReceived,
+ utf8Decode,
+ isControlFrame,
+ isContinuationFrame,
+ isTextBinaryFrame,
+ isValidOpcode,
+ parseExtensions,
+ isValidClientWindowBits
}
/***/ }),
-/***/ 410:
+/***/ 3726:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
+const { webidl } = __nccwpck_require__(5893)
+const { URLSerializer } = __nccwpck_require__(1900)
+const { environmentSettingsObject } = __nccwpck_require__(3168)
+const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(736)
const {
- kDispatches,
- kDispatchKey,
- kDefaultHeaders,
- kDefaultTrailers,
- kContentLength,
- kMockDispatch
-} = __nccwpck_require__(4347)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
-const { buildURL } = __nccwpck_require__(3983)
+ kWebSocketURL,
+ kReadyState,
+ kController,
+ kBinaryType,
+ kResponse,
+ kSentClose,
+ kByteParser
+} = __nccwpck_require__(1216)
+const {
+ isConnecting,
+ isEstablished,
+ isClosing,
+ isValidSubprotocol,
+ fireEvent
+} = __nccwpck_require__(8625)
+const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(6897)
+const { ByteParser } = __nccwpck_require__(1652)
+const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3440)
+const { getGlobalDispatcher } = __nccwpck_require__(2581)
+const { types } = __nccwpck_require__(7975)
+const { ErrorEvent, CloseEvent } = __nccwpck_require__(5188)
+const { SendQueue } = __nccwpck_require__(3900)
-/**
- * Defines the scope API for an interceptor reply
- */
-class MockScope {
- constructor (mockDispatch) {
- this[kMockDispatch] = mockDispatch
+// https://websockets.spec.whatwg.org/#interface-definition
+class WebSocket extends EventTarget {
+ #events = {
+ open: null,
+ error: null,
+ close: null,
+ message: null
}
+ #bufferedAmount = 0
+ #protocol = ''
+ #extensions = ''
+
+ /** @type {SendQueue} */
+ #sendQueue
+
/**
- * Delay a reply by a set amount in ms.
+ * @param {string} url
+ * @param {string|string[]} protocols
*/
- delay (waitInMs) {
- if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
- throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
- }
+ constructor (url, protocols = []) {
+ super()
- this[kMockDispatch].delay = waitInMs
- return this
- }
+ webidl.util.markAsUncloneable(this)
- /**
- * For a defined reply, never mark as consumed.
- */
- persist () {
- this[kMockDispatch].persist = true
- return this
- }
+ const prefix = 'WebSocket constructor'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
- /**
- * Allow one to define a reply for a set amount of matching requests.
- */
- times (repeatTimes) {
- if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
- throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
- }
+ const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols, prefix, 'options')
- this[kMockDispatch].times = repeatTimes
- return this
- }
-}
+ url = webidl.converters.USVString(url, prefix, 'url')
+ protocols = options.protocols
-/**
- * Defines an interceptor for a Mock
- */
-class MockInterceptor {
- constructor (opts, mockDispatches) {
- if (typeof opts !== 'object') {
- throw new InvalidArgumentError('opts must be an object')
+ // 1. Let baseURL be this's relevant settings object's API base URL.
+ const baseURL = environmentSettingsObject.settingsObject.baseUrl
+
+ // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
+ let urlRecord
+
+ try {
+ urlRecord = new URL(url, baseURL)
+ } catch (e) {
+ // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
+ throw new DOMException(e, 'SyntaxError')
}
- if (typeof opts.path === 'undefined') {
- throw new InvalidArgumentError('opts.path must be defined')
+
+ // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
+ if (urlRecord.protocol === 'http:') {
+ urlRecord.protocol = 'ws:'
+ } else if (urlRecord.protocol === 'https:') {
+ // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
+ urlRecord.protocol = 'wss:'
}
- if (typeof opts.method === 'undefined') {
- opts.method = 'GET'
+
+ // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
+ if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
+ throw new DOMException(
+ `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
+ 'SyntaxError'
+ )
}
- // See https://github.com/nodejs/undici/issues/1245
- // As per RFC 3986, clients are not supposed to send URI
- // fragments to servers when they retrieve a document,
- if (typeof opts.path === 'string') {
- if (opts.query) {
- opts.path = buildURL(opts.path, opts.query)
- } else {
- // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
- const parsedURL = new URL(opts.path, 'data://')
- opts.path = parsedURL.pathname + parsedURL.search
- }
+
+ // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
+ // DOMException.
+ if (urlRecord.hash || urlRecord.href.endsWith('#')) {
+ throw new DOMException('Got fragment', 'SyntaxError')
}
- if (typeof opts.method === 'string') {
- opts.method = opts.method.toUpperCase()
+
+ // 8. If protocols is a string, set protocols to a sequence consisting
+ // of just that string.
+ if (typeof protocols === 'string') {
+ protocols = [protocols]
}
- this[kDispatchKey] = buildKey(opts)
- this[kDispatches] = mockDispatches
- this[kDefaultHeaders] = {}
- this[kDefaultTrailers] = {}
- this[kContentLength] = false
- }
+ // 9. If any of the values in protocols occur more than once or otherwise
+ // fail to match the requirements for elements that comprise the value
+ // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
+ // protocol, then throw a "SyntaxError" DOMException.
+ if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
+ throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ }
- createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
- const responseData = getResponseData(data)
- const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
- const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
- const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
+ if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
+ throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ }
- return { statusCode, data, headers, trailers }
- }
+ // 10. Set this's url to urlRecord.
+ this[kWebSocketURL] = new URL(urlRecord.href)
- validateReplyParameters (statusCode, data, responseOptions) {
- if (typeof statusCode === 'undefined') {
- throw new InvalidArgumentError('statusCode must be defined')
- }
- if (typeof data === 'undefined') {
- throw new InvalidArgumentError('data must be defined')
- }
- if (typeof responseOptions !== 'object') {
- throw new InvalidArgumentError('responseOptions must be an object')
- }
- }
+ // 11. Let client be this's relevant settings object.
+ const client = environmentSettingsObject.settingsObject
- /**
- * Mock an undici request with a defined reply.
- */
- reply (replyData) {
- // Values of reply aren't available right now as they
- // can only be available when the reply callback is invoked.
- if (typeof replyData === 'function') {
- // We'll first wrap the provided callback in another function,
- // this function will properly resolve the data from the callback
- // when invoked.
- const wrappedDefaultsCallback = (opts) => {
- // Our reply options callback contains the parameter for statusCode, data and options.
- const resolvedData = replyData(opts)
+ // 12. Run this step in parallel:
- // Check if it is in the right format
- if (typeof resolvedData !== 'object') {
- throw new InvalidArgumentError('reply options callback must return an object')
- }
+ // 1. Establish a WebSocket connection given urlRecord, protocols,
+ // and client.
+ this[kController] = establishWebSocketConnection(
+ urlRecord,
+ protocols,
+ client,
+ this,
+ (response, extensions) => this.#onConnectionEstablished(response, extensions),
+ options
+ )
- const { statusCode, data = '', responseOptions = {} } = resolvedData
- this.validateReplyParameters(statusCode, data, responseOptions)
- // Since the values can be obtained immediately we return them
- // from this higher order function that will be resolved later.
- return {
- ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
- }
- }
+ // Each WebSocket object has an associated ready state, which is a
+ // number representing the state of the connection. Initially it must
+ // be CONNECTING (0).
+ this[kReadyState] = WebSocket.CONNECTING
- // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
- return new MockScope(newMockDispatch)
- }
+ this[kSentClose] = sentCloseFrameState.NOT_SENT
- // We can have either one or three parameters, if we get here,
- // we should have 1-3 parameters. So we spread the arguments of
- // this function to obtain the parameters, since replyData will always
- // just be the statusCode.
- const [statusCode, data = '', responseOptions = {}] = [...arguments]
- this.validateReplyParameters(statusCode, data, responseOptions)
+ // The extensions attribute must initially return the empty string.
- // Send in-already provided data like usual
- const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
- return new MockScope(newMockDispatch)
+ // The protocol attribute must initially return the empty string.
+
+ // Each WebSocket object has an associated binary type, which is a
+ // BinaryType. Initially it must be "blob".
+ this[kBinaryType] = 'blob'
}
/**
- * Mock an undici request with a defined error.
+ * @see https://websockets.spec.whatwg.org/#dom-websocket-close
+ * @param {number|undefined} code
+ * @param {string|undefined} reason
*/
- replyWithError (error) {
- if (typeof error === 'undefined') {
- throw new InvalidArgumentError('error must be defined')
+ close (code = undefined, reason = undefined) {
+ webidl.brandCheck(this, WebSocket)
+
+ const prefix = 'WebSocket.close'
+
+ if (code !== undefined) {
+ code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })
}
- const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
- return new MockScope(newMockDispatch)
- }
+ if (reason !== undefined) {
+ reason = webidl.converters.USVString(reason, prefix, 'reason')
+ }
- /**
- * Set default reply headers on the interceptor for subsequent replies
- */
- defaultReplyHeaders (headers) {
- if (typeof headers === 'undefined') {
- throw new InvalidArgumentError('headers must be defined')
+ // 1. If code is present, but is neither an integer equal to 1000 nor an
+ // integer in the range 3000 to 4999, inclusive, throw an
+ // "InvalidAccessError" DOMException.
+ if (code !== undefined) {
+ if (code !== 1000 && (code < 3000 || code > 4999)) {
+ throw new DOMException('invalid code', 'InvalidAccessError')
+ }
}
- this[kDefaultHeaders] = headers
- return this
- }
+ let reasonByteLength = 0
- /**
- * Set default reply trailers on the interceptor for subsequent replies
- */
- defaultReplyTrailers (trailers) {
- if (typeof trailers === 'undefined') {
- throw new InvalidArgumentError('trailers must be defined')
+ // 2. If reason is present, then run these substeps:
+ if (reason !== undefined) {
+ // 1. Let reasonBytes be the result of encoding reason.
+ // 2. If reasonBytes is longer than 123 bytes, then throw a
+ // "SyntaxError" DOMException.
+ reasonByteLength = Buffer.byteLength(reason)
+
+ if (reasonByteLength > 123) {
+ throw new DOMException(
+ `Reason must be less than 123 bytes; received ${reasonByteLength}`,
+ 'SyntaxError'
+ )
+ }
}
- this[kDefaultTrailers] = trailers
- return this
+ // 3. Run the first matching steps from the following list:
+ closeWebSocketConnection(this, code, reason, reasonByteLength)
}
/**
- * Set reply content length header for replies on the interceptor
+ * @see https://websockets.spec.whatwg.org/#dom-websocket-send
+ * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
*/
- replyContentLength () {
- this[kContentLength] = true
- return this
- }
-}
+ send (data) {
+ webidl.brandCheck(this, WebSocket)
-module.exports.MockInterceptor = MockInterceptor
-module.exports.MockScope = MockScope
+ const prefix = 'WebSocket.send'
+ webidl.argumentLengthCheck(arguments, 1, prefix)
+ data = webidl.converters.WebSocketSendData(data, prefix, 'data')
-/***/ }),
+ // 1. If this's ready state is CONNECTING, then throw an
+ // "InvalidStateError" DOMException.
+ if (isConnecting(this)) {
+ throw new DOMException('Sent before connected.', 'InvalidStateError')
+ }
-/***/ 6193:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // 2. Run the appropriate set of steps from the following list:
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
+
+ if (!isEstablished(this) || isClosing(this)) {
+ return
+ }
+
+ // If data is a string
+ if (typeof data === 'string') {
+ // If the WebSocket connection is established and the WebSocket
+ // closing handshake has not yet started, then the user agent
+ // must send a WebSocket Message comprised of the data argument
+ // using a text frame opcode; if the data cannot be sent, e.g.
+ // because it would need to be buffered but the buffer is full,
+ // the user agent must flag the WebSocket as full and then close
+ // the WebSocket connection. Any invocation of this method with a
+ // string argument that does not throw an exception must increase
+ // the bufferedAmount attribute by the number of bytes needed to
+ // express the argument as UTF-8.
-"use strict";
+ const length = Buffer.byteLength(data)
+ this.#bufferedAmount += length
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= length
+ }, sendHints.string)
+ } else if (types.isArrayBuffer(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need
+ // to be buffered but the buffer is full, the user agent must flag
+ // the WebSocket as full and then close the WebSocket connection.
+ // The data to be sent is the data stored in the buffer described
+ // by the ArrayBuffer object. Any invocation of this method with an
+ // ArrayBuffer argument that does not throw an exception must
+ // increase the bufferedAmount attribute by the length of the
+ // ArrayBuffer in bytes.
-const { promisify } = __nccwpck_require__(3837)
-const Pool = __nccwpck_require__(4634)
-const { buildMockDispatch } = __nccwpck_require__(9323)
-const {
- kDispatches,
- kMockAgent,
- kClose,
- kOriginalClose,
- kOrigin,
- kOriginalDispatch,
- kConnected
-} = __nccwpck_require__(4347)
-const { MockInterceptor } = __nccwpck_require__(410)
-const Symbols = __nccwpck_require__(2785)
-const { InvalidArgumentError } = __nccwpck_require__(8045)
+ this.#bufferedAmount += data.byteLength
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.byteLength
+ }, sendHints.arrayBuffer)
+ } else if (ArrayBuffer.isView(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need to
+ // be buffered but the buffer is full, the user agent must flag the
+ // WebSocket as full and then close the WebSocket connection. The
+ // data to be sent is the data stored in the section of the buffer
+ // described by the ArrayBuffer object that data references. Any
+ // invocation of this method with this kind of argument that does
+ // not throw an exception must increase the bufferedAmount attribute
+ // by the length of data’s buffer in bytes.
-/**
- * MockPool provides an API that extends the Pool to influence the mockDispatches.
- */
-class MockPool extends Pool {
- constructor (origin, opts) {
- super(origin, opts)
+ this.#bufferedAmount += data.byteLength
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.byteLength
+ }, sendHints.typedArray)
+ } else if (isBlobLike(data)) {
+ // If the WebSocket connection is established, and the WebSocket
+ // closing handshake has not yet started, then the user agent must
+ // send a WebSocket Message comprised of data using a binary frame
+ // opcode; if the data cannot be sent, e.g. because it would need to
+ // be buffered but the buffer is full, the user agent must flag the
+ // WebSocket as full and then close the WebSocket connection. The data
+ // to be sent is the raw data represented by the Blob object. Any
+ // invocation of this method with a Blob argument that does not throw
+ // an exception must increase the bufferedAmount attribute by the size
+ // of the Blob object’s raw data, in bytes.
- if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
- throw new InvalidArgumentError('Argument opts.agent must implement Agent')
+ this.#bufferedAmount += data.size
+ this.#sendQueue.add(data, () => {
+ this.#bufferedAmount -= data.size
+ }, sendHints.blob)
}
+ }
- this[kMockAgent] = opts.agent
- this[kOrigin] = origin
- this[kDispatches] = []
- this[kConnected] = 1
- this[kOriginalDispatch] = this.dispatch
- this[kOriginalClose] = this.close.bind(this)
+ get readyState () {
+ webidl.brandCheck(this, WebSocket)
- this.dispatch = buildMockDispatch.call(this)
- this.close = this[kClose]
+ // The readyState getter steps are to return this's ready state.
+ return this[kReadyState]
}
- get [Symbols.kConnected] () {
- return this[kConnected]
- }
+ get bufferedAmount () {
+ webidl.brandCheck(this, WebSocket)
- /**
- * Sets up the base interceptor for mocking replies from undici.
- */
- intercept (opts) {
- return new MockInterceptor(opts, this[kDispatches])
+ return this.#bufferedAmount
}
- async [kClose] () {
- await promisify(this[kOriginalClose])()
- this[kConnected] = 0
- this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
+ get url () {
+ webidl.brandCheck(this, WebSocket)
+
+ // The url getter steps are to return this's url, serialized.
+ return URLSerializer(this[kWebSocketURL])
}
-}
-module.exports = MockPool
+ get extensions () {
+ webidl.brandCheck(this, WebSocket)
+ return this.#extensions
+ }
-/***/ }),
+ get protocol () {
+ webidl.brandCheck(this, WebSocket)
-/***/ 4347:
-/***/ ((module) => {
+ return this.#protocol
+ }
-"use strict";
+ get onopen () {
+ webidl.brandCheck(this, WebSocket)
+ return this.#events.open
+ }
-module.exports = {
- kAgent: Symbol('agent'),
- kOptions: Symbol('options'),
- kFactory: Symbol('factory'),
- kDispatches: Symbol('dispatches'),
- kDispatchKey: Symbol('dispatch key'),
- kDefaultHeaders: Symbol('default headers'),
- kDefaultTrailers: Symbol('default trailers'),
- kContentLength: Symbol('content length'),
- kMockAgent: Symbol('mock agent'),
- kMockAgentSet: Symbol('mock agent set'),
- kMockAgentGet: Symbol('mock agent get'),
- kMockDispatch: Symbol('mock dispatch'),
- kClose: Symbol('close'),
- kOriginalClose: Symbol('original agent close'),
- kOrigin: Symbol('origin'),
- kIsMockActive: Symbol('is mock active'),
- kNetConnect: Symbol('net connect'),
- kGetNetConnect: Symbol('get net connect'),
- kConnected: Symbol('connected')
-}
+ set onopen (fn) {
+ webidl.brandCheck(this, WebSocket)
+ if (this.#events.open) {
+ this.removeEventListener('open', this.#events.open)
+ }
-/***/ }),
+ if (typeof fn === 'function') {
+ this.#events.open = fn
+ this.addEventListener('open', fn)
+ } else {
+ this.#events.open = null
+ }
+ }
-/***/ 9323:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ get onerror () {
+ webidl.brandCheck(this, WebSocket)
-"use strict";
+ return this.#events.error
+ }
+ set onerror (fn) {
+ webidl.brandCheck(this, WebSocket)
-const { MockNotMatchedError } = __nccwpck_require__(888)
-const {
- kDispatches,
- kMockAgent,
- kOriginalDispatch,
- kOrigin,
- kGetNetConnect
-} = __nccwpck_require__(4347)
-const { buildURL, nop } = __nccwpck_require__(3983)
-const { STATUS_CODES } = __nccwpck_require__(3685)
-const {
- types: {
- isPromise
- }
-} = __nccwpck_require__(3837)
+ if (this.#events.error) {
+ this.removeEventListener('error', this.#events.error)
+ }
-function matchValue (match, value) {
- if (typeof match === 'string') {
- return match === value
- }
- if (match instanceof RegExp) {
- return match.test(value)
+ if (typeof fn === 'function') {
+ this.#events.error = fn
+ this.addEventListener('error', fn)
+ } else {
+ this.#events.error = null
+ }
}
- if (typeof match === 'function') {
- return match(value) === true
+
+ get onclose () {
+ webidl.brandCheck(this, WebSocket)
+
+ return this.#events.close
}
- return false
-}
-function lowerCaseEntries (headers) {
- return Object.fromEntries(
- Object.entries(headers).map(([headerName, headerValue]) => {
- return [headerName.toLocaleLowerCase(), headerValue]
- })
- )
-}
+ set onclose (fn) {
+ webidl.brandCheck(this, WebSocket)
-/**
- * @param {import('../../index').Headers|string[]|Record} headers
- * @param {string} key
- */
-function getHeaderByName (headers, key) {
- if (Array.isArray(headers)) {
- for (let i = 0; i < headers.length; i += 2) {
- if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
- return headers[i + 1]
- }
+ if (this.#events.close) {
+ this.removeEventListener('close', this.#events.close)
}
- return undefined
- } else if (typeof headers.get === 'function') {
- return headers.get(key)
- } else {
- return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
+ if (typeof fn === 'function') {
+ this.#events.close = fn
+ this.addEventListener('close', fn)
+ } else {
+ this.#events.close = null
+ }
}
-}
-/** @param {string[]} headers */
-function buildHeadersFromArray (headers) { // fetch HeadersList
- const clone = headers.slice()
- const entries = []
- for (let index = 0; index < clone.length; index += 2) {
- entries.push([clone[index], clone[index + 1]])
+ get onmessage () {
+ webidl.brandCheck(this, WebSocket)
+
+ return this.#events.message
}
- return Object.fromEntries(entries)
-}
-function matchHeaders (mockDispatch, headers) {
- if (typeof mockDispatch.headers === 'function') {
- if (Array.isArray(headers)) { // fetch HeadersList
- headers = buildHeadersFromArray(headers)
+ set onmessage (fn) {
+ webidl.brandCheck(this, WebSocket)
+
+ if (this.#events.message) {
+ this.removeEventListener('message', this.#events.message)
+ }
+
+ if (typeof fn === 'function') {
+ this.#events.message = fn
+ this.addEventListener('message', fn)
+ } else {
+ this.#events.message = null
}
- return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
- }
- if (typeof mockDispatch.headers === 'undefined') {
- return true
}
- if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
- return false
+
+ get binaryType () {
+ webidl.brandCheck(this, WebSocket)
+
+ return this[kBinaryType]
}
- for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
- const headerValue = getHeaderByName(headers, matchHeaderName)
+ set binaryType (type) {
+ webidl.brandCheck(this, WebSocket)
- if (!matchValue(matchHeaderValue, headerValue)) {
- return false
+ if (type !== 'blob' && type !== 'arraybuffer') {
+ this[kBinaryType] = 'blob'
+ } else {
+ this[kBinaryType] = type
}
}
- return true
-}
-function safeUrl (path) {
- if (typeof path !== 'string') {
- return path
- }
+ /**
+ * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
+ */
+ #onConnectionEstablished (response, parsedExtensions) {
+ // processResponse is called when the "response's header list has been received and initialized."
+ // once this happens, the connection is open
+ this[kResponse] = response
- const pathSegments = path.split('?')
+ const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions
+ const maxFragments = webSocketOptions?.maxFragments
+ const maxPayloadSize = webSocketOptions?.maxPayloadSize
- if (pathSegments.length !== 2) {
- return path
- }
+ const parser = new ByteParser(this, parsedExtensions, {
+ maxFragments,
+ maxPayloadSize
+ })
+ parser.on('drain', onParserDrain)
+ parser.on('error', onParserError.bind(this))
- const qp = new URLSearchParams(pathSegments.pop())
- qp.sort()
- return [...pathSegments, qp.toString()].join('?')
-}
+ response.socket.ws = this
+ this[kByteParser] = parser
-function matchKey (mockDispatch, { path, method, body, headers }) {
- const pathMatch = matchValue(mockDispatch.path, path)
- const methodMatch = matchValue(mockDispatch.method, method)
- const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
- const headersMatch = matchHeaders(mockDispatch, headers)
- return pathMatch && methodMatch && bodyMatch && headersMatch
-}
+ this.#sendQueue = new SendQueue(response.socket)
-function getResponseData (data) {
- if (Buffer.isBuffer(data)) {
- return data
- } else if (typeof data === 'object') {
- return JSON.stringify(data)
- } else {
- return data.toString()
+ // 1. Change the ready state to OPEN (1).
+ this[kReadyState] = states.OPEN
+
+ // 2. Change the extensions attribute’s value to the extensions in use, if
+ // it is not the null value.
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
+ const extensions = response.headersList.get('sec-websocket-extensions')
+
+ if (extensions !== null) {
+ this.#extensions = extensions
+ }
+
+ // 3. Change the protocol attribute’s value to the subprotocol in use, if
+ // it is not the null value.
+ // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
+ const protocol = response.headersList.get('sec-websocket-protocol')
+
+ if (protocol !== null) {
+ this.#protocol = protocol
+ }
+
+ // 4. Fire an event named open at the WebSocket object.
+ fireEvent('open', this)
}
}
-function getMockDispatch (mockDispatches, key) {
- const basePath = key.query ? buildURL(key.path, key.query) : key.path
- const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
+// https://websockets.spec.whatwg.org/#dom-websocket-connecting
+WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
+// https://websockets.spec.whatwg.org/#dom-websocket-open
+WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
+// https://websockets.spec.whatwg.org/#dom-websocket-closing
+WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
+// https://websockets.spec.whatwg.org/#dom-websocket-closed
+WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
- // Match path
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
+Object.defineProperties(WebSocket.prototype, {
+ CONNECTING: staticPropertyDescriptors,
+ OPEN: staticPropertyDescriptors,
+ CLOSING: staticPropertyDescriptors,
+ CLOSED: staticPropertyDescriptors,
+ url: kEnumerableProperty,
+ readyState: kEnumerableProperty,
+ bufferedAmount: kEnumerableProperty,
+ onopen: kEnumerableProperty,
+ onerror: kEnumerableProperty,
+ onclose: kEnumerableProperty,
+ close: kEnumerableProperty,
+ onmessage: kEnumerableProperty,
+ binaryType: kEnumerableProperty,
+ send: kEnumerableProperty,
+ extensions: kEnumerableProperty,
+ protocol: kEnumerableProperty,
+ [Symbol.toStringTag]: {
+ value: 'WebSocket',
+ writable: false,
+ enumerable: false,
+ configurable: true
}
+})
- // Match method
- matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
+Object.defineProperties(WebSocket, {
+ CONNECTING: staticPropertyDescriptors,
+ OPEN: staticPropertyDescriptors,
+ CLOSING: staticPropertyDescriptors,
+ CLOSED: staticPropertyDescriptors
+})
+
+webidl.converters['sequence'] = webidl.sequenceConverter(
+ webidl.converters.DOMString
+)
+
+webidl.converters['DOMString or sequence'] = function (V, prefix, argument) {
+ if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
+ return webidl.converters['sequence'](V)
}
- // Match body
- matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
+ return webidl.converters.DOMString(V, prefix, argument)
+}
+
+// This implements the proposal made in https://github.com/whatwg/websockets/issues/42
+webidl.converters.WebSocketInit = webidl.dictionaryConverter([
+ {
+ key: 'protocols',
+ converter: webidl.converters['DOMString or sequence'],
+ defaultValue: () => new Array(0)
+ },
+ {
+ key: 'dispatcher',
+ converter: webidl.converters.any,
+ defaultValue: () => getGlobalDispatcher()
+ },
+ {
+ key: 'headers',
+ converter: webidl.nullableConverter(webidl.converters.HeadersInit)
}
+])
- // Match headers
- matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
- if (matchedMockDispatches.length === 0) {
- throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
+webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {
+ if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
+ return webidl.converters.WebSocketInit(V)
}
- return matchedMockDispatches[0]
+ return { protocols: webidl.converters['DOMString or sequence'](V) }
}
-function addMockDispatch (mockDispatches, key, data) {
- const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
- const replyData = typeof data === 'function' ? { callback: data } : { ...data }
- const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
- mockDispatches.push(newMockDispatch)
- return newMockDispatch
-}
+webidl.converters.WebSocketSendData = function (V) {
+ if (webidl.util.Type(V) === 'Object') {
+ if (isBlobLike(V)) {
+ return webidl.converters.Blob(V, { strict: false })
+ }
-function deleteMockDispatch (mockDispatches, key) {
- const index = mockDispatches.findIndex(dispatch => {
- if (!dispatch.consumed) {
- return false
+ if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) {
+ return webidl.converters.BufferSource(V)
}
- return matchKey(dispatch, key)
- })
- if (index !== -1) {
- mockDispatches.splice(index, 1)
}
-}
-function buildKey (opts) {
- const { path, method, body, headers, query } = opts
- return {
- path,
- method,
- body,
- headers,
- query
- }
+ return webidl.converters.USVString(V)
}
-function generateKeyValues (data) {
- return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
- ...keyValuePairs,
- Buffer.from(`${key}`),
- Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
- ], [])
+function onParserDrain () {
+ this.ws[kResponse].socket.resume()
}
-/**
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
- * @param {number} statusCode
- */
-function getStatusText (statusCode) {
- return STATUS_CODES[statusCode] || 'unknown'
-}
+function onParserError (err) {
+ let message
+ let code
-async function getResponse (body) {
- const buffers = []
- for await (const data of body) {
- buffers.push(data)
+ if (err instanceof CloseEvent) {
+ message = err.reason
+ code = err.code
+ } else {
+ message = err.message
}
- return Buffer.concat(buffers).toString('utf8')
-}
-/**
- * Mock dispatch function used to simulate undici dispatches
- */
-function mockDispatch (opts, handler) {
- // Get mock dispatch from built key
- const key = buildKey(opts)
- const mockDispatch = getMockDispatch(this[kDispatches], key)
+ fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))
- mockDispatch.timesInvoked++
+ closeWebSocketConnection(this, code)
+}
- // Here's where we resolve a callback if a callback is present for the dispatch data.
- if (mockDispatch.data.callback) {
- mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
- }
+module.exports = {
+ WebSocket
+}
- // Parse mockDispatch data
- const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
- const { timesInvoked, times } = mockDispatch
- // If it's used up and not persistent, mark as consumed
- mockDispatch.consumed = !persist && timesInvoked >= times
- mockDispatch.pending = timesInvoked < times
+/***/ }),
- // If specified, trigger dispatch error
- if (error !== null) {
- deleteMockDispatch(this[kDispatches], key)
- handler.onError(error)
- return true
- }
+/***/ 2613:
+/***/ ((module) => {
- // Handle the request with a delay if necessary
- if (typeof delay === 'number' && delay > 0) {
- setTimeout(() => {
- handleReply(this[kDispatches])
- }, delay)
- } else {
- handleReply(this[kDispatches])
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert");
- function handleReply (mockDispatches, _data = data) {
- // fetch's HeadersList is a 1D string array
- const optsHeaders = Array.isArray(opts.headers)
- ? buildHeadersFromArray(opts.headers)
- : opts.headers
- const body = typeof _data === 'function'
- ? _data({ ...opts, headers: optsHeaders })
- : _data
+/***/ }),
- // util.types.isPromise is likely needed for jest.
- if (isPromise(body)) {
- // If handleReply is asynchronous, throwing an error
- // in the callback will reject the promise, rather than
- // synchronously throw the error, which breaks some tests.
- // Rather, we wait for the callback to resolve if it is a
- // promise, and then re-run handleReply with the new body.
- body.then((newData) => handleReply(mockDispatches, newData))
- return
- }
+/***/ 6982:
+/***/ ((module) => {
- const responseData = getResponseData(body)
- const responseHeaders = generateKeyValues(headers)
- const responseTrailers = generateKeyValues(trailers)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto");
- handler.abort = nop
- handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
- handler.onData(Buffer.from(responseData))
- handler.onComplete(responseTrailers)
- deleteMockDispatch(mockDispatches, key)
- }
+/***/ }),
- function resume () {}
+/***/ 4434:
+/***/ ((module) => {
- return true
-}
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events");
-function buildMockDispatch () {
- const agent = this[kMockAgent]
- const origin = this[kOrigin]
- const originalDispatch = this[kOriginalDispatch]
+/***/ }),
- return function dispatch (opts, handler) {
- if (agent.isMockActive) {
- try {
- mockDispatch.call(this, opts, handler)
- } catch (error) {
- if (error instanceof MockNotMatchedError) {
- const netConnect = agent[kGetNetConnect]()
- if (netConnect === false) {
- throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
- }
- if (checkNetConnect(netConnect, origin)) {
- originalDispatch.call(this, opts, handler)
- } else {
- throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
- }
- } else {
- throw error
- }
- }
- } else {
- originalDispatch.call(this, opts, handler)
- }
- }
-}
+/***/ 9896:
+/***/ ((module) => {
-function checkNetConnect (netConnect, origin) {
- const url = new URL(origin)
- if (netConnect === true) {
- return true
- } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
- return true
- }
- return false
-}
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs");
-function buildMockOptions (opts) {
- if (opts) {
- const { agent, ...mockOptions } = opts
- return mockOptions
- }
-}
+/***/ }),
-module.exports = {
- getResponseData,
- getMockDispatch,
- addMockDispatch,
- deleteMockDispatch,
- buildKey,
- generateKeyValues,
- matchValue,
- getResponse,
- getStatusText,
- mockDispatch,
- buildMockDispatch,
- checkNetConnect,
- buildMockOptions,
- getHeaderByName
-}
+/***/ 8611:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http");
/***/ }),
-/***/ 6823:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 5675:
+/***/ ((module) => {
-"use strict";
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2");
+/***/ }),
-const { Transform } = __nccwpck_require__(2781)
-const { Console } = __nccwpck_require__(6206)
+/***/ 5692:
+/***/ ((module) => {
-/**
- * Gets the output of `console.table(…)` as a string.
- */
-module.exports = class PendingInterceptorsFormatter {
- constructor ({ disableColors } = {}) {
- this.transform = new Transform({
- transform (chunk, _enc, cb) {
- cb(null, chunk)
- }
- })
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https");
- this.logger = new Console({
- stdout: this.transform,
- inspectOptions: {
- colors: !disableColors && !process.env.CI
- }
- })
- }
+/***/ }),
- format (pendingInterceptors) {
- const withPrettyHeaders = pendingInterceptors.map(
- ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
- Method: method,
- Origin: origin,
- Path: path,
- 'Status code': statusCode,
- Persistent: persist ? '✅' : '❌',
- Invocations: timesInvoked,
- Remaining: persist ? Infinity : times - timesInvoked
- }))
+/***/ 9278:
+/***/ ((module) => {
- this.logger.table(withPrettyHeaders)
- return this.transform.read().toString()
- }
-}
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net");
+
+/***/ }),
+
+/***/ 4589:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:assert");
/***/ }),
-/***/ 8891:
+/***/ 6698:
/***/ ((module) => {
-"use strict";
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:async_hooks");
+/***/ }),
-const singulars = {
- pronoun: 'it',
- is: 'is',
- was: 'was',
- this: 'this'
-}
+/***/ 4573:
+/***/ ((module) => {
-const plurals = {
- pronoun: 'they',
- is: 'are',
- was: 'were',
- this: 'these'
-}
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer");
-module.exports = class Pluralizer {
- constructor (singular, plural) {
- this.singular = singular
- this.plural = plural
- }
+/***/ }),
- pluralize (count) {
- const one = count === 1
- const keys = one ? singulars : plurals
- const noun = one ? this.singular : this.plural
- return { ...keys, count, noun }
- }
-}
+/***/ 7540:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:console");
/***/ }),
-/***/ 8266:
+/***/ 7598:
/***/ ((module) => {
-"use strict";
-/* eslint-disable */
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
+/***/ }),
+/***/ 3053:
+/***/ ((module) => {
-// Extracted from node/lib/internal/fixed_queue.js
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:diagnostics_channel");
-// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
-const kSize = 2048;
-const kMask = kSize - 1;
+/***/ }),
-// The FixedQueue is implemented as a singly-linked list of fixed-size
-// circular buffers. It looks something like this:
-//
-// head tail
-// | |
-// v v
-// +-----------+ <-----\ +-----------+ <------\ +-----------+
-// | [null] | \----- | next | \------- | next |
-// +-----------+ +-----------+ +-----------+
-// | item | <-- bottom | item | <-- bottom | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | | [empty] |
-// | item | | item | bottom --> | item |
-// | item | | item | | item |
-// | ... | | ... | | ... |
-// | item | | item | | item |
-// | item | | item | | item |
-// | [empty] | <-- top | item | | item |
-// | [empty] | | item | | item |
-// | [empty] | | [empty] | <-- top top --> | [empty] |
-// +-----------+ +-----------+ +-----------+
-//
-// Or, if there is only one circular buffer, it looks something
-// like either of these:
-//
-// head tail head tail
-// | | | |
-// v v v v
-// +-----------+ +-----------+
-// | [null] | | [null] |
-// +-----------+ +-----------+
-// | [empty] | | item |
-// | [empty] | | item |
-// | item | <-- bottom top --> | [empty] |
-// | item | | [empty] |
-// | [empty] | <-- top bottom --> | item |
-// | [empty] | | item |
-// +-----------+ +-----------+
-//
-// Adding a value means moving `top` forward by one, removing means
-// moving `bottom` forward by one. After reaching the end, the queue
-// wraps around.
-//
-// When `top === bottom` the current queue is empty and when
-// `top + 1 === bottom` it's full. This wastes a single space of storage
-// but allows much quicker checks.
+/***/ 610:
+/***/ ((module) => {
-class FixedCircularBuffer {
- constructor() {
- this.bottom = 0;
- this.top = 0;
- this.list = new Array(kSize);
- this.next = null;
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns");
- isEmpty() {
- return this.top === this.bottom;
- }
+/***/ }),
- isFull() {
- return ((this.top + 1) & kMask) === this.bottom;
- }
+/***/ 8474:
+/***/ ((module) => {
- push(data) {
- this.list[this.top] = data;
- this.top = (this.top + 1) & kMask;
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events");
- shift() {
- const nextItem = this.list[this.bottom];
- if (nextItem === undefined)
- return null;
- this.list[this.bottom] = undefined;
- this.bottom = (this.bottom + 1) & kMask;
- return nextItem;
- }
-}
+/***/ }),
-module.exports = class FixedQueue {
- constructor() {
- this.head = this.tail = new FixedCircularBuffer();
- }
+/***/ 3024:
+/***/ ((module) => {
- isEmpty() {
- return this.head.isEmpty();
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
- push(data) {
- if (this.head.isFull()) {
- // Head is full: Creates a new queue, sets the old queue's `.next` to it,
- // and sets it as the new main queue.
- this.head = this.head.next = new FixedCircularBuffer();
- }
- this.head.push(data);
- }
+/***/ }),
- shift() {
- const tail = this.tail;
- const next = tail.shift();
- if (tail.isEmpty() && tail.next !== null) {
- // If there is another queue, it forms the new tail.
- this.tail = tail.next;
- }
- return next;
- }
-};
+/***/ 7067:
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http");
+
+/***/ }),
+/***/ 2467:
+/***/ ((module) => {
-/***/ }),
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:http2");
-/***/ 3198:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ }),
-"use strict";
+/***/ 7030:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net");
-const DispatcherBase = __nccwpck_require__(4839)
-const FixedQueue = __nccwpck_require__(8266)
-const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
-const PoolStats = __nccwpck_require__(9689)
+/***/ }),
-const kClients = Symbol('clients')
-const kNeedDrain = Symbol('needDrain')
-const kQueue = Symbol('queue')
-const kClosedResolve = Symbol('closed resolve')
-const kOnDrain = Symbol('onDrain')
-const kOnConnect = Symbol('onConnect')
-const kOnDisconnect = Symbol('onDisconnect')
-const kOnConnectionError = Symbol('onConnectionError')
-const kGetDispatcher = Symbol('get dispatcher')
-const kAddClient = Symbol('add client')
-const kRemoveClient = Symbol('remove client')
-const kStats = Symbol('stats')
+/***/ 8161:
+/***/ ((module) => {
-class PoolBase extends DispatcherBase {
- constructor () {
- super()
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
- this[kQueue] = new FixedQueue()
- this[kClients] = []
- this[kQueued] = 0
+/***/ }),
- const pool = this
+/***/ 6760:
+/***/ ((module) => {
- this[kOnDrain] = function onDrain (origin, targets) {
- const queue = pool[kQueue]
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
- let needDrain = false
+/***/ }),
- while (!needDrain) {
- const item = queue.shift()
- if (!item) {
- break
- }
- pool[kQueued]--
- needDrain = !this.dispatch(item.opts, item.handler)
- }
+/***/ 643:
+/***/ ((module) => {
- this[kNeedDrain] = needDrain
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:perf_hooks");
- if (!this[kNeedDrain] && pool[kNeedDrain]) {
- pool[kNeedDrain] = false
- pool.emit('drain', origin, [pool, ...targets])
- }
+/***/ }),
- if (pool[kClosedResolve] && queue.isEmpty()) {
- Promise
- .all(pool[kClients].map(c => c.close()))
- .then(pool[kClosedResolve])
- }
- }
+/***/ 1792:
+/***/ ((module) => {
- this[kOnConnect] = (origin, targets) => {
- pool.emit('connect', origin, [pool, ...targets])
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:querystring");
- this[kOnDisconnect] = (origin, targets, err) => {
- pool.emit('disconnect', origin, [pool, ...targets], err)
- }
+/***/ }),
- this[kOnConnectionError] = (origin, targets, err) => {
- pool.emit('connectionError', origin, [pool, ...targets], err)
- }
+/***/ 7075:
+/***/ ((module) => {
- this[kStats] = new PoolStats(this)
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream");
- get [kBusy] () {
- return this[kNeedDrain]
- }
+/***/ }),
- get [kConnected] () {
- return this[kClients].filter(client => client[kConnected]).length
- }
+/***/ 1692:
+/***/ ((module) => {
- get [kFree] () {
- return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls");
- get [kPending] () {
- let ret = this[kQueued]
- for (const { [kPending]: pending } of this[kClients]) {
- ret += pending
- }
- return ret
- }
+/***/ }),
- get [kRunning] () {
- let ret = 0
- for (const { [kRunning]: running } of this[kClients]) {
- ret += running
- }
- return ret
- }
+/***/ 3136:
+/***/ ((module) => {
- get [kSize] () {
- let ret = this[kQueued]
- for (const { [kSize]: size } of this[kClients]) {
- ret += size
- }
- return ret
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url");
- get stats () {
- return this[kStats]
- }
+/***/ }),
- async [kClose] () {
- if (this[kQueue].isEmpty()) {
- return Promise.all(this[kClients].map(c => c.close()))
- } else {
- return new Promise((resolve) => {
- this[kClosedResolve] = resolve
- })
- }
- }
+/***/ 7975:
+/***/ ((module) => {
- async [kDestroy] (err) {
- while (true) {
- const item = this[kQueue].shift()
- if (!item) {
- break
- }
- item.handler.onError(err)
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util");
- return Promise.all(this[kClients].map(c => c.destroy(err)))
- }
+/***/ }),
- [kDispatch] (opts, handler) {
- const dispatcher = this[kGetDispatcher]()
+/***/ 3429:
+/***/ ((module) => {
- if (!dispatcher) {
- this[kNeedDrain] = true
- this[kQueue].push({ opts, handler })
- this[kQueued]++
- } else if (!dispatcher.dispatch(opts, handler)) {
- dispatcher[kNeedDrain] = true
- this[kNeedDrain] = !this[kGetDispatcher]()
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util/types");
- return !this[kNeedDrain]
- }
+/***/ }),
- [kAddClient] (client) {
- client
- .on('drain', this[kOnDrain])
- .on('connect', this[kOnConnect])
- .on('disconnect', this[kOnDisconnect])
- .on('connectionError', this[kOnConnectionError])
+/***/ 5919:
+/***/ ((module) => {
- this[kClients].push(client)
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:worker_threads");
- if (this[kNeedDrain]) {
- process.nextTick(() => {
- if (this[kNeedDrain]) {
- this[kOnDrain](client[kUrl], [this, client])
- }
- })
- }
+/***/ }),
- return this
- }
+/***/ 8522:
+/***/ ((module) => {
- [kRemoveClient] (client) {
- client.close(() => {
- const idx = this[kClients].indexOf(client)
- if (idx !== -1) {
- this[kClients].splice(idx, 1)
- }
- })
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib");
- this[kNeedDrain] = this[kClients].some(dispatcher => (
- !dispatcher[kNeedDrain] &&
- dispatcher.closed !== true &&
- dispatcher.destroyed !== true
- ))
- }
-}
+/***/ }),
-module.exports = {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kRemoveClient,
- kGetDispatcher
-}
+/***/ 857:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os");
/***/ }),
-/***/ 9689:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 6928:
+/***/ ((module) => {
-const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
-const kPool = Symbol('pool')
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path");
-class PoolStats {
- constructor (pool) {
- this[kPool] = pool
- }
+/***/ }),
- get connected () {
- return this[kPool][kConnected]
- }
+/***/ 2203:
+/***/ ((module) => {
- get free () {
- return this[kPool][kFree]
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream");
- get pending () {
- return this[kPool][kPending]
- }
+/***/ }),
- get queued () {
- return this[kPool][kQueued]
- }
+/***/ 3193:
+/***/ ((module) => {
- get running () {
- return this[kPool][kRunning]
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder");
- get size () {
- return this[kPool][kSize]
- }
-}
+/***/ }),
-module.exports = PoolStats
+/***/ 4756:
+/***/ ((module) => {
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls");
/***/ }),
-/***/ 4634:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 2018:
+/***/ ((module) => {
-"use strict";
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty");
+/***/ }),
-const {
- PoolBase,
- kClients,
- kNeedDrain,
- kAddClient,
- kGetDispatcher
-} = __nccwpck_require__(3198)
-const Client = __nccwpck_require__(3598)
-const {
- InvalidArgumentError
-} = __nccwpck_require__(8045)
-const util = __nccwpck_require__(3983)
-const { kUrl, kInterceptors } = __nccwpck_require__(2785)
-const buildConnector = __nccwpck_require__(2067)
+/***/ 7016:
+/***/ ((module) => {
-const kOptions = Symbol('options')
-const kConnections = Symbol('connections')
-const kFactory = Symbol('factory')
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
-function defaultFactory (origin, opts) {
- return new Client(origin, opts)
-}
+/***/ }),
-class Pool extends PoolBase {
- constructor (origin, {
- connections,
- factory = defaultFactory,
- connect,
- connectTimeout,
- tls,
- maxCachedSessions,
- socketPath,
- autoSelectFamily,
- autoSelectFamilyAttemptTimeout,
- allowH2,
- ...options
- } = {}) {
- super()
+/***/ 9023:
+/***/ ((module) => {
- if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
- throw new InvalidArgumentError('invalid connections')
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util");
- if (typeof factory !== 'function') {
- throw new InvalidArgumentError('factory must be a function.')
- }
+/***/ }),
- if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
- throw new InvalidArgumentError('connect must be a function or an object')
- }
+/***/ 3106:
+/***/ ((module) => {
- if (typeof connect !== 'function') {
- connect = buildConnector({
- ...tls,
- maxCachedSessions,
- allowH2,
- socketPath,
- timeout: connectTimeout,
- ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
- ...connect
- })
- }
+module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib");
- this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
- ? options.interceptors.Pool
- : []
- this[kConnections] = connections || null
- this[kUrl] = util.parseOrigin(origin)
- this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
- this[kOptions].interceptors = options.interceptors
- ? { ...options.interceptors }
- : undefined
- this[kFactory] = factory
- }
+/***/ }),
- [kGetDispatcher] () {
- let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
+/***/ 4649:
+/***/ ((__unused_webpack_module, exports) => {
- if (dispatcher) {
- return dispatcher
- }
+var __webpack_unused_export__;
- if (!this[kConnections] || this[kClients].length < this[kConnections]) {
- dispatcher = this[kFactory](this[kUrl], this[kOptions])
- this[kAddClient](dispatcher)
+/*!
+ * content-type
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+__webpack_unused_export__ = ({ value: true });
+__webpack_unused_export__ = format;
+exports.qg = parse;
+const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;
+const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4
+ */
+const QUOTE_REGEXP = /[\\"]/g;
+/**
+ * RegExp to match type in RFC 9110 sec 8.3.1
+ *
+ * media-type = type "/" subtype
+ * type = token
+ * subtype = token
+ */
+const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
+/**
+ * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.
+ */
+const NullObject = /* @__PURE__ */ (() => {
+ const C = function () { };
+ C.prototype = Object.create(null);
+ return C;
+})();
+/**
+ * Format an object into a `Content-Type` header.
+ */
+function format(obj) {
+ const { type, parameters } = obj;
+ if (!type || !TYPE_REGEXP.test(type)) {
+ throw new TypeError(`Invalid type: ${type}`);
}
-
- return dispatcher
- }
+ let result = type;
+ if (parameters) {
+ for (const param of Object.keys(parameters)) {
+ if (!TOKEN_REGEXP.test(param)) {
+ throw new TypeError(`Invalid parameter name: ${param}`);
+ }
+ result += `; ${param}=${qstring(parameters[param])}`;
+ }
+ }
+ return result;
}
-
-module.exports = Pool
-
+/**
+ * Parse a `Content-Type` header.
+ */
+function parse(header, options) {
+ const len = header.length;
+ let index = skipOWS(header, 0, len);
+ const valueStart = index;
+ index = skipValue(header, index, len);
+ const valueEnd = trailingOWS(header, valueStart, index);
+ const type = header.slice(valueStart, valueEnd).toLowerCase();
+ const parameters = options?.parameters === false
+ ? new NullObject()
+ : parseParameters(header, index, len);
+ return { type, parameters };
+}
+const SP = 32; // " "
+const HTAB = 9; // "\t"
+const SEMI = 59; // ";"
+const EQ = 61; // "="
+const DQUOTE = 34; // '"'
+const BSLASH = 92; // "\\"
+/**
+ * Parses the parameters of a `Content-Type` header starting at the given index.
+ */
+function parseParameters(header, index, len) {
+ const parameters = new NullObject();
+ parameter: while (index < len) {
+ index = skipOWS(header, index + 1 /* Skip over ; */, len);
+ const keyStart = index;
+ while (index < len) {
+ const code = header.charCodeAt(index);
+ if (code === SEMI)
+ continue parameter;
+ if (code === EQ) {
+ const keyEnd = trailingOWS(header, keyStart, index);
+ const key = header.slice(keyStart, keyEnd).toLowerCase();
+ index = skipOWS(header, index + 1, len);
+ if (index < len && header.charCodeAt(index) === DQUOTE) {
+ index++;
+ let value = "";
+ while (index < len) {
+ const code = header.charCodeAt(index++);
+ if (code === DQUOTE) {
+ index = skipValue(header, index, len);
+ if (parameters[key] === undefined)
+ parameters[key] = value;
+ break;
+ }
+ if (code === BSLASH && index < len) {
+ value += header[index++];
+ continue;
+ }
+ value += String.fromCharCode(code);
+ }
+ continue parameter;
+ }
+ const valueStart = index;
+ index = skipValue(header, index, len);
+ if (parameters[key] === undefined) {
+ const valueEnd = trailingOWS(header, valueStart, index);
+ parameters[key] = header.slice(valueStart, valueEnd);
+ }
+ continue parameter;
+ }
+ index++;
+ }
+ }
+ return parameters;
+}
+/**
+ * Skip over characters until a semicolon.
+ */
+function skipValue(str, index, len) {
+ while (index < len) {
+ const char = str.charCodeAt(index);
+ if (char === SEMI)
+ break;
+ index++;
+ }
+ return index;
+}
+/**
+ * Skip optional whitespace (OWS) in an HTTP header value.
+ *
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
+ */
+function skipOWS(header, index, len) {
+ while (index < len) {
+ const char = header.charCodeAt(index);
+ if (char !== SP && char !== HTAB)
+ break;
+ index++;
+ }
+ return index;
+}
+/**
+ * Trim optional whitespace (OWS) from the end of a substring.
+ *
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
+ */
+function trailingOWS(header, start, end) {
+ while (end > start) {
+ const char = header.charCodeAt(end - 1);
+ if (char !== SP && char !== HTAB)
+ break;
+ end--;
+ }
+ return end;
+}
+/**
+ * Serialize a parameter value.
+ */
+function qstring(str) {
+ if (TOKEN_REGEXP.test(str))
+ return str;
+ if (TEXT_REGEXP.test(str))
+ return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`;
+ throw new TypeError(`Invalid parameter value: ${str}`);
+}
+//# sourceMappingURL=index.js.map
/***/ }),
-/***/ 7858:
+/***/ 7269:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */
-const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
-const { URL } = __nccwpck_require__(7310)
-const Agent = __nccwpck_require__(7890)
-const Pool = __nccwpck_require__(4634)
-const DispatcherBase = __nccwpck_require__(4839)
-const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
-const buildConnector = __nccwpck_require__(2067)
-
-const kAgent = Symbol('proxy agent')
-const kClient = Symbol('proxy client')
-const kProxyHeaders = Symbol('proxy headers')
-const kRequestTls = Symbol('request tls settings')
-const kProxyTls = Symbol('proxy tls settings')
-const kConnectEndpoint = Symbol('connect endpoint function')
+var FormData$1 = __nccwpck_require__(6454);
+var crypto = __nccwpck_require__(6982);
+var url = __nccwpck_require__(7016);
+var HttpsProxyAgent = __nccwpck_require__(3669);
+var http = __nccwpck_require__(8611);
+var https = __nccwpck_require__(5692);
+var http2 = __nccwpck_require__(5675);
+var util = __nccwpck_require__(9023);
+var path = __nccwpck_require__(6928);
+var followRedirects = __nccwpck_require__(1573);
+var zlib = __nccwpck_require__(3106);
+var stream = __nccwpck_require__(2203);
+var events = __nccwpck_require__(4434);
-function defaultProtocolPort (protocol) {
- return protocol === 'https:' ? 443 : 80
+/**
+ * Create a bound version of a function with a specified `this` context
+ *
+ * @param {Function} fn - The function to bind
+ * @param {*} thisArg - The value to be passed as the `this` parameter
+ * @returns {Function} A new function that will call the original function with the specified `this` context
+ */
+function bind(fn, thisArg) {
+ return function wrap() {
+ return fn.apply(thisArg, arguments);
+ };
}
-function buildProxyOptions (opts) {
- if (typeof opts === 'string') {
- opts = { uri: opts }
- }
-
- if (!opts || !opts.uri) {
- throw new InvalidArgumentError('Proxy opts.uri is mandatory')
- }
-
- return {
- uri: opts.uri,
- protocol: opts.protocol || 'https'
- }
-}
+// utils is a library of generic helper functions non-specific to axios
-function defaultFactory (origin, opts) {
- return new Pool(origin, opts)
-}
+const {
+ toString
+} = Object.prototype;
+const {
+ getPrototypeOf
+} = Object;
+const {
+ iterator,
+ toStringTag
+} = Symbol;
-class ProxyAgent extends DispatcherBase {
- constructor (opts) {
- super(opts)
- this[kProxy] = buildProxyOptions(opts)
- this[kAgent] = new Agent(opts)
- this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
- ? opts.interceptors.ProxyAgent
- : []
+/* Creating a function that will check if an object has a property. */
+const hasOwnProperty = (({
+ hasOwnProperty
+}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
- if (typeof opts === 'string') {
- opts = { uri: opts }
+/**
+ * Walk the prototype chain (excluding the shared Object.prototype) looking for
+ * an own `prop`. This distinguishes genuine own/inherited members — including
+ * class accessors and template prototypes — from members injected via
+ * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
+ * live on Object.prototype itself and are therefore never matched.
+ *
+ * @param {*} thing The value whose chain to inspect
+ * @param {string|symbol} prop The property key to look for
+ *
+ * @returns {boolean} True when `prop` is owned below Object.prototype
+ */
+const hasOwnInPrototypeChain = (thing, prop) => {
+ let obj = thing;
+ const seen = [];
+ while (obj != null && obj !== Object.prototype) {
+ if (seen.indexOf(obj) !== -1) {
+ return false;
}
-
- if (!opts || !opts.uri) {
- throw new InvalidArgumentError('Proxy opts.uri is mandatory')
+ seen.push(obj);
+ if (hasOwnProperty(obj, prop)) {
+ return true;
}
+ obj = getPrototypeOf(obj);
+ }
+ return false;
+};
- const { clientFactory = defaultFactory } = opts
+/**
+ * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
+ * properties and members inherited from a non-Object.prototype source (a class
+ * instance or template object) are honored; a value reachable only through a
+ * polluted Object.prototype is ignored and `undefined` is returned.
+ *
+ * @param {*} obj The source object
+ * @param {string|symbol} prop The property key to read
+ *
+ * @returns {*} The resolved value, or undefined when unsafe/absent
+ */
+const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
+const kindOf = (cache => thing => {
+ const str = toString.call(thing);
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
+})(Object.create(null));
+const kindOfTest = type => {
+ type = type.toLowerCase();
+ return thing => kindOf(thing) === type;
+};
+const typeOfTest = type => thing => typeof thing === type;
- if (typeof clientFactory !== 'function') {
- throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
- }
+/**
+ * Determine if a value is a non-null object
+ *
+ * @param {Object} val The value to test
+ *
+ * @returns {boolean} True if value is an Array, otherwise false
+ */
+const {
+ isArray
+} = Array;
- this[kRequestTls] = opts.requestTls
- this[kProxyTls] = opts.proxyTls
- this[kProxyHeaders] = opts.headers || {}
+/**
+ * Determine if a value is undefined
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if the value is undefined, otherwise false
+ */
+const isUndefined = typeOfTest('undefined');
- const resolvedUrl = new URL(opts.uri)
- const { origin, port, host, username, password } = resolvedUrl
+/**
+ * Determine if a value is a Buffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Buffer, otherwise false
+ */
+function isBuffer(val) {
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
+}
- if (opts.auth && opts.token) {
- throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
- } else if (opts.auth) {
- /* @deprecated in favour of opts.token */
- this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
- } else if (opts.token) {
- this[kProxyHeaders]['proxy-authorization'] = opts.token
- } else if (username && password) {
- this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
- }
+/**
+ * Determine if a value is an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
+ */
+const isArrayBuffer = kindOfTest('ArrayBuffer');
- const connect = buildConnector({ ...opts.proxyTls })
- this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
- this[kClient] = clientFactory(resolvedUrl, { connect })
- this[kAgent] = new Agent({
- ...opts,
- connect: async (opts, callback) => {
- let requestedHost = opts.host
- if (!opts.port) {
- requestedHost += `:${defaultProtocolPort(opts.protocol)}`
- }
- try {
- const { socket, statusCode } = await this[kClient].connect({
- origin,
- port,
- path: requestedHost,
- signal: opts.signal,
- headers: {
- ...this[kProxyHeaders],
- host
- }
- })
- if (statusCode !== 200) {
- socket.on('error', () => {}).destroy()
- callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
- }
- if (opts.protocol !== 'https:') {
- callback(null, socket)
- return
- }
- let servername
- if (this[kRequestTls]) {
- servername = this[kRequestTls].servername
- } else {
- servername = opts.servername
- }
- this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
- } catch (err) {
- callback(err)
- }
- }
- })
+/**
+ * Determine if a value is a view on an ArrayBuffer
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
+ */
+function isArrayBufferView(val) {
+ let result;
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
+ result = ArrayBuffer.isView(val);
+ } else {
+ result = val && val.buffer && isArrayBuffer(val.buffer);
}
+ return result;
+}
- dispatch (opts, handler) {
- const { host } = new URL(opts.origin)
- const headers = buildHeaders(opts.headers)
- throwIfProxyAuthIsSent(headers)
- return this[kAgent].dispatch(
- {
- ...opts,
- headers: {
- ...headers,
- host
- }
- },
- handler
- )
- }
+/**
+ * Determine if a value is a String
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a String, otherwise false
+ */
+const isString = typeOfTest('string');
- async [kClose] () {
- await this[kAgent].close()
- await this[kClient].close()
- }
+/**
+ * Determine if a value is a Function
+ *
+ * @param {*} val The value to test
+ * @returns {boolean} True if value is a Function, otherwise false
+ */
+const isFunction$1 = typeOfTest('function');
- async [kDestroy] () {
- await this[kAgent].destroy()
- await this[kClient].destroy()
- }
-}
+/**
+ * Determine if a value is a Number
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Number, otherwise false
+ */
+const isNumber = typeOfTest('number');
/**
- * @param {string[] | Record} headers
- * @returns {Record}
+ * Determine if a value is an Object
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an Object, otherwise false
*/
-function buildHeaders (headers) {
- // When using undici.fetch, the headers list is stored
- // as an array.
- if (Array.isArray(headers)) {
- /** @type {Record} */
- const headersPair = {}
+const isObject = thing => thing !== null && typeof thing === 'object';
- for (let i = 0; i < headers.length; i += 2) {
- headersPair[headers[i]] = headers[i + 1]
- }
+/**
+ * Determine if a value is a Boolean
+ *
+ * @param {*} thing The value to test
+ * @returns {boolean} True if value is a Boolean, otherwise false
+ */
+const isBoolean = thing => thing === true || thing === false;
- return headersPair
+/**
+ * Determine if a value is a plain Object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a plain Object, otherwise false
+ */
+const isPlainObject = val => {
+ if (!isObject(val)) {
+ return false;
}
-
- return headers
-}
+ const prototype = getPrototypeOf(val);
+ return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
+ // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
+ // than a plain object, while ignoring keys injected onto Object.prototype.
+ !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
+};
/**
- * @param {Record} headers
+ * Determine if a value is an empty object (safely handles Buffers)
*
- * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
- * Nevertheless, it was changed and to avoid a security vulnerability by end users
- * this check was created.
- * It should be removed in the next major version for performance reasons
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is an empty object, otherwise false
*/
-function throwIfProxyAuthIsSent (headers) {
- const existProxyAuth = headers && Object.keys(headers)
- .find((key) => key.toLowerCase() === 'proxy-authorization')
- if (existProxyAuth) {
- throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
+const isEmptyObject = val => {
+ // Early return for non-objects or Buffers to prevent RangeError
+ if (!isObject(val) || isBuffer(val)) {
+ return false;
}
-}
+ try {
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
+ } catch (e) {
+ // Fallback for any other objects that might cause RangeError with Object.keys()
+ return false;
+ }
+};
-module.exports = ProxyAgent
+/**
+ * Determine if a value is a Date
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Date, otherwise false
+ */
+const isDate = kindOfTest('Date');
+/**
+ * Determine if a value is a File
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a File, otherwise false
+ */
+const isFile = kindOfTest('File');
-/***/ }),
+/**
+ * Determine if a value is a React Native Blob
+ * React Native "blob": an object with a `uri` attribute. Optionally, it can
+ * also have a `name` and `type` attribute to specify filename and content type
+ *
+ * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
+ *
+ * @param {*} value The value to test
+ *
+ * @returns {boolean} True if value is a React Native Blob, otherwise false
+ */
+const isReactNativeBlob = value => {
+ return !!(value && typeof value.uri !== 'undefined');
+};
-/***/ 9459:
-/***/ ((module) => {
+/**
+ * Determine if environment is React Native
+ * ReactNative `FormData` has a non-standard `getParts()` method
+ *
+ * @param {*} formData The formData to test
+ *
+ * @returns {boolean} True if environment is React Native, otherwise false
+ */
+const isReactNative = formData => formData && typeof formData.getParts !== 'undefined';
-"use strict";
+/**
+ * Determine if a value is a Blob
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Blob, otherwise false
+ */
+const isBlob = kindOfTest('Blob');
+/**
+ * Determine if a value is a FileList
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a FileList, otherwise false
+ */
+const isFileList = kindOfTest('FileList');
-let fastNow = Date.now()
-let fastNowTimeout
+/**
+ * Determine if a value is a Stream
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a Stream, otherwise false
+ */
+const isStream = val => isObject(val) && isFunction$1(val.pipe);
-const fastTimers = []
+/**
+ * Determine if a value is a FormData
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value is an FormData, otherwise false
+ */
+function getGlobal() {
+ if (typeof globalThis !== 'undefined') return globalThis;
+ if (typeof self !== 'undefined') return self;
+ if (typeof window !== 'undefined') return window;
+ if (typeof global !== 'undefined') return global;
+ return {};
+}
+const G = getGlobal();
+const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
+const isFormData = thing => {
+ if (!thing) return false;
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
+ const proto = getPrototypeOf(thing);
+ if (!proto || proto === Object.prototype) return false;
+ if (!isFunction$1(thing.append)) return false;
+ const kind = kindOf(thing);
+ return kind === 'formdata' ||
+ // detect form-data instance
+ kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]';
+};
-function onTimeout () {
- fastNow = Date.now()
+/**
+ * Determine if a value is a URLSearchParams object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
+ */
+const isURLSearchParams = kindOfTest('URLSearchParams');
+const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
- let len = fastTimers.length
- let idx = 0
- while (idx < len) {
- const timer = fastTimers[idx]
+/**
+ * Trim excess whitespace off the beginning and end of a string
+ *
+ * @param {String} str The String to trim
+ *
+ * @returns {String} The String freed of excess whitespace
+ */
+const trim = str => {
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+};
+/**
+ * Iterate over an Array or an Object invoking a function for each item.
+ *
+ * If `obj` is an Array callback will be called passing
+ * the value, index, and complete array for each item.
+ *
+ * If 'obj' is an Object callback will be called passing
+ * the value, key, and complete object for each property.
+ *
+ * @param {Object|Array} obj The object to iterate
+ * @param {Function} fn The callback to invoke for each item
+ *
+ * @param {Object} [options]
+ * @param {Boolean} [options.allOwnKeys = false]
+ * @returns {any}
+ */
+function forEach(obj, fn, {
+ allOwnKeys = false
+} = {}) {
+ // Don't bother if no value provided
+ if (obj === null || typeof obj === 'undefined') {
+ return;
+ }
+ let i;
+ let l;
- if (timer.state === 0) {
- timer.state = fastNow + timer.delay
- } else if (timer.state > 0 && fastNow >= timer.state) {
- timer.state = -1
- timer.callback(timer.opaque)
+ // Force an array if not already something iterable
+ if (typeof obj !== 'object') {
+ /*eslint no-param-reassign:0*/
+ obj = [obj];
+ }
+ if (isArray(obj)) {
+ // Iterate over array values
+ for (i = 0, l = obj.length; i < l; i++) {
+ fn.call(null, obj[i], i, obj);
}
-
- if (timer.state === -1) {
- timer.state = -2
- if (idx !== len - 1) {
- fastTimers[idx] = fastTimers.pop()
- } else {
- fastTimers.pop()
- }
- len -= 1
- } else {
- idx += 1
+ } else {
+ // Buffer check
+ if (isBuffer(obj)) {
+ return;
}
- }
- if (fastTimers.length > 0) {
- refreshTimeout()
+ // Iterate over object keys
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ fn.call(null, obj[key], key, obj);
+ }
}
}
-function refreshTimeout () {
- if (fastNowTimeout && fastNowTimeout.refresh) {
- fastNowTimeout.refresh()
- } else {
- clearTimeout(fastNowTimeout)
- fastNowTimeout = setTimeout(onTimeout, 1e3)
- if (fastNowTimeout.unref) {
- fastNowTimeout.unref()
+/**
+ * Finds a key in an object, case-insensitive, returning the actual key name.
+ * Returns null if the object is a Buffer or if no match is found.
+ *
+ * @param {Object} obj - The object to search.
+ * @param {string} key - The key to find (case-insensitive).
+ * @returns {?string} The actual key name if found, otherwise null.
+ */
+function findKey(obj, key) {
+ if (isBuffer(obj)) {
+ return null;
+ }
+ key = key.toLowerCase();
+ const keys = Object.keys(obj);
+ let i = keys.length;
+ let _key;
+ while (i-- > 0) {
+ _key = keys[i];
+ if (key === _key.toLowerCase()) {
+ return _key;
}
}
+ return null;
}
+const _global = (() => {
+ /*eslint no-undef:0*/
+ if (typeof globalThis !== 'undefined') return globalThis;
+ return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
+})();
+const isContextDefined = context => !isUndefined(context) && context !== _global;
-class Timeout {
- constructor (callback, delay, opaque) {
- this.callback = callback
- this.delay = delay
- this.opaque = opaque
-
- // -2 not in timer list
- // -1 in timer list but inactive
- // 0 in timer list waiting for time
- // > 0 in timer list waiting for time to expire
- this.state = -2
-
- this.refresh()
- }
+/**
+ * Accepts varargs expecting each argument to be an object, then
+ * immutably merges the properties of each object and returns result.
+ *
+ * When multiple objects contain the same key the later object in
+ * the arguments list will take precedence.
+ *
+ * Example:
+ *
+ * ```js
+ * const result = merge({foo: 123}, {foo: 456});
+ * console.log(result.foo); // outputs 456
+ * ```
+ *
+ * @param {Object} obj1 Object to merge
+ *
+ * @returns {Object} Result of all merge properties
+ */
+function merge(...objs) {
+ const {
+ caseless,
+ skipUndefined
+ } = isContextDefined(this) && this || {};
+ const result = {};
+ const assignValue = (val, key) => {
+ // Skip dangerous property names to prevent prototype pollution
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
+ return;
+ }
- refresh () {
- if (this.state === -2) {
- fastTimers.push(this)
- if (!fastNowTimeout || fastTimers.length === 1) {
- refreshTimeout()
+ // findKey lowercases the key, so caseless lookup only applies to strings —
+ // symbol keys are identity-matched.
+ const targetKey = caseless && typeof key === 'string' && findKey(result, key) || key;
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
+ // chain, so a polluted Object.prototype value could surface here and get
+ // copied into the merged result.
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
+ if (isPlainObject(existing) && isPlainObject(val)) {
+ result[targetKey] = merge(existing, val);
+ } else if (isPlainObject(val)) {
+ result[targetKey] = merge({}, val);
+ } else if (isArray(val)) {
+ result[targetKey] = val.slice();
+ } else if (!skipUndefined || !isUndefined(val)) {
+ result[targetKey] = val;
+ }
+ };
+ for (let i = 0, l = objs.length; i < l; i++) {
+ const source = objs[i];
+ if (!source || isBuffer(source)) {
+ continue;
+ }
+ forEach(source, assignValue);
+ if (typeof source !== 'object' || isArray(source)) {
+ continue;
+ }
+ const symbols = Object.getOwnPropertySymbols(source);
+ for (let j = 0; j < symbols.length; j++) {
+ const symbol = symbols[j];
+ if (propertyIsEnumerable.call(source, symbol)) {
+ assignValue(source[symbol], symbol);
}
}
-
- this.state = 0
- }
-
- clear () {
- this.state = -1
}
+ return result;
}
-module.exports = {
- setTimeout (callback, delay, opaque) {
- return delay < 1e3
- ? setTimeout(callback, delay, opaque)
- : new Timeout(callback, delay, opaque)
- },
- clearTimeout (timeout) {
- if (timeout instanceof Timeout) {
- timeout.clear()
+/**
+ * Extends object a by mutably adding to it the properties of object b.
+ *
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to copy properties from
+ * @param {Object} thisArg The object to bind function to
+ *
+ * @param {Object} [options]
+ * @param {Boolean} [options.allOwnKeys]
+ * @returns {Object} The resulting value of object a
+ */
+const extend = (a, b, thisArg, {
+ allOwnKeys
+} = {}) => {
+ forEach(b, (val, key) => {
+ if (thisArg && isFunction$1(val)) {
+ Object.defineProperty(a, key, {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
+ // hijack defineProperty's accessor-vs-data resolution.
+ __proto__: null,
+ value: bind(val, thisArg),
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
} else {
- clearTimeout(timeout)
+ Object.defineProperty(a, key, {
+ __proto__: null,
+ value: val,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
}
- }
-}
-
-
-/***/ }),
-
-/***/ 5354:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const diagnosticsChannel = __nccwpck_require__(7643)
-const { uid, states } = __nccwpck_require__(9188)
-const {
- kReadyState,
- kSentClose,
- kByteParser,
- kReceivedClose
-} = __nccwpck_require__(7578)
-const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
-const { CloseEvent } = __nccwpck_require__(2611)
-const { makeRequest } = __nccwpck_require__(8359)
-const { fetching } = __nccwpck_require__(4881)
-const { Headers } = __nccwpck_require__(554)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { kHeadersList } = __nccwpck_require__(2785)
-
-const channels = {}
-channels.open = diagnosticsChannel.channel('undici:websocket:open')
-channels.close = diagnosticsChannel.channel('undici:websocket:close')
-channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
-
-/** @type {import('crypto')} */
-let crypto
-try {
- crypto = __nccwpck_require__(6113)
-} catch {
-
-}
+ }, {
+ allOwnKeys
+ });
+ return a;
+};
/**
- * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
- * @param {URL} url
- * @param {string|string[]} protocols
- * @param {import('./websocket').WebSocket} ws
- * @param {(response: any) => void} onEstablish
- * @param {Partial} options
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ *
+ * @param {string} content with BOM
+ *
+ * @returns {string} content value without BOM
*/
-function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
- // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
- // scheme is "ws", and to "https" otherwise.
- const requestURL = url
-
- requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
-
- // 2. Let request be a new request, whose URL is requestURL, client is client,
- // service-workers mode is "none", referrer is "no-referrer", mode is
- // "websocket", credentials mode is "include", cache mode is "no-store" ,
- // and redirect mode is "error".
- const request = makeRequest({
- urlList: [requestURL],
- serviceWorkers: 'none',
- referrer: 'no-referrer',
- mode: 'websocket',
- credentials: 'include',
- cache: 'no-store',
- redirect: 'error'
- })
-
- // Note: undici extension, allow setting custom headers.
- if (options.headers) {
- const headersList = new Headers(options.headers)[kHeadersList]
-
- request.headersList = headersList
- }
-
- // 3. Append (`Upgrade`, `websocket`) to request’s header list.
- // 4. Append (`Connection`, `Upgrade`) to request’s header list.
- // Note: both of these are handled by undici currently.
- // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
-
- // 5. Let keyValue be a nonce consisting of a randomly selected
- // 16-byte value that has been forgiving-base64-encoded and
- // isomorphic encoded.
- const keyValue = crypto.randomBytes(16).toString('base64')
-
- // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
- // header list.
- request.headersList.append('sec-websocket-key', keyValue)
-
- // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
- // header list.
- request.headersList.append('sec-websocket-version', '13')
-
- // 8. For each protocol in protocols, combine
- // (`Sec-WebSocket-Protocol`, protocol) in request’s header
- // list.
- for (const protocol of protocols) {
- request.headersList.append('sec-websocket-protocol', protocol)
+const stripBOM = content => {
+ if (content.charCodeAt(0) === 0xfeff) {
+ content = content.slice(1);
}
+ return content;
+};
- // 9. Let permessageDeflate be a user-agent defined
- // "permessage-deflate" extension header value.
- // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
- // TODO: enable once permessage-deflate is supported
- const permessageDeflate = '' // 'permessage-deflate; 15'
-
- // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
- // request’s header list.
- // request.headersList.append('sec-websocket-extensions', permessageDeflate)
-
- // 11. Fetch request with useParallelQueue set to true, and
- // processResponse given response being these steps:
- const controller = fetching({
- request,
- useParallelQueue: true,
- dispatcher: options.dispatcher ?? getGlobalDispatcher(),
- processResponse (response) {
- // 1. If response is a network error or its status is not 101,
- // fail the WebSocket connection.
- if (response.type === 'error' || response.status !== 101) {
- failWebsocketConnection(ws, 'Received network error or non-101 status code.')
- return
- }
-
- // 2. If protocols is not the empty list and extracting header
- // list values given `Sec-WebSocket-Protocol` and response’s
- // header list results in null, failure, or the empty byte
- // sequence, then fail the WebSocket connection.
- if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
- failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
- return
- }
-
- // 3. Follow the requirements stated step 2 to step 6, inclusive,
- // of the last set of steps in section 4.1 of The WebSocket
- // Protocol to validate response. This either results in fail
- // the WebSocket connection or the WebSocket connection is
- // established.
-
- // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
- // header field contains a value that is not an ASCII case-
- // insensitive match for the value "websocket", the client MUST
- // _Fail the WebSocket Connection_.
- if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
- failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
- return
- }
-
- // 3. If the response lacks a |Connection| header field or the
- // |Connection| header field doesn't contain a token that is an
- // ASCII case-insensitive match for the value "Upgrade", the client
- // MUST _Fail the WebSocket Connection_.
- if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
- failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
- return
- }
-
- // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
- // the |Sec-WebSocket-Accept| contains a value other than the
- // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
- // Key| (as a string, not base64-decoded) with the string "258EAFA5-
- // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
- // trailing whitespace, the client MUST _Fail the WebSocket
- // Connection_.
- const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
- const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
- if (secWSAccept !== digest) {
- failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
- return
- }
-
- // 5. If the response includes a |Sec-WebSocket-Extensions| header
- // field and this header field indicates the use of an extension
- // that was not present in the client's handshake (the server has
- // indicated an extension not requested by the client), the client
- // MUST _Fail the WebSocket Connection_. (The parsing of this
- // header field to determine which extensions are requested is
- // discussed in Section 9.1.)
- const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
-
- if (secExtension !== null && secExtension !== permessageDeflate) {
- failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
- return
- }
-
- // 6. If the response includes a |Sec-WebSocket-Protocol| header field
- // and this header field indicates the use of a subprotocol that was
- // not present in the client's handshake (the server has indicated a
- // subprotocol not requested by the client), the client MUST _Fail
- // the WebSocket Connection_.
- const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
-
- if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
- failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
- return
- }
-
- response.socket.on('data', onSocketData)
- response.socket.on('close', onSocketClose)
- response.socket.on('error', onSocketError)
+/**
+ * Inherit the prototype methods from one constructor into another
+ * @param {function} constructor
+ * @param {function} superConstructor
+ * @param {object} [props]
+ * @param {object} [descriptors]
+ *
+ * @returns {void}
+ */
+const inherits = (constructor, superConstructor, props, descriptors) => {
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
+ Object.defineProperty(constructor.prototype, 'constructor', {
+ __proto__: null,
+ value: constructor,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ Object.defineProperty(constructor, 'super', {
+ __proto__: null,
+ value: superConstructor.prototype
+ });
+ props && Object.assign(constructor.prototype, props);
+};
- if (channels.open.hasSubscribers) {
- channels.open.publish({
- address: response.socket.address(),
- protocol: secProtocol,
- extensions: secExtension
- })
+/**
+ * Resolve object with deep prototype chain to a flat object
+ * @param {Object} sourceObj source object
+ * @param {Object} [destObj]
+ * @param {Function|Boolean} [filter]
+ * @param {Function} [propFilter]
+ *
+ * @returns {Object}
+ */
+const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
+ let props;
+ let i;
+ let prop;
+ const merged = {};
+ destObj = destObj || {};
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ if (sourceObj == null) return destObj;
+ do {
+ props = Object.getOwnPropertyNames(sourceObj);
+ i = props.length;
+ while (i-- > 0) {
+ prop = props[i];
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
+ destObj[prop] = sourceObj[prop];
+ merged[prop] = true;
}
-
- onEstablish(response)
}
- })
-
- return controller
-}
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
+ return destObj;
+};
/**
- * @param {Buffer} chunk
+ * Determines whether a string ends with the characters of a specified string
+ *
+ * @param {String} str
+ * @param {String} searchString
+ * @param {Number} [position= 0]
+ *
+ * @returns {boolean}
*/
-function onSocketData (chunk) {
- if (!this.ws[kByteParser].write(chunk)) {
- this.pause()
+const endsWith = (str, searchString, position) => {
+ str = String(str);
+ if (position === undefined || position > str.length) {
+ position = str.length;
}
-}
+ position -= searchString.length;
+ const lastIndex = str.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+};
/**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
- * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
+ * Returns new array from array like object or null if failed
+ *
+ * @param {*} [thing]
+ *
+ * @returns {?Array}
*/
-function onSocketClose () {
- const { ws } = this
-
- // If the TCP connection was closed after the
- // WebSocket closing handshake was completed, the WebSocket connection
- // is said to have been closed _cleanly_.
- const wasClean = ws[kSentClose] && ws[kReceivedClose]
-
- let code = 1005
- let reason = ''
-
- const result = ws[kByteParser].closingInfo
-
- if (result) {
- code = result.code ?? 1005
- reason = result.reason
- } else if (!ws[kSentClose]) {
- // If _The WebSocket
- // Connection is Closed_ and no Close control frame was received by the
- // endpoint (such as could occur if the underlying transport connection
- // is lost), _The WebSocket Connection Close Code_ is considered to be
- // 1006.
- code = 1006
+const toArray = thing => {
+ if (!thing) return null;
+ if (isArray(thing)) return thing;
+ let i = thing.length;
+ if (!isNumber(i)) return null;
+ const arr = new Array(i);
+ while (i-- > 0) {
+ arr[i] = thing[i];
}
+ return arr;
+};
- // 1. Change the ready state to CLOSED (3).
- ws[kReadyState] = states.CLOSED
-
- // 2. If the user agent was required to fail the WebSocket
- // connection, or if the WebSocket connection was closed
- // after being flagged as full, fire an event named error
- // at the WebSocket object.
- // TODO
-
- // 3. Fire an event named close at the WebSocket object,
- // using CloseEvent, with the wasClean attribute
- // initialized to true if the connection closed cleanly
- // and false otherwise, the code attribute initialized to
- // the WebSocket connection close code, and the reason
- // attribute initialized to the result of applying UTF-8
- // decode without BOM to the WebSocket connection close
- // reason.
- fireEvent('close', ws, CloseEvent, {
- wasClean, code, reason
- })
+/**
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
+ * thing passed in is an instance of Uint8Array
+ *
+ * @param {TypedArray}
+ *
+ * @returns {Array}
+ */
+// eslint-disable-next-line func-names
+const isTypedArray = (TypedArray => {
+ // eslint-disable-next-line func-names
+ return thing => {
+ return TypedArray && thing instanceof TypedArray;
+ };
+})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
- if (channels.close.hasSubscribers) {
- channels.close.publish({
- websocket: ws,
- code,
- reason
- })
+/**
+ * For each entry in the object, call the function with the key and value.
+ *
+ * @param {Object} obj - The object to iterate over.
+ * @param {Function} fn - The function to call for each entry.
+ *
+ * @returns {void}
+ */
+const forEachEntry = (obj, fn) => {
+ const generator = obj && obj[iterator];
+ const _iterator = generator.call(obj);
+ let result;
+ while ((result = _iterator.next()) && !result.done) {
+ const pair = result.value;
+ fn.call(obj, pair[0], pair[1]);
}
-}
-
-function onSocketError (error) {
- const { ws } = this
-
- ws[kReadyState] = states.CLOSING
+};
- if (channels.socketError.hasSubscribers) {
- channels.socketError.publish(error)
+/**
+ * It takes a regular expression and a string, and returns an array of all the matches
+ *
+ * @param {string} regExp - The regular expression to match against.
+ * @param {string} str - The string to search.
+ *
+ * @returns {Array}
+ */
+const matchAll = (regExp, str) => {
+ let matches;
+ const arr = [];
+ while ((matches = regExp.exec(str)) !== null) {
+ arr.push(matches);
}
+ return arr;
+};
- this.destroy()
-}
-
-module.exports = {
- establishWebSocketConnection
-}
-
-
-/***/ }),
-
-/***/ 9188:
-/***/ ((module) => {
-
-"use strict";
+/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
+const isHTMLForm = kindOfTest('HTMLFormElement');
+const toCamelCase = str => {
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
+ return p1.toUpperCase() + p2;
+ });
+};
+const {
+ propertyIsEnumerable
+} = Object.prototype;
+/**
+ * Determine if a value is a RegExp object
+ *
+ * @param {*} val The value to test
+ *
+ * @returns {boolean} True if value is a RegExp object, otherwise false
+ */
+const isRegExp = kindOfTest('RegExp');
+const reduceDescriptors = (obj, reducer) => {
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
+ const reducedDescriptors = {};
+ forEach(descriptors, (descriptor, name) => {
+ let ret;
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
+ reducedDescriptors[name] = ret || descriptor;
+ }
+ });
+ Object.defineProperties(obj, reducedDescriptors);
+};
-// This is a Globally Unique Identifier unique used
-// to validate that the endpoint accepts websocket
-// connections.
-// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
-const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
+/**
+ * Makes all methods read-only
+ * @param {Object} obj
+ */
-/** @type {PropertyDescriptor} */
-const staticPropertyDescriptors = {
- enumerable: true,
- writable: false,
- configurable: false
-}
+const freezeMethods = obj => {
+ reduceDescriptors(obj, (descriptor, name) => {
+ // skip restricted props in strict mode
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
+ return false;
+ }
+ const value = obj[name];
+ if (!isFunction$1(value)) return;
+ descriptor.enumerable = false;
+ if ('writable' in descriptor) {
+ descriptor.writable = false;
+ return;
+ }
+ if (!descriptor.set) {
+ descriptor.set = () => {
+ throw Error("Can not rewrite read-only method '" + name + "'");
+ };
+ }
+ });
+};
-const states = {
- CONNECTING: 0,
- OPEN: 1,
- CLOSING: 2,
- CLOSED: 3
-}
+/**
+ * Converts an array or a delimited string into an object set with values as keys and true as values.
+ * Useful for fast membership checks.
+ *
+ * @param {Array|string} arrayOrString - The array or string to convert.
+ * @param {string} delimiter - The delimiter to use if input is a string.
+ * @returns {Object} An object with keys from the array or string, values set to true.
+ */
+const toObjectSet = (arrayOrString, delimiter) => {
+ const obj = {};
+ const define = arr => {
+ arr.forEach(value => {
+ obj[value] = true;
+ });
+ };
+ isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
+ return obj;
+};
+const noop = () => {};
+const toFiniteNumber = (value, defaultValue) => {
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
+};
-const opcodes = {
- CONTINUATION: 0x0,
- TEXT: 0x1,
- BINARY: 0x2,
- CLOSE: 0x8,
- PING: 0x9,
- PONG: 0xA
+/**
+ * If the thing is a FormData object, return true, otherwise return false.
+ *
+ * @param {unknown} thing - The thing to check.
+ *
+ * @returns {boolean}
+ */
+function isSpecCompliantForm(thing) {
+ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
}
-const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
-
-const parserStates = {
- INFO: 0,
- PAYLOADLENGTH_16: 2,
- PAYLOADLENGTH_64: 3,
- READ_DATA: 4
-}
+/**
+ * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
+ *
+ * @param {Object} obj - The object to convert.
+ * @returns {Object} The JSON-compatible object.
+ */
+const toJSONObject = obj => {
+ const visited = new WeakSet();
+ const visit = source => {
+ if (isObject(source)) {
+ if (visited.has(source)) {
+ return;
+ }
-const emptyBuffer = Buffer.allocUnsafe(0)
+ //Buffer check
+ if (isBuffer(source)) {
+ return source;
+ }
+ if (!('toJSON' in source)) {
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
+ visited.add(source);
+ const target = isArray(source) ? [] : {};
+ forEach(source, (value, key) => {
+ const reducedValue = visit(value);
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
+ });
+ visited.delete(source);
+ return target;
+ }
+ }
+ return source;
+ };
+ return visit(obj);
+};
-module.exports = {
- uid,
- staticPropertyDescriptors,
- states,
- opcodes,
- maxUnsigned16Bit,
- parserStates,
- emptyBuffer
-}
+/**
+ * Determines if a value is an async function.
+ *
+ * @param {*} thing - The value to test.
+ * @returns {boolean} True if value is an async function, otherwise false.
+ */
+const isAsyncFn = kindOfTest('AsyncFunction');
+/**
+ * Determines if a value is thenable (has then and catch methods).
+ *
+ * @param {*} thing - The value to test.
+ * @returns {boolean} True if value is thenable, otherwise false.
+ */
+const isThenable = thing => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
-/***/ }),
+// original code
+// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
-/***/ 2611:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/**
+ * Provides a cross-platform setImmediate implementation.
+ * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
+ *
+ * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
+ * @param {boolean} postMessageSupported - Whether postMessage is supported.
+ * @returns {Function} A function to schedule a callback asynchronously.
+ */
+const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
+ if (setImmediateSupported) {
+ return setImmediate;
+ }
+ return postMessageSupported ? ((token, callbacks) => {
+ _global.addEventListener('message', ({
+ source,
+ data
+ }) => {
+ if (source === _global && data === token) {
+ callbacks.length && callbacks.shift()();
+ }
+ }, false);
+ return cb => {
+ callbacks.push(cb);
+ _global.postMessage(token, '*');
+ };
+ })(`axios@${Math.random()}`, []) : cb => setTimeout(cb);
+})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
-"use strict";
+/**
+ * Schedules a microtask or asynchronous callback as soon as possible.
+ * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
+ *
+ * @type {Function}
+ */
+const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
+// *********************
-const { webidl } = __nccwpck_require__(1744)
-const { kEnumerableProperty } = __nccwpck_require__(3983)
-const { MessagePort } = __nccwpck_require__(1267)
+const isIterable = thing => thing != null && isFunction$1(thing[iterator]);
/**
- * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
+ * Determine if a value is iterable via an iterator that is NOT sourced solely
+ * from a polluted Object.prototype. Use this instead of `isIterable` whenever
+ * the iterable comes from untrusted input (e.g. user-supplied header sources),
+ * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
+ * into an attacker-controlled entries iterator.
+ *
+ * @param {*} thing The value to test
+ *
+ * @returns {boolean} True if value has a non-polluted iterator
*/
-class MessageEvent extends Event {
- #eventInit
-
- constructor (type, eventInitDict = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
+const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
+var utils$1 = {
+ isArray,
+ isArrayBuffer,
+ isBuffer,
+ isFormData,
+ isArrayBufferView,
+ isString,
+ isNumber,
+ isBoolean,
+ isObject,
+ isPlainObject,
+ isEmptyObject,
+ isReadableStream,
+ isRequest,
+ isResponse,
+ isHeaders,
+ isUndefined,
+ isDate,
+ isFile,
+ isReactNativeBlob,
+ isReactNative,
+ isBlob,
+ isRegExp,
+ isFunction: isFunction$1,
+ isStream,
+ isURLSearchParams,
+ isTypedArray,
+ isFileList,
+ forEach,
+ merge,
+ extend,
+ trim,
+ stripBOM,
+ inherits,
+ toFlatObject,
+ kindOf,
+ kindOfTest,
+ endsWith,
+ toArray,
+ forEachEntry,
+ matchAll,
+ isHTMLForm,
+ hasOwnProperty,
+ hasOwnProp: hasOwnProperty,
+ // an alias to avoid ESLint no-prototype-builtins detection
+ hasOwnInPrototypeChain,
+ getSafeProp,
+ reduceDescriptors,
+ freezeMethods,
+ toObjectSet,
+ toCamelCase,
+ noop,
+ toFiniteNumber,
+ findKey,
+ global: _global,
+ isContextDefined,
+ isSpecCompliantForm,
+ toJSONObject,
+ isAsyncFn,
+ isThenable,
+ setImmediate: _setImmediate,
+ asap,
+ isIterable,
+ isSafeIterable
+};
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
+// RawAxiosHeaders whose duplicates are ignored by node
+// c.f. https://nodejs.org/api/http.html#http_message_headers
+const ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
- super(type, eventInitDict)
+/**
+ * Parse headers into an object
+ *
+ * ```
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
+ * Content-Type: application/json
+ * Connection: keep-alive
+ * Transfer-Encoding: chunked
+ * ```
+ *
+ * @param {String} rawHeaders Headers needing to be parsed
+ *
+ * @returns {Object} Headers parsed into an object
+ */
+var parseHeaders = rawHeaders => {
+ const parsed = {};
+ let key;
+ let val;
+ let i;
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
+ i = line.indexOf(':');
+ key = line.substring(0, i).trim().toLowerCase();
+ val = line.substring(i + 1).trim();
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
+ return;
+ }
+ if (key === 'set-cookie') {
+ if (parsed[key]) {
+ parsed[key].push(val);
+ } else {
+ parsed[key] = [val];
+ }
+ } else {
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+ }
+ });
+ return parsed;
+};
- this.#eventInit = eventInitDict
+function trimSPorHTAB(str) {
+ let start = 0;
+ let end = str.length;
+ while (start < end) {
+ const code = str.charCodeAt(start);
+ if (code !== 0x09 && code !== 0x20) {
+ break;
+ }
+ start += 1;
}
-
- get data () {
- webidl.brandCheck(this, MessageEvent)
-
- return this.#eventInit.data
+ while (end > start) {
+ const code = str.charCodeAt(end - 1);
+ if (code !== 0x09 && code !== 0x20) {
+ break;
+ }
+ end -= 1;
}
+ return start === 0 && end === str.length ? str : str.slice(start, end);
+}
- get origin () {
- webidl.brandCheck(this, MessageEvent)
-
- return this.#eventInit.origin
+// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
+// eslint-disable-next-line no-control-regex
+const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
+// eslint-disable-next-line no-control-regex
+const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
+function sanitizeValue(value, invalidChars) {
+ if (utils$1.isArray(value)) {
+ return value.map(item => sanitizeValue(item, invalidChars));
}
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
+}
+const sanitizeHeaderValue = value => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
+const sanitizeByteStringHeaderValue = value => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
+function toByteStringHeaderObject(headers) {
+ const byteStringHeaders = Object.create(null);
+ utils$1.forEach(headers.toJSON(), (value, header) => {
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
+ });
+ return byteStringHeaders;
+}
- get lastEventId () {
- webidl.brandCheck(this, MessageEvent)
-
- return this.#eventInit.lastEventId
+const $internals = Symbol('internals');
+function normalizeHeader(header) {
+ return header && String(header).trim().toLowerCase();
+}
+function normalizeValue(value) {
+ if (value === false || value == null) {
+ return value;
+ }
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
+}
+function parseTokens(str) {
+ const tokens = Object.create(null);
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
+ let match;
+ while (match = tokensRE.exec(str)) {
+ tokens[match[1]] = match[2];
+ }
+ return tokens;
+}
+const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
+function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
+ if (utils$1.isFunction(filter)) {
+ return filter.call(this, value, header);
+ }
+ if (isHeaderNameFilter) {
+ value = header;
+ }
+ if (!utils$1.isString(value)) return;
+ if (utils$1.isString(filter)) {
+ return value.indexOf(filter) !== -1;
+ }
+ if (utils$1.isRegExp(filter)) {
+ return filter.test(value);
+ }
+}
+function formatHeader(header) {
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
+ return char.toUpperCase() + str;
+ });
+}
+function buildAccessors(obj, header) {
+ const accessorName = utils$1.toCamelCase(' ' + header);
+ ['get', 'set', 'has'].forEach(methodName => {
+ Object.defineProperty(obj, methodName + accessorName, {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: function (arg1, arg2, arg3) {
+ return this[methodName].call(this, header, arg1, arg2, arg3);
+ },
+ configurable: true
+ });
+ });
+}
+class AxiosHeaders {
+ constructor(headers) {
+ headers && this.set(headers);
+ }
+ set(header, valueOrRewrite, rewrite) {
+ const self = this;
+ function setHeader(_value, _header, _rewrite) {
+ const lHeader = normalizeHeader(_header);
+ if (!lHeader) {
+ return;
+ }
+ const key = utils$1.findKey(self, lHeader);
+ if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
+ self[key || _header] = normalizeValue(_value);
+ }
+ }
+ const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
+ setHeaders(header, valueOrRewrite);
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
+ setHeaders(parseHeaders(header), valueOrRewrite);
+ } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
+ let obj = Object.create(null),
+ dest,
+ key;
+ for (const entry of header) {
+ if (!utils$1.isArray(entry)) {
+ throw new TypeError('Object iterator must return a key-value pair');
+ }
+ key = entry[0];
+ if (utils$1.hasOwnProp(obj, key)) {
+ dest = obj[key];
+ obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
+ } else {
+ obj[key] = entry[1];
+ }
+ }
+ setHeaders(obj, valueOrRewrite);
+ } else {
+ header != null && setHeader(valueOrRewrite, header, rewrite);
+ }
+ return this;
+ }
+ get(header, parser) {
+ header = normalizeHeader(header);
+ if (header) {
+ const key = utils$1.findKey(this, header);
+ if (key) {
+ const value = this[key];
+ if (!parser) {
+ return value;
+ }
+ if (parser === true) {
+ return parseTokens(value);
+ }
+ if (utils$1.isFunction(parser)) {
+ return parser.call(this, value, key);
+ }
+ if (utils$1.isRegExp(parser)) {
+ return parser.exec(value);
+ }
+ throw new TypeError('parser must be boolean|regexp|function');
+ }
+ }
}
-
- get source () {
- webidl.brandCheck(this, MessageEvent)
-
- return this.#eventInit.source
+ has(header, matcher) {
+ header = normalizeHeader(header);
+ if (header) {
+ const key = utils$1.findKey(this, header);
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
+ }
+ return false;
}
-
- get ports () {
- webidl.brandCheck(this, MessageEvent)
-
- if (!Object.isFrozen(this.#eventInit.ports)) {
- Object.freeze(this.#eventInit.ports)
+ delete(header, matcher) {
+ const self = this;
+ let deleted = false;
+ function deleteHeader(_header) {
+ _header = normalizeHeader(_header);
+ if (_header) {
+ const key = utils$1.findKey(self, _header);
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
+ delete self[key];
+ deleted = true;
+ }
+ }
}
-
- return this.#eventInit.ports
+ if (utils$1.isArray(header)) {
+ header.forEach(deleteHeader);
+ } else {
+ deleteHeader(header);
+ }
+ return deleted;
}
-
- initMessageEvent (
- type,
- bubbles = false,
- cancelable = false,
- data = null,
- origin = '',
- lastEventId = '',
- source = null,
- ports = []
- ) {
- webidl.brandCheck(this, MessageEvent)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
-
- return new MessageEvent(type, {
- bubbles, cancelable, data, origin, lastEventId, source, ports
- })
+ clear(matcher) {
+ const keys = Object.keys(this);
+ let i = keys.length;
+ let deleted = false;
+ while (i--) {
+ const key = keys[i];
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
+ delete this[key];
+ deleted = true;
+ }
+ }
+ return deleted;
}
-}
-
-/**
- * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
- */
-class CloseEvent extends Event {
- #eventInit
-
- constructor (type, eventInitDict = {}) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
-
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
-
- super(type, eventInitDict)
-
- this.#eventInit = eventInitDict
+ normalize(format) {
+ const self = this;
+ const headers = {};
+ utils$1.forEach(this, (value, header) => {
+ const key = utils$1.findKey(headers, header);
+ if (key) {
+ self[key] = normalizeValue(value);
+ delete self[header];
+ return;
+ }
+ const normalized = format ? formatHeader(header) : String(header).trim();
+ if (normalized !== header) {
+ delete self[header];
+ }
+ self[normalized] = normalizeValue(value);
+ headers[normalized] = true;
+ });
+ return this;
}
-
- get wasClean () {
- webidl.brandCheck(this, CloseEvent)
-
- return this.#eventInit.wasClean
+ concat(...targets) {
+ return this.constructor.concat(this, ...targets);
}
-
- get code () {
- webidl.brandCheck(this, CloseEvent)
-
- return this.#eventInit.code
+ toJSON(asStrings) {
+ const obj = Object.create(null);
+ utils$1.forEach(this, (value, header) => {
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
+ });
+ return obj;
}
-
- get reason () {
- webidl.brandCheck(this, CloseEvent)
-
- return this.#eventInit.reason
+ [Symbol.iterator]() {
+ return Object.entries(this.toJSON())[Symbol.iterator]();
}
-}
-
-// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
-class ErrorEvent extends Event {
- #eventInit
-
- constructor (type, eventInitDict) {
- webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
-
- super(type, eventInitDict)
-
- type = webidl.converters.DOMString(type)
- eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
-
- this.#eventInit = eventInitDict
+ toString() {
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
}
-
- get message () {
- webidl.brandCheck(this, ErrorEvent)
-
- return this.#eventInit.message
+ getSetCookie() {
+ return this.get('set-cookie') || [];
}
-
- get filename () {
- webidl.brandCheck(this, ErrorEvent)
-
- return this.#eventInit.filename
+ get [Symbol.toStringTag]() {
+ return 'AxiosHeaders';
}
-
- get lineno () {
- webidl.brandCheck(this, ErrorEvent)
-
- return this.#eventInit.lineno
+ static from(thing) {
+ return thing instanceof this ? thing : new this(thing);
}
-
- get colno () {
- webidl.brandCheck(this, ErrorEvent)
-
- return this.#eventInit.colno
+ static concat(first, ...targets) {
+ const computed = new this(first);
+ targets.forEach(target => computed.set(target));
+ return computed;
}
-
- get error () {
- webidl.brandCheck(this, ErrorEvent)
-
- return this.#eventInit.error
+ static accessor(header) {
+ const internals = this[$internals] = this[$internals] = {
+ accessors: {}
+ };
+ const accessors = internals.accessors;
+ const prototype = this.prototype;
+ function defineAccessor(_header) {
+ const lHeader = normalizeHeader(_header);
+ if (!accessors[lHeader]) {
+ buildAccessors(prototype, _header);
+ accessors[lHeader] = true;
+ }
+ }
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
+ return this;
}
}
+AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
-Object.defineProperties(MessageEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'MessageEvent',
- configurable: true
- },
- data: kEnumerableProperty,
- origin: kEnumerableProperty,
- lastEventId: kEnumerableProperty,
- source: kEnumerableProperty,
- ports: kEnumerableProperty,
- initMessageEvent: kEnumerableProperty
-})
-
-Object.defineProperties(CloseEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'CloseEvent',
- configurable: true
- },
- reason: kEnumerableProperty,
- code: kEnumerableProperty,
- wasClean: kEnumerableProperty
-})
-
-Object.defineProperties(ErrorEvent.prototype, {
- [Symbol.toStringTag]: {
- value: 'ErrorEvent',
- configurable: true
- },
- message: kEnumerableProperty,
- filename: kEnumerableProperty,
- lineno: kEnumerableProperty,
- colno: kEnumerableProperty,
- error: kEnumerableProperty
-})
-
-webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
-
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.MessagePort
-)
+// reserved names hotfix
+utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
+ value
+}, key) => {
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
+ return {
+ get: () => value,
+ set(headerValue) {
+ this[mapped] = headerValue;
+ }
+ };
+});
+utils$1.freezeMethods(AxiosHeaders);
-const eventInit = [
- {
- key: 'bubbles',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'cancelable',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'composed',
- converter: webidl.converters.boolean,
- defaultValue: false
+const REDACTED = '[REDACTED ****]';
+function hasOwnOrPrototypeToJSON(source) {
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
+ return true;
}
-]
+ let prototype = Object.getPrototypeOf(source);
+ while (prototype && prototype !== Object.prototype) {
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
+ return true;
+ }
+ prototype = Object.getPrototypeOf(prototype);
+ }
+ return false;
+}
+
+// Build a plain-object snapshot of `config` and replace the value of any key
+// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
+// and AxiosHeaders, and short-circuits on circular references.
+function redactConfig(config, redactKeys) {
+ const lowerKeys = new Set(redactKeys.map(k => String(k).toLowerCase()));
+ const seen = [];
+ const visit = source => {
+ if (source === null || typeof source !== 'object') return source;
+ if (utils$1.isBuffer(source)) return source;
+ if (seen.indexOf(source) !== -1) return undefined;
+ if (source instanceof AxiosHeaders) {
+ source = source.toJSON();
+ }
+ seen.push(source);
+ let result;
+ if (utils$1.isArray(source)) {
+ result = [];
+ source.forEach((v, i) => {
+ const reducedValue = visit(v);
+ if (!utils$1.isUndefined(reducedValue)) {
+ result[i] = reducedValue;
+ }
+ });
+ } else {
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
+ seen.pop();
+ return source;
+ }
+ result = Object.create(null);
+ for (const [key, value] of Object.entries(source)) {
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
+ if (!utils$1.isUndefined(reducedValue)) {
+ result[key] = reducedValue;
+ }
+ }
+ }
+ seen.pop();
+ return result;
+ };
+ return visit(config);
+}
+class AxiosError extends Error {
+ static from(error, code, config, request, response, customProps) {
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
+ // Match native `Error` `cause` semantics: non-enumerable. The wrapped
+ // error often carries circular internals (sockets, requests, agents), so
+ // an enumerable `cause` makes structured loggers (pino/winston) and any
+ // own-property walk throw "Converting circular structure to JSON".
+ // Regression from #6982; see #7205. `__proto__: null` mirrors the
+ // `message` descriptor below (prototype-pollution-safe descriptor).
+ Object.defineProperty(axiosError, 'cause', {
+ __proto__: null,
+ value: error,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ axiosError.name = error.name;
-webidl.converters.MessageEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'data',
- converter: webidl.converters.any,
- defaultValue: null
- },
- {
- key: 'origin',
- converter: webidl.converters.USVString,
- defaultValue: ''
- },
- {
- key: 'lastEventId',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'source',
- // Node doesn't implement WindowProxy or ServiceWorker, so the only
- // valid value for source is a MessagePort.
- converter: webidl.nullableConverter(webidl.converters.MessagePort),
- defaultValue: null
- },
- {
- key: 'ports',
- converter: webidl.converters['sequence'],
- get defaultValue () {
- return []
+ // Preserve status from the original error if not already set from response
+ if (error.status != null && axiosError.status == null) {
+ axiosError.status = error.status;
}
+ customProps && Object.assign(axiosError, customProps);
+ return axiosError;
}
-])
-webidl.converters.CloseEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'wasClean',
- converter: webidl.converters.boolean,
- defaultValue: false
- },
- {
- key: 'code',
- converter: webidl.converters['unsigned short'],
- defaultValue: 0
- },
- {
- key: 'reason',
- converter: webidl.converters.USVString,
- defaultValue: ''
- }
-])
+ /**
+ * Create an Error with the specified message, config, error code, request and response.
+ *
+ * @param {string} message The error message.
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
+ * @param {Object} [config] The config.
+ * @param {Object} [request] The request.
+ * @param {Object} [response] The response.
+ *
+ * @returns {Error} The created error.
+ */
+ constructor(message, code, config, request, response) {
+ super(message);
-webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
- ...eventInit,
- {
- key: 'message',
- converter: webidl.converters.DOMString,
- defaultValue: ''
- },
- {
- key: 'filename',
- converter: webidl.converters.USVString,
- defaultValue: ''
- },
- {
- key: 'lineno',
- converter: webidl.converters['unsigned long'],
- defaultValue: 0
- },
- {
- key: 'colno',
- converter: webidl.converters['unsigned long'],
- defaultValue: 0
- },
- {
- key: 'error',
- converter: webidl.converters.any
+ // Make message enumerable to maintain backward compatibility
+ // The native Error constructor sets message as non-enumerable,
+ // but axios < v1.13.3 had it as enumerable
+ Object.defineProperty(this, 'message', {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: message,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ });
+ this.name = 'AxiosError';
+ this.isAxiosError = true;
+ code && (this.code = code);
+ config && (this.config = config);
+ request && (this.request = request);
+ if (response) {
+ this.response = response;
+ this.status = response.status;
+ }
+ }
+ toJSON() {
+ // Opt-in redaction: when the request config carries a `redact` array, the
+ // value of any matching key (case-insensitive, at any depth) is replaced
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
+ // existing serialization behavior unchanged.
+ const config = this.config;
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
+ const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
+ return {
+ // Standard
+ message: this.message,
+ name: this.name,
+ // Microsoft
+ description: this.description,
+ number: this.number,
+ // Mozilla
+ fileName: this.fileName,
+ lineNumber: this.lineNumber,
+ columnNumber: this.columnNumber,
+ stack: this.stack,
+ // Axios
+ config: serializedConfig,
+ code: this.code,
+ status: this.status
+ };
}
-])
-
-module.exports = {
- MessageEvent,
- CloseEvent,
- ErrorEvent
}
+// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
+AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
+AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
+AxiosError.ECONNABORTED = 'ECONNABORTED';
+AxiosError.ETIMEDOUT = 'ETIMEDOUT';
+AxiosError.ECONNREFUSED = 'ECONNREFUSED';
+AxiosError.ERR_NETWORK = 'ERR_NETWORK';
+AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
+AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
+AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
+AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
+AxiosError.ERR_CANCELED = 'ERR_CANCELED';
+AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
+AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
+AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
-/***/ }),
-
-/***/ 5444:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+// Default nesting limit shared with the inverse transform (formDataToJSON) so
+// the FormData <-> JSON round-trip stays symmetric.
+const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
+/**
+ * Determines if the given thing is a array or js object.
+ *
+ * @param {string} thing - The object or array to be visited.
+ *
+ * @returns {boolean}
+ */
+function isVisitable(thing) {
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
+}
-const { maxUnsigned16Bit } = __nccwpck_require__(9188)
+/**
+ * It removes the brackets from the end of a string
+ *
+ * @param {string} key - The key of the parameter.
+ *
+ * @returns {string} the key without the brackets.
+ */
+function removeBrackets(key) {
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
+}
-/** @type {import('crypto')} */
-let crypto
-try {
- crypto = __nccwpck_require__(6113)
-} catch {
+/**
+ * It takes a path, a key, and a boolean, and returns a string
+ *
+ * @param {string} path - The path to the current key.
+ * @param {string} key - The key of the current object being iterated over.
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
+ *
+ * @returns {string} The path to the current key.
+ */
+function renderKey(path, key, dots) {
+ if (!path) return key;
+ return path.concat(key).map(function each(token, i) {
+ // eslint-disable-next-line no-param-reassign
+ token = removeBrackets(token);
+ return !dots && i ? '[' + token + ']' : token;
+ }).join(dots ? '.' : '');
+}
+/**
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
+ *
+ * @param {Array} arr - The array to check
+ *
+ * @returns {boolean}
+ */
+function isFlatArray(arr) {
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
}
+const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
+ return /^is[A-Z]/.test(prop);
+});
-class WebsocketFrameSend {
- /**
- * @param {Buffer|undefined} data
- */
- constructor (data) {
- this.frameData = data
- this.maskKey = crypto.randomBytes(4)
- }
+/**
+ * Convert a data object to FormData
+ *
+ * @param {Object} obj
+ * @param {?Object} [formData]
+ * @param {?Object} [options]
+ * @param {Function} [options.visitor]
+ * @param {Boolean} [options.metaTokens = true]
+ * @param {Boolean} [options.dots = false]
+ * @param {?Boolean} [options.indexes = false]
+ *
+ * @returns {Object}
+ **/
- createFrame (opcode) {
- const bodyLength = this.frameData?.byteLength ?? 0
+/**
+ * It converts an object into a FormData object
+ *
+ * @param {Object} obj - The object to convert to form data.
+ * @param {string} formData - The FormData object to append to.
+ * @param {Object} options
+ *
+ * @returns
+ */
+function toFormData(obj, formData, options) {
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('target must be an object');
+ }
- /** @type {number} */
- let payloadLength = bodyLength // 0-125
- let offset = 6
+ // eslint-disable-next-line no-param-reassign
+ formData = formData || new (FormData$1 || FormData)();
- if (bodyLength > maxUnsigned16Bit) {
- offset += 8 // payload length is next 8 bytes
- payloadLength = 127
- } else if (bodyLength > 125) {
- offset += 2 // payload length is next 2 bytes
- payloadLength = 126
+ // eslint-disable-next-line no-param-reassign
+ options = utils$1.toFlatObject(options, {
+ metaTokens: true,
+ dots: false,
+ indexes: false
+ }, false, function defined(option, source) {
+ // eslint-disable-next-line no-eq-null,eqeqeq
+ return !utils$1.isUndefined(source[option]);
+ });
+ const metaTokens = options.metaTokens;
+ // eslint-disable-next-line no-use-before-define
+ const visitor = options.visitor || defaultVisitor;
+ const dots = options.dots;
+ const indexes = options.indexes;
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
+ const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
+ const stack = [];
+ if (!utils$1.isFunction(visitor)) {
+ throw new TypeError('visitor must be a function');
+ }
+ function convertValue(value) {
+ if (value === null) return '';
+ if (utils$1.isDate(value)) {
+ return value.toISOString();
}
-
- const buffer = Buffer.allocUnsafe(bodyLength + offset)
-
- // Clear first 2 bytes, everything else is overwritten
- buffer[0] = buffer[1] = 0
- buffer[0] |= 0x80 // FIN
- buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
-
- /*! ws. MIT License. Einar Otto Stangvik */
- buffer[offset - 4] = this.maskKey[0]
- buffer[offset - 3] = this.maskKey[1]
- buffer[offset - 2] = this.maskKey[2]
- buffer[offset - 1] = this.maskKey[3]
-
- buffer[1] = payloadLength
-
- if (payloadLength === 126) {
- buffer.writeUInt16BE(bodyLength, 2)
- } else if (payloadLength === 127) {
- // Clear extended payload length
- buffer[2] = buffer[3] = 0
- buffer.writeUIntBE(bodyLength, 4, 6)
+ if (utils$1.isBoolean(value)) {
+ return value.toString();
+ }
+ if (!useBlob && utils$1.isBlob(value)) {
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
+ }
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
+ if (useBlob && typeof _Blob === 'function') {
+ return new _Blob([value]);
+ }
+ if (typeof Buffer !== 'undefined') {
+ return Buffer.from(value);
+ }
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
+ }
+ return value;
+ }
+ function throwIfMaxDepthExceeded(depth) {
+ if (depth > maxDepth) {
+ throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
}
-
- buffer[1] |= 0x80 // MASK
-
- // mask body
- for (let i = 0; i < bodyLength; i++) {
- buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
+ }
+ function stringifyWithDepthLimit(value, depth) {
+ if (maxDepth === Infinity) {
+ return JSON.stringify(value);
}
+ const ancestors = [];
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
+ if (!utils$1.isObject(currentValue)) {
+ return currentValue;
+ }
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
+ ancestors.pop();
+ }
+ ancestors.push(currentValue);
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
+ return currentValue;
+ });
+ }
- return buffer
+ /**
+ * Default visitor.
+ *
+ * @param {*} value
+ * @param {String|Number} key
+ * @param {Array} path
+ * @this {FormData}
+ *
+ * @returns {boolean} return true to visit the each prop of the value recursively
+ */
+ function defaultVisitor(value, key, path) {
+ let arr = value;
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
+ formData.append(renderKey(path, key, dots), convertValue(value));
+ return false;
+ }
+ if (value && !path && typeof value === 'object') {
+ if (utils$1.endsWith(key, '{}')) {
+ // eslint-disable-next-line no-param-reassign
+ key = metaTokens ? key : key.slice(0, -2);
+ // eslint-disable-next-line no-param-reassign
+ value = stringifyWithDepthLimit(value, 1);
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
+ // eslint-disable-next-line no-param-reassign
+ key = removeBrackets(key);
+ arr.forEach(function each(el, index) {
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
+ // eslint-disable-next-line no-nested-ternary
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
+ });
+ return false;
+ }
+ }
+ if (isVisitable(value)) {
+ return true;
+ }
+ formData.append(renderKey(path, key, dots), convertValue(value));
+ return false;
+ }
+ const exposedHelpers = Object.assign(predicates, {
+ defaultVisitor,
+ convertValue,
+ isVisitable
+ });
+ function build(value, path, depth = 0) {
+ if (utils$1.isUndefined(value)) return;
+ throwIfMaxDepthExceeded(depth);
+ if (stack.indexOf(value) !== -1) {
+ throw new Error('Circular reference detected in ' + path.join('.'));
+ }
+ stack.push(value);
+ utils$1.forEach(value, function each(el, key) {
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
+ if (result === true) {
+ build(el, path ? path.concat(key) : [key], depth + 1);
+ }
+ });
+ stack.pop();
+ }
+ if (!utils$1.isObject(obj)) {
+ throw new TypeError('data must be an object');
}
+ build(obj);
+ return formData;
}
-module.exports = {
- WebsocketFrameSend
+/**
+ * It encodes a string by replacing all characters that are not in the unreserved set with
+ * their percent-encoded equivalents
+ *
+ * @param {string} str - The string to encode.
+ *
+ * @returns {string} The encoded string.
+ */
+function encode$1(str) {
+ const charMap = {
+ '!': '%21',
+ "'": '%27',
+ '(': '%28',
+ ')': '%29',
+ '~': '%7E',
+ '%20': '+'
+ };
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
+ return charMap[match];
+ });
}
+/**
+ * It takes a params object and converts it to a FormData object
+ *
+ * @param {Object} params - The parameters to be converted to a FormData object.
+ * @param {Object} options - The options object passed to the Axios constructor.
+ *
+ * @returns {void}
+ */
+function AxiosURLSearchParams(params, options) {
+ this._pairs = [];
+ params && toFormData(params, this, options);
+}
+const prototype = AxiosURLSearchParams.prototype;
+prototype.append = function append(name, value) {
+ this._pairs.push([name, value]);
+};
+prototype.toString = function toString(encoder) {
+ const _encode = encoder ? value => encoder.call(this, value, encode$1) : encode$1;
+ return this._pairs.map(function each(pair) {
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
+ }, '').join('&');
+};
-/***/ }),
-
-/***/ 1688:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const { Writable } = __nccwpck_require__(2781)
-const diagnosticsChannel = __nccwpck_require__(7643)
-const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
-const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
-const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
-const { WebsocketFrameSend } = __nccwpck_require__(5444)
-
-// This code was influenced by ws released under the MIT license.
-// Copyright (c) 2011 Einar Otto Stangvik
-// Copyright (c) 2013 Arnout Kazemier and contributors
-// Copyright (c) 2016 Luigi Pinca and contributors
-
-const channels = {}
-channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
-channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
-
-class ByteParser extends Writable {
- #buffers = []
- #byteOffset = 0
-
- #state = parserStates.INFO
+/**
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
+ * their plain counterparts (`:`, `$`, `,`, `+`).
+ *
+ * @param {string} val The value to be encoded.
+ *
+ * @returns {string} The encoded value.
+ */
+function encode(val) {
+ return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+');
+}
- #info = {}
- #fragments = []
+/**
+ * Build a URL by appending params to the end
+ *
+ * @param {string} url The base of the url (e.g., http://www.google.com)
+ * @param {object} [params] The params to be appended
+ * @param {?(object|Function)} options
+ *
+ * @returns {string} The formatted url
+ */
+function buildURL(url, params, options) {
+ if (!params) {
+ return url;
+ }
+ url = url || '';
+ const _options = utils$1.isFunction(options) ? {
+ serialize: options
+ } : options;
- constructor (ws) {
- super()
+ // Read serializer options pollution-safely: own properties and methods on a
+ // class/template prototype are honored, but values injected onto a polluted
+ // Object.prototype are ignored.
+ const _encode = utils$1.getSafeProp(_options, 'encode') || encode;
+ const serializeFn = utils$1.getSafeProp(_options, 'serialize');
+ let serializedParams;
+ if (serializeFn) {
+ serializedParams = serializeFn(params, _options);
+ } else {
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
+ }
+ if (serializedParams) {
+ const hashmarkIndex = url.indexOf('#');
+ if (hashmarkIndex !== -1) {
+ url = url.slice(0, hashmarkIndex);
+ }
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
+ }
+ return url;
+}
- this.ws = ws
+class InterceptorManager {
+ constructor() {
+ this.handlers = [];
}
/**
- * @param {Buffer} chunk
- * @param {() => void} callback
+ * Add a new interceptor to the stack
+ *
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
+ *
+ * @return {Number} An ID used to remove interceptor later
*/
- _write (chunk, _, callback) {
- this.#buffers.push(chunk)
- this.#byteOffset += chunk.length
-
- this.run(callback)
+ use(fulfilled, rejected, options) {
+ this.handlers.push({
+ fulfilled,
+ rejected,
+ synchronous: options ? options.synchronous : false,
+ runWhen: options ? options.runWhen : null
+ });
+ return this.handlers.length - 1;
}
/**
- * Runs whenever a new chunk is received.
- * Callback is called whenever there are no more chunks buffering,
- * or not enough bytes are buffered to parse.
+ * Remove an interceptor from the stack
+ *
+ * @param {Number} id The ID that was returned by `use`
+ *
+ * @returns {void}
*/
- run (callback) {
- while (true) {
- if (this.#state === parserStates.INFO) {
- // If there aren't enough bytes to parse the payload length, etc.
- if (this.#byteOffset < 2) {
- return callback()
- }
-
- const buffer = this.consume(2)
-
- this.#info.fin = (buffer[0] & 0x80) !== 0
- this.#info.opcode = buffer[0] & 0x0F
-
- // If we receive a fragmented message, we use the type of the first
- // frame to parse the full message as binary/text, when it's terminated
- this.#info.originalOpcode ??= this.#info.opcode
-
- this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
-
- if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
- // Only text and binary frames can be fragmented
- failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
- return
- }
-
- const payloadLength = buffer[1] & 0x7F
-
- if (payloadLength <= 125) {
- this.#info.payloadLength = payloadLength
- this.#state = parserStates.READ_DATA
- } else if (payloadLength === 126) {
- this.#state = parserStates.PAYLOADLENGTH_16
- } else if (payloadLength === 127) {
- this.#state = parserStates.PAYLOADLENGTH_64
- }
-
- if (this.#info.fragmented && payloadLength > 125) {
- // A fragmented frame can't be fragmented itself
- failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
- return
- } else if (
- (this.#info.opcode === opcodes.PING ||
- this.#info.opcode === opcodes.PONG ||
- this.#info.opcode === opcodes.CLOSE) &&
- payloadLength > 125
- ) {
- // Control frames can have a payload length of 125 bytes MAX
- failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
- return
- } else if (this.#info.opcode === opcodes.CLOSE) {
- if (payloadLength === 1) {
- failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
- return
- }
-
- const body = this.consume(payloadLength)
-
- this.#info.closeInfo = this.parseCloseBody(false, body)
-
- if (!this.ws[kSentClose]) {
- // If an endpoint receives a Close frame and did not previously send a
- // Close frame, the endpoint MUST send a Close frame in response. (When
- // sending a Close frame in response, the endpoint typically echos the
- // status code it received.)
- const body = Buffer.allocUnsafe(2)
- body.writeUInt16BE(this.#info.closeInfo.code, 0)
- const closeFrame = new WebsocketFrameSend(body)
-
- this.ws[kResponse].socket.write(
- closeFrame.createFrame(opcodes.CLOSE),
- (err) => {
- if (!err) {
- this.ws[kSentClose] = true
- }
- }
- )
- }
-
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- this.ws[kReadyState] = states.CLOSING
- this.ws[kReceivedClose] = true
-
- this.end()
-
- return
- } else if (this.#info.opcode === opcodes.PING) {
- // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
- // response, unless it already received a Close frame.
- // A Pong frame sent in response to a Ping frame must have identical
- // "Application data"
-
- const body = this.consume(payloadLength)
-
- if (!this.ws[kReceivedClose]) {
- const frame = new WebsocketFrameSend(body)
-
- this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
-
- if (channels.ping.hasSubscribers) {
- channels.ping.publish({
- payload: body
- })
- }
- }
-
- this.#state = parserStates.INFO
-
- if (this.#byteOffset > 0) {
- continue
- } else {
- callback()
- return
- }
- } else if (this.#info.opcode === opcodes.PONG) {
- // A Pong frame MAY be sent unsolicited. This serves as a
- // unidirectional heartbeat. A response to an unsolicited Pong frame is
- // not expected.
-
- const body = this.consume(payloadLength)
+ eject(id) {
+ if (this.handlers[id]) {
+ this.handlers[id] = null;
+ }
+ }
- if (channels.pong.hasSubscribers) {
- channels.pong.publish({
- payload: body
- })
- }
+ /**
+ * Clear all interceptors from the stack
+ *
+ * @returns {void}
+ */
+ clear() {
+ if (this.handlers) {
+ this.handlers = [];
+ }
+ }
- if (this.#byteOffset > 0) {
- continue
- } else {
- callback()
- return
- }
- }
- } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
- if (this.#byteOffset < 2) {
- return callback()
- }
+ /**
+ * Iterate over all the registered interceptors
+ *
+ * This method is particularly useful for skipping over any
+ * interceptors that may have become `null` calling `eject`.
+ *
+ * @param {Function} fn The function to call for each interceptor
+ *
+ * @returns {void}
+ */
+ forEach(fn) {
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
+ if (h !== null) {
+ fn(h);
+ }
+ });
+ }
+}
- const buffer = this.consume(2)
+var transitionalDefaults = {
+ silentJSONParsing: true,
+ forcedJSONParsing: true,
+ clarifyTimeoutError: false,
+ legacyInterceptorReqResOrdering: true,
+ advertiseZstdAcceptEncoding: false,
+ validateStatusUndefinedResolves: true
+};
- this.#info.payloadLength = buffer.readUInt16BE(0)
- this.#state = parserStates.READ_DATA
- } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
- if (this.#byteOffset < 8) {
- return callback()
- }
+var URLSearchParams = url.URLSearchParams;
- const buffer = this.consume(8)
- const upper = buffer.readUInt32BE(0)
+const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
+const DIGIT = '0123456789';
+const ALPHABET = {
+ DIGIT,
+ ALPHA,
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
+};
+const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
+ let str = '';
+ const {
+ length
+ } = alphabet;
+ const randomValues = new Uint32Array(size);
+ crypto.randomFillSync(randomValues);
+ for (let i = 0; i < size; i++) {
+ str += alphabet[randomValues[i] % length];
+ }
+ return str;
+};
+var platform$1 = {
+ isNode: true,
+ classes: {
+ URLSearchParams,
+ FormData: FormData$1,
+ Blob: typeof Blob !== 'undefined' && Blob || null
+ },
+ ALPHABET,
+ generateString,
+ protocols: ['http', 'https', 'file', 'data']
+};
- // 2^31 is the maxinimum bytes an arraybuffer can contain
- // on 32-bit systems. Although, on 64-bit systems, this is
- // 2^53-1 bytes.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
- // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
- // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
- if (upper > 2 ** 31 - 1) {
- failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
- return
- }
+const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
+const _navigator = typeof navigator === 'object' && navigator || undefined;
- const lower = buffer.readUInt32BE(4)
+/**
+ * Determine if we're running in a standard browser environment
+ *
+ * This allows axios to run in a web worker, and react-native.
+ * Both environments support XMLHttpRequest, but not fully standard globals.
+ *
+ * web workers:
+ * typeof window -> undefined
+ * typeof document -> undefined
+ *
+ * react-native:
+ * navigator.product -> 'ReactNative'
+ * nativescript
+ * navigator.product -> 'NativeScript' or 'NS'
+ *
+ * @returns {boolean}
+ */
+const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
- this.#info.payloadLength = (upper << 8) + lower
- this.#state = parserStates.READ_DATA
- } else if (this.#state === parserStates.READ_DATA) {
- if (this.#byteOffset < this.#info.payloadLength) {
- // If there is still more data in this chunk that needs to be read
- return callback()
- } else if (this.#byteOffset >= this.#info.payloadLength) {
- // If the server sent multiple frames in a single chunk
+/**
+ * Determine if we're running in a standard browser webWorker environment
+ *
+ * Although the `isStandardBrowserEnv` method indicates that
+ * `allows axios to run in a web worker`, the WebWorker will still be
+ * filtered out due to its judgment standard
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
+ * This leads to a problem when axios post `FormData` in webWorker
+ */
+const hasStandardBrowserWebWorkerEnv = (() => {
+ return typeof WorkerGlobalScope !== 'undefined' &&
+ // eslint-disable-next-line no-undef
+ self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
+})();
+const origin = hasBrowserEnv && window.location.href || 'http://localhost';
- const body = this.consume(this.#info.payloadLength)
+var utils = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ hasBrowserEnv: hasBrowserEnv,
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
+ navigator: _navigator,
+ origin: origin
+});
- this.#fragments.push(body)
+var platform = {
+ ...utils,
+ ...platform$1
+};
- // If the frame is unfragmented, or a fragmented frame was terminated,
- // a message was received
- if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
- const fullMessage = Buffer.concat(this.#fragments)
+function toURLEncodedForm(data, options) {
+ return toFormData(data, new platform.classes.URLSearchParams(), {
+ visitor: function (value, key, path, helpers) {
+ if (platform.isNode && utils$1.isBuffer(value)) {
+ this.append(key, value.toString('base64'));
+ return false;
+ }
+ return helpers.defaultVisitor.apply(this, arguments);
+ },
+ ...options
+ });
+}
- websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
+const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
+function throwIfDepthExceeded(index) {
+ if (index > MAX_DEPTH) {
+ throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
+ }
+}
- this.#info = {}
- this.#fragments.length = 0
- }
+/**
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
+ *
+ * @param {string} name - The name of the property to get.
+ *
+ * @returns An array of strings.
+ */
+function parsePropPath(name) {
+ // foo[x][y][z]
+ // foo.x.y.z
+ // foo-x-y-z
+ // foo x y z
+ const path = [];
+ const pattern = /\w+|\[(\w*)]/g;
+ let match;
+ while ((match = pattern.exec(name)) !== null) {
+ throwIfDepthExceeded(path.length);
+ path.push(match[0] === '[]' ? '' : match[1] || match[0]);
+ }
+ return path;
+}
- this.#state = parserStates.INFO
- }
- }
+/**
+ * Convert an array to an object.
+ *
+ * @param {Array} arr - The array to convert to an object.
+ *
+ * @returns An object with the same keys and values as the array.
+ */
+function arrayToObject(arr) {
+ const obj = {};
+ const keys = Object.keys(arr);
+ let i;
+ const len = keys.length;
+ let key;
+ for (i = 0; i < len; i++) {
+ key = keys[i];
+ obj[key] = arr[key];
+ }
+ return obj;
+}
- if (this.#byteOffset > 0) {
- continue
+/**
+ * It takes a FormData object and returns a JavaScript object
+ *
+ * @param {string} formData The FormData object to convert to JSON.
+ *
+ * @returns {Object | null} The converted object.
+ */
+function formDataToJSON(formData) {
+ function buildPath(path, value, target, index) {
+ throwIfDepthExceeded(index);
+ let name = path[index++];
+ if (name === '__proto__') return true;
+ const isNumericKey = Number.isFinite(+name);
+ const isLast = index >= path.length;
+ name = !name && utils$1.isArray(target) ? target.length : name;
+ if (isLast) {
+ if (utils$1.hasOwnProp(target, name)) {
+ target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
} else {
- callback()
- break
+ target[name] = value;
}
+ return !isNumericKey;
}
- }
-
- /**
- * Take n bytes from the buffered Buffers
- * @param {number} n
- * @returns {Buffer|null}
- */
- consume (n) {
- if (n > this.#byteOffset) {
- return null
- } else if (n === 0) {
- return emptyBuffer
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
+ target[name] = [];
}
-
- if (this.#buffers[0].length === n) {
- this.#byteOffset -= this.#buffers[0].length
- return this.#buffers.shift()
+ const result = buildPath(path, value, target[name], index);
+ if (result && utils$1.isArray(target[name])) {
+ target[name] = arrayToObject(target[name]);
}
+ return !isNumericKey;
+ }
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
+ const obj = {};
+ utils$1.forEachEntry(formData, (name, value) => {
+ buildPath(parsePropPath(name), value, obj, 0);
+ });
+ return obj;
+ }
+ return null;
+}
- const buffer = Buffer.allocUnsafe(n)
- let offset = 0
-
- while (offset !== n) {
- const next = this.#buffers[0]
- const { length } = next
+const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined;
- if (length + offset === n) {
- buffer.set(this.#buffers.shift(), offset)
- break
- } else if (length + offset > n) {
- buffer.set(next.subarray(0, n - offset), offset)
- this.#buffers[0] = next.subarray(n - offset)
- break
- } else {
- buffer.set(this.#buffers.shift(), offset)
- offset += next.length
+/**
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
+ * of the input
+ *
+ * @param {any} rawValue - The value to be stringified.
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
+ * @param {Function} encoder - A function that takes a value and returns a string.
+ *
+ * @returns {string} A stringified version of the rawValue.
+ */
+function stringifySafely(rawValue, parser, encoder) {
+ if (utils$1.isString(rawValue)) {
+ try {
+ (parser || JSON.parse)(rawValue);
+ return utils$1.trim(rawValue);
+ } catch (e) {
+ if (e.name !== 'SyntaxError') {
+ throw e;
}
}
-
- this.#byteOffset -= n
-
- return buffer
}
-
- parseCloseBody (onlyCode, data) {
- // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
- /** @type {number|undefined} */
- let code
-
- if (data.length >= 2) {
- // _The WebSocket Connection Close Code_ is
- // defined as the status code (Section 7.4) contained in the first Close
- // control frame received by the application
- code = data.readUInt16BE(0)
+ return (encoder || JSON.stringify)(rawValue);
+}
+const defaults = {
+ transitional: transitionalDefaults,
+ adapter: ['xhr', 'http', 'fetch'],
+ transformRequest: [function transformRequest(data, headers) {
+ const contentType = headers.getContentType() || '';
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
+ const isObjectPayload = utils$1.isObject(data);
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
+ data = new FormData(data);
}
-
- if (onlyCode) {
- if (!isValidStatusCode(code)) {
- return null
+ const isFormData = utils$1.isFormData(data);
+ if (isFormData) {
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
+ }
+ if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
+ return data;
+ }
+ if (utils$1.isArrayBufferView(data)) {
+ return data.buffer;
+ }
+ if (utils$1.isURLSearchParams(data)) {
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
+ return data.toString();
+ }
+ let isFileList;
+ if (isObjectPayload) {
+ const formSerializer = own(this, 'formSerializer');
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
+ return toURLEncodedForm(data, formSerializer).toString();
+ }
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
+ const env = own(this, 'env');
+ const _FormData = env && env.FormData;
+ return toFormData(isFileList ? {
+ 'files[]': data
+ } : data, _FormData && new _FormData(), formSerializer);
}
-
- return { code }
}
-
- // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
- /** @type {Buffer} */
- let reason = data.subarray(2)
-
- // Remove BOM
- if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
- reason = reason.subarray(3)
+ if (isObjectPayload || hasJSONContentType) {
+ headers.setContentType('application/json', false);
+ return stringifySafely(data);
}
-
- if (code !== undefined && !isValidStatusCode(code)) {
- return null
+ return data;
+ }],
+ transformResponse: [function transformResponse(data) {
+ const transitional = own(this, 'transitional') || defaults.transitional;
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
+ const responseType = own(this, 'responseType');
+ const JSONRequested = responseType === 'json';
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
+ return data;
}
-
- try {
- // TODO: optimize this
- reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
- } catch {
- return null
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
+ try {
+ return JSON.parse(data, own(this, 'parseReviver'));
+ } catch (e) {
+ if (strictJSONParsing) {
+ if (e.name === 'SyntaxError') {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
+ }
+ throw e;
+ }
+ }
+ }
+ return data;
+ }],
+ /**
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
+ * timeout is not created.
+ */
+ timeout: 0,
+ xsrfCookieName: 'XSRF-TOKEN',
+ xsrfHeaderName: 'X-XSRF-TOKEN',
+ maxContentLength: -1,
+ maxBodyLength: -1,
+ env: {
+ FormData: platform.classes.FormData,
+ Blob: platform.classes.Blob
+ },
+ validateStatus: function validateStatus(status) {
+ return status >= 200 && status < 300;
+ },
+ headers: {
+ common: {
+ Accept: 'application/json, text/plain, */*',
+ 'Content-Type': undefined
}
-
- return { code, reason }
}
+};
+utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], method => {
+ defaults.headers[method] = {};
+});
- get closingInfo () {
- return this.#info.closeInfo
- }
+/**
+ * Transform the data for a request or a response
+ *
+ * @param {Array|Function} fns A single function or Array of functions
+ * @param {?Object} response The response object
+ *
+ * @returns {*} The resulting transformed data
+ */
+function transformData(fns, response) {
+ const config = this || defaults;
+ const context = response || config;
+ const headers = AxiosHeaders.from(context.headers);
+ let data = context.data;
+ utils$1.forEach(fns, function transform(fn) {
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
+ });
+ headers.normalize();
+ return data;
}
-module.exports = {
- ByteParser
+function isCancel(value) {
+ return !!(value && value.__CANCEL__);
}
-
-/***/ }),
-
-/***/ 7578:
-/***/ ((module) => {
-
-"use strict";
-
-
-module.exports = {
- kWebSocketURL: Symbol('url'),
- kReadyState: Symbol('ready state'),
- kController: Symbol('controller'),
- kResponse: Symbol('response'),
- kBinaryType: Symbol('binary type'),
- kSentClose: Symbol('sent close'),
- kReceivedClose: Symbol('received close'),
- kByteParser: Symbol('byte parser')
+class CanceledError extends AxiosError {
+ /**
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
+ *
+ * @param {string=} message The message.
+ * @param {Object=} config The config.
+ * @param {Object=} request The request.
+ *
+ * @returns {CanceledError} The created error.
+ */
+ constructor(message, config, request) {
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
+ this.name = 'CanceledError';
+ this.__CANCEL__ = true;
+ }
}
+/**
+ * Resolve or reject a Promise based on response status.
+ *
+ * @param {Function} resolve A function that resolves the promise.
+ * @param {Function} reject A function that rejects the promise.
+ * @param {object} response The response.
+ *
+ * @returns {object} The response.
+ */
+function settle(resolve, reject, response) {
+ const validateStatus = response.config.validateStatus;
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
+ resolve(response);
+ } else {
+ reject(new AxiosError('Request failed with status code ' + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response));
+ }
+}
-/***/ }),
-
-/***/ 5515:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
+/**
+ * Determines whether the specified URL is absolute
+ *
+ * @param {string} url The URL to test
+ *
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
+ */
+function isAbsoluteURL(url) {
+ // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
+ // by any combination of letters, digits, plus, period, or hyphen.
+ if (typeof url !== 'string') {
+ return false;
+ }
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
+}
-const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
-const { states, opcodes } = __nccwpck_require__(9188)
-const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
+/**
+ * Creates a new URL by combining the specified URLs
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} relativeURL The relative URL
+ *
+ * @returns {string} The combined URL
+ */
+function combineURLs(baseURL, relativeURL) {
+ return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
+}
-/* globals Blob */
+const malformedHttpProtocol = /^https?:(?!\/\/)/i;
+const httpProtocolControlCharacters = /[\t\n\r]/g;
+function stripLeadingC0ControlOrSpace(url) {
+ let i = 0;
+ while (i < url.length && url.charCodeAt(i) <= 0x20) {
+ i++;
+ }
+ return url.slice(i);
+}
+function normalizeURLForProtocolCheck(url) {
+ return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
+}
+function assertValidHttpProtocolURL(url, config) {
+ if (typeof url === 'string' && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
+ throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config);
+ }
+}
/**
- * @param {import('./websocket').WebSocket} ws
+ * Creates a new URL by combining the baseURL with the requestedURL,
+ * only when the requestedURL is not already an absolute URL.
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
+ *
+ * @param {string} baseURL The base URL
+ * @param {string} requestedURL Absolute or relative URL to combine
+ *
+ * @returns {string} The combined full path
*/
-function isEstablished (ws) {
- // If the server's response is validated as provided for above, it is
- // said that _The WebSocket Connection is Established_ and that the
- // WebSocket Connection is in the OPEN state.
- return ws[kReadyState] === states.OPEN
+function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
+ assertValidHttpProtocolURL(requestedURL, config);
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
+ assertValidHttpProtocolURL(baseURL, config);
+ return combineURLs(baseURL, requestedURL);
+ }
+ return requestedURL;
+}
+
+var DEFAULT_PORTS$1 = {
+ ftp: 21,
+ gopher: 70,
+ http: 80,
+ https: 443,
+ ws: 80,
+ wss: 443
+};
+function parseUrl(urlString) {
+ try {
+ return new URL(urlString);
+ } catch {
+ return null;
+ }
}
/**
- * @param {import('./websocket').WebSocket} ws
+ * @param {string|object|URL} url - The URL as a string or URL instance, or a
+ * compatible object (such as the result from legacy url.parse).
+ * @return {string} The URL of the proxy that should handle the request to the
+ * given URL. If no proxy is set, this will be an empty string.
*/
-function isClosing (ws) {
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- return ws[kReadyState] === states.CLOSING
+function getProxyForUrl(url) {
+ var parsedUrl = (typeof url === 'string' ? parseUrl(url) : url) || {};
+ var proto = parsedUrl.protocol;
+ var hostname = parsedUrl.host;
+ var port = parsedUrl.port;
+ if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
+ return ''; // Don't proxy URLs without a valid scheme or host.
+ }
+ proto = proto.split(':', 1)[0];
+ // Stripping ports in this way instead of using parsedUrl.hostname to make
+ // sure that the brackets around IPv6 addresses are kept.
+ hostname = hostname.replace(/:\d*$/, '');
+ port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
+ if (!shouldProxy(hostname, port)) {
+ return ''; // Don't proxy URLs that match NO_PROXY.
+ }
+ var proxy = getEnv(proto + '_proxy') || getEnv('all_proxy');
+ if (proxy && proxy.indexOf('://') === -1) {
+ // Missing scheme in proxy, default to the requested URL's scheme.
+ proxy = proto + '://' + proxy;
+ }
+ return proxy;
}
/**
- * @param {import('./websocket').WebSocket} ws
+ * Determines whether a given URL should be proxied.
+ *
+ * @param {string} hostname - The host name of the URL.
+ * @param {number} port - The effective port of the URL.
+ * @returns {boolean} Whether the given URL should be proxied.
+ * @private
*/
-function isClosed (ws) {
- return ws[kReadyState] === states.CLOSED
+function shouldProxy(hostname, port) {
+ var NO_PROXY = getEnv('no_proxy').toLowerCase();
+ if (!NO_PROXY) {
+ return true; // Always proxy if NO_PROXY is not set.
+ }
+ if (NO_PROXY === '*') {
+ return false; // Never proxy if wildcard is set.
+ }
+ return NO_PROXY.split(/[,\s]/).every(function (proxy) {
+ if (!proxy) {
+ return true; // Skip zero-length hosts.
+ }
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
+ if (parsedProxyPort && parsedProxyPort !== port) {
+ return true; // Skip if ports don't match.
+ }
+ if (!/^[.*]/.test(parsedProxyHostname)) {
+ // No wildcards, so stop proxying if there is an exact match.
+ return hostname !== parsedProxyHostname;
+ }
+ if (parsedProxyHostname.charAt(0) === '*') {
+ // Remove leading wildcard.
+ parsedProxyHostname = parsedProxyHostname.slice(1);
+ }
+ // Stop proxying if the hostname ends with the no_proxy host.
+ return !hostname.endsWith(parsedProxyHostname);
+ });
}
/**
- * @see https://dom.spec.whatwg.org/#concept-event-fire
- * @param {string} e
- * @param {EventTarget} target
- * @param {EventInit | undefined} eventInitDict
+ * Get the value for an environment variable.
+ *
+ * @param {string} key - The name of the environment variable.
+ * @return {string} The value of the environment variable.
+ * @private
*/
-function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
- // 1. If eventConstructor is not given, then let eventConstructor be Event.
-
- // 2. Let event be the result of creating an event given eventConstructor,
- // in the relevant realm of target.
- // 3. Initialize event’s type attribute to e.
- const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
+function getEnv(key) {
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
+}
- // 4. Initialize any other IDL attributes of event as described in the
- // invocation of this algorithm.
+const VERSION = "1.18.1";
- // 5. Return the result of dispatching event at target, with legacy target
- // override flag set if set.
- target.dispatchEvent(event)
+function parseProtocol(url) {
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
+ return match && match[1] || '';
}
+// RFC 2397: data:[][;base64],
+// mediatype = type/subtype followed by optional ;name=value parameters
+const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
+
/**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
- * @param {import('./websocket').WebSocket} ws
- * @param {number} type Opcode
- * @param {Buffer} data application data
+ * Parse data uri to a Buffer or Blob
+ *
+ * @param {String} uri
+ * @param {?Boolean} asBlob
+ * @param {?Object} options
+ * @param {?Function} options.Blob
+ *
+ * @returns {Buffer|Blob}
*/
-function websocketMessageReceived (ws, type, data) {
- // 1. If ready state is not OPEN (1), then return.
- if (ws[kReadyState] !== states.OPEN) {
- return
+function fromDataURI(uri, asBlob, options) {
+ const _Blob = options && options.Blob || platform.classes.Blob;
+ const protocol = parseProtocol(uri);
+ if (asBlob === undefined && _Blob) {
+ asBlob = true;
}
+ if (protocol === 'data') {
+ uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
+ const match = DATA_URL_PATTERN.exec(uri);
+ if (!match) {
+ throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
+ }
+ const type = match[1];
+ const params = match[2];
+ const encoding = match[3] ? 'base64' : 'utf8';
+ const body = match[4];
- // 2. Let dataForEvent be determined by switching on type and binary type:
- let dataForEvent
+ // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII
+ // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.
+ let mime = '';
+ if (type) {
+ mime = params ? type + params : type;
+ } else if (params) {
+ mime = 'text/plain' + params;
+ }
+ const buffer = encoding === 'base64' ? Buffer.from(body, 'base64') : Buffer.from(decodeURIComponent(body), encoding);
+ if (asBlob) {
+ if (!_Blob) {
+ throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
+ }
+ return new _Blob([buffer], {
+ type: mime
+ });
+ }
+ return buffer;
+ }
+ throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
+}
- if (type === opcodes.TEXT) {
- // -> type indicates that the data is Text
- // a new DOMString containing data
- try {
- dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
- } catch {
- failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
- return
+const kInternals = Symbol('internals');
+class AxiosTransformStream extends stream.Transform {
+ constructor(options) {
+ options = utils$1.toFlatObject(options, {
+ maxRate: 0,
+ chunkSize: 64 * 1024,
+ minChunkSize: 100,
+ timeWindow: 500,
+ ticksRate: 2,
+ samplesCount: 15
+ }, null, (prop, source) => {
+ return !utils$1.isUndefined(source[prop]);
+ });
+ super({
+ readableHighWaterMark: options.chunkSize
+ });
+ const internals = this[kInternals] = {
+ timeWindow: options.timeWindow,
+ chunkSize: options.chunkSize,
+ maxRate: options.maxRate,
+ minChunkSize: options.minChunkSize,
+ bytesSeen: 0,
+ isCaptured: false,
+ notifiedBytesLoaded: 0,
+ ts: Date.now(),
+ bytes: 0,
+ onReadCallback: null
+ };
+ this.on('newListener', event => {
+ if (event === 'progress') {
+ if (!internals.isCaptured) {
+ internals.isCaptured = true;
+ }
+ }
+ });
+ }
+ _read(size) {
+ const internals = this[kInternals];
+ if (internals.onReadCallback) {
+ internals.onReadCallback();
}
- } else if (type === opcodes.BINARY) {
- if (ws[kBinaryType] === 'blob') {
- // -> type indicates that the data is Binary and binary type is "blob"
- // a new Blob object, created in the relevant Realm of the WebSocket
- // object, that represents data as its raw data
- dataForEvent = new Blob([data])
+ return super._read(size);
+ }
+ _transform(chunk, encoding, callback) {
+ const internals = this[kInternals];
+ const maxRate = internals.maxRate;
+ const readableHighWaterMark = this.readableHighWaterMark;
+ const timeWindow = internals.timeWindow;
+ const divider = 1000 / timeWindow;
+ const bytesThreshold = maxRate / divider;
+ const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
+ const pushChunk = (_chunk, _callback) => {
+ const bytes = Buffer.byteLength(_chunk);
+ internals.bytesSeen += bytes;
+ internals.bytes += bytes;
+ internals.isCaptured && this.emit('progress', internals.bytesSeen);
+ if (this.push(_chunk)) {
+ process.nextTick(_callback);
+ } else {
+ internals.onReadCallback = () => {
+ internals.onReadCallback = null;
+ process.nextTick(_callback);
+ };
+ }
+ };
+ const transformChunk = (_chunk, _callback) => {
+ const chunkSize = Buffer.byteLength(_chunk);
+ let chunkRemainder = null;
+ let maxChunkSize = readableHighWaterMark;
+ let bytesLeft;
+ let passed = 0;
+ if (maxRate) {
+ const now = Date.now();
+ if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
+ internals.ts = now;
+ bytesLeft = bytesThreshold - internals.bytes;
+ internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
+ passed = 0;
+ }
+ bytesLeft = bytesThreshold - internals.bytes;
+ }
+ if (maxRate) {
+ if (bytesLeft <= 0) {
+ // next time window
+ return setTimeout(() => {
+ _callback(null, _chunk);
+ }, timeWindow - passed);
+ }
+ if (bytesLeft < maxChunkSize) {
+ maxChunkSize = bytesLeft;
+ }
+ }
+ if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
+ chunkRemainder = _chunk.subarray(maxChunkSize);
+ _chunk = _chunk.subarray(0, maxChunkSize);
+ }
+ pushChunk(_chunk, chunkRemainder ? () => {
+ process.nextTick(_callback, null, chunkRemainder);
+ } : _callback);
+ };
+ transformChunk(chunk, function transformNextChunk(err, _chunk) {
+ if (err) {
+ return callback(err);
+ }
+ if (_chunk) {
+ transformChunk(_chunk, transformNextChunk);
+ } else {
+ callback(null);
+ }
+ });
+ }
+}
+
+const {
+ asyncIterator
+} = Symbol;
+const readBlob = async function* (blob) {
+ if (blob.stream) {
+ yield* blob.stream();
+ } else if (blob.arrayBuffer) {
+ yield await blob.arrayBuffer();
+ } else if (blob[asyncIterator]) {
+ yield* blob[asyncIterator]();
+ } else {
+ yield blob;
+ }
+};
+
+const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
+const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
+const CRLF = '\r\n';
+const CRLF_BYTES = textEncoder.encode(CRLF);
+const CRLF_BYTES_COUNT = 2;
+class FormDataPart {
+ constructor(name, value) {
+ const {
+ escapeName
+ } = this.constructor;
+ const isStringValue = utils$1.isString(value);
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''}${CRLF}`;
+ if (isStringValue) {
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
} else {
- // -> type indicates that the data is Binary and binary type is "arraybuffer"
- // a new ArrayBuffer object, created in the relevant Realm of the
- // WebSocket object, whose contents are data
- dataForEvent = new Uint8Array(data).buffer
+ const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
+ headers += `Content-Type: ${safeType}${CRLF}`;
+ }
+ this.headers = textEncoder.encode(headers + CRLF);
+ this.contentLength = isStringValue ? value.byteLength : value.size;
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
+ this.name = name;
+ this.value = value;
+ }
+ async *encode() {
+ yield this.headers;
+ const {
+ value
+ } = this;
+ if (utils$1.isTypedArray(value)) {
+ yield value;
+ } else {
+ yield* readBlob(value);
}
+ yield CRLF_BYTES;
+ }
+ static escapeName(name) {
+ return String(name).replace(/[\r\n"]/g, match => ({
+ '\r': '%0D',
+ '\n': '%0A',
+ '"': '%22'
+ })[match]);
}
-
- // 3. Fire an event named message at the WebSocket object, using MessageEvent,
- // with the origin attribute initialized to the serialization of the WebSocket
- // object’s url's origin, and the data attribute initialized to dataForEvent.
- fireEvent('message', ws, MessageEvent, {
- origin: ws[kWebSocketURL].origin,
- data: dataForEvent
- })
}
-
-/**
- * @see https://datatracker.ietf.org/doc/html/rfc6455
- * @see https://datatracker.ietf.org/doc/html/rfc2616
- * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
- * @param {string} protocol
- */
-function isValidSubprotocol (protocol) {
- // If present, this value indicates one
- // or more comma-separated subprotocol the client wishes to speak,
- // ordered by preference. The elements that comprise this value
- // MUST be non-empty strings with characters in the range U+0021 to
- // U+007E not including separator characters as defined in
- // [RFC2616] and MUST all be unique strings.
- if (protocol.length === 0) {
- return false
+const formDataToStream = (form, headersHandler, options) => {
+ const {
+ tag = 'form-data-boundary',
+ size = 25,
+ boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
+ } = options || {};
+ if (!utils$1.isFormData(form)) {
+ throw new TypeError('FormData instance required');
+ }
+ if (boundary.length < 1 || boundary.length > 70) {
+ throw new Error('boundary must be 1-70 characters long');
+ }
+ const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
+ let contentLength = footerBytes.byteLength;
+ const parts = Array.from(form.entries()).map(([name, value]) => {
+ const part = new FormDataPart(name, value);
+ contentLength += part.size;
+ return part;
+ });
+ contentLength += boundaryBytes.byteLength * parts.length;
+ contentLength = utils$1.toFiniteNumber(contentLength);
+ const computedHeaders = {
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
+ };
+ if (Number.isFinite(contentLength)) {
+ computedHeaders['Content-Length'] = contentLength;
}
+ headersHandler && headersHandler(computedHeaders);
+ return stream.Readable.from(async function* () {
+ for (const part of parts) {
+ yield boundaryBytes;
+ yield* part.encode();
+ }
+ yield footerBytes;
+ }());
+};
- for (const char of protocol) {
- const code = char.charCodeAt(0)
+class ZlibHeaderTransformStream extends stream.Transform {
+ __transform(chunk, encoding, callback) {
+ this.push(chunk);
+ callback();
+ }
+ _transform(chunk, encoding, callback) {
+ if (chunk.length !== 0) {
+ this._transform = this.__transform;
- if (
- code < 0x21 ||
- code > 0x7E ||
- char === '(' ||
- char === ')' ||
- char === '<' ||
- char === '>' ||
- char === '@' ||
- char === ',' ||
- char === ';' ||
- char === ':' ||
- char === '\\' ||
- char === '"' ||
- char === '/' ||
- char === '[' ||
- char === ']' ||
- char === '?' ||
- char === '=' ||
- char === '{' ||
- char === '}' ||
- code === 32 || // SP
- code === 9 // HT
- ) {
- return false
+ // Add Default Compression headers if no zlib headers are present
+ if (chunk[0] !== 120) {
+ // Hex: 78
+ const header = Buffer.alloc(2);
+ header[0] = 120; // Hex: 78
+ header[1] = 156; // Hex: 9C
+ this.push(header, encoding);
+ }
}
+ this.__transform(chunk, encoding, callback);
}
-
- return true
}
-/**
- * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
- * @param {number} code
- */
-function isValidStatusCode (code) {
- if (code >= 1000 && code < 1015) {
- return (
- code !== 1004 && // reserved
- code !== 1005 && // "MUST NOT be set as a status code"
- code !== 1006 // "MUST NOT be set as a status code"
- )
+class Http2Sessions {
+ constructor() {
+ this.sessions = Object.create(null);
+ }
+ getSession(authority, options) {
+ options = Object.assign({
+ sessionTimeout: 1000
+ }, options);
+ let authoritySessions = this.sessions[authority];
+ if (authoritySessions) {
+ let len = authoritySessions.length;
+ for (let i = 0; i < len; i++) {
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
+ return sessionHandle;
+ }
+ }
+ }
+ const session = http2.connect(authority, options);
+ let removed;
+ let timer;
+ const removeSession = () => {
+ if (removed) {
+ return;
+ }
+ removed = true;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ let entries = authoritySessions,
+ len = entries.length,
+ i = len;
+ while (i--) {
+ if (entries[i][0] === session) {
+ if (len === 1) {
+ delete this.sessions[authority];
+ } else {
+ entries.splice(i, 1);
+ }
+ if (!session.closed) {
+ session.close();
+ }
+ return;
+ }
+ }
+ };
+ const originalRequestFn = session.request;
+ const {
+ sessionTimeout
+ } = options;
+ if (sessionTimeout != null) {
+ let streamsCount = 0;
+ session.request = function () {
+ const stream = originalRequestFn.apply(this, arguments);
+ streamsCount++;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
+ }
+ stream.once('close', () => {
+ if (! --streamsCount) {
+ timer = setTimeout(() => {
+ timer = null;
+ removeSession();
+ }, sessionTimeout);
+ }
+ });
+ return stream;
+ };
+ }
+ session.once('close', removeSession);
+ let entry = [session, options];
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
+ return session;
}
-
- return code >= 3000 && code <= 4999
}
-/**
- * @param {import('./websocket').WebSocket} ws
- * @param {string|undefined} reason
- */
-function failWebsocketConnection (ws, reason) {
- const { [kController]: controller, [kResponse]: response } = ws
+const callbackify = (fn, reducer) => {
+ return utils$1.isAsyncFn(fn) ? function (...args) {
+ const cb = args.pop();
+ fn.apply(this, args).then(value => {
+ try {
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
+ } catch (err) {
+ cb(err);
+ }
+ }, cb);
+ } : fn;
+};
- controller.abort()
+const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
+const isIPv4Loopback = host => {
+ const parts = host.split('.');
+ if (parts.length !== 4) return false;
+ if (parts[0] !== '127') return false;
+ return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
+};
+const isIPv6ZeroGroup = group => /^0{1,4}$/.test(group);
+
+// The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host
+// for outbound connections, so treat it as loopback-equivalent for NO_PROXY
+// matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed
+// and full IPv6 all-zero forms so both families bypass symmetrically.
+const isIPv6Unspecified = host => {
+ if (host === '::') return true;
+ const compressionIndex = host.indexOf('::');
+ if (compressionIndex !== -1) {
+ if (compressionIndex !== host.lastIndexOf('::')) return false;
+ const left = host.slice(0, compressionIndex);
+ const right = host.slice(compressionIndex + 2);
+ const leftGroups = left ? left.split(':') : [];
+ const rightGroups = right ? right.split(':') : [];
+ const explicitGroups = leftGroups.length + rightGroups.length;
+ return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
+ }
+ const groups = host.split(':');
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
+};
+const isIPv6Loopback = host => {
+ // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1
+ // First, strip any leading "::" by normalising with Set lookup of common forms,
+ // then fall back to structural check.
+ if (host === '::1') return true;
+
+ // Check IPv4-mapped IPv6 loopback: ::ffff: or ::ffff:
+ // Node's URL parser normalises ::ffff:127.0.0.1 → ::ffff:7f00:1
+ const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
+ if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]);
+ const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
+ if (v4MappedHex) {
+ const high = parseInt(v4MappedHex[1], 16);
+ // High 16 bits must start with 127 (0x7f) — i.e. 0x7f00..0x7fff
+ return high >= 0x7f00 && high <= 0x7fff;
+ }
+
+ // Full-form ::1 variants: any number of zero groups followed by trailing 1
+ // e.g. 0:0:0:0:0:0:0:1, 0000:...:0001
+ const groups = host.split(':');
+ if (groups.length === 8) {
+ for (let i = 0; i < 7; i++) {
+ if (!/^0+$/.test(groups[i])) return false;
+ }
+ return /^0*1$/.test(groups[7]);
+ }
+ return false;
+};
+const isLoopback = host => {
+ if (!host) return false;
+ if (LOOPBACK_HOSTNAMES.has(host)) return true;
+ if (isIPv4Loopback(host)) return true;
+ if (isIPv6Unspecified(host)) return true;
+ return isIPv6Loopback(host);
+};
+const DEFAULT_PORTS = {
+ http: 80,
+ https: 443,
+ ws: 80,
+ wss: 443,
+ ftp: 21
+};
+const parseNoProxyEntry = entry => {
+ let entryHost = entry;
+ let entryPort = 0;
+ if (entryHost.charAt(0) === '[') {
+ const bracketIndex = entryHost.indexOf(']');
+ if (bracketIndex !== -1) {
+ const host = entryHost.slice(1, bracketIndex);
+ const rest = entryHost.slice(bracketIndex + 1);
+ if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) {
+ entryPort = Number.parseInt(rest.slice(1), 10);
+ }
+ return [host, entryPort];
+ }
+ }
+ const firstColon = entryHost.indexOf(':');
+ const lastColon = entryHost.lastIndexOf(':');
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
+ entryHost = entryHost.slice(0, lastColon);
+ }
+ return [entryHost, entryPort];
+};
- if (response?.socket && !response.socket.destroyed) {
- response.socket.destroy()
+// Convert IPv4-mapped IPv6 (::ffff:0:0/96 prefix) to IPv4 dotted form so both
+// sides of a NO_PROXY comparison see the same canonical address. Without this,
+// `NO_PROXY=192.168.1.5` would not match a request to `http://[::ffff:192.168.1.5]/`
+// (Node's URL parser normalises that to `[::ffff:c0a8:105]`), and vice-versa,
+// allowing the proxy-bypass policy to be circumvented by using the alternate
+// representation. Returns the input unchanged when not IPv4-mapped.
+const IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i;
+const IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i;
+const unmapIPv4MappedIPv6 = host => {
+ if (typeof host !== 'string' || host.indexOf(':') === -1) return host;
+ const dotted = host.match(IPV4_MAPPED_DOTTED_RE);
+ if (dotted) return dotted[1];
+ const hex = host.match(IPV4_MAPPED_HEX_RE);
+ if (hex) {
+ const high = parseInt(hex[1], 16);
+ const low = parseInt(hex[2], 16);
+ return `${high >> 8}.${high & 0xff}.${low >> 8}.${low & 0xff}`;
+ }
+ return host;
+};
+const normalizeNoProxyHost = hostname => {
+ if (!hostname) {
+ return hostname;
}
-
- if (reason) {
- fireEvent('error', ws, ErrorEvent, {
- error: new Error(reason)
- })
+ if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') {
+ hostname = hostname.slice(1, -1);
}
-}
-
-module.exports = {
- isEstablished,
- isClosing,
- isClosed,
- fireEvent,
- isValidSubprotocol,
- isValidStatusCode,
- failWebsocketConnection,
- websocketMessageReceived
-}
-
-
-/***/ }),
-
-/***/ 4284:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const { webidl } = __nccwpck_require__(1744)
-const { DOMException } = __nccwpck_require__(1037)
-const { URLSerializer } = __nccwpck_require__(685)
-const { getGlobalOrigin } = __nccwpck_require__(1246)
-const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
-const {
- kWebSocketURL,
- kReadyState,
- kController,
- kBinaryType,
- kResponse,
- kSentClose,
- kByteParser
-} = __nccwpck_require__(7578)
-const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
-const { establishWebSocketConnection } = __nccwpck_require__(5354)
-const { WebsocketFrameSend } = __nccwpck_require__(5444)
-const { ByteParser } = __nccwpck_require__(1688)
-const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
-const { getGlobalDispatcher } = __nccwpck_require__(1892)
-const { types } = __nccwpck_require__(3837)
-
-let experimentalWarned = false
-
-// https://websockets.spec.whatwg.org/#interface-definition
-class WebSocket extends EventTarget {
- #events = {
- open: null,
- error: null,
- close: null,
- message: null
+ return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ''));
+};
+function shouldBypassProxy(location) {
+ let parsed;
+ try {
+ parsed = new URL(location);
+ } catch (_err) {
+ return false;
}
-
- #bufferedAmount = 0
- #protocol = ''
- #extensions = ''
-
- /**
- * @param {string} url
- * @param {string|string[]} protocols
- */
- constructor (url, protocols = []) {
- super()
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
-
- if (!experimentalWarned) {
- experimentalWarned = true
- process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
- code: 'UNDICI-WS'
- })
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase();
+ if (!noProxy) {
+ return false;
+ }
+ if (noProxy === '*') {
+ return true;
+ }
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;
+ const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
+ return noProxy.split(/[\s,]+/).some(entry => {
+ if (!entry) {
+ return false;
}
-
- const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols)
-
- url = webidl.converters.USVString(url)
- protocols = options.protocols
-
- // 1. Let baseURL be this's relevant settings object's API base URL.
- const baseURL = getGlobalOrigin()
-
- // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
- let urlRecord
-
- try {
- urlRecord = new URL(url, baseURL)
- } catch (e) {
- // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
- throw new DOMException(e, 'SyntaxError')
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
+ entryHost = normalizeNoProxyHost(entryHost);
+ if (!entryHost) {
+ return false;
}
-
- // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
- if (urlRecord.protocol === 'http:') {
- urlRecord.protocol = 'ws:'
- } else if (urlRecord.protocol === 'https:') {
- // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
- urlRecord.protocol = 'wss:'
+ if (entryPort && entryPort !== port) {
+ return false;
}
-
- // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
- if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
- throw new DOMException(
- `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
- 'SyntaxError'
- )
+ if (entryHost.charAt(0) === '*') {
+ entryHost = entryHost.slice(1);
}
-
- // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
- // DOMException.
- if (urlRecord.hash || urlRecord.href.endsWith('#')) {
- throw new DOMException('Got fragment', 'SyntaxError')
+ if (entryHost.charAt(0) === '.') {
+ return hostname.endsWith(entryHost);
}
+ return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost);
+ });
+}
- // 8. If protocols is a string, set protocols to a sequence consisting
- // of just that string.
- if (typeof protocols === 'string') {
- protocols = [protocols]
+/**
+ * Calculate data maxRate
+ * @param {Number} [samplesCount= 10]
+ * @param {Number} [min= 1000]
+ * @returns {Function}
+ */
+function speedometer(samplesCount, min) {
+ samplesCount = samplesCount || 10;
+ const bytes = new Array(samplesCount);
+ const timestamps = new Array(samplesCount);
+ let head = 0;
+ let tail = 0;
+ let firstSampleTS;
+ min = min !== undefined ? min : 1000;
+ return function push(chunkLength) {
+ const now = Date.now();
+ const startedAt = timestamps[tail];
+ if (!firstSampleTS) {
+ firstSampleTS = now;
}
-
- // 9. If any of the values in protocols occur more than once or otherwise
- // fail to match the requirements for elements that comprise the value
- // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
- // protocol, then throw a "SyntaxError" DOMException.
- if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
- throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ bytes[head] = chunkLength;
+ timestamps[head] = now;
+ let i = tail;
+ let bytesCount = 0;
+ while (i !== head) {
+ bytesCount += bytes[i++];
+ i = i % samplesCount;
}
-
- if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
- throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
+ head = (head + 1) % samplesCount;
+ if (head === tail) {
+ tail = (tail + 1) % samplesCount;
}
-
- // 10. Set this's url to urlRecord.
- this[kWebSocketURL] = new URL(urlRecord.href)
-
- // 11. Let client be this's relevant settings object.
-
- // 12. Run this step in parallel:
-
- // 1. Establish a WebSocket connection given urlRecord, protocols,
- // and client.
- this[kController] = establishWebSocketConnection(
- urlRecord,
- protocols,
- this,
- (response) => this.#onConnectionEstablished(response),
- options
- )
-
- // Each WebSocket object has an associated ready state, which is a
- // number representing the state of the connection. Initially it must
- // be CONNECTING (0).
- this[kReadyState] = WebSocket.CONNECTING
-
- // The extensions attribute must initially return the empty string.
-
- // The protocol attribute must initially return the empty string.
-
- // Each WebSocket object has an associated binary type, which is a
- // BinaryType. Initially it must be "blob".
- this[kBinaryType] = 'blob'
- }
-
- /**
- * @see https://websockets.spec.whatwg.org/#dom-websocket-close
- * @param {number|undefined} code
- * @param {string|undefined} reason
- */
- close (code = undefined, reason = undefined) {
- webidl.brandCheck(this, WebSocket)
-
- if (code !== undefined) {
- code = webidl.converters['unsigned short'](code, { clamp: true })
+ if (now - firstSampleTS < min) {
+ return;
}
+ const passed = startedAt && now - startedAt;
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
+ };
+}
- if (reason !== undefined) {
- reason = webidl.converters.USVString(reason)
+/**
+ * Throttle decorator
+ * @param {Function} fn
+ * @param {Number} freq
+ * @return {Function}
+ */
+function throttle(fn, freq) {
+ let timestamp = 0;
+ let threshold = 1000 / freq;
+ let lastArgs;
+ let timer;
+ const invoke = (args, now = Date.now()) => {
+ timestamp = now;
+ lastArgs = null;
+ if (timer) {
+ clearTimeout(timer);
+ timer = null;
}
-
- // 1. If code is present, but is neither an integer equal to 1000 nor an
- // integer in the range 3000 to 4999, inclusive, throw an
- // "InvalidAccessError" DOMException.
- if (code !== undefined) {
- if (code !== 1000 && (code < 3000 || code > 4999)) {
- throw new DOMException('invalid code', 'InvalidAccessError')
+ fn(...args);
+ };
+ const throttled = (...args) => {
+ const now = Date.now();
+ const passed = now - timestamp;
+ if (passed >= threshold) {
+ invoke(args, now);
+ } else {
+ lastArgs = args;
+ if (!timer) {
+ timer = setTimeout(() => {
+ timer = null;
+ invoke(lastArgs);
+ }, threshold - passed);
}
}
+ };
+ const flush = () => lastArgs && invoke(lastArgs);
+ return [throttled, flush];
+}
- let reasonByteLength = 0
+const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
+ let bytesNotified = 0;
+ const _speedometer = speedometer(50, 250);
+ return throttle(e => {
+ if (!e || typeof e.loaded !== 'number') {
+ return;
+ }
+ const rawLoaded = e.loaded;
+ const total = e.lengthComputable ? e.total : undefined;
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
+ const progressBytes = Math.max(0, loaded - bytesNotified);
+ const rate = _speedometer(progressBytes);
+ bytesNotified = Math.max(bytesNotified, loaded);
+ const data = {
+ loaded,
+ total,
+ progress: total ? loaded / total : undefined,
+ bytes: progressBytes,
+ rate: rate ? rate : undefined,
+ estimated: rate && total ? (total - loaded) / rate : undefined,
+ event: e,
+ lengthComputable: total != null,
+ [isDownloadStream ? 'download' : 'upload']: true
+ };
+ listener(data);
+ }, freq);
+};
+const progressEventDecorator = (total, throttled) => {
+ const lengthComputable = total != null;
+ return [loaded => throttled[0]({
+ lengthComputable,
+ total,
+ loaded
+ }), throttled[1]];
+};
+const asyncDecorator = fn => (...args) => utils$1.asap(() => fn(...args));
- // 2. If reason is present, then run these substeps:
- if (reason !== undefined) {
- // 1. Let reasonBytes be the result of encoding reason.
- // 2. If reasonBytes is longer than 123 bytes, then throw a
- // "SyntaxError" DOMException.
- reasonByteLength = Buffer.byteLength(reason)
+/**
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
+ * - For base64: compute exact decoded size using length and padding;
+ * handle %XX at the character-count level (no string allocation).
+ * - For non-base64: compute the exact percent-decoded UTF-8 byte length.
+ *
+ * @param {string} url
+ * @returns {number}
+ */
+const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
+const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
+function estimateDataURLDecodedBytes(url) {
+ if (!url || typeof url !== 'string') return 0;
+ if (!url.startsWith('data:')) return 0;
+ const comma = url.indexOf(',');
+ if (comma < 0) return 0;
+ const meta = url.slice(5, comma);
+ const body = url.slice(comma + 1);
+ const isBase64 = /;base64/i.test(meta);
+ if (isBase64) {
+ let effectiveLen = body.length;
+ const len = body.length; // cache length
+
+ for (let i = 0; i < len; i++) {
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
+ const a = body.charCodeAt(i + 1);
+ const b = body.charCodeAt(i + 2);
+ const isHex = isHexDigit(a) && isHexDigit(b);
+ if (isHex) {
+ effectiveLen -= 2;
+ i += 2;
+ }
+ }
+ }
+ let pad = 0;
+ let idx = len - 1;
+ const tailIsPct3D = j => j >= 2 && body.charCodeAt(j - 2) === 37 &&
+ // '%'
+ body.charCodeAt(j - 1) === 51 && (
+ // '3'
+ body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
- if (reasonByteLength > 123) {
- throw new DOMException(
- `Reason must be less than 123 bytes; received ${reasonByteLength}`,
- 'SyntaxError'
- )
+ if (idx >= 0) {
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
+ pad++;
+ idx--;
+ } else if (tailIsPct3D(idx)) {
+ pad++;
+ idx -= 3;
+ }
+ }
+ if (pad === 1 && idx >= 0) {
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
+ pad++;
+ } else if (tailIsPct3D(idx)) {
+ pad++;
}
}
+ const groups = Math.floor(effectiveLen / 4);
+ const bytes = groups * 3 - (pad || 0);
+ return bytes > 0 ? bytes : 0;
+ }
- // 3. Run the first matching steps from the following list:
- if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
- // If this's ready state is CLOSING (2) or CLOSED (3)
- // Do nothing.
- } else if (!isEstablished(this)) {
- // If the WebSocket connection is not yet established
- // Fail the WebSocket connection and set this's ready state
- // to CLOSING (2).
- failWebsocketConnection(this, 'Connection was closed before it was established.')
- this[kReadyState] = WebSocket.CLOSING
- } else if (!isClosing(this)) {
- // If the WebSocket closing handshake has not yet been started
- // Start the WebSocket closing handshake and set this's ready
- // state to CLOSING (2).
- // - If neither code nor reason is present, the WebSocket Close
- // message must not have a body.
- // - If code is present, then the status code to use in the
- // WebSocket Close message must be the integer given by code.
- // - If reason is also present, then reasonBytes must be
- // provided in the Close message after the status code.
-
- const frame = new WebsocketFrameSend()
-
- // If neither code nor reason is present, the WebSocket Close
- // message must not have a body.
-
- // If code is present, then the status code to use in the
- // WebSocket Close message must be the integer given by code.
- if (code !== undefined && reason === undefined) {
- frame.frameData = Buffer.allocUnsafe(2)
- frame.frameData.writeUInt16BE(code, 0)
- } else if (code !== undefined && reason !== undefined) {
- // If reason is also present, then reasonBytes must be
- // provided in the Close message after the status code.
- frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
- frame.frameData.writeUInt16BE(code, 0)
- // the body MAY contain UTF-8-encoded data with value /reason/
- frame.frameData.write(reason, 2, 'utf-8')
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
+ // Valid %XX triplets count as one decoded byte; this matches the bytes that
+ // decodeURIComponent(body) would produce before Buffer re-encodes the string.
+ let bytes = 0;
+ for (let i = 0, len = body.length; i < len; i++) {
+ const c = body.charCodeAt(i);
+ if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
+ bytes += 1;
+ i += 2;
+ } else if (c < 0x80) {
+ bytes += 1;
+ } else if (c < 0x800) {
+ bytes += 2;
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
+ const next = body.charCodeAt(i + 1);
+ if (next >= 0xdc00 && next <= 0xdfff) {
+ bytes += 4;
+ i++;
} else {
- frame.frameData = emptyBuffer
+ bytes += 3;
}
-
- /** @type {import('stream').Duplex} */
- const socket = this[kResponse].socket
-
- socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
- if (!err) {
- this[kSentClose] = true
- }
- })
-
- // Upon either sending or receiving a Close control frame, it is said
- // that _The WebSocket Closing Handshake is Started_ and that the
- // WebSocket connection is in the CLOSING state.
- this[kReadyState] = states.CLOSING
} else {
- // Otherwise
- // Set this's ready state to CLOSING (2).
- this[kReadyState] = WebSocket.CLOSING
+ bytes += 3;
}
}
+ return bytes;
+}
- /**
- * @see https://websockets.spec.whatwg.org/#dom-websocket-send
- * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
- */
- send (data) {
- webidl.brandCheck(this, WebSocket)
-
- webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
-
- data = webidl.converters.WebSocketSendData(data)
-
- // 1. If this's ready state is CONNECTING, then throw an
- // "InvalidStateError" DOMException.
- if (this[kReadyState] === WebSocket.CONNECTING) {
- throw new DOMException('Sent before connected.', 'InvalidStateError')
- }
-
- // 2. Run the appropriate set of steps from the following list:
- // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
- // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
-
- if (!isEstablished(this) || isClosing(this)) {
- return
+const zlibOptions = {
+ flush: zlib.constants.Z_SYNC_FLUSH,
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
+};
+const brotliOptions = {
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
+};
+const zstdOptions = {
+ flush: zlib.constants.ZSTD_e_flush,
+ finishFlush: zlib.constants.ZSTD_e_flush
+};
+const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
+const isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
+const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : '');
+const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : '');
+const {
+ http: httpFollow,
+ https: httpsFollow
+} = followRedirects;
+const isHttps = /https:?/;
+const FORM_DATA_CONTENT_HEADERS$1 = ['content-type', 'content-length'];
+function setFormDataHeaders$1(headers, formHeaders, policy) {
+ if (policy !== 'content-only') {
+ headers.set(formHeaders);
+ return;
+ }
+ Object.entries(formHeaders).forEach(([key, val]) => {
+ if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
+ headers.set(key, val);
}
+ });
+}
- /** @type {import('stream').Duplex} */
- const socket = this[kResponse].socket
-
- // If data is a string
- if (typeof data === 'string') {
- // If the WebSocket connection is established and the WebSocket
- // closing handshake has not yet started, then the user agent
- // must send a WebSocket Message comprised of the data argument
- // using a text frame opcode; if the data cannot be sent, e.g.
- // because it would need to be buffered but the buffer is full,
- // the user agent must flag the WebSocket as full and then close
- // the WebSocket connection. Any invocation of this method with a
- // string argument that does not throw an exception must increase
- // the bufferedAmount attribute by the number of bytes needed to
- // express the argument as UTF-8.
-
- const value = Buffer.from(data)
- const frame = new WebsocketFrameSend(value)
- const buffer = frame.createFrame(opcodes.TEXT)
-
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- } else if (types.isArrayBuffer(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need
- // to be buffered but the buffer is full, the user agent must flag
- // the WebSocket as full and then close the WebSocket connection.
- // The data to be sent is the data stored in the buffer described
- // by the ArrayBuffer object. Any invocation of this method with an
- // ArrayBuffer argument that does not throw an exception must
- // increase the bufferedAmount attribute by the length of the
- // ArrayBuffer in bytes.
-
- const value = Buffer.from(data)
- const frame = new WebsocketFrameSend(value)
- const buffer = frame.createFrame(opcodes.BINARY)
-
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- } else if (ArrayBuffer.isView(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need to
- // be buffered but the buffer is full, the user agent must flag the
- // WebSocket as full and then close the WebSocket connection. The
- // data to be sent is the data stored in the section of the buffer
- // described by the ArrayBuffer object that data references. Any
- // invocation of this method with this kind of argument that does
- // not throw an exception must increase the bufferedAmount attribute
- // by the length of data’s buffer in bytes.
-
- const ab = Buffer.from(data, data.byteOffset, data.byteLength)
-
- const frame = new WebsocketFrameSend(ab)
- const buffer = frame.createFrame(opcodes.BINARY)
-
- this.#bufferedAmount += ab.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= ab.byteLength
- })
- } else if (isBlobLike(data)) {
- // If the WebSocket connection is established, and the WebSocket
- // closing handshake has not yet started, then the user agent must
- // send a WebSocket Message comprised of data using a binary frame
- // opcode; if the data cannot be sent, e.g. because it would need to
- // be buffered but the buffer is full, the user agent must flag the
- // WebSocket as full and then close the WebSocket connection. The data
- // to be sent is the raw data represented by the Blob object. Any
- // invocation of this method with a Blob argument that does not throw
- // an exception must increase the bufferedAmount attribute by the size
- // of the Blob object’s raw data, in bytes.
-
- const frame = new WebsocketFrameSend()
-
- data.arrayBuffer().then((ab) => {
- const value = Buffer.from(ab)
- frame.frameData = value
- const buffer = frame.createFrame(opcodes.BINARY)
-
- this.#bufferedAmount += value.byteLength
- socket.write(buffer, () => {
- this.#bufferedAmount -= value.byteLength
- })
- })
- }
+// Symbols used to bind a single 'error' listener to a pooled socket and track
+// the request currently owning that socket across keep-alive reuse (issue #10780).
+const kAxiosSocketListener = Symbol('axios.http.socketListener');
+const kAxiosCurrentReq = Symbol('axios.http.currentReq');
+
+// Tags HttpsProxyAgent instances installed by setProxy() so the redirect path
+// can strip them without clobbering a user-supplied agent that happens to be
+// an HttpsProxyAgent.
+const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
+
+// Cache of CONNECT-tunneling agents keyed by proxy config so repeat requests
+// through the same proxy reuse a single agent (and its socket pool). The
+// keyspace is bounded by the set of distinct proxy configs the process uses,
+// so unbounded growth is not a concern in practice.
+const tunnelingAgentCache = new Map();
+const tunnelingAgentCacheUser = new WeakMap();
+// Minimum minor versions where Node's HTTP Agent supports native proxyEnv
+// handling. Checking the selected agent below also covers startup modes such
+// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.
+const NODE_NATIVE_ENV_PROXY_SUPPORT = {
+ 22: 21,
+ 24: 5
+};
+function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
+ if (!nodeVersion) {
+ return false;
+ }
+ const [major, minor] = nodeVersion.split('.').map(part => Number(part));
+ if (!Number.isInteger(major) || !Number.isInteger(minor)) {
+ return false;
+ }
+ if (major > 24) {
+ return true;
+ }
+ return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];
+}
+function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
+ if (!isNodeNativeEnvProxySupported(nodeVersion)) {
+ return false;
+ }
+ const agentOptions = agent && agent.options;
+ return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null);
+}
+function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
+ return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;
+}
+function getTunnelingAgent(agentOptions, userHttpsAgent) {
+ const key = agentOptions.protocol + '//' + agentOptions.hostname + ':' + (agentOptions.port || '') + '#' + (agentOptions.auth || '');
+ const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent) : tunnelingAgentCache;
+ let agent = cache.get(key);
+ if (agent) return agent;
+ // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert,
+ // etc.) into the tunneling agent so they apply to the origin TLS upgrade
+ // performed after CONNECT. Our proxy fields take precedence on conflict.
+ const merged = userHttpsAgent && userHttpsAgent.options ? {
+ ...userHttpsAgent.options,
+ ...agentOptions
+ } : agentOptions;
+ agent = new HttpsProxyAgent(merged);
+ if (userHttpsAgent && userHttpsAgent.options) {
+ const originTLSOptions = {
+ ...userHttpsAgent.options
+ };
+ const callback = agent.callback;
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
+ // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
+ return callback.call(this, req, {
+ ...originTLSOptions,
+ ...opts
+ });
+ };
}
+ agent[kAxiosInstalledTunnel] = true;
+ cache.set(key, agent);
+ return agent;
+}
+const supportedProtocols = platform.protocols.map(protocol => {
+ return protocol + ':';
+});
- get readyState () {
- webidl.brandCheck(this, WebSocket)
-
- // The readyState getter steps are to return this's ready state.
- return this[kReadyState]
+// Node's WHATWG URL parser returns `username` and `password` percent-encoded.
+// Decode before composing the `auth` option so credentials such as
+// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
+// original value for malformed input so a bad encoding never throws.
+const decodeURIComponentSafe$1 = value => {
+ if (!utils$1.isString(value)) {
+ return value;
}
-
- get bufferedAmount () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#bufferedAmount
+ try {
+ return decodeURIComponent(value);
+ } catch (error) {
+ return value;
}
+};
+const flushOnFinish = (stream, [throttled, flush]) => {
+ stream.on('end', flush).on('error', flush);
+ return throttled;
+};
+const http2Sessions = new Http2Sessions();
- get url () {
- webidl.brandCheck(this, WebSocket)
-
- // The url getter steps are to return this's url, serialized.
- return URLSerializer(this[kWebSocketURL])
+/**
+ * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined,
+ * call them with the options object.
+ *
+ * @param {Object} options - The options object that was passed to the request.
+ *
+ * @returns {Object}
+ */
+function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
+ if (options.beforeRedirects.proxy) {
+ options.beforeRedirects.proxy(options);
}
-
- get extensions () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#extensions
+ if (options.beforeRedirects.auth) {
+ options.beforeRedirects.auth(options);
}
-
- get protocol () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#protocol
+ if (options.beforeRedirects.sensitiveHeaders) {
+ options.beforeRedirects.sensitiveHeaders(options, requestDetails);
}
-
- get onopen () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#events.open
+ if (options.beforeRedirects.config) {
+ options.beforeRedirects.config(options, responseDetails, requestDetails);
}
-
- set onopen (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.open) {
- this.removeEventListener('open', this.#events.open)
+}
+function stripMatchingHeaders(headers, sensitiveSet) {
+ if (!headers) {
+ return;
+ }
+ Object.keys(headers).forEach(header => {
+ if (sensitiveSet.has(header.toLowerCase())) {
+ delete headers[header];
}
+ });
+}
+function isSameOriginRedirect(redirectOptions, requestDetails) {
+ if (!requestDetails) {
+ return false;
+ }
+ try {
+ return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
+ } catch (e) {
+ // If origin comparison fails, treat the redirect as unsafe.
+ return false;
+ }
+}
- if (typeof fn === 'function') {
- this.#events.open = fn
- this.addEventListener('open', fn)
- } else {
- this.#events.open = null
+/**
+ * If the proxy or config afterRedirects functions are defined, call them with the options
+ *
+ * @param {http.ClientRequestArgs} options
+ * @param {AxiosProxyConfig} configProxy configuration from Axios options object
+ * @param {string} location
+ *
+ * @returns {http.ClientRequestArgs}
+ */
+function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
+ let proxy = configProxy;
+ const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
+ if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
+ const proxyUrl = getProxyForUrl(location);
+ if (proxyUrl) {
+ if (!shouldBypassProxy(location)) {
+ proxy = new URL(proxyUrl);
+ }
}
}
-
- get onerror () {
- webidl.brandCheck(this, WebSocket)
-
- return this.#events.error
+ // On redirect re-invocation, strip any stale Proxy-Authorization header carried
+ // over from the prior request (e.g. new target no longer uses a proxy, or uses
+ // a different proxy). Skip on the initial request so user-supplied headers are
+ // preserved. Header names are case-insensitive, so remove every case variant.
+ if (isRedirect && options.headers) {
+ for (const name of Object.keys(options.headers)) {
+ if (name.toLowerCase() === 'proxy-authorization') {
+ delete options.headers[name];
+ }
+ }
}
+ // Strip any tunneling agent we installed for the previous hop so a redirect
+ // that drops the proxy or crosses an HTTPS↔HTTP boundary doesn't reuse a
+ // stale one. Match on our Symbol marker so a user-supplied HttpsProxyAgent
+ // (which won't carry the marker) is left alone.
+ if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
+ options.agent = undefined;
+ }
+ if (proxy) {
+ // Read proxy fields without traversing the prototype chain. URL instances expose
+ // username/password/hostname/host/port/protocol via getters on URL.prototype (so
+ // direct reads are shielded), but plain object proxies — and the `auth` field
+ // (which URL does not expose) — must be guarded so a polluted Object.prototype
+ // (e.g. Object.prototype.auth = { username, password }) cannot inject
+ // attacker-controlled credentials into the Proxy-Authorization header or
+ // redirect proxying to an attacker-controlled host.
+ const isProxyURL = proxy instanceof URL;
+ const readProxyField = key => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : undefined;
+ const proxyUsername = readProxyField('username');
+ const proxyPassword = readProxyField('password');
+ let proxyAuth = utils$1.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined;
- set onerror (fn) {
- webidl.brandCheck(this, WebSocket)
-
- if (this.#events.error) {
- this.removeEventListener('error', this.#events.error)
+ // Basic proxy authorization
+ if (proxyUsername) {
+ proxyAuth = (proxyUsername || '') + ':' + (proxyPassword || '');
+ }
+ if (proxyAuth) {
+ // Support proxy auth object form. Read sub-fields via own-prop checks so a
+ // plain object inheriting from polluted Object.prototype cannot leak creds.
+ const authIsObject = typeof proxyAuth === 'object';
+ const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined;
+ const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined;
+ const validProxyAuth = Boolean(authUsername || authPassword);
+ if (validProxyAuth) {
+ proxyAuth = (authUsername || '') + ':' + (authPassword || '');
+ } else if (authIsObject) {
+ throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, {
+ proxy
+ });
+ }
}
-
- if (typeof fn === 'function') {
- this.#events.error = fn
- this.addEventListener('error', fn)
+ const targetIsHttps = isHttps.test(options.protocol);
+ if (targetIsHttps) {
+ // CONNECT-tunneling path for HTTPS targets. Preserves end-to-end TLS to
+ // the origin so the proxy cannot inspect the URL, headers, or body — the
+ // behavior already promised by THREATMODEL.md (T-R9). HttpsProxyAgent
+ // sends Proxy-Authorization on the CONNECT request only, never on the
+ // wrapped TLS request, which is why we don't stamp it onto
+ // options.headers here. If the user already supplied an HttpsProxyAgent,
+ // they own tunneling end-to-end and we leave them alone; otherwise we
+ // install our own tunneling agent and forward their TLS options (if any)
+ // so a custom httpsAgent for cert pinning / rejectUnauthorized still
+ // applies to the origin TLS upgrade.
+ if (!(configHttpsAgent instanceof HttpsProxyAgent)) {
+ const proxyHost = readProxyField('hostname') || readProxyField('host');
+ const proxyPort = readProxyField('port');
+ const rawProxyProtocol = readProxyField('protocol');
+ const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(':') ? rawProxyProtocol : `${rawProxyProtocol}:` : 'http:';
+ // Bracket IPv6 literals for URL parsing; URL.hostname strips the
+ // brackets again on read so the agent receives the raw form.
+ const proxyHostForURL = proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[') ? `[${proxyHost}]` : proxyHost;
+ const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}`);
+ const agentOptions = {
+ protocol: proxyURL.protocol,
+ hostname: proxyURL.hostname.replace(/^\[|\]$/g, ''),
+ port: proxyURL.port,
+ auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined
+ };
+ if (proxyURL.protocol === 'https:') {
+ agentOptions.ALPNProtocols = ['http/1.1'];
+ }
+ const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent);
+ // Set both: `options.agent` is consumed by the native https.request path
+ // (maxRedirects === 0); `options.agents.https` is consumed by
+ // follow-redirects, which ignores `options.agent` when `options.agents`
+ // is present.
+ options.agent = tunnelingAgent;
+ if (options.agents) {
+ options.agents.https = tunnelingAgent;
+ }
+ }
} else {
- this.#events.error = null
+ // Forward-proxy mode for plaintext HTTP targets. The request line carries
+ // the absolute URL and the proxy sees everything — acceptable for plain
+ // HTTP since the wire was already plaintext.
+ if (proxyAuth) {
+ const base64 = Buffer.from(proxyAuth, 'utf8').toString('base64');
+ options.headers['Proxy-Authorization'] = 'Basic ' + base64;
+ }
+
+ // Preserve a user-supplied Host header (case-insensitive) so callers can override
+ // the value forwarded to the proxy; otherwise default to the request URL's host.
+ let hasUserHostHeader = false;
+ for (const name of Object.keys(options.headers)) {
+ if (name.toLowerCase() === 'host') {
+ hasUserHostHeader = true;
+ break;
+ }
+ }
+ if (!hasUserHostHeader) {
+ options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
+ }
+ const proxyHost = readProxyField('hostname') || readProxyField('host');
+ options.hostname = proxyHost;
+ // Replace 'host' since options is not a URL object
+ options.host = proxyHost;
+ options.port = readProxyField('port');
+ options.path = location;
+ const proxyProtocol = readProxyField('protocol');
+ if (proxyProtocol) {
+ options.protocol = proxyProtocol.includes(':') ? proxyProtocol : `${proxyProtocol}:`;
+ }
}
}
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
+ // Configure proxy for redirected request, passing the original config proxy to apply
+ // the exact same logic as if the redirected request was performed by axios directly.
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
+ };
+}
+const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
- get onclose () {
- webidl.brandCheck(this, WebSocket)
+// temporary hotfix
- return this.#events.close
+const wrapAsync = asyncExecutor => {
+ return new Promise((resolve, reject) => {
+ let onDone;
+ let isDone;
+ const done = (value, isRejected) => {
+ if (isDone) return;
+ isDone = true;
+ onDone && onDone(value, isRejected);
+ };
+ const _resolve = value => {
+ done(value);
+ resolve(value);
+ };
+ const _reject = reason => {
+ done(reason, true);
+ reject(reason);
+ };
+ asyncExecutor(_resolve, _reject, onDoneHandler => onDone = onDoneHandler).catch(_reject);
+ });
+};
+const resolveFamily = ({
+ address,
+ family
+}) => {
+ if (!utils$1.isString(address)) {
+ throw TypeError('address must be a string');
+ }
+ return {
+ address,
+ family: family || (address.indexOf('.') < 0 ? 6 : 4)
+ };
+};
+const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
+ address,
+ family
+});
+const http2Transport = {
+ request(options, cb) {
+ const authority = options.protocol + '//' + options.hostname + ':' + (options.port || (options.protocol === 'https:' ? 443 : 80));
+ const {
+ http2Options,
+ headers
+ } = options;
+ const session = http2Sessions.getSession(authority, http2Options);
+ const {
+ HTTP2_HEADER_SCHEME,
+ HTTP2_HEADER_METHOD,
+ HTTP2_HEADER_PATH,
+ HTTP2_HEADER_STATUS
+ } = http2.constants;
+ const http2Headers = {
+ [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
+ [HTTP2_HEADER_METHOD]: options.method,
+ [HTTP2_HEADER_PATH]: options.path
+ };
+ utils$1.forEach(headers, (header, name) => {
+ name.charAt(0) !== ':' && (http2Headers[name] = header);
+ });
+ const req = session.request(http2Headers);
+ req.once('response', responseHeaders => {
+ const response = req; //duplex
+
+ responseHeaders = Object.assign({}, responseHeaders);
+ const status = responseHeaders[HTTP2_HEADER_STATUS];
+ delete responseHeaders[HTTP2_HEADER_STATUS];
+ response.headers = responseHeaders;
+ response.statusCode = +status;
+ cb(response);
+ });
+ return req;
}
+};
- set onclose (fn) {
- webidl.brandCheck(this, WebSocket)
+/*eslint consistent-return:0*/
+var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
+ // Read config pollution-safely: own properties and members inherited from
+ // a non-Object.prototype source (e.g. an Object.create(defaults) template)
+ // are honored, but values injected onto a polluted Object.prototype are
+ // ignored. All behavior-affecting reads in this adapter go through own()
+ // so the protection boundary stays consistent.
+ const own = key => utils$1.getSafeProp(config, key);
+ const transitional = own('transitional') || transitionalDefaults;
+ let data = own('data');
+ let lookup = own('lookup');
+ let family = own('family');
+ let httpVersion = own('httpVersion');
+ if (httpVersion === undefined) httpVersion = 1;
+ let http2Options = own('http2Options');
+ const httpAgent = own('httpAgent');
+ const httpsAgent = own('httpsAgent');
+ const configProxy = own('proxy');
+ const responseType = own('responseType');
+ const responseEncoding = own('responseEncoding');
+ const socketPath = own('socketPath');
+ const method = own('method').toUpperCase();
+ const maxRedirects = own('maxRedirects');
+ const maxBodyLength = own('maxBodyLength');
+ const maxContentLength = own('maxContentLength');
+ const decompress = own('decompress');
+ let isDone;
+ let rejected = false;
+ let req;
+ let connectPhaseTimer;
+ httpVersion = +httpVersion;
+ if (Number.isNaN(httpVersion)) {
+ throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
+ }
+ if (httpVersion !== 1 && httpVersion !== 2) {
+ throw TypeError(`Unsupported protocol version '${httpVersion}'`);
+ }
+ const isHttp2 = httpVersion === 2;
+ if (lookup) {
+ const _lookup = callbackify(lookup, value => utils$1.isArray(value) ? value : [value]);
+ // hotfix to support opt.all option which is required for node 20.x
+ lookup = (hostname, opt, cb) => {
+ _lookup(hostname, opt, (err, arg0, arg1) => {
+ if (err) {
+ return cb(err);
+ }
+ const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
+ });
+ };
+ }
+ const abortEmitter = new events.EventEmitter();
+ function abort(reason) {
+ try {
+ abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
+ } catch (err) {
+ // ignore emit errors
+ }
+ }
+ function clearConnectPhaseTimer() {
+ if (connectPhaseTimer) {
+ clearTimeout(connectPhaseTimer);
+ connectPhaseTimer = null;
+ }
+ }
+ function createTimeoutError() {
+ const configTimeout = own('timeout');
+ let timeoutErrorMessage = configTimeout ? 'timeout of ' + configTimeout + 'ms exceeded' : 'timeout exceeded';
+ const configTimeoutErrorMessage = own('timeoutErrorMessage');
+ if (configTimeoutErrorMessage) {
+ timeoutErrorMessage = configTimeoutErrorMessage;
+ }
+ return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
+ }
+ abortEmitter.once('abort', reject);
+ const onFinished = () => {
+ clearConnectPhaseTimer();
+ if (config.cancelToken) {
+ config.cancelToken.unsubscribe(abort);
+ }
+ if (config.signal) {
+ config.signal.removeEventListener('abort', abort);
+ }
+ abortEmitter.removeAllListeners();
+ };
+ if (config.cancelToken || config.signal) {
+ config.cancelToken && config.cancelToken.subscribe(abort);
+ if (config.signal) {
+ config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
+ }
+ }
+ onDone((response, isRejected) => {
+ isDone = true;
+ clearConnectPhaseTimer();
+ if (isRejected) {
+ rejected = true;
+ onFinished();
+ return;
+ }
+ const {
+ data
+ } = response;
+ if (data instanceof stream.Readable || data instanceof stream.Duplex) {
+ const offListeners = stream.finished(data, () => {
+ offListeners();
+ onFinished();
+ });
+ } else {
+ onFinished();
+ }
+ });
- if (this.#events.close) {
- this.removeEventListener('close', this.#events.close)
+ // Parse url
+ const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);
+ // Unix-socket requests (own socketPath) commonly pass a path-only url
+ // like '/foo'; supply a synthetic base so new URL() can still parse it.
+ // Use the own-property value (not config.socketPath) so a polluted
+ // prototype cannot influence URL base selection.
+ const urlBase = socketPath ? 'http://localhost' : platform.hasBrowserEnv ? platform.origin : undefined;
+ const parsed = new URL(fullPath, urlBase);
+ const protocol = parsed.protocol || supportedProtocols[0];
+ if (protocol === 'data:') {
+ // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
+ if (maxContentLength > -1) {
+ // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed.
+ const dataUrl = String(own('url') || fullPath || '');
+ const estimated = estimateDataURLDecodedBytes(dataUrl);
+ if (estimated > maxContentLength) {
+ return reject(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config));
+ }
+ }
+ let convertedData;
+ if (method !== 'GET') {
+ return settle(resolve, reject, {
+ status: 405,
+ statusText: 'method not allowed',
+ headers: {},
+ config
+ });
+ }
+ try {
+ convertedData = fromDataURI(own('url'), responseType === 'blob', {
+ Blob: config.env && config.env.Blob
+ });
+ } catch (err) {
+ throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
+ }
+ if (responseType === 'text') {
+ convertedData = convertedData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ convertedData = utils$1.stripBOM(convertedData);
+ }
+ } else if (responseType === 'stream') {
+ convertedData = stream.Readable.from(convertedData);
+ }
+ return settle(resolve, reject, {
+ data: convertedData,
+ status: 200,
+ statusText: 'OK',
+ headers: new AxiosHeaders(),
+ config
+ });
+ }
+ if (supportedProtocols.indexOf(protocol) === -1) {
+ return reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config));
}
+ const headers = AxiosHeaders.from(config.headers).normalize();
- if (typeof fn === 'function') {
- this.#events.close = fn
- this.addEventListener('close', fn)
+ // Set User-Agent (required by some servers)
+ // See https://github.com/axios/axios/issues/69
+ // User-Agent is specified; handle case where no UA header is desired
+ // Only set header if it hasn't been set in config
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+ const {
+ onUploadProgress,
+ onDownloadProgress
+ } = config;
+ const maxRate = config.maxRate;
+ let maxUploadRate = undefined;
+ let maxDownloadRate = undefined;
+
+ // support for spec compliant FormData objects
+ if (utils$1.isSpecCompliantForm(data)) {
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
+ data = formDataToStream(data, formHeaders => {
+ headers.set(formHeaders);
+ }, {
+ tag: `axios-${VERSION}-boundary`,
+ boundary: userBoundary && userBoundary[1] || undefined
+ });
+ // support for https://www.npmjs.com/package/form-data api
+ } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
+ setFormDataHeaders$1(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+ if (!headers.hasContentLength()) {
+ try {
+ const knownLength = await util.promisify(data.getLength).call(data);
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
+ /*eslint no-empty:0*/
+ } catch (e) {}
+ }
+ } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
+ data.size && headers.setContentType(data.type || 'application/octet-stream');
+ headers.setContentLength(data.size || 0);
+ data = stream.Readable.from(readBlob(data));
+ } else if (data && !utils$1.isStream(data)) {
+ if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
+ data = Buffer.from(new Uint8Array(data));
+ } else if (utils$1.isString(data)) {
+ data = Buffer.from(data, 'utf-8');
+ } else {
+ return reject(new AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config));
+ }
+
+ // Add Content-Length header if data exists
+ headers.setContentLength(data.length, false);
+ if (maxBodyLength > -1 && data.length > maxBodyLength) {
+ return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config));
+ }
+ }
+ const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
+ if (utils$1.isArray(maxRate)) {
+ maxUploadRate = maxRate[0];
+ maxDownloadRate = maxRate[1];
} else {
- this.#events.close = null
+ maxUploadRate = maxDownloadRate = maxRate;
+ }
+ if (data && (onUploadProgress || maxUploadRate)) {
+ if (!utils$1.isStream(data)) {
+ data = stream.Readable.from(data, {
+ objectMode: false
+ });
+ }
+ data = stream.pipeline([data, new AxiosTransformStream({
+ maxRate: utils$1.toFiniteNumber(maxUploadRate)
+ })], utils$1.noop);
+ onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
}
- }
-
- get onmessage () {
- webidl.brandCheck(this, WebSocket)
- return this.#events.message
- }
+ // HTTP basic authentication
+ let auth = undefined;
+ const configAuth = own('auth');
+ if (configAuth) {
+ const username = utils$1.getSafeProp(configAuth, 'username') || '';
+ const password = utils$1.getSafeProp(configAuth, 'password') || '';
+ auth = username + ':' + password;
+ }
+ if (!auth && (parsed.username || parsed.password)) {
+ const urlUsername = decodeURIComponentSafe$1(parsed.username);
+ const urlPassword = decodeURIComponentSafe$1(parsed.password);
+ auth = urlUsername + ':' + urlPassword;
+ }
+ auth && headers.delete('authorization');
+ let path$1;
+ try {
+ path$1 = buildURL(parsed.pathname + parsed.search, own('params'), own('paramsSerializer')).replace(/^\?/, '');
+ } catch (err) {
+ return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {
+ url: own('url'),
+ exists: true
+ }));
+ }
+ headers.set('Accept-Encoding', utils$1.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
- set onmessage (fn) {
- webidl.brandCheck(this, WebSocket)
+ // Null-prototype to block prototype pollution gadgets on properties read
+ // directly by Node's http.request (e.g. insecureHTTPParser, lookup).
+ const options = Object.assign(Object.create(null), {
+ path: path$1,
+ method: method,
+ headers: toByteStringHeaderObject(headers),
+ agents: {
+ http: httpAgent,
+ https: httpsAgent
+ },
+ auth,
+ protocol,
+ family,
+ beforeRedirect: dispatchBeforeRedirect,
+ beforeRedirects: Object.create(null),
+ http2Options
+ });
- if (this.#events.message) {
- this.removeEventListener('message', this.#events.message)
+ // cacheable-lookup integration hotfix
+ !utils$1.isUndefined(lookup) && (options.lookup = lookup);
+ if (socketPath) {
+ if (typeof socketPath !== 'string') {
+ return reject(new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ const allowedSocketPaths = own('allowedSocketPaths');
+ if (allowedSocketPaths != null) {
+ const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths];
+ const resolvedSocket = path.resolve(socketPath);
+ const isAllowed = allowed.some(entry => typeof entry === 'string' && path.resolve(entry) === resolvedSocket);
+ if (!isAllowed) {
+ return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ }
+ options.socketPath = socketPath;
+ } else {
+ options.hostname = parsed.hostname.startsWith('[') ? parsed.hostname.slice(1, -1) : parsed.hostname;
+ options.port = parsed.port;
+ setProxy(options, configProxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent, httpAgent);
+ }
+ let transport;
+ let isNativeTransport = false;
+ // True only for the follow-redirects transport, which applies
+ // options.maxBodyLength itself. Every other transport (http2, native
+ // http/https, a user-supplied custom transport) needs the explicit
+ // byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
+ let transportEnforcesMaxBodyLength = false;
+ const isHttpsRequest = isHttps.test(options.protocol);
+ // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
+ // HTTPS target.
+ if (options.agent == null) {
+ options.agent = isHttpsRequest ? httpsAgent : httpAgent;
+ }
+ if (isHttp2) {
+ transport = http2Transport;
+ } else {
+ const configTransport = own('transport');
+ if (configTransport) {
+ transport = configTransport;
+ } else if (maxRedirects === 0) {
+ transport = isHttpsRequest ? https : http;
+ isNativeTransport = true;
+ } else {
+ transportEnforcesMaxBodyLength = true;
+ options.sensitiveHeaders = [];
+ if (maxRedirects) {
+ options.maxRedirects = maxRedirects;
+ }
+ const configBeforeRedirect = own('beforeRedirect');
+ if (configBeforeRedirect) {
+ options.beforeRedirects.config = configBeforeRedirect;
+ }
+ if (auth) {
+ // Restore HTTP Basic credentials on same-origin redirects only.
+ // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929);
+ // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md
+ // and is preserved by deliberately not restoring on origin change.
+ const requestOrigin = parsed.origin;
+ const authToRestore = auth;
+ options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
+ try {
+ if (new URL(redirectOptions.href).origin === requestOrigin) {
+ redirectOptions.auth = authToRestore;
+ }
+ } catch (e) {
+ // ignore malformed URL: leaving auth stripped is fail-safe
+ }
+ };
+ }
+ const sensitiveHeaders = own('sensitiveHeaders');
+ if (sensitiveHeaders != null) {
+ if (!utils$1.isArray(sensitiveHeaders)) {
+ return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ const sensitiveSet = new Set();
+ for (const header of sensitiveHeaders) {
+ if (!utils$1.isString(header)) {
+ return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config));
+ }
+ sensitiveSet.add(header.toLowerCase());
+ }
+ if (sensitiveSet.size) {
+ options.sensitiveHeaders = Array.from(sensitiveSet);
+ options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
+ if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
+ stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
+ }
+ };
+ }
+ }
+ transport = isHttpsRequest ? httpsFollow : httpFollow;
+ }
}
- if (typeof fn === 'function') {
- this.#events.message = fn
- this.addEventListener('message', fn)
+ // Set an explicit maxBodyLength option for transports that inspect it.
+ // When maxBodyLength is -1 (default/unlimited), use Infinity so
+ // follow-redirects does not fall back to its own 10MB default.
+ if (maxBodyLength > -1) {
+ options.maxBodyLength = maxBodyLength;
} else {
- this.#events.message = null
+ options.maxBodyLength = Infinity;
}
- }
- get binaryType () {
- webidl.brandCheck(this, WebSocket)
+ // Always set an explicit own value so a polluted
+ // Object.prototype.insecureHTTPParser cannot enable the lenient parser
+ // through Node's internal options copy
+ options.insecureHTTPParser = Boolean(own('insecureHTTPParser'));
- return this[kBinaryType]
- }
+ // Create the request
+ req = transport.request(options, function handleResponse(res) {
+ clearConnectPhaseTimer();
+ if (req.destroyed) return;
+ const streams = [res];
+ const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
+ if (onDownloadProgress || maxDownloadRate) {
+ const transformStream = new AxiosTransformStream({
+ maxRate: utils$1.toFiniteNumber(maxDownloadRate)
+ });
+ onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
+ streams.push(transformStream);
+ }
- set binaryType (type) {
- webidl.brandCheck(this, WebSocket)
+ // decompress the response body transparently if required
+ let responseStream = res;
- if (type !== 'blob' && type !== 'arraybuffer') {
- this[kBinaryType] = 'blob'
- } else {
- this[kBinaryType] = type
- }
- }
+ // return the last request in case of redirects
+ const lastRequest = res.req || req;
- /**
- * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
- */
- #onConnectionEstablished (response) {
- // processResponse is called when the "response’s header list has been received and initialized."
- // once this happens, the connection is open
- this[kResponse] = response
+ // if decompress disabled we should not decompress
+ if (decompress !== false && res.headers['content-encoding']) {
+ // if no content, but headers still say that it is encoded,
+ // remove the header not confuse downstream operations
+ if (method === 'HEAD' || res.statusCode === 204) {
+ delete res.headers['content-encoding'];
+ }
+ switch ((res.headers['content-encoding'] || '').toLowerCase()) {
+ /*eslint default-case:0*/
+ case 'gzip':
+ case 'x-gzip':
+ case 'compress':
+ case 'x-compress':
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
+
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'deflate':
+ streams.push(new ZlibHeaderTransformStream());
- const parser = new ByteParser(this)
- parser.on('drain', function onParserDrain () {
- this.ws[kResponse].socket.resume()
- })
+ // add the unzipper to the body stream processing pipeline
+ streams.push(zlib.createUnzip(zlibOptions));
- response.socket.ws = this
- this[kByteParser] = parser
+ // remove the content-encoding in order to not confuse downstream operations
+ delete res.headers['content-encoding'];
+ break;
+ case 'br':
+ if (isBrotliSupported) {
+ streams.push(zlib.createBrotliDecompress(brotliOptions));
+ delete res.headers['content-encoding'];
+ }
+ break;
+ case 'zstd':
+ if (isZstdSupported) {
+ streams.push(zlib.createZstdDecompress(zstdOptions));
+ delete res.headers['content-encoding'];
+ }
+ break;
+ }
+ }
+ responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
+ const response = {
+ status: res.statusCode,
+ statusText: res.statusMessage,
+ headers: new AxiosHeaders(res.headers),
+ config,
+ request: lastRequest
+ };
+ if (responseType === 'stream') {
+ // Enforce maxContentLength on streamed responses; previously this
+ // was applied only to buffered responses.
+ if (maxContentLength > -1) {
+ const limit = maxContentLength;
+ const source = responseStream;
+ async function* enforceMaxContentLength() {
+ let totalResponseBytes = 0;
+ for await (const chunk of source) {
+ totalResponseBytes += chunk.length;
+ if (totalResponseBytes > limit) {
+ throw new AxiosError('maxContentLength size of ' + limit + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
+ }
+ yield chunk;
+ }
+ }
+ responseStream = stream.Readable.from(enforceMaxContentLength(), {
+ objectMode: false
+ });
+ }
+ response.data = responseStream;
+ settle(resolve, reject, response);
+ } else {
+ const responseBuffer = [];
+ let totalResponseBytes = 0;
+ responseStream.on('data', function handleStreamData(chunk) {
+ responseBuffer.push(chunk);
+ totalResponseBytes += chunk.length;
- // 1. Change the ready state to OPEN (1).
- this[kReadyState] = states.OPEN
+ // make sure the content length is not over the maxContentLength if specified
+ if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
+ // stream.destroy() emit aborted event before calling reject() on Node.js v16
+ rejected = true;
+ responseStream.destroy();
+ abort(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
+ }
+ });
+ responseStream.on('aborted', function handlerStreamAborted() {
+ if (rejected) {
+ return;
+ }
+ const err = new AxiosError('stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response);
+ responseStream.destroy(err);
+ reject(err);
+ });
+ responseStream.on('error', function handleStreamError(err) {
+ if (rejected) return;
+ reject(AxiosError.from(err, null, config, lastRequest, response));
+ });
+ responseStream.on('end', function handleStreamEnd() {
+ try {
+ let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
+ if (responseType !== 'arraybuffer') {
+ responseData = responseData.toString(responseEncoding);
+ if (!responseEncoding || responseEncoding === 'utf8') {
+ responseData = utils$1.stripBOM(responseData);
+ }
+ }
+ response.data = responseData;
+ } catch (err) {
+ return reject(AxiosError.from(err, null, config, response.request, response));
+ }
+ settle(resolve, reject, response);
+ });
+ }
+ abortEmitter.once('abort', err => {
+ if (!responseStream.destroyed) {
+ responseStream.emit('error', err);
+ responseStream.destroy();
+ }
+ });
+ });
+ abortEmitter.once('abort', err => {
+ if (req.close) {
+ req.close();
+ } else {
+ req.destroy(err);
+ }
+ });
+
+ // Handle errors
+ req.on('error', function handleRequestError(err) {
+ reject(AxiosError.from(err, null, config, req));
+ });
+
+ // set tcp keep alive to prevent drop connection by peer
+ // Track every socket bound to this outer RedirectableRequest so a single
+ // 'close' listener can release ownership on all of them. follow-redirects
+ // re-emits the 'socket' event for each hop's native request onto the same
+ // outer request, so attaching per-request listeners inside this handler
+ // would accumulate across hops and trigger MaxListenersExceededWarning at
+ // >= 11 redirects. Clearing only the last-bound socket would leave stale
+ // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive
+ // pool, causing an idle-pool 'error' to be attributed to a closed req.
+ const boundSockets = new Set();
+ req.on('socket', function handleRequestSocket(socket) {
+ // default interval of sending ack packet is 1 minute
+ // proxy agents (e.g. agent-base) may return a generic Duplex stream
+ // that doesn't have setKeepAlive, so guard before calling
+ if (typeof socket.setKeepAlive === 'function') {
+ socket.setKeepAlive(true, 1000 * 60);
+ }
+
+ // Install a single 'error' listener per socket (not per request) to avoid
+ // accumulating listeners on pooled keep-alive sockets that get reassigned
+ // to new requests before the previous request's 'close' fires (issue #10780).
+ // The listener is bound to the socket's currently-active request via a
+ // symbol, which is swapped as the socket is reassigned.
+ if (!socket[kAxiosSocketListener]) {
+ socket.on('error', function handleSocketError(err) {
+ const current = socket[kAxiosCurrentReq];
+ if (current && !current.destroyed) {
+ current.destroy(err);
+ }
+ });
+ socket[kAxiosSocketListener] = true;
+ }
+ socket[kAxiosCurrentReq] = req;
+ boundSockets.add(socket);
+ });
+ req.once('close', function clearCurrentReq() {
+ clearConnectPhaseTimer();
+ for (const socket of boundSockets) {
+ if (socket[kAxiosCurrentReq] === req) {
+ socket[kAxiosCurrentReq] = null;
+ }
+ }
+ boundSockets.clear();
+ });
+
+ // Handle request timeout
+ if (own('timeout')) {
+ // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
+ const timeout = parseInt(own('timeout'), 10);
+ if (Number.isNaN(timeout)) {
+ abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
+ return;
+ }
+ const handleTimeout = function handleTimeout() {
+ if (isDone) return;
+ abort(createTimeoutError());
+ };
+ if (isNativeTransport && timeout > 0) {
+ // Native ClientRequest#setTimeout starts from the socket lifecycle and
+ // may not fire while TCP connect is still pending. Mirror the
+ // follow-redirects wall-clock timer for the maxRedirects === 0 path.
+ connectPhaseTimer = setTimeout(handleTimeout, timeout);
+ }
+
+ // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
+ // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
+ // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
+ // And then these socket which be hang up will devouring CPU little by little.
+ // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
+ req.setTimeout(timeout, handleTimeout);
+ } else {
+ // explicitly reset the socket timeout value for a possible `keep-alive` request
+ req.setTimeout(0);
+ }
- // 2. Change the extensions attribute’s value to the extensions in use, if
- // it is not the null value.
- // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
- const extensions = response.headersList.get('sec-websocket-extensions')
+ // Send the request
+ if (utils$1.isStream(data)) {
+ let ended = false;
+ let errored = false;
+ data.on('end', () => {
+ ended = true;
+ });
+ data.once('error', err => {
+ errored = true;
+ req.destroy(err);
+ });
+ data.on('close', () => {
+ if (!ended && !errored) {
+ abort(new CanceledError('Request stream has been aborted', config, req));
+ }
+ });
- if (extensions !== null) {
- this.#extensions = extensions
+ // Enforce maxBodyLength for streamed uploads on every transport that
+ // does not apply options.maxBodyLength itself (native http/https, http2,
+ // and user-supplied custom transports). The follow-redirects transport
+ // enforces it on the redirected HTTP/1 path.
+ let uploadStream = data;
+ if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
+ const limit = maxBodyLength;
+ let bytesSent = 0;
+ uploadStream = stream.pipeline([data, new stream.Transform({
+ transform(chunk, _enc, cb) {
+ bytesSent += chunk.length;
+ if (bytesSent > limit) {
+ return cb(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, req));
+ }
+ cb(null, chunk);
+ }
+ })], utils$1.noop);
+ uploadStream.on('error', err => {
+ if (!req.destroyed) req.destroy(err);
+ });
+ }
+ uploadStream.pipe(req);
+ } else {
+ data && req.write(data);
+ req.end();
}
+ });
+};
- // 3. Change the protocol attribute’s value to the subprotocol in use, if
- // it is not the null value.
- // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
- const protocol = response.headersList.get('sec-websocket-protocol')
+var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => url => {
+ url = new URL(url, platform.origin);
+ return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
+})(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true;
- if (protocol !== null) {
- this.#protocol = protocol
+var cookies = platform.hasStandardBrowserEnv ?
+// Standard browser envs support document.cookie
+{
+ write(name, value, expires, path, domain, secure, sameSite) {
+ if (typeof document === 'undefined') return;
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
+ if (utils$1.isNumber(expires)) {
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
}
-
- // 4. Fire an event named open at the WebSocket object.
- fireEvent('open', this)
+ if (utils$1.isString(path)) {
+ cookie.push(`path=${path}`);
+ }
+ if (utils$1.isString(domain)) {
+ cookie.push(`domain=${domain}`);
+ }
+ if (secure === true) {
+ cookie.push('secure');
+ }
+ if (utils$1.isString(sameSite)) {
+ cookie.push(`SameSite=${sameSite}`);
+ }
+ document.cookie = cookie.join('; ');
+ },
+ read(name) {
+ if (typeof document === 'undefined') return null;
+ // Match name=value by splitting on the semicolon separator instead of building a
+ // RegExp from `name` — interpolating an unescaped string into a RegExp would let
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
+ // "; ", so ignore optional whitespace before each cookie name.
+ const cookies = document.cookie.split(';');
+ for (let i = 0; i < cookies.length; i++) {
+ const cookie = cookies[i].replace(/^\s+/, '');
+ const eq = cookie.indexOf('=');
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
+ try {
+ return decodeURIComponent(cookie.slice(eq + 1));
+ } catch (e) {
+ return cookie.slice(eq + 1);
+ }
+ }
+ }
+ return null;
+ },
+ remove(name) {
+ this.write(name, '', Date.now() - 86400000, '/');
}
-}
+} :
+// Non-standard browser env (web workers, react-native) lack needed support.
+{
+ write() {},
+ read() {
+ return null;
+ },
+ remove() {}
+};
-// https://websockets.spec.whatwg.org/#dom-websocket-connecting
-WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
-// https://websockets.spec.whatwg.org/#dom-websocket-open
-WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
-// https://websockets.spec.whatwg.org/#dom-websocket-closing
-WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
-// https://websockets.spec.whatwg.org/#dom-websocket-closed
-WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
+const headersToObject = thing => thing instanceof AxiosHeaders ? {
+ ...thing
+} : thing;
-Object.defineProperties(WebSocket.prototype, {
- CONNECTING: staticPropertyDescriptors,
- OPEN: staticPropertyDescriptors,
- CLOSING: staticPropertyDescriptors,
- CLOSED: staticPropertyDescriptors,
- url: kEnumerableProperty,
- readyState: kEnumerableProperty,
- bufferedAmount: kEnumerableProperty,
- onopen: kEnumerableProperty,
- onerror: kEnumerableProperty,
- onclose: kEnumerableProperty,
- close: kEnumerableProperty,
- onmessage: kEnumerableProperty,
- binaryType: kEnumerableProperty,
- send: kEnumerableProperty,
- extensions: kEnumerableProperty,
- protocol: kEnumerableProperty,
- [Symbol.toStringTag]: {
- value: 'WebSocket',
- writable: false,
+/**
+ * Config-specific merge-function which creates a new config-object
+ * by merging two configuration objects together.
+ *
+ * @param {Object} config1
+ * @param {Object} config2
+ *
+ * @returns {Object} New object resulting from merging config2 to config1
+ */
+function mergeConfig(config1, config2) {
+ // eslint-disable-next-line no-param-reassign
+ config1 = config1 || {};
+ config2 = config2 || {};
+
+ // Use a null-prototype object so that downstream reads such as `config.auth`
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
+ // ergonomics for user code that relies on it.
+ const config = Object.create(null);
+ Object.defineProperty(config, 'hasOwnProperty', {
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
+ // this data descriptor into an accessor descriptor on the way in.
+ __proto__: null,
+ value: Object.prototype.hasOwnProperty,
enumerable: false,
+ writable: true,
configurable: true
+ });
+ function getMergedValue(target, source, prop, caseless) {
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
+ return utils$1.merge.call({
+ caseless
+ }, target, source);
+ } else if (utils$1.isPlainObject(source)) {
+ return utils$1.merge({}, source);
+ } else if (utils$1.isArray(source)) {
+ return source.slice();
+ }
+ return source;
}
-})
-
-Object.defineProperties(WebSocket, {
- CONNECTING: staticPropertyDescriptors,
- OPEN: staticPropertyDescriptors,
- CLOSING: staticPropertyDescriptors,
- CLOSED: staticPropertyDescriptors
-})
-
-webidl.converters['sequence'] = webidl.sequenceConverter(
- webidl.converters.DOMString
-)
-
-webidl.converters['DOMString or sequence'] = function (V) {
- if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
- return webidl.converters['sequence'](V)
+ function mergeDeepProperties(a, b, prop, caseless) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(a, b, prop, caseless);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a, prop, caseless);
+ }
}
- return webidl.converters.DOMString(V)
-}
-
-// This implements the propsal made in https://github.com/whatwg/websockets/issues/42
-webidl.converters.WebSocketInit = webidl.dictionaryConverter([
- {
- key: 'protocols',
- converter: webidl.converters['DOMString or sequence'],
- get defaultValue () {
- return []
- }
- },
- {
- key: 'dispatcher',
- converter: (V) => V,
- get defaultValue () {
- return getGlobalDispatcher()
+ // eslint-disable-next-line consistent-return
+ function valueFromConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
}
- },
- {
- key: 'headers',
- converter: webidl.nullableConverter(webidl.converters.HeadersInit)
}
-])
-webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {
- if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
- return webidl.converters.WebSocketInit(V)
+ // eslint-disable-next-line consistent-return
+ function defaultToConfig2(a, b) {
+ if (!utils$1.isUndefined(b)) {
+ return getMergedValue(undefined, b);
+ } else if (!utils$1.isUndefined(a)) {
+ return getMergedValue(undefined, a);
+ }
}
-
- return { protocols: webidl.converters['DOMString or sequence'](V) }
-}
-
-webidl.converters.WebSocketSendData = function (V) {
- if (webidl.util.Type(V) === 'Object') {
- if (isBlobLike(V)) {
- return webidl.converters.Blob(V, { strict: false })
+ function getMergedTransitionalOption(prop) {
+ const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
+ if (!utils$1.isUndefined(transitional2)) {
+ if (utils$1.isPlainObject(transitional2)) {
+ if (utils$1.hasOwnProp(transitional2, prop)) {
+ return transitional2[prop];
+ }
+ } else {
+ return undefined;
+ }
}
-
- if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
- return webidl.converters.BufferSource(V)
+ const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
+ if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
+ return transitional1[prop];
}
+ return undefined;
}
- return webidl.converters.USVString(V)
+ // eslint-disable-next-line consistent-return
+ function mergeDirectKeys(a, b, prop) {
+ if (utils$1.hasOwnProp(config2, prop)) {
+ return getMergedValue(a, b);
+ } else if (utils$1.hasOwnProp(config1, prop)) {
+ return getMergedValue(undefined, a);
+ }
+ }
+ const mergeMap = {
+ url: valueFromConfig2,
+ method: valueFromConfig2,
+ data: valueFromConfig2,
+ baseURL: defaultToConfig2,
+ transformRequest: defaultToConfig2,
+ transformResponse: defaultToConfig2,
+ paramsSerializer: defaultToConfig2,
+ timeout: defaultToConfig2,
+ timeoutMessage: defaultToConfig2,
+ withCredentials: defaultToConfig2,
+ withXSRFToken: defaultToConfig2,
+ adapter: defaultToConfig2,
+ responseType: defaultToConfig2,
+ xsrfCookieName: defaultToConfig2,
+ xsrfHeaderName: defaultToConfig2,
+ onUploadProgress: defaultToConfig2,
+ onDownloadProgress: defaultToConfig2,
+ decompress: defaultToConfig2,
+ maxContentLength: defaultToConfig2,
+ maxBodyLength: defaultToConfig2,
+ beforeRedirect: defaultToConfig2,
+ transport: defaultToConfig2,
+ httpAgent: defaultToConfig2,
+ httpsAgent: defaultToConfig2,
+ cancelToken: defaultToConfig2,
+ socketPath: defaultToConfig2,
+ allowedSocketPaths: defaultToConfig2,
+ responseEncoding: defaultToConfig2,
+ validateStatus: mergeDirectKeys,
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
+ };
+ utils$1.forEach(Object.keys({
+ ...config1,
+ ...config2
+ }), function computeConfigValue(prop) {
+ if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
+ const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
+ const configValue = merge(a, b, prop);
+ utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
+ });
+ if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) {
+ if (utils$1.hasOwnProp(config1, 'validateStatus')) {
+ config.validateStatus = getMergedValue(undefined, config1.validateStatus);
+ } else {
+ delete config.validateStatus;
+ }
+ }
+ return config;
}
-module.exports = {
- WebSocket
+const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
+function setFormDataHeaders(headers, formHeaders, policy) {
+ if (policy !== 'content-only') {
+ headers.set(formHeaders);
+ return;
+ }
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
+ headers.set(key, val);
+ }
+ });
}
+/**
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
+ *
+ * @param {string} str The string to encode
+ *
+ * @returns {string} UTF-8 bytes as a Latin-1 string
+ */
+const encodeUTF8$1 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+function resolveConfig(config) {
+ const newConfig = mergeConfig({}, config);
-/***/ }),
-
-/***/ 5030:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+ // Read only own properties to prevent prototype pollution gadgets
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
+ const own = key => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
+ const data = own('data');
+ let withXSRFToken = own('withXSRFToken');
+ const xsrfHeaderName = own('xsrfHeaderName');
+ const xsrfCookieName = own('xsrfCookieName');
+ let headers = own('headers');
+ const auth = own('auth');
+ const baseURL = own('baseURL');
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
+ const url = own('url');
+ newConfig.headers = headers = AxiosHeaders.from(headers);
+ newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer'));
-function getUserAgent() {
- if (typeof navigator === "object" && "userAgent" in navigator) {
- return navigator.userAgent;
+ // HTTP basic authentication
+ if (auth) {
+ const username = utils$1.getSafeProp(auth, 'username') || '';
+ const password = utils$1.getSafeProp(auth, 'password') || '';
+ try {
+ headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')));
+ } catch (e) {
+ throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
+ }
}
-
- if (typeof process === "object" && process.version !== undefined) {
- return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
+ if (utils$1.isFormData(data)) {
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
+ headers.setContentType(undefined); // browser/web worker/RN handles it
+ } else if (utils$1.isFunction(data.getHeaders)) {
+ // Node.js FormData (like form-data package)
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
+ }
}
- return "";
-}
-
-exports.getUserAgent = getUserAgent;
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ 2940:
-/***/ ((module) => {
-
-// Returns a wrapper function that returns a wrapped callback
-// The wrapper function should do some stuff, and return a
-// presumably different callback function.
-// This makes sure that own properties are retained, so that
-// decorations and such are not lost along the way.
-module.exports = wrappy
-function wrappy (fn, cb) {
- if (fn && cb) return wrappy(fn)(cb)
-
- if (typeof fn !== 'function')
- throw new TypeError('need wrapper function')
-
- Object.keys(fn).forEach(function (k) {
- wrapper[k] = fn[k]
- })
-
- return wrapper
+ // Add xsrf header
+ // This is only done if running in a standard browser environment.
+ // Specifically not if we're in a web worker, or react-native.
- function wrapper() {
- var args = new Array(arguments.length)
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i]
+ if (platform.hasStandardBrowserEnv) {
+ if (utils$1.isFunction(withXSRFToken)) {
+ withXSRFToken = withXSRFToken(newConfig);
}
- var ret = fn.apply(this, args)
- var cb = args[args.length-1]
- if (typeof ret === 'function' && ret !== cb) {
- Object.keys(cb).forEach(function (k) {
- ret[k] = cb[k]
- })
+
+ // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
+ // the XSRF token cross-origin.
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
+ if (shouldSendXSRF) {
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
+ if (xsrfValue) {
+ headers.set(xsrfHeaderName, xsrfValue);
+ }
}
- return ret
}
+ return newConfig;
}
+const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
+var xhrAdapter = isXHRAdapterSupported && function (config) {
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
+ const _config = resolveConfig(config);
+ let requestData = _config.data;
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
+ let {
+ responseType,
+ onUploadProgress,
+ onDownloadProgress
+ } = _config;
+ let onCanceled;
+ let uploadThrottled, downloadThrottled;
+ let flushUpload, flushDownload;
+ function done() {
+ flushUpload && flushUpload(); // flush events
+ flushDownload && flushDownload(); // flush events
-/***/ }),
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
+ }
+ let request = new XMLHttpRequest();
+ request.open(_config.method.toUpperCase(), _config.url, true);
-/***/ 9491:
-/***/ ((module) => {
+ // Set the request timeout in MS
+ request.timeout = _config.timeout;
+ function onloadend() {
+ if (!request) {
+ return;
+ }
+ // Prepare the response
+ const responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
+ const response = {
+ data: responseData,
+ status: request.status,
+ statusText: request.statusText,
+ headers: responseHeaders,
+ config,
+ request
+ };
+ settle(function _resolve(value) {
+ resolve(value);
+ done();
+ }, function _reject(err) {
+ reject(err);
+ done();
+ }, response);
-"use strict";
-module.exports = require("assert");
+ // Clean up request
+ request = null;
+ }
+ if ('onloadend' in request) {
+ // Use onloadend if available
+ request.onloadend = onloadend;
+ } else {
+ // Listen for ready state to emulate onloadend
+ request.onreadystatechange = function handleLoad() {
+ if (!request || request.readyState !== 4) {
+ return;
+ }
-/***/ }),
+ // The request errored out and we didn't get a response, this will be
+ // handled by onerror instead
+ // With one exception: request that using file: protocol, most browsers
+ // will return status as 0 even though it's a successful request
+ if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith('file:'))) {
+ return;
+ }
+ // readystate handler is calling before onerror or ontimeout handlers,
+ // so we should call onloadend on the next 'tick'
+ setTimeout(onloadend);
+ };
+ }
-/***/ 852:
-/***/ ((module) => {
+ // Handle browser request cancellation (as opposed to a manual cancellation)
+ request.onabort = function handleAbort() {
+ if (!request) {
+ return;
+ }
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
+ done();
-"use strict";
-module.exports = require("async_hooks");
+ // Clean up request
+ request = null;
+ };
-/***/ }),
+ // Handle low level network errors
+ request.onerror = function handleError(event) {
+ // Browsers deliver a ProgressEvent in XHR onerror
+ // (message may be empty; when present, surface it)
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
+ const msg = event && event.message ? event.message : 'Network Error';
+ const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
+ // attach the underlying event for consumers who want details
+ err.event = event || null;
+ reject(err);
+ done();
+ request = null;
+ };
-/***/ 4300:
-/***/ ((module) => {
+ // Handle timeout
+ request.ontimeout = function handleTimeout() {
+ let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
+ const transitional = _config.transitional || transitionalDefaults;
+ if (_config.timeoutErrorMessage) {
+ timeoutErrorMessage = _config.timeoutErrorMessage;
+ }
+ reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
+ done();
-"use strict";
-module.exports = require("buffer");
+ // Clean up request
+ request = null;
+ };
-/***/ }),
+ // Remove Content-Type if data is undefined
+ requestData === undefined && requestHeaders.setContentType(null);
-/***/ 6206:
-/***/ ((module) => {
+ // Add headers to the request
+ if ('setRequestHeader' in request) {
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
+ request.setRequestHeader(key, val);
+ });
+ }
-"use strict";
-module.exports = require("console");
+ // Add withCredentials to request if needed
+ if (!utils$1.isUndefined(_config.withCredentials)) {
+ request.withCredentials = !!_config.withCredentials;
+ }
-/***/ }),
+ // Add responseType to request if needed
+ if (responseType && responseType !== 'json') {
+ request.responseType = _config.responseType;
+ }
-/***/ 6113:
-/***/ ((module) => {
+ // Handle progress if needed
+ if (onDownloadProgress) {
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
+ request.addEventListener('progress', downloadThrottled);
+ }
+
+ // Not all browsers support upload events
+ if (onUploadProgress && request.upload) {
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
+ request.upload.addEventListener('progress', uploadThrottled);
+ request.upload.addEventListener('loadend', flushUpload);
+ }
+ if (_config.cancelToken || _config.signal) {
+ // Handle cancellation
+ // eslint-disable-next-line func-names
+ onCanceled = cancel => {
+ if (!request) {
+ return;
+ }
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
+ request.abort();
+ done();
+ request = null;
+ };
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
+ if (_config.signal) {
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
+ }
+ }
+ const protocol = parseProtocol(_config.url);
+ if (protocol && !platform.protocols.includes(protocol)) {
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
+ done();
+ return;
+ }
-"use strict";
-module.exports = require("crypto");
+ // Send the request
+ request.send(requestData || null);
+ });
+};
-/***/ }),
+const composeSignals = (signals, timeout) => {
+ signals = signals ? signals.filter(Boolean) : [];
+ if (!timeout && !signals.length) {
+ return;
+ }
+ const controller = new AbortController();
+ let aborted = false;
+ const onabort = function (reason) {
+ if (!aborted) {
+ aborted = true;
+ unsubscribe();
+ const err = reason instanceof Error ? reason : this.reason;
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
+ }
+ };
+ let timer = timeout && setTimeout(() => {
+ timer = null;
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
+ }, timeout);
+ const unsubscribe = () => {
+ if (!signals) {
+ return;
+ }
+ timer && clearTimeout(timer);
+ timer = null;
+ signals.forEach(signal => {
+ signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
+ });
+ signals = null;
+ };
+ signals.forEach(signal => signal.addEventListener('abort', onabort, {
+ once: true
+ }));
+ const {
+ signal
+ } = controller;
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
+ return signal;
+};
-/***/ 7643:
-/***/ ((module) => {
+const streamChunk = function* (chunk, chunkSize) {
+ let len = chunk.byteLength;
+ if (len < chunkSize) {
+ yield chunk;
+ return;
+ }
+ let pos = 0;
+ let end;
+ while (pos < len) {
+ end = pos + chunkSize;
+ yield chunk.slice(pos, end);
+ pos = end;
+ }
+};
+const readBytes = async function* (iterable, chunkSize) {
+ for await (const chunk of readStream(iterable)) {
+ yield* streamChunk(chunk, chunkSize);
+ }
+};
+const readStream = async function* (stream) {
+ if (stream[Symbol.asyncIterator]) {
+ yield* stream;
+ return;
+ }
+ const reader = stream.getReader();
+ try {
+ for (;;) {
+ const {
+ done,
+ value
+ } = await reader.read();
+ if (done) {
+ break;
+ }
+ yield value;
+ }
+ } finally {
+ await reader.cancel();
+ }
+};
+const trackStream = (stream, chunkSize, onProgress, onFinish) => {
+ const iterator = readBytes(stream, chunkSize);
+ let bytes = 0;
+ let done;
+ let _onFinish = e => {
+ if (!done) {
+ done = true;
+ onFinish && onFinish(e);
+ }
+ };
+ return new ReadableStream({
+ async pull(controller) {
+ try {
+ const {
+ done,
+ value
+ } = await iterator.next();
+ if (done) {
+ _onFinish();
+ controller.close();
+ return;
+ }
+ let len = value.byteLength;
+ if (onProgress) {
+ let loadedBytes = bytes += len;
+ onProgress(loadedBytes);
+ }
+ controller.enqueue(new Uint8Array(value));
+ } catch (err) {
+ _onFinish(err);
+ throw err;
+ }
+ },
+ cancel(reason) {
+ _onFinish(reason);
+ return iterator.return();
+ }
+ }, {
+ highWaterMark: 2
+ });
+};
-"use strict";
-module.exports = require("diagnostics_channel");
+const DEFAULT_CHUNK_SIZE = 64 * 1024;
+const {
+ isFunction
+} = utils$1;
-/***/ }),
+/**
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
+ *
+ * @param {string} str The string to encode
+ *
+ * @returns {string} UTF-8 bytes as a Latin-1 string
+ */
+const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
+
+// Node's WHATWG URL parser returns `username` and `password` percent-encoded.
+// Decode before composing the `auth` option so credentials such as
+// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the
+// original value for malformed input so a bad encoding never throws.
+const decodeURIComponentSafe = value => {
+ if (!utils$1.isString(value)) {
+ return value;
+ }
+ try {
+ return decodeURIComponent(value);
+ } catch (error) {
+ return value;
+ }
+};
+const test = (fn, ...args) => {
+ try {
+ return !!fn(...args);
+ } catch (e) {
+ return false;
+ }
+};
+const maybeWithAuthCredentials = url => {
+ const protocolIndex = url.indexOf('://');
+ let urlToCheck = url;
+ if (protocolIndex !== -1) {
+ urlToCheck = urlToCheck.slice(protocolIndex + 3);
+ }
+ return urlToCheck.includes('@') || urlToCheck.includes(':');
+};
+const factory = env => {
+ const globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis;
+ const {
+ ReadableStream,
+ TextEncoder
+ } = globalObject;
+ env = utils$1.merge.call({
+ skipUndefined: true
+ }, {
+ Request: globalObject.Request,
+ Response: globalObject.Response
+ }, env);
+ const {
+ fetch: envFetch,
+ Request,
+ Response
+ } = env;
+ const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
+ const isRequestSupported = isFunction(Request);
+ const isResponseSupported = isFunction(Response);
+ if (!isFetchSupported) {
+ return false;
+ }
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
+ const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? (encoder => str => encoder.encode(str))(new TextEncoder()) : async str => new Uint8Array(await new Request(str).arrayBuffer()));
+ const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
+ let duplexAccessed = false;
+ const request = new Request(platform.origin, {
+ body: new ReadableStream(),
+ method: 'POST',
+ get duplex() {
+ duplexAccessed = true;
+ return 'half';
+ }
+ });
+ const hasContentType = request.headers.has('Content-Type');
+ if (request.body != null) {
+ request.body.cancel();
+ }
+ return duplexAccessed && !hasContentType;
+ });
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response('').body));
+ const resolvers = {
+ stream: supportsResponseStream && (res => res.body)
+ };
+ isFetchSupported && (() => {
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
+ !resolvers[type] && (resolvers[type] = (res, config) => {
+ let method = res && res[type];
+ if (method) {
+ return method.call(res);
+ }
+ throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
+ });
+ });
+ })();
+ const getBodyLength = async body => {
+ if (body == null) {
+ return 0;
+ }
+ if (utils$1.isBlob(body)) {
+ return body.size;
+ }
+ if (utils$1.isSpecCompliantForm(body)) {
+ const _request = new Request(platform.origin, {
+ method: 'POST',
+ body
+ });
+ return (await _request.arrayBuffer()).byteLength;
+ }
+ if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
+ return body.byteLength;
+ }
+ if (utils$1.isURLSearchParams(body)) {
+ body = body + '';
+ }
+ if (utils$1.isString(body)) {
+ return (await encodeText(body)).byteLength;
+ }
+ };
+ const resolveBodyLength = async (headers, body) => {
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
+ return length == null ? getBodyLength(body) : length;
+ };
+ return async config => {
+ let {
+ url,
+ method,
+ data,
+ signal,
+ cancelToken,
+ timeout,
+ onDownloadProgress,
+ onUploadProgress,
+ responseType,
+ headers,
+ withCredentials = 'same-origin',
+ fetchOptions,
+ maxContentLength,
+ maxBodyLength
+ } = resolveConfig(config);
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
+ const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined;
+ let _fetch = envFetch || fetch;
+ responseType = responseType ? (responseType + '').toLowerCase() : 'text';
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
+ let request = null;
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
+ composedSignal.unsubscribe();
+ });
+ let requestContentLength;
+
+ // AxiosError we raise while the request body is being streamed. Captured
+ // by identity so the catch block can surface it directly, regardless of
+ // how the runtime wraps the resulting fetch rejection (undici exposes it
+ // as `err.cause`; some browsers drop the original error entirely).
+ let pendingBodyError = null;
+ const maxBodyLengthError = () => new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request);
+ try {
+ // HTTP basic authentication
+ let auth = undefined;
+ const configAuth = own('auth');
+ if (configAuth) {
+ const username = utils$1.getSafeProp(configAuth, 'username') || '';
+ const password = utils$1.getSafeProp(configAuth, 'password') || '';
+ auth = {
+ username,
+ password
+ };
+ }
+ if (maybeWithAuthCredentials(url)) {
+ const parsedURL = new URL(url, platform.origin);
+ if (!auth && (parsedURL.username || parsedURL.password)) {
+ const urlUsername = decodeURIComponentSafe(parsedURL.username);
+ const urlPassword = decodeURIComponentSafe(parsedURL.password);
+ auth = {
+ username: urlUsername,
+ password: urlPassword
+ };
+ }
+ if (parsedURL.username || parsedURL.password) {
+ parsedURL.username = '';
+ parsedURL.password = '';
+ url = parsedURL.href;
+ }
+ }
+ if (auth) {
+ headers.delete('authorization');
+ headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))));
+ }
-/***/ 2361:
-/***/ ((module) => {
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
+ // "if (protocol === 'data:')" branch).
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
+ const estimated = estimateDataURLDecodedBytes(url);
+ if (estimated > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
-"use strict";
-module.exports = require("events");
+ // Enforce maxBodyLength against known-size bodies before dispatch using
+ // the body's *actual* size — never a caller-declared Content-Length,
+ // which could under-report to slip an oversized body past the check.
+ // Unknown-size streams return undefined here and are counted per-chunk
+ // below as fetch consumes them.
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
+ const outboundLength = await getBodyLength(data);
+ if (typeof outboundLength === 'number' && isFinite(outboundLength)) {
+ requestContentLength = outboundLength;
+ if (outboundLength > maxBodyLength) {
+ throw maxBodyLengthError();
+ }
+ }
+ }
-/***/ }),
+ // A streamed body under maxBodyLength must be counted as fetch consumes
+ // it; its size is never trusted from a caller-declared Content-Length.
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
+ const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, loadedBytes => {
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
+ throw pendingBodyError = maxBodyLengthError();
+ }
+ onProgress && onProgress(loadedBytes);
+ }, flush);
+ if (supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody)) {
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
+
+ // A declared length of 0 is only trusted to skip the wrap when we are
+ // not enforcing a stream limit (which must not rely on that header).
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
+ let _request = new Request(url, {
+ method: 'POST',
+ body: data,
+ duplex: 'half'
+ });
+ let contentTypeHeader;
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
+ headers.setContentType(contentTypeHeader);
+ }
+ if (_request.body) {
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
+ data = trackRequestStream(_request.body, onProgress, flush);
+ }
+ }
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head') {
+ data = trackRequestStream(data);
+ } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head') {
+ throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request);
+ }
+ if (!utils$1.isString(withCredentials)) {
+ withCredentials = withCredentials ? 'include' : 'omit';
+ }
-/***/ 7147:
-/***/ ((module) => {
+ // Cloudflare Workers throws when credentials are defined
+ // see https://github.com/cloudflare/workerd/issues/902
+ const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
-"use strict";
-module.exports = require("fs");
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
+ // delete it so fetch can set it correctly with the boundary
+ if (utils$1.isFormData(data)) {
+ const contentType = headers.getContentType();
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
+ headers.delete('content-type');
+ }
+ }
-/***/ }),
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
+ headers.set('User-Agent', 'axios/' + VERSION, false);
+ const resolvedOptions = {
+ ...fetchOptions,
+ signal: composedSignal,
+ method: method.toUpperCase(),
+ headers: toByteStringHeaderObject(headers.normalize()),
+ body: data,
+ duplex: 'half',
+ credentials: isCredentialsSupported ? withCredentials : undefined
+ };
+ request = isRequestSupported && new Request(url, resolvedOptions);
+ let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
+ const responseHeaders = AxiosHeaders.from(response.headers);
+
+ // Cheap pre-check: if the server honestly declares a content-length that
+ // already exceeds the cap, reject before we start streaming.
+ if (hasMaxContentLength) {
+ const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
+ if (declaredLength != null && declaredLength > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
+ if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
+ const options = {};
+ ['status', 'statusText', 'headers'].forEach(prop => {
+ options[prop] = response[prop];
+ });
+ const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
+ let bytesRead = 0;
+ const onChunkProgress = loadedBytes => {
+ if (hasMaxContentLength) {
+ bytesRead = loadedBytes;
+ if (bytesRead > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ onProgress && onProgress(loadedBytes);
+ };
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
+ flush && flush();
+ unsubscribe && unsubscribe();
+ }), options);
+ }
+ responseType = responseType || 'text';
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
+
+ // Fallback enforcement for environments without ReadableStream support
+ // (legacy runtimes). Detect materialized size from typed output; skip
+ // streams/Response passthrough since the user will read those themselves.
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
+ let materializedSize;
+ if (responseData != null) {
+ if (typeof responseData.byteLength === 'number') {
+ materializedSize = responseData.byteLength;
+ } else if (typeof responseData.size === 'number') {
+ materializedSize = responseData.size;
+ } else if (typeof responseData === 'string') {
+ materializedSize = typeof TextEncoder === 'function' ? new TextEncoder().encode(responseData).byteLength : responseData.length;
+ }
+ }
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
+ throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
+ }
+ }
+ !isStreamResponse && unsubscribe && unsubscribe();
+ return await new Promise((resolve, reject) => {
+ settle(resolve, reject, {
+ data: responseData,
+ headers: AxiosHeaders.from(response.headers),
+ status: response.status,
+ statusText: response.statusText,
+ config,
+ request
+ });
+ });
+ } catch (err) {
+ unsubscribe && unsubscribe();
+
+ // Safari can surface fetch aborts as a DOMException-like object whose
+ // branded getters throw. Prefer our composed signal reason before reading
+ // the caught error, preserving timeout vs cancellation semantics.
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
+ const canceledError = composedSignal.reason;
+ canceledError.config = config;
+ request && (canceledError.request = request);
+ if (err !== canceledError) {
+ // Non-enumerable to match native Error `cause` semantics so loggers
+ // don't recurse into circular fetch internals (see #7205).
+ Object.defineProperty(canceledError, 'cause', {
+ __proto__: null,
+ value: err,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ }
+ throw canceledError;
+ }
+
+ // Surface a maxBodyLength violation we raised while the request body was
+ // being streamed. Matching by identity (rather than reading
+ // `err.cause.isAxiosError`) keeps the error deterministic across runtimes
+ // and avoids both prototype-pollution reads and mis-attributing a foreign
+ // AxiosError that merely happened to land in `err.cause`.
+ if (pendingBodyError) {
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
+ throw pendingBodyError;
+ }
+
+ // Re-throw AxiosErrors we raised synchronously (data: URL / content-length
+ // pre-checks, response size enforcement) without re-wrapping them.
+ if (err instanceof AxiosError) {
+ request && !err.request && (err.request = request);
+ throw err;
+ }
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
+ const networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response);
+ // Non-enumerable to match native Error `cause` semantics so loggers
+ // don't recurse into circular fetch internals (see #7205).
+ Object.defineProperty(networkError, 'cause', {
+ __proto__: null,
+ value: err.cause || err,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ });
+ throw networkError;
+ }
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
+ }
+ };
+};
+const seedCache = new Map();
+const getFetch = config => {
+ let env = config && config.env || {};
+ const {
+ fetch,
+ Request,
+ Response
+ } = env;
+ const seeds = [Request, Response, fetch];
+ let len = seeds.length,
+ i = len,
+ seed,
+ target,
+ map = seedCache;
+ while (i--) {
+ seed = seeds[i];
+ target = map.get(seed);
+ target === undefined && map.set(seed, target = i ? new Map() : factory(env));
+ map = target;
+ }
+ return target;
+};
+getFetch();
-/***/ 3685:
-/***/ ((module) => {
+/**
+ * Known adapters mapping.
+ * Provides environment-specific adapters for Axios:
+ * - `http` for Node.js
+ * - `xhr` for browsers
+ * - `fetch` for fetch API-based requests
+ *
+ * @type {Object}
+ */
+const knownAdapters = {
+ http: httpAdapter,
+ xhr: xhrAdapter,
+ fetch: {
+ get: getFetch
+ }
+};
-"use strict";
-module.exports = require("http");
+// Assign adapter names for easier debugging and identification
+utils$1.forEach(knownAdapters, (fn, value) => {
+ if (fn) {
+ try {
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
+ // these data descriptors into accessor descriptors on the way in.
+ Object.defineProperty(fn, 'name', {
+ __proto__: null,
+ value
+ });
+ } catch (e) {
+ // eslint-disable-next-line no-empty
+ }
+ Object.defineProperty(fn, 'adapterName', {
+ __proto__: null,
+ value
+ });
+ }
+});
-/***/ }),
+/**
+ * Render a rejection reason string for unknown or unsupported adapters
+ *
+ * @param {string} reason
+ * @returns {string}
+ */
+const renderReason = reason => `- ${reason}`;
-/***/ 5158:
-/***/ ((module) => {
+/**
+ * Check if the adapter is resolved (function, null, or false)
+ *
+ * @param {Function|null|false} adapter
+ * @returns {boolean}
+ */
+const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === null || adapter === false;
-"use strict";
-module.exports = require("http2");
+/**
+ * Get the first suitable adapter from the provided list.
+ * Tries each adapter in order until a supported one is found.
+ * Throws an AxiosError if no adapter is suitable.
+ *
+ * @param {Array|string|Function} adapters - Adapter(s) by name or function.
+ * @param {Object} config - Axios request configuration
+ * @throws {AxiosError} If no suitable adapter is available
+ * @returns {Function} The resolved adapter function
+ */
+function getAdapter(adapters, config) {
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
+ const {
+ length
+ } = adapters;
+ let nameOrAdapter;
+ let adapter;
+ const rejectedReasons = {};
+ for (let i = 0; i < length; i++) {
+ nameOrAdapter = adapters[i];
+ let id;
+ adapter = nameOrAdapter;
+ if (!isResolvedHandle(nameOrAdapter)) {
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
+ if (adapter === undefined) {
+ throw new AxiosError(`Unknown adapter '${id}'`);
+ }
+ }
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
+ break;
+ }
+ rejectedReasons[id || '#' + i] = adapter;
+ }
+ if (!adapter) {
+ const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
+ let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT);
+ }
+ return adapter;
+}
-/***/ }),
+/**
+ * Exports Axios adapters and utility to resolve an adapter
+ */
+var adapters = {
+ /**
+ * Resolve an adapter from a list of adapter names or functions.
+ * @type {Function}
+ */
+ getAdapter,
+ /**
+ * Exposes all known adapters
+ * @type {Object