Showing preview only (1,010K chars total). Download the full file or copy to clipboard to get everything.
Repository: yukiarrr/ios-build-action
Branch: master
Commit: 099d9f7b468a
Files: 10
Total size: 983.7 KB
Directory structure:
gitextract_dr75mqoc/
├── .gitignore
├── .node-version
├── LICENSE
├── README.md
├── action.yml
├── build.sh
├── dist/
│ └── index.js
├── fastlane/
│ └── Fastfile
├── index.js
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea/
node_modules
================================================
FILE: .node-version
================================================
20.12.0
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 yukiarrr
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.
================================================
FILE: README.md
================================================
# iOS Build Action
This action build iOS project. (.xcodeproj, .xcworkspace)
And can export to ipa, so it can be continuously delivered to DeployGate and TestFlight.
self-hosted is also supported. If you use self-hosted, install Xcode.
## Inputs
### p12
You can add a single p12 key+cert file with `p12-base64 (p12-path)`, or if you have key and cert in separate files you can add them with `p12-key-base64 (p12-key-path)` and `p12-cer-base64 (p12-cer-path)`. One of the two options is required.
#### `p12-base64`
**Required if single file**: Base64 encoded p12 file (key + cert).
#### `p12-key-base64`
**Required if split key/cert**: Base64 encoded p12 key file.
#### `p12-cer-base64`
**Required if split key/cert**: Base64 encoded certificate for the p12 key.
#### `p12-path`
**Required if single file**: p12 path (key + cert).
#### `p12-key-path`
**Required if split key/cert**: p12 key path.
#### `p12-cer-path`
**Required if split key/cert**: Certificate path for the p12 key.
### mobileprovision
#### `mobileprovision-base64`
**Required**: Base64 encoded mobileprovision file. If you want to specify multiple files, you need to input in multiple lines and then use [`export-options`](#export-options) to specify the provisioning profile to use for each executable in your app.
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
mobileprovision-base64: |
${{ secrets.MY_MOBILEPROVISION_BASE64 }}
${{ secrets.YOUR_MOBILEPROVISION_BASE64 }}
```
Also note, when creating base64 encoded inputs, make sure they don't contain newlines, e.g.
openssl base64 -in MyAppProvisioning.mobileprovision -A
#### `mobileprovision-path`
**Required**: mobileprovision path. If you want to specify multiple files, you need to input in multiple lines and then use [`export-options`](#export-options) to specify the provisioning profile to use for each executable in your app.
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
mobileprovision-path: |
ios-build-1.mobileprovision
ios-build-2.mobileprovision
```
### `project-path`
**Required**: .xcodeproj path.
### `code-signing-identity`
**Required**: For example, `"iOS Distribution"`.
### `team-id`
**Required**: Team id.
### `workspace-path`
.xcworkspace path. Default `""`.
### `export-method`
Choose `"app-store"`, `"ad-hoc"`, `"package"` `"enterprise"`, `"development"`, or `"developer-id"`. Default `"app-store"`.
### `configuration`
For example, `"Debug"`, `"Release"`. Default `"Release"`.
### `scheme`
For example, `"MyScheme"`.
### `certificate-password`
Certificate password. Default `""`.
### `output-path`
Output path of ipa. Default `"output.ipa"`.
### `update-targets`
Targets to be updated with mobileprovision, code signing identity, etc. Split on new lines. Default `""`. (default to all targets)
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
update-targets: |
MyApp
YourApp
```
### `disable-targets`
Deprecated, use [`update-targets`](#update-targets) instead.
These targets will not use automatic code signing and instead use the identity specified in other inputs. Input targets separated by `","`. For example, `"MyApp,YourApp"`. Default `""`. (default to all targets)
### `export-options`
Path to an export options plist. Default `""`.
### `cloned-source-packages-path`
Path for Swift Package Manager dependencies. Default `""`.
### `entitlements-file-path`
Path to your entitlements file. Default `""`.
### `build-sdk`
The SDK that should be used for building the application. Default `""`. For example, `"iOS 11.1"`.
### `build-destination`
Use a custom destination for building the app. Default `""`. For example, `"generic/platform=iOS"`.
### `build-path`
Use a custom build path for building the app. Default `"/Users/{user}/Library/Developer/Xcode/Archives/{date}"`. For example, `"./archive"`.
### `increment-version-number`
Increment the version number of your project. Supports `"patch"`, `"minor"`, `"major"` or a specific version number. Default `""`.
### `increment-build-number`
Increment the build number before building the application. Default `""`.
- `true` - automatically increment the project build number by one
- `testflight` - increment the latest TestFlight build number by one. If this is specified you must also provide `bundle-identifier`, `app-store-connect-api-key-id`, `app-store-connect-api-key-issuer-id` and `app-store-connect-api-key-base64`
- a specific build number e.g. `75`
### `bundle-identifier`
Application bundle identifier. Default `""`.
### `app-store-connect-api-key-id`
App Store Connect API Key ID. Default `""`.
### `app-store-connect-api-key-issuer-id`
App Store Connect API Key Issuer ID. Default `""`.
### `app-store-connect-api-key-base64`
Base64 encoded App Store Connect API Key. Default `""`.
### `custom-keychain-name`
Custom keychain name. Default `ios-build.keychain`
## Contributions Welcome!
If you have any other inputs you'd like to add, feel free to create PR.
Welcome your contributions!
## Example usage
### single p12
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
project-path: Unity-iPhone.xcodeproj
p12-base64: ${{ secrets.P12_BASE64 }}
mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.TEAM_ID }}
workspace-path: Unity-iPhone.xcworkspace # optional
```
### key and cert
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
project-path: Unity-iPhone.xcodeproj
p12-key-base64: ${{ secrets.P12_KEY_BASE64 }}
p12-cer-base64: ${{ secrets.P12_CER_BASE64 }}
mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.TEAM_ID }}
workspace-path: Unity-iPhone.xcworkspace # optional
```
### custom keychain name
```yaml
- uses: yukiarrr/ios-build-action@v1.12.0
with:
custom-keychain-name: my-ios-build.keychin # or {commit-hash}-ios-build.keychain
project-path: Unity-iPhone.xcodeproj
p12-key-base64: ${{ secrets.P12_KEY_BASE64 }}
p12-cer-base64: ${{ secrets.P12_CER_BASE64 }}
mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }}
code-signing-identity: ${{ secrets.CODE_SIGNING_IDENTITY }}
team-id: ${{ secrets.TEAM_ID }}
workspace-path: Unity-iPhone.xcworkspace # optional
```
================================================
FILE: action.yml
================================================
name: "iOS Build Action"
description: "Build iOS project (.xcodeproj, .xcworkspace), and export ipa with custom entitlements"
inputs:
p12-key-base64:
description: "Base64 encoded p12 key"
required: false
p12-cer-base64:
description: "Base64 encoded certificate for the p12 key"
required: false
p12-base64:
description: "Base64 encoded p12 file (key + cert)"
required: false
mobileprovision-base64:
description: "Base64 encoded mobileprovision file"
required: false
p12-key-path:
description: "p12 key path"
required: false
p12-cer-path:
description: "Certificate path for the p12 key"
required: false
p12-path:
description: "p12 path (key + cert)"
required: false
mobileprovision-path:
description: "mobileprovision path"
required: false
project-path:
description: "Project path"
required: true
code-signing-identity:
description: "For example, iOS Distribution"
required: true
team-id:
description: "Team id"
required: true
workspace-path:
description: "Workspace path"
required: false
default: ""
export-method:
description: "Choose app-store, ad-hoc, package, enterprise, development, or developer-id"
required: false
default: "app-store"
configuration:
description: "For example, Debug, Release"
required: false
default: "Release"
certificate-password:
description: "Certificate password"
required: false
default: ""
output-path:
description: "Output path of ipa"
required: false
default: "output.ipa"
scheme:
description: "Scheme"
required: false
default: ""
update-targets:
description: "Targets to be updated with mobileprovision, code signing identity, etc"
required: false
default: ""
disable-targets:
description: "Deprecated, use update-targets instead"
required: false
default: ""
export-options:
description: "Path to an export options plist"
required: false
default: ""
build-sdk:
description: "The SDK that should be used for building the application"
required: false
default: ""
build-destination:
description: "Use a custom destination for building the app"
required: false
default: ""
cloned-source-packages-path:
description: "Path for Swift Package Manager dependencies"
required: false
default: ""
entitlements-file-path:
description: "Path to your entitlements file"
required: false
default: ""
increment-build-number:
description: "Increment the build number before building the application"
required: false
default: ""
increment-version-number:
description: 'Increment the version number of your project. Supports patch, minor, major or a specific version number.'
required: false
default: ""
bundle-identifier:
description: 'Bundle identifier of the application.'
required: false
default: ""
app-store-connect-api-key-id:
description: 'App Store Connect API Key ID'
required: false
default: ""
app-store-connect-api-key-issuer-id:
description: 'App Store Connect API Key Issuer ID'
required: false
default: ""
app-store-connect-api-key-base64:
description: 'Base64 encoded App Store Connect API Key'
required: false
default: ""
build-path:
description: 'Build path'
required: false
default: ""
custom-keychain-name:
description: 'Custom Keychain Name'
required: false
default: "ios-build.keychain"
runs:
using: "node20"
main: "dist/index.js"
================================================
FILE: build.sh
================================================
#!/bin/bash -e
if ! type fastlane > /dev/null 2>&1; then
if type brew > /dev/null 2>&1; then
brew install fastlane
else
sudo gem install fastlane -NV
fi
fi
script_path=$(cd $(dirname ${0}); pwd)
cp -r ${script_path}/fastlane ./
fastlane export_ipa
================================================
FILE: dist/index.js
================================================
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 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;
};
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.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) {
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
}
command_1.issueCommand('set-env', { name }, convertedVal);
}
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.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.issueFileCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
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}`);
}
if (options && options.trimWhitespace === false) {
return val;
}
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 !== '');
if (options && options.trimWhitespace === false) {
return inputs;
}
return inputs.map(input => input.trim());
}
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) {
const filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
}
process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(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) {
const filePath = process.env['GITHUB_STATE'] || '';
if (filePath) {
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
}
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(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;
/**
* Summary exports
*/
var summary_1 = __nccwpck_require__(1327);
Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
/**
* @deprecated use core.summary
*/
var summary_2 = __nccwpck_require__(1327);
Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
/**
* Path exports
*/
var path_utils_1 = __nccwpck_require__(2981);
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
//# 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.prepareKeyValueMessage = exports.issueFileCommand = 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 uuid_1 = __nccwpck_require__(5840);
const utils_1 = __nccwpck_require__(5278);
function issueFileCommand(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.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.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}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
}
exports.prepareKeyValueMessage = prepareKeyValueMessage;
//# 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__(6255);
const auth_1 = __nccwpck_require__(5526);
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);
}
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) {
var _a;
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.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 __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}`);
}
});
}
}
exports.OidcClient = OidcClient;
//# sourceMappingURL=oidc-utils.js.map
/***/ }),
/***/ 2981:
/***/ (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.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
const path = __importStar(__nccwpck_require__(1017));
/**
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
* replaced with /.
*
* @param pth. Path to transform.
* @return string Posix path.
*/
function toPosixPath(pth) {
return pth.replace(/[\\]/g, '/');
}
exports.toPosixPath = toPosixPath;
/**
* toWin32Path converts the given path to the win32 form. On Linux, / will be
* replaced with \\.
*
* @param pth. Path to transform.
* @return string Win32 path.
*/
function toWin32Path(pth) {
return pth.replace(/[/]/g, '\\');
}
exports.toWin32Path = toWin32Path;
/**
* 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);
}
exports.toPlatformPath = toPlatformPath;
//# sourceMappingURL=path-utils.js.map
/***/ }),
/***/ 1327:
/***/ (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.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
const os_1 = __nccwpck_require__(2037);
const fs_1 = __nccwpck_require__(7147);
const { access, appendFile, writeFile } = fs_1.promises;
exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
class Summary {
constructor() {
this._buffer = '';
}
/**
* 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 __awaiter(this, void 0, void 0, function* () {
if (this._filePath) {
return this._filePath;
}
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
if (!pathFromEnv) {
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
}
try {
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.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;
});
}
/**
* 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}>`;
}
/**
* 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>} summary instance
*/
write(options) {
return __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();
});
}
/**
* Clears the summary buffer and wipes the summary file
*
* @returns {Summary} summary instance
*/
clear() {
return __awaiter(this, void 0, void 0, function* () {
return this.emptyBuffer().write({ overwrite: true });
});
}
/**
* Returns the current summary buffer as a string
*
* @returns {string} string of summary buffer
*/
stringify() {
return this._buffer;
}
/**
* If the summary buffer is empty
*
* @returns {boolen} true if the buffer is empty
*/
isEmptyBuffer() {
return this._buffer.length === 0;
}
/**
* Resets the summary buffer without writing to summary file
*
* @returns {Summary} summary instance
*/
emptyBuffer() {
this._buffer = '';
return this;
}
/**
* 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(os_1.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 (<hr>) 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 (<br>) to the summary buffer
*
* @returns {Summary} summary instance
*/
addBreak() {
const element = this.wrap('br', null);
return this.addRaw(element).addEOL();
}
/**
* 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();
}
/**
* 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`
*/
exports.markdownSummary = _summary;
exports.summary = _summary;
//# sourceMappingURL=summary.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 '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
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 {};
}
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
/***/ }),
/***/ 1514:
/***/ (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;
};
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.getExecOutput = exports.exec = void 0;
const string_decoder_1 = __nccwpck_require__(1576);
const tr = __importStar(__nccwpck_require__(8159));
/**
* 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<number> exit code
*/
function exec(commandLine, args, options) {
return __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();
});
}
exports.exec = 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<ExecOutput> exit code, stdout, and stderr
*/
function getExecOutput(commandLine, args, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
let stdout = '';
let stderr = '';
//Using string decoder covers the case where a mult-byte character is split
const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
const stderrDecoder = new string_decoder_1.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(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
//flush any remaining characters
stdout += stdoutDecoder.end();
stderr += stderrDecoder.end();
return {
exitCode,
stdout,
stderr
};
});
}
exports.getExecOutput = getExecOutput;
//# sourceMappingURL=exec.js.map
/***/ }),
/***/ 8159:
/***/ (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;
};
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.argStringToArray = exports.ToolRunner = void 0;
const os = __importStar(__nccwpck_require__(2037));
const events = __importStar(__nccwpck_require__(2361));
const child = __importStar(__nccwpck_require__(2081));
const path = __importStar(__nccwpck_require__(1017));
const io = __importStar(__nccwpck_require__(7436));
const ioUtil = __importStar(__nccwpck_require__(1962));
const timers_1 = __nccwpck_require__(9512);
/* eslint-disable @typescript-eslint/unbound-method */
const IS_WINDOWS = process.platform === 'win32';
/*
* Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
*/
class ToolRunner extends 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 || {};
}
_debug(message) {
if (this.options.listeners && this.options.listeners.debug) {
this.options.listeners.debug(message);
}
}
_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 (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)}`;
}
}
}
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}`;
}
}
return cmd;
}
_processLineBuffer(data, strBuffer, onLine) {
try {
let s = strBuffer + data.toString();
let n = s.indexOf(os.EOL);
while (n > -1) {
const line = s.substring(0, n);
onLine(line);
// the rest of the string ...
s = s.substring(n + os.EOL.length);
n = s.indexOf(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 '';
}
}
_getSpawnFileName() {
if (IS_WINDOWS) {
if (this._isCmdFile()) {
return process.env['COMSPEC'] || 'cmd.exe';
}
}
return this.toolPath;
}
_getSpawnArgs(options) {
if (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;
}
_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;
}
_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;
}
/**
* 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 __awaiter(this, void 0, void 0, function* () {
// root the tool path if it is unrooted and contains relative pathing
if (!ioUtil.isRooted(this.toolPath) &&
(this.toolPath.includes('/') ||
(IS_WINDOWS && this.toolPath.includes('\\')))) {
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
this.toolPath = 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 io.which(this.toolPath, true);
return new Promise((resolve, reject) => __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) + os.EOL);
}
const state = new ExecState(optionsNonNull, this.toolPath);
state.on('debug', (message) => {
this._debug(message);
});
if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
}
const fileName = this._getSpawnFileName();
const cp = child.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);
}
}));
});
}
}
exports.ToolRunner = ToolRunner;
/**
* 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;
}
exports.argStringToArray = argStringToArray;
class ExecState extends 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 = timers_1.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
/***/ }),
/***/ 5526:
/***/ (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 }));
exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
class BasicCredentialHandler {
constructor(username, password) {
this.username = username;
this.password = password;
}
prepareRequest(options) {
if (!options.headers) {
throw Error('The request has no headers');
}
options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
}
// This handler cannot handle 401
canHandleAuthentication() {
return false;
}
handleAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
exports.BasicCredentialHandler = BasicCredentialHandler;
class 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 __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
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) {
if (!options.headers) {
throw Error('The request has no headers');
}
options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
}
// This handler cannot handle 401
canHandleAuthentication() {
return false;
}
handleAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
//# sourceMappingURL=auth.js.map
/***/ }),
/***/ 6255:
/***/ (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__(9835));
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);
});
}
/**
* 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;
});
}
/**
* 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 __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);
});
});
}
/**
* 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);
});
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();
}
}
/**
* 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 || {});
}
_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;
}
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));
});
}
_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);
}
}));
});
}
}
exports.HttpClient = HttpClient;
const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 9835:
/***/ ((__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;
}
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}`);
}
}
else {
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}`);
}
// 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.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]'));
}
//# sourceMappingURL=proxy.js.map
/***/ }),
/***/ 1962:
/***/ (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());
});
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const assert_1 = __nccwpck_require__(9491);
const fs = __nccwpck_require__(7147);
const path = __nccwpck_require__(1017);
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
exports.IS_WINDOWS = process.platform === 'win32';
function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield exports.stat(fsPath);
}
catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
return true;
});
}
exports.exists = exists;
function isDirectory(fsPath, useStat = false) {
return __awaiter(this, void 0, void 0, function* () {
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
return stats.isDirectory();
});
}
exports.isDirectory = 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 (exports.IS_WINDOWS) {
return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
); // e.g. C: or C:\hello
}
return p.startsWith('/');
}
exports.isRooted = isRooted;
/**
* Recursively create a directory at `fsPath`.
*
* This implementation is optimistic, meaning it attempts to create the full
* path first, and backs up the path stack from there.
*
* @param fsPath The path to create
* @param maxDepth The maximum recursion depth
* @param depth The current recursion depth
*/
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided');
fsPath = path.resolve(fsPath);
if (depth >= maxDepth)
return exports.mkdir(fsPath);
try {
yield exports.mkdir(fsPath);
return;
}
catch (err) {
switch (err.code) {
case 'ENOENT': {
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
yield exports.mkdir(fsPath);
return;
}
default: {
let stats;
try {
stats = yield exports.stat(fsPath);
}
catch (err2) {
throw err;
}
if (!stats.isDirectory())
throw err;
}
}
}
});
}
exports.mkdirP = mkdirP;
/**
* 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 __awaiter(this, void 0, void 0, function* () {
let stats = undefined;
try {
// test file exists
stats = yield exports.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 (exports.IS_WINDOWS) {
// on Windows, test for valid extension
const upperExt = 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 exports.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 (exports.IS_WINDOWS) {
// preserve the case of the actual file (since an extension was appended)
try {
const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield exports.readdir(directory)) {
if (upperName === actualName.toUpperCase()) {
filePath = 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 '';
});
}
exports.tryGetExecutablePath = tryGetExecutablePath;
function normalizeSeparators(p) {
p = p || '';
if (exports.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 && stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
}
//# sourceMappingURL=io-util.js.map
/***/ }),
/***/ 7436:
/***/ (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 }));
const childProcess = __nccwpck_require__(2081);
const path = __nccwpck_require__(1017);
const util_1 = __nccwpck_require__(3837);
const ioUtil = __nccwpck_require__(1962);
const exec = util_1.promisify(childProcess.exec);
/**
* 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, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const { force, recursive } = 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()
? 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 copyFile(source, newDest, force);
}
});
}
exports.cp = cp;
/**
* Moves a path.
*
* @param source source path
* @param dest destination path
* @param options optional. See MoveOptions.
*/
function mv(source, dest, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
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);
});
}
exports.mv = mv;
/**
* Remove a path recursively with force
*
* @param inputPath path to remove
*/
function rmRF(inputPath) {
return __awaiter(this, void 0, void 0, function* () {
if (ioUtil.IS_WINDOWS) {
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
try {
if (yield ioUtil.isDirectory(inputPath, true)) {
yield exec(`rd /s /q "${inputPath}"`);
}
else {
yield exec(`del /f /a "${inputPath}"`);
}
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
try {
yield ioUtil.unlink(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
}
}
else {
let isDir = false;
try {
isDir = yield ioUtil.isDirectory(inputPath);
}
catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT')
throw err;
return;
}
if (isDir) {
yield exec(`rm -rf "${inputPath}"`);
}
else {
yield ioUtil.unlink(inputPath);
}
}
});
}
exports.rmRF = rmRF;
/**
* Make a directory. Creates the full path with folders in between
* Will throw if it fails
*
* @param fsPath path to create
* @returns Promise<void>
*/
function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
yield ioUtil.mkdirP(fsPath);
});
}
exports.mkdirP = mkdirP;
/**
* 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<string> path to tool
*/
function which(tool, check) {
return __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 (ioUtil.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.`);
}
}
}
try {
// build the list of extensions to try
const extensions = [];
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
if (extension) {
extensions.push(extension);
}
}
}
// if it's rooted, return it if exists. otherwise return empty.
if (ioUtil.isRooted(tool)) {
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
if (filePath) {
return filePath;
}
return '';
}
// if any path separators, return empty
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
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(path.delimiter)) {
if (p) {
directories.push(p);
}
}
}
// return the first match
for (const directory of directories) {
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
if (filePath) {
return filePath;
}
}
return '';
}
catch (err) {
throw new Error(`which failed with message ${err.message}`);
}
});
}
exports.which = which;
function readCopyOptions(options) {
const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive);
return { force, recursive };
}
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
return __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 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 copyFile(srcFile, destFile, force) {
return __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
/***/ }),
/***/ 4294:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
module.exports = __nccwpck_require__(4219);
/***/ }),
/***/ 4219:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
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);
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);
});
}
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();
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);
}
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);
}
};
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);
});
}
};
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
});
// 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
};
}
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
/***/ }),
/***/ 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
}
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
module.exports.DecoratorHandler = DecoratorHandler
module.exports.RedirectHandler = RedirectHandler
module.exports.createRedirectInterceptor = createRedirectInterceptor
module.exports.buildConnector = buildConnector
module.exports.errors = errors
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')
}
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}`
}
url = new URL(util.parseOrigin(url).origin + path)
} else {
if (!opts) {
opts = typeof url === 'object' ? url : {}
}
url = util.parseURL(url)
}
const { agent, dispatcher = getGlobalDispatcher() } = opts
if (agent) {
throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
}
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
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)
}
try {
return await fetchImpl(...arguments)
} catch (err) {
if (typeof err === 'object') {
Error.captureStackTrace(err, this)
}
throw err
}
}
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)
module.exports.setGlobalOrigin = setGlobalOrigin
module.exports.getGlobalOrigin = getGlobalOrigin
const { CacheStorage } = __nccwpck_require__(7907)
const { kConstruct } = __nccwpck_require__(9174)
// 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 (util.nodeMajor >= 16) {
const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
module.exports.deleteCookie = deleteCookie
module.exports.getCookies = getCookies
module.exports.getSetCookies = getSetCookies
module.exports.setCookie = setCookie
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
module.exports.parseMIMEType = parseMIMEType
module.exports.serializeAMimeType = serializeAMimeType
}
if (util.nodeMajor >= 18 && hasCrypto) {
const { WebSocket } = __nccwpck_require__(4284)
module.exports.WebSocket = WebSocket
}
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
/***/ }),
/***/ 7890:
/***/ ((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 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')
function defaultFactory (origin, opts) {
return opts && opts.connections === 1
? new Client(origin, opts)
: new Pool(origin, opts)
}
class Agent extends DispatcherBase {
constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
super()
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')
}
if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
throw new InvalidArgumentError('maxRedirections must be a positive number')
}
if (connect && typeof connect !== 'function') {
connect = { ...connect }
}
this[kInterceptors] = options.interceptors && 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[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)
}
})
const agent = this
this[kOnDrain] = (origin, targets) => {
agent.emit('drain', origin, [agent, ...targets])
}
this[kOnConnect] = (origin, targets) => {
agent.emit('connect', origin, [agent, ...targets])
}
this[kOnDisconnect] = (origin, targets, err) => {
agent.emit('disconnect', origin, [agent, ...targets], err)
}
this[kOnConnectionError] = (origin, targets, err) => {
agent.emit('connectionError', origin, [agent, ...targets], err)
}
}
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
}
[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.')
}
const ref = this[kClients].get(key)
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])
this[kClients].set(key, new WeakRef(dispatcher))
this[kFinalizer].register(dispatcher, key)
}
return dispatcher.dispatch(opts, handler)
}
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())
}
}
await Promise.all(closePromises)
}
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))
}
}
await Promise.all(destroyPromises)
}
}
module.exports = Agent
/***/ }),
/***/ 7032:
/***/ ((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
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
}
/***/ }),
/***/ 9744:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const { AsyncResource } = __nccwpck_require__(852)
const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
const util = __nccwpck_require__(3983)
const { addSignal, removeSignal } = __nccwpck_require__(7032)
class ConnectHandler 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
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
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.callback) {
throw new RequestAbortedError()
}
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 })
})
}
}
}
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 && opts.opaque
queueMicrotask(() => callback(err, { opaque }))
}
}
module.exports = connect
/***/ }),
/***/ 8752:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
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)
const kResume = Symbol('resume')
class PipelineRequest extends Readable {
constructor () {
super({ autoDestroy: true })
this[kResume] = null
}
_read () {
const { [kResume]: resume } = this
if (resume) {
this[kResume] = null
resume()
}
}
_destroy (err, callback) {
this._read()
callback(err)
}
}
class PipelineResponse extends Readable {
constructor (resume) {
super({ autoDestroy: true })
this[kResume] = resume
}
_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
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
if (method === 'CONNECT') {
throw new InvalidArgumentError('invalid method')
}
if (onInfo && typeof onInfo !== 'function') {
throw new InvalidArgumentError('invalid onInfo callback')
}
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)
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)
}
onConnect (abort, context) {
const { ret, res } = this
assert(!res, 'pipeline cannot be retried')
if (ret.destroyed) {
throw new RequestAbortedError()
}
this.abort = abort
this.context = context
}
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')
}
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
ret.push(null)
})
.on('close', () => {
const { ret } = this
if (!ret._readableState.ended) {
util.destroy(ret, new RequestAbortedError())
}
})
this.body = body
}
onData (chunk) {
const { res } = this
return res.push(chunk)
}
onComplete (trailers) {
const { res } = this
res.push(null)
}
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
/***/ }),
/***/ 5448:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
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)
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')
}
if (method === 'CONNECT') {
throw new InvalidArgumentError('invalid method')
}
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.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
if (util.isStream(body)) {
body.on('error', (err) => {
this.onError(err)
})
}
addSignal(this, signal)
}
onConnect (abort, context) {
if (!this.callback) {
throw new RequestAbortedError()
}
this.abort = abort
this.context = context
}
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
}
const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
const contentType = parsedHeaders['content-type']
const body = new Readable({ resume, abort, contentType, highWaterMark })
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
})
}
}
}
onData (chunk) {
const { res } = this
return res.push(chunk)
}
onComplete (trailers) {
const { res } = this
removeSignal(this)
util.parseHeaders(trailers, this.trailers)
res.push(null)
}
onError (err) {
const { res, callback, body, opaque } = this
removeSignal(this)
if (callback) {
// TODO: Does this need queueMicrotask?
this.callback = null
queueMicrotask(() => {
this.runInAsyncScope(callback, null, err, { opaque })
})
}
if (res) {
this.res = null
// Ensure all queued handlers are invoked before destroying res.
queueMicrotask(() => {
util.destroy(res, err)
})
}
if (body) {
this.body = null
util.destroy(body, err)
}
}
}
function request (opts, callback) {
if (callback === undefined) {
return new Promise((resolve, reject) => {
request.call(this, opts, (err, data) => {
return err ? reject(err) : resolve(data)
})
})
}
try {
this.dispatch(opts, new RequestHandler(opts, callback))
} catch (err) {
if (typeof callback !== 'function') {
throw err
}
const opaque = opts && opts.opaque
queueMicrotask(() => callback(err, { opaque }))
}
}
module.exports = request
module.exports.RequestHandler = RequestHandler
/***/ }),
/***/ 5395:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
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)
class StreamHandler extends AsyncResource {
constructor (opts, factory, callback) {
if (!opts || typeof opts !== 'object') {
throw new InvalidArgumentError('invalid opts')
}
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')
}
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
if (method === 'CONNECT') {
throw new InvalidArgumentError('invalid method')
}
if (onInfo && typeof onInfo !== 'function') {
throw new InvalidArgumentError('invalid onInfo callback')
}
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 (util.isStream(body)) {
body.on('error', (err) => {
this.onError(err)
})
}
addSignal(this, signal)
}
onConnect (abort, context) {
if (!this.callback) {
throw new RequestAbortedError()
}
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)
if (statusCode < 200) {
if (this.onInfo) {
this.onInfo({ statusCode, headers })
}
return
}
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()
this.callback = null
this.runInAsyncScope(getResolveErrorBodyCallback, null,
{ callback, body: res, contentType, statusCode, statusMessage, headers }
)
} else {
if (factory === null) {
return
}
res = this.runInAsyncScope(factory, null, {
statusCode,
headers,
opaque,
context
})
if (
!res ||
typeof res.write !== 'function' ||
typeof res.end !== 'function' ||
typeof res.on !== 'function'
) {
throw new InvalidReturnValueError('expected Writable')
}
// TODO: Avoid finished. It registers an unnecessary amount of listeners.
finished(res, { readable: false }, (err) => {
const { callback, res, opaque, trailers, abort } = this
this.res = null
if (err || !res.readable) {
util.destroy(res, err)
}
this.callback = null
this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
if (err) {
abort()
}
})
}
res.on('drain', resume)
this.res = res
const needDrain = res.writableNeedDrain !== undefined
? res.writableNeedDrain
: res._writableState && res._writableState.needDrain
return needDrain !== true
}
onData (chunk) {
const { res } = this
return res ? res.write(chunk) : true
}
onComplete (trailers) {
const { res } = this
removeSignal(this)
if (!res) {
return
}
this.trailers = util.parseHeaders(trailers)
res.end()
}
onError (err) {
const { res, callback, opaque, body } = this
removeSignal(this)
this.factory = null
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)
}
}
}
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)
})
})
}
try {
this.dispatch(opts, new StreamHandler(opts, factory, callback))
} catch (err) {
if (typeof callback !== 'function') {
throw err
}
const opaque = opts && opts.opaque
queueMicrotask(() => callback(err, { opaque }))
}
}
module.exports = stream
/***/ }),
/***/ 6923:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
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)
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
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
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()
}
this.abort = abort
this.context = null
}
onHeaders () {
throw new SocketError('bad upgrade', null)
}
onUpgrade (statusCode, rawHeaders, socket) {
const { callback, opaque, context } = this
assert.strictEqual(statusCode, 101)
removeSignal(this)
this.callback = null
const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
this.runInAsyncScope(callback, null, null, {
headers,
socket,
opaque,
context
})
}
onError (err) {
const { callback, opaque } = this
removeSignal(this)
if (callback) {
this.callback = null
queueMicrotask(() => {
this.runInAsyncScope(callback, null, err, { opaque })
})
}
}
}
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 && 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)
/***/ }),
/***/ 3858:
/***/ ((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
})
this._readableState.dataEmitted = false
this[kAbort] = abort
this[kConsume] = null
this[kBody] = null
this[kContentType] = contentType
// 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
}
destroy (err) {
if (this.destroyed) {
// Node < 16
return this
}
if (!err && !this._readableState.endEmitted) {
err = new RequestAbortedError()
}
if (err) {
this[kAbort]()
}
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)
}
on (ev, ...args) {
if (ev === 'data' || ev === 'readable') {
this[kReading] = true
}
return super.on(ev, ...args)
}
addListener (ev, ...args) {
return this.on(ev, ...args)
}
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)
}
push (chunk) {
if (this[kConsume] && chunk !== null && this.readableLength === 0) {
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')
}
// https://fetch.spec.whatwg.org/#dom-body-json
async json () {
return consume(this, 'json')
}
// https://fetch.spec.whatwg.org/#dom-body-blob
async blob () {
return consume(this, 'blob')
}
// 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()
}
// https://fetch.spec.whatwg.org/#dom-body-bodyused
get bodyUsed () {
return util.isDisturbed(this)
}
// 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]
}
dump (opts) {
let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
const signal = opts && opts.signal
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.closed) {
return Promise.resolve(null)
}
return new Promise((resolve, reject) => {
const signalListenerCleanup = signal
? util.addAbortListener(signal, () => {
this.destroy()
})
: 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()
})
}
}
// 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)
}
async function consume (stream, type) {
if (isUnusable(stream)) {
throw new TypeError('unusable')
}
assert(!stream[kConsume])
return new Promise((resolve, reject) => {
stream[kConsume] = {
type,
stream,
resolve,
reject,
length: 0,
body: []
}
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
}
const { _readableState: state } = consume.stream
for (const chunk of state.buffer) {
consumePush(consume, chunk)
}
if (state.endEmitted) {
consumeEnd(this[kConsume])
} else {
consume.stream.on('end', function () {
consumeEnd(this[kConsume])
})
}
consume.stream.resume()
while (consume.stream.read() != null) {
// Loop
}
}
function consumeEnd (consume) {
const { type, body, resolve, stream, length } = consume
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] }))
}
consumeFinish(consume)
} catch (err) {
stream.destroy(err)
}
}
function consumePush (consume, chunk) {
consume.length += chunk.length
consume.body.push(chunk)
}
function consumeFinish (consume, err) {
if (consume.body === null) {
return
}
if (err) {
consume.reject(err)
} else {
consume.resolve()
}
consume.type = null
consume.stream = null
consume.resolve = null
consume.reject = null
consume.length = 0
consume.body = null
}
/***/ }),
/***/ 7474:
/***/ ((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
for await (const chunk of body) {
chunks.push(chunk)
limit += chunk.length
if (limit > 128 * 1024) {
chunks = null
break
}
}
if (statusCode === 204 || !contentType || !chunks) {
process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
return
}
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
}
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
}
process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
}
module.exports = { getResolveErrorBodyCallback }
/***/ }),
/***/ 7931:
/***/ ((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)
}
function defaultFactory (origin, opts) {
return new Pool(origin, opts)
}
class BalancedPool extends PoolBase {
constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
super()
this[kOptions] = opts
this[kIndex] = -1
this[kCurrentWeight] = 0
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.')
}
this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
? opts.interceptors.BalancedPool
: []
this[kFactory] = factory
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]))
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()
})
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()
}
})
for (const client of this[kClients]) {
client[kWeight] = this[kMaxWeightPerServer]
}
this._updateBalancedPoolStats()
return this
}
_updateBalancedPoolStats () {
this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
}
removeUpstream (upstream) {
const upstreamOrigin = parseOrigin(upstream).origin
const pool = this[kClients].find((pool) => (
pool[kUrl].origin === upstreamOrigin &&
pool.closed !== true &&
pool.destroyed !== true
))
if (pool) {
this[kRemoveClient](pool)
}
return this
}
get upstreams () {
return this[kClients]
.filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
.map((p) => p[kUrl].origin)
}
[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
}
const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
if (allClientsBusy) {
return
}
let counter = 0
let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
while (counter++ < this[kClients].length) {
this[kIndex] = (this[kIndex] + 1) % this[kClients].length
const pool = this[kClients][this[kIndex]]
// find pool index with the largest weight
if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
maxWeightIndex = this[kIndex]
}
// 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
}
}
this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
this[kIndex] = maxWeightIndex
return this[kClients][maxWeightIndex]
}
}
module.exports = BalancedPool
/***/ }),
/***/ 6101:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
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
*/
class Cache {
/**
* @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
* @type {requestResponseList}
*/
#relevantRequestResponseList
constructor () {
if (arguments[0] !== kConstruct) {
webidl.illegalConstructor()
}
this.#relevantRequestResponseList = arguments[1]
}
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
}
return p[0]
}
async matchAll (request = undefined, options = {}) {
webidl.brandCheck(this, Cache)
if (request !== undefined) request = webidl.converters.RequestInfo(request)
options = webidl.converters.CacheQueryOptions(options)
// 1.
let r = null
// 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]
}
}
// 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])
}
}
// 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)
}
async add (request) {
webidl.brandCheck(this, Cache)
webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
request = webidl.converters.RequestInfo(request)
// 1.
const requests = [request]
// 2.
const responseArrayPromise = this.addAll(requests)
// 3.
return await responseArrayPromise
}
async addAll (requests) {
webidl.brandCheck(this, Cache)
webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
requests = webidl.converters['sequence<RequestInfo>'](requests)
// 1.
const responsePromises = []
// 2.
const requestList = []
// 3.
for (const request of requests) {
if (typeof request === 'string') {
continue
}
// 3.1
const r = request[kState]
// 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<typeof fetching>[]} */
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.'
})
}
// 5.4
r.initiator = 'fetch'
r.destination = 'subresource'
// 5.5
requestList.push(r)
// 5.6
const responsePromise = createDeferredPromise()
// 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'))
// 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'
}))
for (const controller of fetchControllers) {
controller.abort()
}
return
}
}
}
},
processResponseEndOfBody (response) {
// 1.
if (response.aborted) {
responsePromise.reject(new DOMException('aborted', 'AbortError'))
return
}
// 2.
responsePromise.resolve(response)
}
}))
// 5.8
responsePromises.push(responsePromise.promise)
}
// 6.
const p = Promise.all(responsePromises)
// 7.
const responses = await p
// 7.1
const operations = []
// 7.2
let index = 0
// 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
}
// 7.5
const cacheJobPromise = createDeferredPromise()
// 7.6.1
let errorData = null
// 7.6.2
try {
this.#batchCacheOperations(operations)
} catch (e) {
errorData = e
}
// 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
}
async put (request, response) {
webidl.brandCheck(this, Cache)
webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
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]
}
// 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'
})
}
// 5.
const innerResponse = response[kState]
// 6.
if (innerResponse.status === 206) {
throw webidl.errors.exception({
header: 'Cache.put',
message: 'Got 206 status'
})
}
// 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'
})
}
}
}
// 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'
})
}
// 9.
const clonedResponse = cloneResponse(innerResponse)
// 10.
const bodyReadPromise = createDeferredPromise()
// 11.
if (innerResponse.body != null) {
// 11.1
const stream = innerResponse.body.stream
// 11.2
const reader = stream.getReader()
// 11.3
readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
} else {
bodyReadPromise.resolve(undefined)
}
// 12.
/** @type {CacheBatchOperation[]} */
const operations = []
// 13.
/** @type {CacheBatchOperation} */
const operation = {
type: 'put', // 14.
request: innerRequest, // 15.
response: clonedResponse // 16.
}
// 17.
operations.push(operation)
// 19.
const bytes = await bodyReadPromise.promise
if (clonedResponse.body != null) {
clonedResponse.body.source = bytes
}
// 19.1
const cacheJobPromise = createDeferredPromise()
// 19.2.1
let errorData = null
// 19.2.2
try {
this.#batchCacheOperations(operations)
} catch (e) {
errorData = e
}
// 19.2.3
queueMicrotask(() => {
// 19.2.3.1
if (errorData === null) {
cacheJobPromise.resolve()
} else { // 19.2.3.2
cacheJobPromise.reject(errorData)
}
})
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)
/**
* @type {Request}
*/
let r = null
if (request instanceof Request) {
r = request[kState]
if (r.method !== 'GET' && !options.ignoreMethod) {
return false
}
} else {
assert(typeof request === 'string')
r = new Request(request)[kState]
}
/** @type {CacheBatchOperation[]} */
const operations = []
/** @type {CacheBatchOperation} */
const operation = {
type: 'delete',
request: r,
options
}
operations.push(operation)
const cacheJobPromise = createDeferredPromise()
let errorData = null
let requestResponses
try {
requestResponses = this.#batchCacheOperations(operations)
} catch (e) {
errorData = e
}
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)
if (request !== undefined) request = webidl.converters.RequestInfo(reques
gitextract_dr75mqoc/ ├── .gitignore ├── .node-version ├── LICENSE ├── README.md ├── action.yml ├── build.sh ├── dist/ │ └── index.js ├── fastlane/ │ └── Fastfile ├── index.js └── package.json
SYMBOL INDEX (999 symbols across 2 files)
FILE: dist/index.js
function issueCommand (line 42) | function issueCommand(command, properties, message) {
function issue (line 47) | function issue(name, message = '') {
class Command (line 52) | class Command {
method constructor (line 53) | constructor(command, properties, message) {
method toString (line 61) | toString() {
function escapeData (line 85) | function escapeData(s) {
function escapeProperty (line 91) | function escapeProperty(s) {
function adopt (line 128) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 130) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 131) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 132) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
function exportVariable (line 167) | function exportVariable(name, val) {
function setSecret (line 181) | function setSecret(secret) {
function addPath (line 189) | function addPath(inputPath) {
function getInput (line 209) | function getInput(name, options) {
function getMultilineInput (line 228) | function getMultilineInput(name, options) {
function getBooleanInput (line 248) | function getBooleanInput(name, options) {
function setOutput (line 267) | function setOutput(name, value) {
function setCommandEcho (line 281) | function setCommandEcho(enabled) {
function setFailed (line 293) | function setFailed(message) {
function isDebug (line 304) | function isDebug() {
function debug (line 312) | function debug(message) {
function error (line 321) | function error(message, properties = {}) {
function warning (line 330) | function warning(message, properties = {}) {
function notice (line 339) | function notice(message, properties = {}) {
function info (line 347) | function info(message) {
function startGroup (line 358) | function startGroup(name) {
function endGroup (line 365) | function endGroup() {
function group (line 377) | function group(name, fn) {
function saveState (line 401) | function saveState(name, value) {
function getState (line 415) | function getState(name) {
function getIDToken (line 419) | function getIDToken(aud) {
function issueFileCommand (line 479) | function issueFileCommand(command, message) {
function prepareKeyValueMessage (line 492) | function prepareKeyValueMessage(key, value) {
function adopt (line 517) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 519) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 520) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 521) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
class OidcClient (line 530) | class OidcClient {
method createHttpClient (line 531) | static createHttpClient(allowRetry = true, maxRetry = 10) {
method getRequestToken (line 538) | static getRequestToken() {
method getIDTokenUrl (line 545) | static getIDTokenUrl() {
method getCall (line 552) | static getCall(id_token_url) {
method getIDToken (line 570) | static getIDToken(audience) {
function toPosixPath (line 629) | function toPosixPath(pth) {
function toWin32Path (line 640) | function toWin32Path(pth) {
function toPlatformPath (line 652) | function toPlatformPath(pth) {
function adopt (line 666) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 668) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 669) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 670) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
class Summary (line 681) | class Summary {
method constructor (line 682) | constructor() {
method filePath (line 691) | filePath() {
method wrap (line 719) | wrap(tag, content, attrs = {}) {
method write (line 735) | write(options) {
method clear (line 749) | clear() {
method stringify (line 759) | stringify() {
method isEmptyBuffer (line 767) | isEmptyBuffer() {
method emptyBuffer (line 775) | emptyBuffer() {
method addRaw (line 787) | addRaw(text, addEOL = false) {
method addEOL (line 796) | addEOL() {
method addCodeBlock (line 807) | addCodeBlock(code, lang) {
method addList (line 820) | addList(items, ordered = false) {
method addTable (line 833) | addTable(rows) {
method addDetails (line 861) | addDetails(label, content) {
method addImage (line 874) | addImage(src, alt, options) {
method addHeading (line 888) | addHeading(text, level) {
method addSeparator (line 901) | addSeparator() {
method addBreak (line 910) | addBreak() {
method addQuote (line 922) | addQuote(text, cite) {
method addLink (line 935) | addLink(text, href) {
function toCommandValue (line 963) | function toCommandValue(input) {
function toCommandProperties (line 979) | function toCommandProperties(annotationProperties) {
function adopt (line 1022) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 1024) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 1025) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 1026) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
function exec (line 1044) | function exec(commandLine, args, options) {
function getExecOutput (line 1068) | function getExecOutput(commandLine, args, options) {
function adopt (line 1132) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 1134) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 1135) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 1136) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
class ToolRunner (line 1154) | class ToolRunner extends events.EventEmitter {
method constructor (line 1155) | constructor(toolPath, args, options) {
method _debug (line 1164) | _debug(message) {
method _getCommandString (line 1169) | _getCommandString(options, noPrefix) {
method _processLineBuffer (line 1207) | _processLineBuffer(data, strBuffer, onLine) {
method _getSpawnFileName (line 1226) | _getSpawnFileName() {
method _getSpawnArgs (line 1234) | _getSpawnArgs(options) {
method _endsWith (line 1250) | _endsWith(str, end) {
method _isCmdFile (line 1253) | _isCmdFile() {
method _windowsQuoteCmdArg (line 1258) | _windowsQuoteCmdArg(arg) {
method _uvQuoteCmdArg (line 1378) | _uvQuoteCmdArg(arg) {
method _cloneExecOptions (line 1457) | _cloneExecOptions(options) {
method _getSpawnOptions (line 1472) | _getSpawnOptions(options, toolPath) {
method exec (line 1493) | exec() {
function argStringToArray (line 1613) | function argStringToArray(argString) {
class ExecState (line 1660) | class ExecState extends events.EventEmitter {
method constructor (line 1661) | constructor(options, toolPath) {
method CheckComplete (line 1680) | CheckComplete() {
method _debug (line 1691) | _debug(message) {
method _setResult (line 1694) | _setResult() {
method HandleTimeout (line 1716) | static HandleTimeout(state) {
function adopt (line 1738) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 1740) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 1741) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 1742) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
class BasicCredentialHandler (line 1748) | class BasicCredentialHandler {
method constructor (line 1749) | constructor(username, password) {
method prepareRequest (line 1753) | prepareRequest(options) {
method canHandleAuthentication (line 1760) | canHandleAuthentication() {
method handleAuthentication (line 1763) | handleAuthentication() {
class BearerCredentialHandler (line 1770) | class BearerCredentialHandler {
method constructor (line 1771) | constructor(token) {
method prepareRequest (line 1776) | prepareRequest(options) {
method canHandleAuthentication (line 1783) | canHandleAuthentication() {
method handleAuthentication (line 1786) | handleAuthentication() {
class PersonalAccessTokenCredentialHandler (line 1793) | class PersonalAccessTokenCredentialHandler {
method constructor (line 1794) | constructor(token) {
method prepareRequest (line 1799) | prepareRequest(options) {
method canHandleAuthentication (line 1806) | canHandleAuthentication() {
method handleAuthentication (line 1809) | handleAuthentication() {
function adopt (line 1850) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 1852) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 1853) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 1854) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
function getProxyUrl (line 1908) | function getProxyUrl(serverUrl) {
class HttpClientError (line 1928) | class HttpClientError extends Error {
method constructor (line 1929) | constructor(message, statusCode) {
class HttpClientResponse (line 1937) | class HttpClientResponse {
method constructor (line 1938) | constructor(message) {
method readBody (line 1941) | readBody() {
method readBodyBuffer (line 1954) | readBodyBuffer() {
function isHttps (line 1969) | function isHttps(requestUrl) {
class HttpClient (line 1974) | class HttpClient {
method constructor (line 1975) | constructor(userAgent, handlers, requestOptions) {
method options (line 2012) | options(requestUrl, additionalHeaders) {
method get (line 2017) | get(requestUrl, additionalHeaders) {
method del (line 2022) | del(requestUrl, additionalHeaders) {
method post (line 2027) | post(requestUrl, data, additionalHeaders) {
method patch (line 2032) | patch(requestUrl, data, additionalHeaders) {
method put (line 2037) | put(requestUrl, data, additionalHeaders) {
method head (line 2042) | head(requestUrl, additionalHeaders) {
method sendStream (line 2047) | sendStream(verb, requestUrl, stream, additionalHeaders) {
method getJson (line 2056) | getJson(requestUrl, additionalHeaders = {}) {
method postJson (line 2063) | postJson(requestUrl, obj, additionalHeaders = {}) {
method putJson (line 2072) | putJson(requestUrl, obj, additionalHeaders = {}) {
method patchJson (line 2081) | patchJson(requestUrl, obj, additionalHeaders = {}) {
method request (line 2095) | request(verb, requestUrl, data, headers) {
method dispose (line 2180) | dispose() {
method requestRaw (line 2191) | requestRaw(info, data) {
method requestRawWithCallback (line 2216) | requestRawWithCallback(info, data, onResult) {
method getAgent (line 2268) | getAgent(serverUrl) {
method getAgentDispatcher (line 2272) | getAgentDispatcher(serverUrl) {
method _prepareRequest (line 2281) | _prepareRequest(method, requestUrl, headers) {
method _mergeHeaders (line 2308) | _mergeHeaders(headers) {
method _getExistingOrDefaultHeader (line 2314) | _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
method _getAgent (line 2321) | _getAgent(parsedUrl) {
method _getProxyAgentDispatcher (line 2376) | _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
method _performExponentialBackoff (line 2400) | _performExponentialBackoff(retryNumber) {
method _processResponse (line 2407) | _processResponse(res, options) {
function getProxyUrl (line 2486) | function getProxyUrl(reqUrl) {
function checkBypass (line 2513) | function checkBypass(reqUrl) {
function isLoopbackAddress (line 2557) | function isLoopbackAddress(host) {
function adopt (line 2574) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 2576) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 2577) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 2578) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
function exists (line 2589) | function exists(fsPath) {
function isDirectory (line 2604) | function isDirectory(fsPath, useStat = false) {
function isRooted (line 2615) | function isRooted(p) {
function mkdirP (line 2637) | function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
function tryGetExecutablePath (line 2676) | function tryGetExecutablePath(filePath, extensions) {
function normalizeSeparators (line 2747) | function normalizeSeparators(p) {
function isUnixExecutable (line 2761) | function isUnixExecutable(stats) {
function adopt (line 2776) | function adopt(value) { return value instanceof P ? value : new P(functi...
function fulfilled (line 2778) | function fulfilled(value) { try { step(generator.next(value)); } catch (...
function rejected (line 2779) | function rejected(value) { try { step(generator["throw"](value)); } catc...
function step (line 2780) | function step(result) { result.done ? resolve(result.value) : adopt(resu...
function cp (line 2798) | function cp(source, dest, options = {}) {
function mv (line 2839) | function mv(source, dest, options = {}) {
function rmRF (line 2867) | function rmRF(inputPath) {
function mkdirP (line 2926) | function mkdirP(fsPath) {
function which (line 2940) | function which(tool, check) {
function readCopyOptions (line 3008) | function readCopyOptions(options) {
function cpDirRecursive (line 3013) | function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
function copyFile (line 3038) | function copyFile(srcFile, destFile, force) {
function httpOverHttp (line 3096) | function httpOverHttp(options) {
function httpsOverHttp (line 3102) | function httpsOverHttp(options) {
function httpOverHttps (line 3110) | function httpOverHttps(options) {
function httpsOverHttps (line 3116) | function httpsOverHttps(options) {
function TunnelingAgent (line 3125) | function TunnelingAgent(options) {
function onFree (line 3168) | function onFree() {
function onCloseOrRemove (line 3172) | function onCloseOrRemove(err) {
function onResponse (line 3212) | function onResponse(res) {
function onUpgrade (line 3217) | function onUpgrade(res, socket, head) {
function onConnect (line 3224) | function onConnect(res, socket, head) {
function onError (line 3253) | function onError(cause) {
function createSecureSocket (line 3283) | function createSecureSocket(options, cb) {
function toOptions (line 3300) | function toOptions(host, port, localAddress) {
function mergeOptions (line 3311) | function mergeOptions(target) {
function makeDispatcher (line 3399) | function makeDispatcher (fn) {
function defaultFactory (line 3546) | function defaultFactory (origin, opts) {
class Agent (line 3552) | class Agent extends DispatcherBase {
method constructor (line 3553) | constructor ({ factory = defaultFactory, maxRedirections = 0, connect,...
method [kRunning] (line 3609) | get [kRunning] () {
method [kDispatch] (line 3621) | [kDispatch] (opts, handler) {
method [kClose] (line 3646) | async [kClose] () {
method [kDestroy] (line 3659) | async [kDestroy] (err) {
function abort (line 3687) | function abort (self) {
function addSignal (line 3695) | function addSignal (self, signal) {
function removeSignal (line 3716) | function removeSignal (self) {
class ConnectHandler (line 3750) | class ConnectHandler extends AsyncResource {
method constructor (line 3751) | constructor (opts, callback) {
method onConnect (line 3776) | onConnect (abort, context) {
method onHeaders (line 3785) | onHeaders () {
method onUpgrade (line 3789) | onUpgrade (statusCode, rawHeaders, socket) {
method onError (line 3811) | onError (err) {
function connect (line 3825) | function connect (opts, callback) {
class PipelineRequest (line 3874) | class PipelineRequest extends Readable {
method constructor (line 3875) | constructor () {
method _read (line 3881) | _read () {
method _destroy (line 3890) | _destroy (err, callback) {
class PipelineResponse (line 3897) | class PipelineResponse extends Readable {
method constructor (line 3898) | constructor (resume) {
method _read (line 3903) | _read () {
method _destroy (line 3907) | _destroy (err, callback) {
class PipelineHandler (line 3916) | class PipelineHandler extends AsyncResource {
method constructor (line 3917) | constructor (opts, handler) {
method onConnect (line 4001) | onConnect (abort, context) {
method onHeaders (line 4014) | onHeaders (statusCode, rawHeaders, resume) {
method onData (line 4076) | onData (chunk) {
method onComplete (line 4081) | onComplete (trailers) {
method onError (line 4086) | onError (err) {
function pipeline (line 4093) | function pipeline (opts, handler) {
class RequestHandler (line 4124) | class RequestHandler extends AsyncResource {
method constructor (line 4125) | constructor (opts, callback) {
method onConnect (line 4182) | onConnect (abort, context) {
method onHeaders (line 4191) | onHeaders (statusCode, rawHeaders, resume, statusMessage) {
method onData (line 4227) | onData (chunk) {
method onComplete (line 4232) | onComplete (trailers) {
method onError (line 4242) | onError (err) {
function request (line 4270) | function request (opts, callback) {
class StreamHandler (line 4313) | class StreamHandler extends AsyncResource {
method constructor (line 4314) | constructor (opts, factory, callback) {
method onConnect (line 4371) | onConnect (abort, context) {
method onHeaders (line 4380) | onHeaders (statusCode, rawHeaders, resume, statusMessage) {
method onData (line 4455) | onData (chunk) {
method onComplete (line 4461) | onComplete (trailers) {
method onError (line 4475) | onError (err) {
function stream (line 4499) | function stream (opts, factory, callback) {
class UpgradeHandler (line 4536) | class UpgradeHandler extends AsyncResource {
method constructor (line 4537) | constructor (opts, callback) {
method onConnect (line 4563) | onConnect (abort, context) {
method onHeaders (line 4572) | onHeaders () {
method onUpgrade (line 4576) | onUpgrade (statusCode, rawHeaders, socket) {
method onError (line 4593) | onError (err) {
function upgrade (line 4607) | function upgrade (opts, callback) {
method constructor (line 4677) | constructor ({
method destroy (line 4703) | destroy (err) {
method emit (line 4720) | emit (ev, ...args) {
method on (line 4731) | on (ev, ...args) {
method addListener (line 4738) | addListener (ev, ...args) {
method off (line 4742) | off (ev, ...args) {
method removeListener (line 4753) | removeListener (ev, ...args) {
method push (line 4757) | push (chunk) {
method text (line 4766) | async text () {
method json (line 4771) | async json () {
method blob (line 4776) | async blob () {
method arrayBuffer (line 4781) | async arrayBuffer () {
method formData (line 4786) | async formData () {
method bodyUsed (line 4792) | get bodyUsed () {
method body (line 4797) | get body () {
method dump (line 4809) | dump (opts) {
function isLocked (line 4857) | function isLocked (self) {
function isUnusable (line 4863) | function isUnusable (self) {
function consume (line 4867) | async function consume (stream, type) {
function consumeStart (line 4898) | function consumeStart (consume) {
function consumeEnd (line 4924) | function consumeEnd (consume) {
function consumePush (line 4955) | function consumePush (consume, chunk) {
function consumeFinish (line 4960) | function consumeFinish (consume, err) {
function getResolveErrorBodyCallback (line 4991) | async function getResolveErrorBodyCallback ({ callback, body, contentTyp...
function getGreatestCommonDivisor (line 5066) | function getGreatestCommonDivisor (a, b) {
function defaultFactory (line 5071) | function defaultFactory (origin, opts) {
class BalancedPool (line 5075) | class BalancedPool extends PoolBase {
method constructor (line 5076) | constructor (upstreams = [], { factory = defaultFactory, ...opts } = {...
method addUpstream (line 5105) | addUpstream (upstream) {
method _updateBalancedPoolStats (line 5145) | _updateBalancedPoolStats () {
method removeUpstream (line 5149) | removeUpstream (upstream) {
method upstreams (line 5165) | get upstreams () {
method [kGetDispatcher] (line 5171) | [kGetDispatcher] () {
class Cache (line 5266) | class Cache {
method constructor (line 5273) | constructor () {
method match (line 5281) | async match (request, options = {}) {
method matchAll (line 5297) | async matchAll (request = undefined, options = {}) {
method add (line 5365) | async add (request) {
method addAll (line 5381) | async addAll (requests) {
method put (line 5542) | async put (request, response) {
method delete (line 5671) | async delete (request, options = {}) {
method keys (line 5735) | async keys (request = undefined, options = {}) {
method #batchCacheOperations (line 5814) | #batchCacheOperations (operations) {
method #queryCache (line 5952) | #queryCache (requestQuery, options, targetStorage) {
method #requestMatchesCachedItem (line 5976) | #requestMatchesCachedItem (requestQuery, request, response = null, opt...
class CacheStorage (line 6090) | class CacheStorage {
method constructor (line 6097) | constructor () {
method match (line 6103) | async match (request, options = {}) {
method has (line 6140) | async has (cacheName) {
method open (line 6156) | async open (cacheName) {
method delete (line 6188) | async delete (cacheName) {
method keys (line 6201) | async keys () {
function urlEquals (line 6261) | function urlEquals (A, B, excludeFragment = false) {
function fieldValues (line 6273) | function fieldValues (header) {
class Client (line 6433) | class Client extends DispatcherBase {
method constructor (line 6439) | constructor (url, {
method pipelining (line 6622) | get pipelining () {
method pipelining (line 6626) | set pipelining (value) {
method [kPending] (line 6631) | get [kPending] () {
method [kRunning] (line 6635) | get [kRunning] () {
method [kSize] (line 6639) | get [kSize] () {
method [kConnected] (line 6643) | get [kConnected] () {
method [kBusy] (line 6647) | get [kBusy] () {
method [kConnect] (line 6657) | [kConnect] (cb) {
method [kDispatch] (line 6662) | [kDispatch] (opts, handler) {
method [kClose] (line 6687) | async [kClose] () {
method [kDestroy] (line 6699) | async [kDestroy] (err) {
function onHttp2SessionError (line 6733) | function onHttp2SessionError (err) {
function onHttp2FrameError (line 6741) | function onHttp2FrameError (type, code, id) {
function onHttp2SessionEnd (line 6750) | function onHttp2SessionEnd () {
function onHTTP2GoAway (line 6755) | function onHTTP2GoAway (code) {
function lazyllhttp (line 6795) | async function lazyllhttp () {
class Parser (line 6870) | class Parser {
method constructor (line 6871) | constructor (client, socket, { exports }) {
method setTimeout (line 6899) | setTimeout (value, type) {
method resume (line 6921) | resume () {
method readMore (line 6944) | readMore () {
method execute (line 6954) | execute (data) {
method destroy (line 7016) | destroy () {
method onStatus (line 7031) | onStatus (buf) {
method onMessageBegin (line 7035) | onMessageBegin () {
method onHeaderField (line 7049) | onHeaderField (buf) {
method onHeaderValue (line 7061) | onHeaderValue (buf) {
method trackHeader (line 7083) | trackHeader (len) {
method onUpgrade (line 7090) | onUpgrade (head) {
method onHeadersComplete (line 7137) | onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
method onBody (line 7246) | onBody (buf) {
method onMessageComplete (line 7278) | onMessageComplete () {
function onParserTimeout (line 7345) | function onParserTimeout (parser) {
function onSocketReadable (line 7364) | function onSocketReadable () {
function onSocketError (line 7371) | function onSocketError (err) {
function onError (line 7391) | function onError (client, err) {
function onSocketEnd (line 7411) | function onSocketEnd () {
function onSocketClose (line 7425) | function onSocketClose () {
function connect (line 7468) | async function connect (client) {
function emitDrain (line 7633) | function emitDrain (client) {
function resume (line 7638) | function resume (client, sync) {
function _resume (line 7655) | function _resume (client, sync) {
function shouldSendContentLength (line 7780) | function shouldSendContentLength (method) {
function write (line 7784) | function write (client, request) {
function writeH2 (line 7949) | function writeH2 (client, session, request) {
function writeStream (line 8213) | function writeStream ({ h2stream, body, client, request, socket, content...
function writeBlob (line 8328) | async function writeBlob ({ h2stream, body, client, request, socket, con...
function writeIterable (line 8363) | async function writeIterable ({ h2stream, body, client, request, socket,...
class AsyncWriter (line 8443) | class AsyncWriter {
method constructor (line 8444) | constructor ({ socket, request, contentLength, client, expectsPayload,...
method write (line 8456) | write (chunk) {
method end (line 8519) | end () {
method destroy (line 8566) | destroy (err) {
function errorRequest (line 8578) | function errorRequest (client, request, err) {
class CompatWeakRef (line 8602) | class CompatWeakRef {
method constructor (line 8603) | constructor (value) {
method deref (line 8607) | deref () {
class CompatFinalizer (line 8614) | class CompatFinalizer {
method constructor (line 8615) | constructor (finalizer) {
method register (line 8619) | register (dispatcher, key) {
function getCookies (line 8697) | function getCookies (headers) {
function deleteCookie (line 8724) | function deleteCookie (headers, name, attributes) {
function getSetCookies (line 8746) | function getSetCookies (headers) {
function setCookie (line 8766) | function setCookie (headers, cookie) {
function parseSetCookie (line 8877) | function parseSetCookie (header) {
function parseUnparsedAttributes (line 8953) | function parseUnparsedAttributes (unparsedAttributes, cookieAttributeLis...
function isCTLExcludingHtab (line 9194) | function isCTLExcludingHtab (value) {
function validateCookieName (line 9221) | function validateCookieName (name) {
function validateCookieValue (line 9258) | function validateCookieValue (value) {
function validateCookiePath (line 9279) | function validateCookiePath (path) {
function validateCookieDomain (line 9294) | function validateCookieDomain (domain) {
function toIMFDate (line 9345) | function toIMFDate (date) {
function validateCookieMaxAge (line 9378) | function validateCookieMaxAge (maxAge) {
function stringify (line 9388) | function stringify (cookie) {
function getHeadersList (line 9456) | function getHeadersList (headers) {
method constructor (line 9507) | constructor (maxCachedSessions) {
method get (line 9522) | get (sessionKey) {
method set (line 9527) | set (sessionKey, session) {
method constructor (line 9538) | constructor (maxCachedSessions) {
method get (line 9543) | get (sessionKey) {
method set (line 9547) | set (sessionKey, session) {
function buildConnector (line 9563) | function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeo...
function setupTimeout (line 9647) | function setupTimeout (onConnectTimeout, timeout) {
function onConnectTimeout (line 9672) | function onConnectTimeout (socket) {
class UndiciError (line 9813) | class UndiciError extends Error {
method constructor (line 9814) | constructor (message) {
class ConnectTimeoutError (line 9821) | class ConnectTimeoutError extends UndiciError {
method constructor (line 9822) | constructor (message) {
class HeadersTimeoutError (line 9831) | class HeadersTimeoutError extends UndiciError {
method constructor (line 9832) | constructor (message) {
class HeadersOverflowError (line 9841) | class HeadersOverflowError extends UndiciError {
method constructor (line 9842) | constructor (message) {
class BodyTimeoutError (line 9851) | class BodyTimeoutError extends UndiciError {
method constructor (line 9852) | constructor (message) {
class ResponseStatusCodeError (line 9861) | class ResponseStatusCodeError extends UndiciError {
method constructor (line 9862) | constructor (message, statusCode, headers, body) {
class InvalidArgumentError (line 9875) | class InvalidArgumentError extends UndiciError {
method constructor (line 9876) | constructor (message) {
class InvalidReturnValueError (line 9885) | class InvalidReturnValueError extends UndiciError {
method constructor (line 9886) | constructor (message) {
class RequestAbortedError (line 9895) | class RequestAbortedError extends UndiciError {
method constructor (line 9896) | constructor (message) {
class InformationalError (line 9905) | class InformationalError extends UndiciError {
method constructor (line 9906) | constructor (message) {
class RequestContentLengthMismatchError (line 9915) | class RequestContentLengthMismatchError extends UndiciError {
method constructor (line 9916) | constructor (message) {
class ResponseContentLengthMismatchError (line 9925) | class ResponseContentLengthMismatchError extends UndiciError {
method constructor (line 9926) | constructor (message) {
class ClientDestroyedError (line 9935) | class ClientDestroyedError extends UndiciError {
method constructor (line 9936) | constructor (message) {
class ClientClosedError (line 9945) | class ClientClosedError extends UndiciError {
method constructor (line 9946) | constructor (message) {
class SocketError (line 9955) | class SocketError extends UndiciError {
method constructor (line 9956) | constructor (message, socket) {
class NotSupportedError (line 9966) | class NotSupportedError extends UndiciError {
method constructor (line 9967) | constructor (message) {
class BalancedPoolMissingUpstreamError (line 9976) | class BalancedPoolMissingUpstreamError extends UndiciError {
method constructor (line 9977) | constructor (message) {
class HTTPParserError (line 9986) | class HTTPParserError extends Error {
method constructor (line 9987) | constructor (message, code, data) {
class ResponseExceededMaxSizeError (line 9996) | class ResponseExceededMaxSizeError extends UndiciError {
method constructor (line 9997) | constructor (message) {
class RequestRetryError (line 10006) | class RequestRetryError extends UndiciError {
method constructor (line 10007) | constructor (message, code, { headers, data }) {
class Request (line 10101) | class Request {
method constructor (line 10102) | constructor (origin, {
method onBodySent (line 10278) | onBodySent (chunk) {
method onRequestSent (line 10288) | onRequestSent () {
method onConnect (line 10302) | onConnect (abort) {
method onHeaders (line 10314) | onHeaders (statusCode, headers, resume, statusText) {
method onData (line 10329) | onData (chunk) {
method onUpgrade (line 10341) | onUpgrade (statusCode, headers, socket) {
method onComplete (line 10348) | onComplete (trailers) {
method onError (line 10366) | onError (error) {
method onFinally (line 10381) | onFinally () {
method addHeader (line 10394) | addHeader (key, value) {
method [kHTTP1BuildRequest] (line 10399) | static [kHTTP1BuildRequest] (origin, opts, handler) {
method [kHTTP2BuildRequest] (line 10405) | static [kHTTP2BuildRequest] (origin, opts, handler) {
method [kHTTP2CopyHeaders] (line 10433) | static [kHTTP2CopyHeaders] (raw) {
method constructor (line 16260) | constructor (input, init = {}) {
method method (line 16752) | get method () {
method url (line 16760) | get url () {
method headers (line 16770) | get headers () {
method destination (line 16779) | get destination () {
method referrer (line 16791) | get referrer () {
method referrerPolicy (line 16813) | get referrerPolicy () {
method mode (line 16823) | get mode () {
method credentials (line 16833) | get credentials () {
method cache (line 16841) | get cache () {
method redirect (line 16852) | get redirect () {
method integrity (line 16862) | get integrity () {
method keepalive (line 16872) | get keepalive () {
method isReloadNavigation (line 16881) | get isReloadNavigation () {
method isHistoryNavigation (line 16891) | get isHistoryNavigation () {
method signal (line 16902) | get signal () {
method body (line 16909) | get body () {
method bodyUsed (line 16915) | get bodyUsed () {
method duplex (line 16921) | get duplex () {
method clone (line 16928) | clone () {
function processHeaderValue (line 10450) | function processHeaderValue (key, val, skipAppend) {
function processHeader (line 10464) | function processHeader (request, key, val, skipAppend = false) {
function nop (line 10641) | function nop () {}
function isStream (line 10643) | function isStream (obj) {
function isBlobLike (line 10648) | function isBlobLike (object) {
function buildURL (line 10658) | function buildURL (url, queryParams) {
function parseURL (line 10672) | function parseURL (url) {
function parseOrigin (line 10739) | function parseOrigin (url) {
function getHostname (line 10749) | function getHostname (host) {
function getServerName (line 10765) | function getServerName (host) {
function deepClone (line 10780) | function deepClone (obj) {
function isAsyncIterable (line 10784) | function isAsyncIterable (obj) {
function isIterable (line 10788) | function isIterable (obj) {
function bodyLength (line 10792) | function bodyLength (body) {
function isDestroyed (line 10809) | function isDestroyed (stream) {
function isReadableAborted (line 10813) | function isReadableAborted (stream) {
function destroy (line 10818) | function destroy (stream, err) {
function parseKeepAliveTimeout (line 10842) | function parseKeepAliveTimeout (val) {
function headerNameToString (line 10852) | function headerNameToString (value) {
function parseHeaders (line 10856) | function parseHeaders (headers, obj = {}) {
function parseRawHeaders (line 10887) | function parseRawHeaders (headers) {
function isBuffer (line 10914) | function isBuffer (buffer) {
function validateHandler (line 10919) | function validateHandler (handler, method, upgrade) {
function isDisturbed (line 10957) | function isDisturbed (body) {
function isErrored (line 10968) | function isErrored (body) {
function isReadable (line 10976) | function isReadable (body) {
function getSocketInfo (line 10984) | function getSocketInfo (socket) {
function ReadableStreamFrom (line 11004) | function ReadableStreamFrom (iterable) {
function isFormDataLike (line 11041) | function isFormDataLike (object) {
function throwIfAborted (line 11055) | function throwIfAborted (signal) {
function addAbortListener (line 11069) | function addAbortListener (signal, listener) {
function toUSVString (line 11083) | function toUSVString (val) {
function parseRangeHeader (line 11095) | function parseRangeHeader (range) {
class DispatcherBase (line 11172) | class DispatcherBase extends Dispatcher {
method constructor (line 11173) | constructor () {
method destroyed (line 11182) | get destroyed () {
method closed (line 11186) | get closed () {
method interceptors (line 11190) | get interceptors () {
method interceptors (line 11194) | set interceptors (newInterceptors) {
method close (line 11207) | close (callback) {
method destroy (line 11253) | destroy (err, callback) {
method [kInterceptedDispatch] (line 11302) | [kInterceptedDispatch] (opts, handler) {
method dispatch (line 11316) | dispatch (opts, handler) {
class Dispatcher (line 11360) | class Dispatcher extends EventEmitter {
method dispatch (line 11361) | dispatch () {
method close (line 11365) | close () {
method destroy (line 11369) | destroy () {
function extractBody (line 11415) | function extractBody (object, keepalive = false) {
function safelyExtractBody (line 11635) | function safelyExtractBody (object, keepalive = false) {
function cloneBody (line 11657) | function cloneBody (body) {
function throwIfAborted (line 11703) | function throwIfAborted (state) {
function bodyMixinMethods (line 11709) | function bodyMixinMethods (instance) {
function mixinBody (line 11871) | function mixinBody (prototype) {
function specConsumeBody (line 11881) | async function specConsumeBody (object, convertBytesToJSValue, instance) {
function bodyUnusable (line 11926) | function bodyUnusable (body) {
function utf8DecodeBytes (line 11937) | function utf8DecodeBytes (buffer) {
function parseJSONFromBytes (line 11963) | function parseJSONFromBytes (bytes) {
function bodyMimeType (line 11971) | function bodyMimeType (object) {
function dataURLProcessor (line 12172) | function dataURLProcessor (dataURL) {
function URLSerializer (line 12274) | function URLSerializer (url, excludeFragment = false) {
function collectASequenceOfCodePoints (line 12291) | function collectASequenceOfCodePoints (condition, input, position) {
function collectASequenceOfCodePointsFast (line 12315) | function collectASequenceOfCodePointsFast (char, input, position) {
function stringPercentDecode (line 12330) | function stringPercentDecode (input) {
function percentDecode (line 12340) | function percentDecode (input) {
function parseMIMEType (line 12385) | function parseMIMEType (input) {
function forgivingBase64 (line 12558) | function forgivingBase64 (data) {
function collectAnHTTPQuotedString (line 12602) | function collectAnHTTPQuotedString (input, position, extractValue) {
function serializeAMimeType (line 12677) | function serializeAMimeType (mimeType) {
function isHTTPWhiteSpace (line 12722) | function isHTTPWhiteSpace (char) {
function removeHTTPWhitespace (line 12730) | function removeHTTPWhitespace (str, leading = true, trailing = true) {
function isASCIIWhitespace (line 12749) | function isASCIIWhitespace (char) {
function removeASCIIWhitespace (line 12756) | function removeASCIIWhitespace (str, leading = true, trailing = true) {
class File (line 12800) | class File extends Blob {
method constructor (line 12801) | constructor (fileBits, fileName, options = {}) {
method name (line 12865) | get name () {
method lastModified (line 12871) | get lastModified () {
method type (line 12877) | get type () {
class FileLike (line 12884) | class FileLike {
method constructor (line 12885) | constructor (blobLike, fileName, options = {}) {
method stream (line 12932) | stream (...args) {
method arrayBuffer (line 12938) | arrayBuffer (...args) {
method slice (line 12944) | slice (...args) {
method text (line 12950) | text (...args) {
method size (line 12956) | get size () {
method type (line 12962) | get type () {
method name (line 12968) | get name () {
method lastModified (line 12974) | get lastModified () {
method [Symbol.toStringTag] (line 12980) | get [Symbol.toStringTag] () {
method defaultValue (line 13022) | get defaultValue () {
function processBlobParts (line 13052) | function processBlobParts (parts, options) {
function convertLineEndingsNative (line 13102) | function convertLineEndingsNative (s) {
function isFileLike (line 13120) | function isFileLike (object) {
class FormData (line 13153) | class FormData {
method constructor (line 13154) | constructor (form) {
method append (line 13166) | append (name, value, filename = undefined) {
method delete (line 13195) | delete (name) {
method get (line 13207) | get (name) {
method getAll (line 13226) | getAll (name) {
method has (line 13242) | has (name) {
method set (line 13254) | set (name, value, filename = undefined) {
method entries (line 13297) | entries () {
method keys (line 13307) | keys () {
method values (line 13317) | values () {
method forEach (line 13331) | forEach (callbackFn, thisArg = globalThis) {
function makeEntry (line 13364) | function makeEntry (name, value, filename) {
function getGlobalOrigin (line 13420) | function getGlobalOrigin () {
function setGlobalOrigin (line 13424) | function setGlobalOrigin (newOrigin) {
function isHTTPWhiteSpaceCharCode (line 13483) | function isHTTPWhiteSpaceCharCode (code) {
function headerValueNormalize (line 13491) | function headerValueNormalize (potentialValue) {
function fill (line 13503) | function fill (headers, object) {
function appendHeader (line 13543) | function appendHeader (headers, name, value) {
class HeadersList (line 13584) | class HeadersList {
method constructor (line 13588) | constructor (init) {
method contains (line 13600) | contains (name) {
method clear (line 13609) | clear () {
method append (line 13616) | append (name, value) {
method set (line 13642) | set (name, value) {
method delete (line 13658) | delete (name) {
method get (line 13671) | get (name) {
method entries (line 13688) | get entries () {
method [Symbol.iterator] (line 13681) | * [Symbol.iterator] () {
class Headers (line 13702) | class Headers {
method constructor (line 13703) | constructor (init = undefined) {
method append (line 13722) | append (name, value) {
method delete (line 13734) | delete (name) {
method get (line 13779) | get (name) {
method has (line 13801) | has (name) {
method set (line 13823) | set (name, value) {
method getSetCookie (line 13872) | getSetCookie () {
method [kHeadersSortedMap] (line 13889) | get [kHeadersSortedMap] () {
method keys (line 13935) | keys () {
method values (line 13951) | values () {
method entries (line 13967) | entries () {
method forEach (line 13987) | forEach (callbackFn, thisArg = globalThis) {
method [Symbol.for('nodejs.util.inspect.custom')] (line 14003) | [Symbol.for('nodejs.util.inspect.custom')] () {
class Fetch (line 14129) | class Fetch extends EE {
method constructor (line 14130) | constructor (dispatcher) {
method terminate (line 14145) | terminate (reason) {
method abort (line 14156) | abort (error) {
function fetch (line 14183) | function fetch (input, init = {}) {
function finalizeAndReportTiming (line 14316) | function finalizeAndReportTiming (response, initiatorType = 'other') {
function markResourceTiming (line 14379) | function markResourceTiming (timingInfo, originalURL, initiatorType, glo...
function abortFetch (line 14386) | function abortFetch (p, request, responseObject, error) {
function fetching (line 14431) | function fetching ({
function mainFetch (line 14586) | async function mainFetch (fetchParams, recursive = false) {
function schemeFetch (line 14838) | function schemeFetch (fetchParams) {
function finalizeResponse (line 14955) | function finalizeResponse (fetchParams, response) {
function fetchFinale (line 14968) | function fetchFinale (fetchParams, response) {
function httpFetch (line 15059) | async function httpFetch (fetchParams) {
function httpRedirectFetch (line 15162) | function httpRedirectFetch (fetchParams, response) {
function httpNetworkOrCacheFetch (line 15306) | async function httpNetworkOrCacheFetch (
function httpNetworkFetch (line 15636) | async function httpNetworkFetch (
class Request (line 16258) | class Request {
method constructor (line 10102) | constructor (origin, {
method onBodySent (line 10278) | onBodySent (chunk) {
method onRequestSent (line 10288) | onRequestSent () {
method onConnect (line 10302) | onConnect (abort) {
method onHeaders (line 10314) | onHeaders (statusCode, headers, resume, statusText) {
method onData (line 10329) | onData (chunk) {
method onUpgrade (line 10341) | onUpgrade (statusCode, headers, socket) {
method onComplete (line 10348) | onComplete (trailers) {
method onError (line 10366) | onError (error) {
method onFinally (line 10381) | onFinally () {
method addHeader (line 10394) | addHeader (key, value) {
method [kHTTP1BuildRequest] (line 10399) | static [kHTTP1BuildRequest] (origin, opts, handler) {
method [kHTTP2BuildRequest] (line 10405) | static [kHTTP2BuildRequest] (origin, opts, handler) {
method [kHTTP2CopyHeaders] (line 10433) | static [kHTTP2CopyHeaders] (raw) {
method constructor (line 16260) | constructor (input, init = {}) {
method method (line 16752) | get method () {
method url (line 16760) | get url () {
method headers (line 16770) | get headers () {
method destination (line 16779) | get destination () {
method referrer (line 16791) | get referrer () {
method referrerPolicy (line 16813) | get referrerPolicy () {
method mode (line 16823) | get mode () {
method credentials (line 16833) | get credentials () {
method cache (line 16841) | get cache () {
method redirect (line 16852) | get redirect () {
method integrity (line 16862) | get integrity () {
method keepalive (line 16872) | get keepalive () {
method isReloadNavigation (line 16881) | get isReloadNavigation () {
method isHistoryNavigation (line 16891) | get isHistoryNavigation () {
method signal (line 16902) | get signal () {
method body (line 16909) | get body () {
method bodyUsed (line 16915) | get bodyUsed () {
method duplex (line 16921) | get duplex () {
method clone (line 16928) | clone () {
function makeRequest (line 16970) | function makeRequest (init) {
function cloneRequest (line 17018) | function cloneRequest (request) {
class Response (line 17202) | class Response {
method error (line 17204) | static error () {
method json (line 17221) | static json (data, init = {}) {
method redirect (line 17252) | static redirect (url, status = 302) {
method constructor (line 17299) | constructor (body = null, init = {}) {
method type (line 17334) | get type () {
method url (line 17342) | get url () {
method redirected (line 17360) | get redirected () {
method status (line 17369) | get status () {
method ok (line 17377) | get ok () {
method statusText (line 17386) | get statusText () {
method headers (line 17395) | get headers () {
method body (line 17402) | get body () {
method bodyUsed (line 17408) | get bodyUsed () {
method clone (line 17415) | clone () {
function cloneResponse (line 17468) | function cloneResponse (response) {
function makeResponse (line 17494) | function makeResponse (init) {
function makeNetworkError (line 17513) | function makeNetworkError (reason) {
function makeFilteredResponse (line 17525) | function makeFilteredResponse (response, state) {
function filterResponse (line 17544) | function filterResponse (response, type) {
function makeAppropriateNetworkError (line 17598) | function makeAppropriateNetworkError (fetchParams, err = null) {
function initializeResponse (line 17610) | function initializeResponse (response, init, body) {
function responseURL (line 17789) | function responseURL (response) {
function responseLocationURL (line 17799) | function responseLocationURL (response, requestFragment) {
function requestCurrentURL (line 17826) | function requestCurrentURL (request) {
function requestBadPort (line 17830) | function requestBadPort (request) {
function isErrorLike (line 17844) | function isErrorLike (object) {
function isValidReasonPhrase (line 17857) | function isValidReasonPhrase (statusText) {
function isTokenCharCode (line 17879) | function isTokenCharCode (c) {
function isValidHTTPToken (line 17909) | function isValidHTTPToken (characters) {
function isValidHeaderName (line 17925) | function isValidHeaderName (potentialValue) {
function isValidHeaderValue (line 17933) | function isValidHeaderValue (potentialValue) {
function setRequestReferrerPolicyOnRedirect (line 17957) | function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
function crossOriginResourcePolicyCheck (line 17997) | function crossOriginResourcePolicyCheck () {
function corsCheck (line 18003) | function corsCheck () {
function TAOCheck (line 18009) | function TAOCheck () {
function appendFetchMetadata (line 18014) | function appendFetchMetadata (httpRequest) {
function appendRequestOriginHeader (line 18040) | function appendRequestOriginHeader (request) {
function coarsenedSharedCurrentTime (line 18083) | function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
function createOpaqueTimingInfo (line 18089) | function createOpaqueTimingInfo (timingInfo) {
function makePolicyContainer (line 18106) | function makePolicyContainer () {
function clonePolicyContainer (line 18114) | function clonePolicyContainer (policyContainer) {
function determineRequestsReferrer (line 18121) | function determineRequestsReferrer (request) {
function stripURLForReferrer (line 18220) | function stripURLForReferrer (url, originOnly) {
function isURLPotentiallyTrustworthy (line 18251) | function isURLPotentiallyTrustworthy (url) {
function bytesMatch (line 18297) | function bytesMatch (bytes, metadataList) {
function parseMetadata (line 18369) | function parseMetadata (metadata) {
function getStrongestMetadata (line 18419) | function getStrongestMetadata (metadataList) {
function filterMetadataListByAlgorithm (line 18448) | function filterMetadataListByAlgorithm (metadataList, algorithm) {
function compareBase64Mixed (line 18473) | function compareBase64Mixed (actualValue, expectedValue) {
function tryUpgradeRequestToAPotentiallyTrustworthyURL (line 18493) | function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
function sameOrigin (line 18502) | function sameOrigin (A, B) {
function createDeferredPromise (line 18518) | function createDeferredPromise () {
function isAborted (line 18529) | function isAborted (fetchParams) {
function isCancelled (line 18533) | function isCancelled (fetchParams) {
function normalizeMethod (line 18560) | function normalizeMethod (method) {
function serializeJavascriptValueToJSONString (line 18565) | function serializeJavascriptValueToJSONString (value) {
function makeIterator (line 18590) | function makeIterator (iterator, name, kind) {
function iteratorResult (line 18653) | function iteratorResult (pair, kind) {
function fullyReadBody (line 18697) | async function fullyReadBody (body, processBody, processBodyError) {
function isReadableStreamLike (line 18733) | function isReadableStreamLike (stream) {
function isomorphicDecode (line 18750) | function isomorphicDecode (input) {
function readableStreamClose (line 18765) | function readableStreamClose (controller) {
function isomorphicEncode (line 18780) | function isomorphicEncode (input) {
function readAllBytes (line 18797) | async function readAllBytes (reader) {
function urlIsLocal (line 18827) | function urlIsLocal (url) {
function urlHasHttpsScheme (line 18838) | function urlHasHttpsScheme (url) {
function urlIsHttpHttpsScheme (line 18850) | function urlIsHttpHttpsScheme (url) {
function getEncoding (line 19578) | function getEncoding (label) {
class FileReader (line 19887) | class FileReader extends EventTarget {
method constructor (line 19888) | constructor () {
method readAsArrayBuffer (line 19908) | readAsArrayBuffer (blob) {
method readAsBinaryString (line 19924) | readAsBinaryString (blob) {
method readAsText (line 19941) | readAsText (blob, encoding = undefined) {
method readAsDataURL (line 19961) | readAsDataURL (blob) {
method abort (line 19976) | abort () {
method readyState (line 20013) | get readyState () {
method result (line 20026) | get result () {
method error (line 20037) | get error () {
method onloadend (line 20045) | get onloadend () {
method onloadend (line 20051) | set onloadend (fn) {
method onerror (line 20066) | get onerror () {
method onerror (line 20072) | set onerror (fn) {
method onloadstart (line 20087) | get onloadstart () {
method onloadstart (line 20093) | set onloadstart (fn) {
method onprogress (line 20108) | get onprogress () {
method onprogress (line 20114) | set onprogress (fn) {
method onload (line 20129) | get onload () {
method onload (line 20135) | set onload (fn) {
method onabort (line 20150) | get onabort () {
method onabort (line 20156) | set onabort (fn) {
class ProgressEvent (line 20231) | class ProgressEvent extends Event {
method constructor (line 20232) | constructor (type, eventInitDict = {}) {
method lengthComputable (line 20245) | get lengthComputable () {
method loaded (line 20251) | get loaded () {
method total (line 20257) | get total () {
function readOperation (line 20357) | function readOperation (fr, blob, type, encodingName) {
function fireAProgressEvent (line 20523) | function fireAProgressEvent (e, reader) {
function packageData (line 20541) | function packageData (bytes, type, mimeType, encodingName) {
function decode (line 20643) | function decode (ioQueue, encoding) {
function BOMSniffing (line 20675) | function BOMSniffing (ioQueue) {
function combineByteSequences (line 20699) | function combineByteSequences (sequences) {
function setGlobalDispatcher (line 20738) | function setGlobalDispatcher (agent) {
function getGlobalDispatcher (line 20750) | function getGlobalDispatcher () {
method constructor (line 20769) | constructor (handler) {
method onConnect (line 20773) | onConnect (...args) {
method onError (line 20777) | onError (...args) {
method onUpgrade (line 20781) | onUpgrade (...args) {
method onHeaders (line 20785) | onHeaders (...args) {
method onData (line 20789) | onData (...args) {
method onComplete (line 20793) | onComplete (...args) {
method onBodySent (line 20797) | onBodySent (...args) {
class BodyAsyncIterable (line 20821) | class BodyAsyncIterable {
method constructor (line 20822) | constructor (body) {
method [Symbol.asyncIterator] (line 20827) | async * [Symbol.asyncIterator] () {
class RedirectHandler (line 20834) | class RedirectHandler {
method constructor (line 20835) | constructor (dispatch, maxRedirections, opts, handler) {
method onConnect (line 20884) | onConnect (abort) {
method onUpgrade (line 20889) | onUpgrade (statusCode, headers, socket) {
method onError (line 20893) | onError (error) {
method onHeaders (line 20897) | onHeaders (statusCode, headers, resume, statusText) {
method onData (line 20930) | onData (chunk) {
method onComplete (line 20954) | onComplete (trailers) {
method onBodySent (line 20974) | onBodySent (chunk) {
function parseLocation (line 20981) | function parseLocation (statusCode, headers) {
function shouldRemoveHeader (line 20994) | function shouldRemoveHeader (header, removeContent, unknownOrigin) {
function cleanRequestHeaders (line 21009) | function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
function calculateRetryAfterHeader (line 21043) | function calculateRetryAfterHeader (retryAfter) {
class RetryHandler (line 21050) | class RetryHandler {
method constructor (line 21051) | constructor (opts, handlers) {
method onRequestSent (line 21113) | onRequestSent () {
method onUpgrade (line 21119) | onUpgrade (statusCode, headers, socket) {
method onConnect (line 21125) | onConnect (abort) {
method onBodySent (line 21133) | onBodySent (chunk) {
method [kRetryHandlerDefaultRetry] (line 21137) | static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
method onHeaders (line 21205) | onHeaders (statusCode, rawHeaders, resume, statusMessage) {
method onData (line 21323) | onData (chunk) {
method onComplete (line 21329) | onComplete (rawTrailers) {
method onError (line 21334) | onError (err) {
function createRedirectInterceptor (line 21385) | function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirec...
function enumToMap (line 21714) | function enumToMap(obj) {
class FakeWeakRef (line 21756) | class FakeWeakRef {
method constructor (line 21757) | constructor (value) {
method deref (line 21761) | deref () {
class MockAgent (line 21766) | class MockAgent extends Dispatcher {
method constructor (line 21767) | constructor (opts) {
method get (line 21784) | get (origin) {
method dispatch (line 21794) | dispatch (opts, handler) {
method close (line 21800) | async close () {
method deactivate (line 21805) | deactivate () {
method activate (line 21809) | activate () {
method enableNetConnect (line 21813) | enableNetConnect (matcher) {
method disableNetConnect (line 21827) | disableNetConnect () {
method isMockActive (line 21833) | get isMockActive () {
method [kMockAgentSet] (line 21837) | [kMockAgentSet] (origin, dispatcher) {
method [kFactory] (line 21841) | [kFactory] (origin) {
method [kMockAgentGet] (line 21848) | [kMockAgentGet] (origin) {
method [kGetNetConnect] (line 21874) | [kGetNetConnect] () {
method pendingInterceptors (line 21878) | pendingInterceptors () {
method assertNoPendingInterceptors (line 21886) | assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new Pend...
class MockClient (line 21933) | class MockClient extends Client {
method constructor (line 21934) | constructor (origin, opts) {
method intercept (line 21959) | intercept (opts) {
method [kClose] (line 21963) | async [kClose] () {
method [Symbols.kConnected] (line 21952) | get [Symbols.kConnected] () {
class MockNotMatchedError (line 21983) | class MockNotMatchedError extends UndiciError {
method constructor (line 21984) | constructor (message) {
class MockScope (line 22021) | class MockScope {
method constructor (line 22022) | constructor (mockDispatch) {
method delay (line 22029) | delay (waitInMs) {
method persist (line 22041) | persist () {
method times (line 22049) | times (repeatTimes) {
class MockInterceptor (line 22062) | class MockInterceptor {
method constructor (line 22063) | constructor (opts, mockDispatches) {
method createMockScopeDispatchData (line 22096) | createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
method validateReplyParameters (line 22105) | validateReplyParameters (statusCode, data, responseOptions) {
method reply (line 22120) | reply (replyData) {
method replyWithError (line 22166) | replyWithError (error) {
method defaultReplyHeaders (line 22178) | defaultReplyHeaders (headers) {
method defaultReplyTrailers (line 22190) | defaultReplyTrailers (trailers) {
method replyContentLength (line 22202) | replyContentLength () {
class MockPool (line 22239) | class MockPool extends Pool {
method constructor (line 22240) | constructor (origin, opts) {
method intercept (line 22265) | intercept (opts) {
method [kClose] (line 22269) | async [kClose] () {
method [Symbols.kConnected] (line 22258) | get [Symbols.kConnected] () {
function matchValue (line 22334) | function matchValue (match, value) {
function lowerCaseEntries (line 22347) | function lowerCaseEntries (headers) {
function getHeaderByName (line 22359) | function getHeaderByName (headers, key) {
function buildHeadersFromArray (line 22376) | function buildHeadersFromArray (headers) { // fetch HeadersList
function matchHeaders (line 22385) | function matchHeaders (mockDispatch, headers) {
function safeUrl (line 22409) | function safeUrl (path) {
function matchKey (line 22425) | function matchKey (mockDispatch, { path, method, body, headers }) {
function getResponseData (line 22433) | function getResponseData (data) {
function getMockDispatch (line 22443) | function getMockDispatch (mockDispatches, key) {
function addMockDispatch (line 22474) | function addMockDispatch (mockDispatches, key, data) {
function deleteMockDispatch (line 22482) | function deleteMockDispatch (mockDispatches, key) {
function buildKey (line 22494) | function buildKey (opts) {
function generateKeyValues (line 22505) | function generateKeyValues (data) {
function getStatusText (line 22517) | function getStatusText (statusCode) {
function getResponse (line 22521) | async function getResponse (body) {
function mockDispatch (line 22532) | function mockDispatch (opts, handler) {
function buildMockDispatch (line 22604) | function buildMockDispatch () {
function checkNetConnect (line 22634) | function checkNetConnect (netConnect, origin) {
function buildMockOptions (line 22644) | function buildMockOptions (opts) {
method constructor (line 22684) | constructor ({ disableColors } = {}) {
method format (line 22699) | format (pendingInterceptors) {
method constructor (line 22740) | constructor (singular, plural) {
method pluralize (line 22745) | pluralize (count) {
class FixedCircularBuffer (line 22818) | class FixedCircularBuffer {
method constructor (line 22819) | constructor() {
method isEmpty (line 22826) | isEmpty() {
method isFull (line 22830) | isFull() {
method push (line 22834) | push(data) {
method shift (line 22839) | shift() {
method constructor (line 22850) | constructor() {
method isEmpty (line 22854) | isEmpty() {
method push (line 22858) | push(data) {
method shift (line 22867) | shift() {
class PoolBase (line 22905) | class PoolBase extends DispatcherBase {
method constructor (line 22906) | constructor () {
method [kBusy] (line 22958) | get [kBusy] () {
method [kConnected] (line 22962) | get [kConnected] () {
method [kFree] (line 22966) | get [kFree] () {
method [kPending] (line 22970) | get [kPending] () {
method [kRunning] (line 22978) | get [kRunning] () {
method [kSize] (line 22986) | get [kSize] () {
method stats (line 22994) | get stats () {
method [kClose] (line 22998) | async [kClose] () {
method [kDestroy] (line 23008) | async [kDestroy] (err) {
method [kDispatch] (line 23020) | [kDispatch] (opts, handler) {
method [kAddClient] (line 23035) | [kAddClient] (client) {
method [kRemoveClient] (line 23055) | [kRemoveClient] (client) {
class PoolStats (line 23089) | class PoolStats {
method constructor (line 23090) | constructor (pool) {
method connected (line 23094) | get connected () {
method free (line 23098) | get free () {
method pending (line 23102) | get pending () {
method queued (line 23106) | get queued () {
method running (line 23110) | get running () {
method size (line 23114) | get size () {
function defaultFactory (line 23149) | function defaultFactory (origin, opts) {
class Pool (line 23153) | class Pool extends PoolBase {
method constructor (line 23154) | constructor (origin, {
method [kGetDispatcher] (line 23205) | [kGetDispatcher] () {
function defaultProtocolPort (line 23247) | function defaultProtocolPort (protocol) {
function buildProxyOptions (line 23251) | function buildProxyOptions (opts) {
function defaultFactory (line 23266) | function defaultFactory (origin, opts) {
class ProxyAgent (line 23270) | class ProxyAgent extends DispatcherBase {
method constructor (line 23271) | constructor (opts) {
method dispatch (line 23354) | dispatch (opts, handler) {
method [kClose] (line 23370) | async [kClose] () {
method [kDestroy] (line 23375) | async [kDestroy] () {
function buildHeaders (line 23385) | function buildHeaders (headers) {
function throwIfProxyAuthIsSent (line 23410) | function throwIfProxyAuthIsSent (headers) {
function onTimeout (line 23434) | function onTimeout () {
function refreshTimeout (line 23467) | function refreshTimeout () {
class Timeout (line 23479) | class Timeout {
method constructor (line 23480) | constructor (callback, delay, opaque) {
method refresh (line 23494) | refresh () {
method clear (line 23505) | clear () {
method setTimeout (line 23511) | setTimeout (callback, delay, opaque) {
method clearTimeout (line 23516) | clearTimeout (timeout) {
function establishWebSocketConnection (line 23571) | function establishWebSocketConnection (url, protocols, ws, onEstablish, ...
function onSocketData (line 23743) | function onSocketData (chunk) {
function onSocketClose (line 23753) | function onSocketClose () {
function onSocketError (line 23808) | function onSocketError (error) {
class MessageEvent (line 23899) | class MessageEvent extends Event {
method constructor (line 23902) | constructor (type, eventInitDict = {}) {
method data (line 23913) | get data () {
method origin (line 23919) | get origin () {
method lastEventId (line 23925) | get lastEventId () {
method source (line 23931) | get source () {
method ports (line 23937) | get ports () {
method initMessageEvent (line 23947) | initMessageEvent (
class CloseEvent (line 23970) | class CloseEvent extends Event {
method constructor (line 23973) | constructor (type, eventInitDict = {}) {
method wasClean (line 23984) | get wasClean () {
method code (line 23990) | get code () {
method reason (line 23996) | get reason () {
class ErrorEvent (line 24004) | class ErrorEvent extends Event {
method constructor (line 24007) | constructor (type, eventInitDict) {
method message (line 24018) | get message () {
method filename (line 24024) | get filename () {
method lineno (line 24030) | get lineno () {
method colno (line 24036) | get colno () {
method error (line 24042) | get error () {
method defaultValue (line 24135) | get defaultValue () {
class WebsocketFrameSend (line 24213) | class WebsocketFrameSend {
method constructor (line 24217) | constructor (data) {
method createFrame (line 24222) | createFrame (opcode) {
class ByteParser (line 24300) | class ByteParser extends Writable {
method constructor (line 24309) | constructor (ws) {
method _write (line 24319) | _write (chunk, _, callback) {
method run (line 24331) | run (callback) {
method consume (line 24538) | consume (n) {
method parseCloseBody (line 24575) | parseCloseBody (onlyCode, data) {
method closingInfo (line 24618) | get closingInfo () {
function isEstablished (line 24665) | function isEstablished (ws) {
function isClosing (line 24675) | function isClosing (ws) {
function isClosed (line 24685) | function isClosed (ws) {
function fireEvent (line 24695) | function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
function websocketMessageReceived (line 24717) | function websocketMessageReceived (ws, type, data) {
function isValidSubprotocol (line 24764) | function isValidSubprotocol (protocol) {
function isValidStatusCode (line 24812) | function isValidStatusCode (code) {
function failWebsocketConnection (line 24828) | function failWebsocketConnection (ws, reason) {
class WebSocket (line 24889) | class WebSocket extends EventTarget {
method constructor (line 24905) | constructor (url, protocols = []) {
method close (line 25011) | close (code = undefined, reason = undefined) {
method send (line 25114) | send (data) {
method readyState (line 25229) | get readyState () {
method bufferedAmount (line 25236) | get bufferedAmount () {
method url (line 25242) | get url () {
method extensions (line 25249) | get extensions () {
method protocol (line 25255) | get protocol () {
method onopen (line 25261) | get onopen () {
method onopen (line 25267) | set onopen (fn) {
method onerror (line 25282) | get onerror () {
method onerror (line 25288) | set onerror (fn) {
method onclose (line 25303) | get onclose () {
method onclose (line 25309) | set onclose (fn) {
method onmessage (line 25324) | get onmessage () {
method onmessage (line 25330) | set onmessage (fn) {
method binaryType (line 25345) | get binaryType () {
method binaryType (line 25351) | set binaryType (type) {
method #onConnectionEstablished (line 25364) | #onConnectionEstablished (response) {
method defaultValue (line 25461) | get defaultValue () {
method defaultValue (line 25468) | get defaultValue () {
function _interopRequireDefault (line 25589) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _interopRequireDefault (line 25606) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function md5 (line 25608) | function md5(bytes) {
function _interopRequireDefault (line 25651) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function parse (line 25653) | function parse(uuid) {
function _interopRequireDefault (line 25718) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function rng (line 25724) | function rng() {
function _interopRequireDefault (line 25749) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function sha1 (line 25751) | function sha1(bytes) {
function _interopRequireDefault (line 25779) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function stringify (line 25791) | function stringify(arr, offset = 0) {
function _interopRequireDefault (line 25827) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function v1 (line 25841) | function v1(options, buf, offset) {
function _interopRequireDefault (line 25941) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _interopRequireDefault (line 25965) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function stringToBytes (line 25967) | function stringToBytes(str) {
function _default (line 25984) | function _default(name, version, hashfunc) {
function _interopRequireDefault (line 26049) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function v4 (line 26051) | function v4(options, buf, offset) {
function _interopRequireDefault (line 26093) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function _interopRequireDefault (line 26114) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function validate (line 26116) | function validate(uuid) {
function _interopRequireDefault (line 26138) | function _interopRequireDefault(obj) { return obj && obj.__esModule ? ob...
function version (line 26140) | function version(uuid) {
function Dicer (line 26412) | function Dicer (cfg) {
function HeaderParser (line 26630) | function HeaderParser (cfg) {
function PartStream (line 26731) | function PartStream (opts) {
function SBMH (line 26778) | function SBMH (needle) {
function Busboy (line 26993) | function Busboy (opts) {
function Multipart (line 27102) | function Multipart (boy, cfg) {
function skipPart (line 27365) | function skipPart (part) {
function FileStream (line 27369) | function FileStream (opts) {
function UrlEncoded (line 27399) | function UrlEncoded (boy, cfg) {
function Decoder (line 27603) | function Decoder () {
function getDecoder (line 27681) | function getDecoder (charset) {
function decodeText (line 27778) | function decodeText (text, sourceEncoding, destEncoding) {
function encodedReplacer (line 27925) | function encodedReplacer (match) {
function parseParams (line 27934) | function parseParams (str) {
function __nccwpck_require__ (line 28024) | function __nccwpck_require__(moduleId) {
function run (line 28062) | async function run() {
FILE: index.js
function run (line 4) | async function run() {
Condensed preview — 10 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,041K chars).
[
{
"path": ".gitignore",
"chars": 20,
"preview": ".idea/\nnode_modules\n"
},
{
"path": ".node-version",
"chars": 8,
"preview": "20.12.0\n"
},
{
"path": "LICENSE",
"chars": 1065,
"preview": "MIT License\n\nCopyright (c) 2020 yukiarrr\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "README.md",
"chars": 6459,
"preview": "# iOS Build Action\n\nThis action build iOS project. (.xcodeproj, .xcworkspace)\n\nAnd can export to ipa, so it can be conti"
},
{
"path": "action.yml",
"chars": 3576,
"preview": "name: \"iOS Build Action\"\ndescription: \"Build iOS project (.xcodeproj, .xcworkspace), and export ipa with custom entitlem"
},
{
"path": "build.sh",
"chars": 264,
"preview": "#!/bin/bash -e\n\nif ! type fastlane > /dev/null 2>&1; then\n if type brew > /dev/null 2>&1; then\n brew install fastlan"
},
{
"path": "dist/index.js",
"chars": 982072,
"preview": "/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 7351:\n/***/ (function(__unused_webpa"
},
{
"path": "fastlane/Fastfile",
"chars": 9346,
"preview": "default_platform(:ios)\n\nplatform :ios do\n desc 'Export ipa'\n lane :export_ipa do\n decode_file\n\n keychain_passwor"
},
{
"path": "index.js",
"chars": 3714,
"preview": "const core = require(\"@actions/core\");\nconst exec = require(\"@actions/exec\");\n\nasync function run() {\n try {\n // Val"
},
{
"path": "package.json",
"chars": 762,
"preview": "{\n \"name\": \"ios-build-action\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"tes"
}
]
About this extraction
This page contains the full source code of the yukiarrr/ios-build-action GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 10 files (983.7 KB), approximately 307.1k tokens, and a symbol index with 999 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.