├── .github └── workflows │ └── test.yml ├── .gitignore ├── COMPARISON.md ├── LICENSE ├── README.md ├── action.yml ├── elisp-check.el ├── index.js ├── node_modules ├── .package-lock.json ├── @actions │ ├── core │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lib │ │ │ ├── command.d.ts │ │ │ ├── command.js │ │ │ ├── command.js.map │ │ │ ├── core.d.ts │ │ │ ├── core.js │ │ │ ├── core.js.map │ │ │ ├── file-command.d.ts │ │ │ ├── file-command.js │ │ │ ├── file-command.js.map │ │ │ ├── oidc-utils.d.ts │ │ │ ├── oidc-utils.js │ │ │ ├── oidc-utils.js.map │ │ │ ├── path-utils.d.ts │ │ │ ├── path-utils.js │ │ │ ├── path-utils.js.map │ │ │ ├── platform.d.ts │ │ │ ├── platform.js │ │ │ ├── platform.js.map │ │ │ ├── summary.d.ts │ │ │ ├── summary.js │ │ │ ├── summary.js.map │ │ │ ├── utils.d.ts │ │ │ ├── utils.js │ │ │ └── utils.js.map │ │ └── package.json │ ├── exec │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lib │ │ │ ├── exec.d.ts │ │ │ ├── exec.js │ │ │ ├── exec.js.map │ │ │ ├── interfaces.d.ts │ │ │ ├── interfaces.js │ │ │ ├── interfaces.js.map │ │ │ ├── toolrunner.d.ts │ │ │ ├── toolrunner.js │ │ │ └── toolrunner.js.map │ │ └── package.json │ ├── http-client │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ │ ├── auth.d.ts │ │ │ ├── auth.js │ │ │ ├── auth.js.map │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ ├── interfaces.d.ts │ │ │ ├── interfaces.js │ │ │ ├── interfaces.js.map │ │ │ ├── proxy.d.ts │ │ │ ├── proxy.js │ │ │ └── proxy.js.map │ │ └── package.json │ └── io │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lib │ │ ├── io-util.d.ts │ │ ├── io-util.js │ │ ├── io-util.js.map │ │ ├── io.d.ts │ │ ├── io.js │ │ └── io.js.map │ │ └── package.json ├── @fastify │ └── busboy │ │ ├── LICENSE │ │ ├── README.md │ │ ├── deps │ │ ├── dicer │ │ │ ├── LICENSE │ │ │ └── lib │ │ │ │ ├── Dicer.js │ │ │ │ ├── HeaderParser.js │ │ │ │ ├── PartStream.js │ │ │ │ └── dicer.d.ts │ │ └── streamsearch │ │ │ └── sbmh.js │ │ ├── lib │ │ ├── main.d.ts │ │ ├── main.js │ │ ├── types │ │ │ ├── multipart.js │ │ │ └── urlencoded.js │ │ └── utils │ │ │ ├── Decoder.js │ │ │ ├── basename.js │ │ │ ├── decodeText.js │ │ │ ├── getLimit.js │ │ │ └── parseParams.js │ │ └── package.json ├── tunnel │ ├── .idea │ │ ├── encodings.xml │ │ ├── modules.xml │ │ ├── node-tunnel.iml │ │ ├── vcs.xml │ │ └── workspace.xml │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ └── tunnel.js │ └── package.json └── undici │ ├── LICENSE │ ├── README.md │ ├── docs │ ├── api │ │ ├── Agent.md │ │ ├── BalancedPool.md │ │ ├── CacheStorage.md │ │ ├── Client.md │ │ ├── Connector.md │ │ ├── ContentType.md │ │ ├── Cookies.md │ │ ├── DiagnosticsChannel.md │ │ ├── DispatchInterceptor.md │ │ ├── Dispatcher.md │ │ ├── Errors.md │ │ ├── Fetch.md │ │ ├── MockAgent.md │ │ ├── MockClient.md │ │ ├── MockErrors.md │ │ ├── MockPool.md │ │ ├── Pool.md │ │ ├── PoolStats.md │ │ ├── ProxyAgent.md │ │ ├── RetryHandler.md │ │ ├── WebSocket.md │ │ └── api-lifecycle.md │ ├── assets │ │ └── lifecycle-diagram.png │ └── best-practices │ │ ├── client-certificate.md │ │ ├── mocking-request.md │ │ ├── proxy.md │ │ └── writing-tests.md │ ├── index-fetch.js │ ├── index.d.ts │ ├── index.js │ ├── lib │ ├── agent.js │ ├── api │ │ ├── abort-signal.js │ │ ├── api-connect.js │ │ ├── api-pipeline.js │ │ ├── api-request.js │ │ ├── api-stream.js │ │ ├── api-upgrade.js │ │ ├── index.js │ │ ├── readable.js │ │ └── util.js │ ├── balanced-pool.js │ ├── cache │ │ ├── cache.js │ │ ├── cachestorage.js │ │ ├── symbols.js │ │ └── util.js │ ├── client.js │ ├── compat │ │ └── dispatcher-weakref.js │ ├── cookies │ │ ├── constants.js │ │ ├── index.js │ │ ├── parse.js │ │ └── util.js │ ├── core │ │ ├── connect.js │ │ ├── constants.js │ │ ├── errors.js │ │ ├── request.js │ │ ├── symbols.js │ │ └── util.js │ ├── dispatcher-base.js │ ├── dispatcher.js │ ├── fetch │ │ ├── LICENSE │ │ ├── body.js │ │ ├── constants.js │ │ ├── dataURL.js │ │ ├── file.js │ │ ├── formdata.js │ │ ├── global.js │ │ ├── headers.js │ │ ├── index.js │ │ ├── request.js │ │ ├── response.js │ │ ├── symbols.js │ │ ├── util.js │ │ └── webidl.js │ ├── fileapi │ │ ├── encoding.js │ │ ├── filereader.js │ │ ├── progressevent.js │ │ ├── symbols.js │ │ └── util.js │ ├── global.js │ ├── handler │ │ ├── DecoratorHandler.js │ │ ├── RedirectHandler.js │ │ └── RetryHandler.js │ ├── interceptor │ │ └── redirectInterceptor.js │ ├── llhttp │ │ ├── constants.d.ts │ │ ├── constants.js │ │ ├── constants.js.map │ │ ├── llhttp-wasm.js │ │ ├── llhttp.wasm │ │ ├── llhttp_simd-wasm.js │ │ ├── llhttp_simd.wasm │ │ ├── utils.d.ts │ │ ├── utils.js │ │ ├── utils.js.map │ │ └── wasm_build_env.txt │ ├── mock │ │ ├── mock-agent.js │ │ ├── mock-client.js │ │ ├── mock-errors.js │ │ ├── mock-interceptor.js │ │ ├── mock-pool.js │ │ ├── mock-symbols.js │ │ ├── mock-utils.js │ │ ├── pending-interceptors-formatter.js │ │ └── pluralizer.js │ ├── node │ │ └── fixed-queue.js │ ├── pool-base.js │ ├── pool-stats.js │ ├── pool.js │ ├── proxy-agent.js │ ├── timers.js │ └── websocket │ │ ├── connection.js │ │ ├── constants.js │ │ ├── events.js │ │ ├── frame.js │ │ ├── receiver.js │ │ ├── symbols.js │ │ ├── util.js │ │ └── websocket.js │ ├── package.json │ └── types │ ├── README.md │ ├── agent.d.ts │ ├── api.d.ts │ ├── balanced-pool.d.ts │ ├── cache.d.ts │ ├── client.d.ts │ ├── connector.d.ts │ ├── content-type.d.ts │ ├── cookies.d.ts │ ├── diagnostics-channel.d.ts │ ├── dispatcher.d.ts │ ├── errors.d.ts │ ├── fetch.d.ts │ ├── file.d.ts │ ├── filereader.d.ts │ ├── formdata.d.ts │ ├── global-dispatcher.d.ts │ ├── global-origin.d.ts │ ├── handlers.d.ts │ ├── header.d.ts │ ├── index.d.ts │ ├── interceptors.d.ts │ ├── mock-agent.d.ts │ ├── mock-client.d.ts │ ├── mock-errors.d.ts │ ├── mock-interceptor.d.ts │ ├── mock-pool.d.ts │ ├── patch.d.ts │ ├── pool-stats.d.ts │ ├── pool.d.ts │ ├── proxy-agent.d.ts │ ├── readable.d.ts │ ├── retry-handler.d.ts │ ├── webidl.d.ts │ └── websocket.d.ts ├── package-lock.json └── package.json /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - master 8 | - 'releases/*' 9 | schedule: 10 | - cron: '0 12 * * *' 11 | 12 | jobs: 13 | test-melpa: 14 | runs-on: ubuntu-latest 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | emacs_version: 19 | - 24.4 20 | - 24.5 21 | - 25.1 22 | - 25.2 23 | - 25.3 24 | - 26.1 25 | - 26.2 26 | - 26.3 27 | - 27.1 28 | - 27.2 29 | - 28.1 30 | - 28.2 31 | - 29.1 32 | - release-snapshot 33 | ignore_warnings: 34 | - true 35 | check: 36 | - melpa 37 | include: 38 | - emacs_version: snapshot 39 | check: melpa 40 | ignore_warnings: false 41 | steps: 42 | - uses: actions/checkout@v4 43 | - uses: purcell/setup-emacs@master 44 | with: 45 | version: ${{ matrix.emacs_version }} 46 | - uses: ./ 47 | with: 48 | file: elisp-check.el 49 | check: ${{ matrix.check }} 50 | ignore_warnings: ${{ matrix.ignore_warnings }} 51 | test-builtin: 52 | runs-on: ubuntu-latest 53 | strategy: 54 | fail-fast: false 55 | matrix: 56 | emacs_version: 57 | - 24.1 58 | - 24.2 59 | - 24.3 60 | - 24.4 61 | - 24.5 62 | - 25.1 63 | - 25.2 64 | - 25.3 65 | - 26.1 66 | - 26.2 67 | - 26.3 68 | - 27.1 69 | - 27.2 70 | - 28.1 71 | - 28.2 72 | - 29.1 73 | - release-snapshot 74 | - snapshot 75 | ignore_warnings: 76 | - true 77 | check: 78 | - load-file 79 | - byte-compile 80 | - checkdoc 81 | steps: 82 | - uses: actions/checkout@v4 83 | - uses: purcell/setup-emacs@master 84 | with: 85 | version: ${{ matrix.emacs_version }} 86 | - uses: ./ 87 | with: 88 | file: elisp-check.el 89 | check: ${{ matrix.check }} 90 | ignore_warnings: ${{ matrix.ignore_warnings }} 91 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.elc 2 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Emacs Lisp check' 2 | description: | 3 | Run a number of different Emacs Lisp checks. 4 | inputs: 5 | check: 6 | description: | 7 | Emacs Lisp check to execute. 8 | Consult the README for supported checks. 9 | default: 'melpa' 10 | file: 11 | description: | 12 | Entry file for Emacs Lisp check. 13 | Basic globbing is supported. 14 | default: '*.el' 15 | ignore_warnings: 16 | description: | 17 | Whether to ignore warnings. 18 | default: false 19 | warnings_as_errors: 20 | description: | 21 | Whether to treat errors as warnings. 22 | default: false 23 | runs: 24 | using: 'node20' 25 | main: 'index.js' 26 | branding: 27 | icon: 'align-left' 28 | color: 'purple' 29 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const exec = require('@actions/exec'); 3 | const local_file_name = __dirname + '/elisp-check.el'; 4 | 5 | async function main() { 6 | try { 7 | // Get inputs 8 | const check = core.getInput('check'); 9 | const file = core.getInput('file'); 10 | const ignore = getBooleanInput('ignore_warnings') 11 | const as_errors = getBooleanInput('warnings_as_errors') 12 | 13 | // Execute Emacs checks 14 | await exec.exec( 15 | 'emacs', 16 | [ 17 | '--no-site-file', 18 | '--batch', 19 | '--eval', '(setq debug-on-error t)', 20 | '--load', local_file_name, 21 | '--eval', `(setq elisp-check-ignore-warnings ${ignore})`, 22 | '--eval', `(setq elisp-check-warnings-as-errors ${as_errors})`, 23 | '--eval', `(elisp-check-run "${check}" "${file}" t)` 24 | ] 25 | ); 26 | } 27 | catch (error) { 28 | process.exitCode = 1 29 | } 30 | } 31 | 32 | // Get a Boolean input as its Emacs Lisp equivalent 33 | function getBooleanInput(name) { 34 | let input = core.getInput(name); 35 | 36 | if (input === 'true') { 37 | return 't'; 38 | } else if (input === 'false') { 39 | return 'nil'; 40 | } else { 41 | throw Error(`Option '${name}' could not be interpreted as a Boolean`); 42 | } 43 | } 44 | 45 | main(); 46 | -------------------------------------------------------------------------------- /node_modules/.package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elisp-check", 3 | "version": "1.4.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "node_modules/@actions/core": { 8 | "version": "1.11.1", 9 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", 10 | "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", 11 | "license": "MIT", 12 | "dependencies": { 13 | "@actions/exec": "^1.1.1", 14 | "@actions/http-client": "^2.0.1" 15 | } 16 | }, 17 | "node_modules/@actions/exec": { 18 | "version": "1.1.1", 19 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", 20 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", 21 | "license": "MIT", 22 | "dependencies": { 23 | "@actions/io": "^1.0.1" 24 | } 25 | }, 26 | "node_modules/@actions/http-client": { 27 | "version": "2.2.3", 28 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", 29 | "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", 30 | "license": "MIT", 31 | "dependencies": { 32 | "tunnel": "^0.0.6", 33 | "undici": "^5.25.4" 34 | } 35 | }, 36 | "node_modules/@actions/io": { 37 | "version": "1.1.3", 38 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", 39 | "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", 40 | "license": "MIT" 41 | }, 42 | "node_modules/@fastify/busboy": { 43 | "version": "2.1.1", 44 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 45 | "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 46 | "license": "MIT", 47 | "engines": { 48 | "node": ">=14" 49 | } 50 | }, 51 | "node_modules/tunnel": { 52 | "version": "0.0.6", 53 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 54 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 55 | "license": "MIT", 56 | "engines": { 57 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 58 | } 59 | }, 60 | "node_modules/undici": { 61 | "version": "5.28.5", 62 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", 63 | "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", 64 | "license": "MIT", 65 | "dependencies": { 66 | "@fastify/busboy": "^2.0.0" 67 | }, 68 | "engines": { 69 | "node": ">=14.0" 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/@actions/core/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2019 GitHub 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.d.ts: -------------------------------------------------------------------------------- 1 | export interface CommandProperties { 2 | [key: string]: any; 3 | } 4 | /** 5 | * Commands 6 | * 7 | * Command Format: 8 | * ::name key=value,key=value::message 9 | * 10 | * Examples: 11 | * ::warning::This is the message 12 | * ::set-env name=MY_VAR::some value 13 | */ 14 | export declare function issueCommand(command: string, properties: CommandProperties, message: any): void; 15 | export declare function issue(name: string, message?: string): void; 16 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 14 | Object.defineProperty(o, "default", { enumerable: true, value: v }); 15 | }) : function(o, v) { 16 | o["default"] = v; 17 | }); 18 | var __importStar = (this && this.__importStar) || function (mod) { 19 | if (mod && mod.__esModule) return mod; 20 | var result = {}; 21 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 22 | __setModuleDefault(result, mod); 23 | return result; 24 | }; 25 | Object.defineProperty(exports, "__esModule", { value: true }); 26 | exports.issue = exports.issueCommand = void 0; 27 | const os = __importStar(require("os")); 28 | const utils_1 = require("./utils"); 29 | /** 30 | * Commands 31 | * 32 | * Command Format: 33 | * ::name key=value,key=value::message 34 | * 35 | * Examples: 36 | * ::warning::This is the message 37 | * ::set-env name=MY_VAR::some value 38 | */ 39 | function issueCommand(command, properties, message) { 40 | const cmd = new Command(command, properties, message); 41 | process.stdout.write(cmd.toString() + os.EOL); 42 | } 43 | exports.issueCommand = issueCommand; 44 | function issue(name, message = '') { 45 | issueCommand(name, {}, message); 46 | } 47 | exports.issue = issue; 48 | const CMD_STRING = '::'; 49 | class Command { 50 | constructor(command, properties, message) { 51 | if (!command) { 52 | command = 'missing.command'; 53 | } 54 | this.command = command; 55 | this.properties = properties; 56 | this.message = message; 57 | } 58 | toString() { 59 | let cmdStr = CMD_STRING + this.command; 60 | if (this.properties && Object.keys(this.properties).length > 0) { 61 | cmdStr += ' '; 62 | let first = true; 63 | for (const key in this.properties) { 64 | if (this.properties.hasOwnProperty(key)) { 65 | const val = this.properties[key]; 66 | if (val) { 67 | if (first) { 68 | first = false; 69 | } 70 | else { 71 | cmdStr += ','; 72 | } 73 | cmdStr += `${key}=${escapeProperty(val)}`; 74 | } 75 | } 76 | } 77 | } 78 | cmdStr += `${CMD_STRING}${escapeData(this.message)}`; 79 | return cmdStr; 80 | } 81 | } 82 | function escapeData(s) { 83 | return (0, utils_1.toCommandValue)(s) 84 | .replace(/%/g, '%25') 85 | .replace(/\r/g, '%0D') 86 | .replace(/\n/g, '%0A'); 87 | } 88 | function escapeProperty(s) { 89 | return (0, utils_1.toCommandValue)(s) 90 | .replace(/%/g, '%25') 91 | .replace(/\r/g, '%0D') 92 | .replace(/\n/g, '%0A') 93 | .replace(/:/g, '%3A') 94 | .replace(/,/g, '%2C'); 95 | } 96 | //# sourceMappingURL=command.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,IAAA,sBAAc,EAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,IAAA,sBAAc,EAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/file-command.d.ts: -------------------------------------------------------------------------------- 1 | export declare function issueFileCommand(command: string, message: any): void; 2 | export declare function prepareKeyValueMessage(key: string, value: any): string; 3 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/file-command.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // For internal use, subject to change. 3 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 4 | if (k2 === undefined) k2 = k; 5 | var desc = Object.getOwnPropertyDescriptor(m, k); 6 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 7 | desc = { enumerable: true, get: function() { return m[k]; } }; 8 | } 9 | Object.defineProperty(o, k2, desc); 10 | }) : (function(o, m, k, k2) { 11 | if (k2 === undefined) k2 = k; 12 | o[k2] = m[k]; 13 | })); 14 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 15 | Object.defineProperty(o, "default", { enumerable: true, value: v }); 16 | }) : function(o, v) { 17 | o["default"] = v; 18 | }); 19 | var __importStar = (this && this.__importStar) || function (mod) { 20 | if (mod && mod.__esModule) return mod; 21 | var result = {}; 22 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 23 | __setModuleDefault(result, mod); 24 | return result; 25 | }; 26 | Object.defineProperty(exports, "__esModule", { value: true }); 27 | exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; 28 | // We use any as a valid input type 29 | /* eslint-disable @typescript-eslint/no-explicit-any */ 30 | const crypto = __importStar(require("crypto")); 31 | const fs = __importStar(require("fs")); 32 | const os = __importStar(require("os")); 33 | const utils_1 = require("./utils"); 34 | function issueFileCommand(command, message) { 35 | const filePath = process.env[`GITHUB_${command}`]; 36 | if (!filePath) { 37 | throw new Error(`Unable to find environment variable for file command ${command}`); 38 | } 39 | if (!fs.existsSync(filePath)) { 40 | throw new Error(`Missing file at path: ${filePath}`); 41 | } 42 | fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { 43 | encoding: 'utf8' 44 | }); 45 | } 46 | exports.issueFileCommand = issueFileCommand; 47 | function prepareKeyValueMessage(key, value) { 48 | const delimiter = `ghadelimiter_${crypto.randomUUID()}`; 49 | const convertedValue = (0, utils_1.toCommandValue)(value); 50 | // These should realistically never happen, but just in case someone finds a 51 | // way to exploit uuid generation let's not allow keys or values that contain 52 | // the delimiter. 53 | if (key.includes(delimiter)) { 54 | throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); 55 | } 56 | if (convertedValue.includes(delimiter)) { 57 | throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); 58 | } 59 | return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; 60 | } 61 | exports.prepareKeyValueMessage = prepareKeyValueMessage; 62 | //# sourceMappingURL=file-command.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/file-command.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,+CAAgC;AAChC,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,gBAAgB,CAAC,OAAe,EAAE,OAAY;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,IAAA,sBAAc,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,4CAcC;AAED,SAAgB,sBAAsB,CAAC,GAAW,EAAE,KAAU;IAC5D,MAAM,SAAS,GAAG,gBAAgB,MAAM,CAAC,UAAU,EAAE,EAAE,CAAA;IACvD,MAAM,cAAc,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAA;IAE5C,4EAA4E;IAC5E,6EAA6E;IAC7E,iBAAiB;IACjB,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,4DAA4D,SAAS,GAAG,CACzE,CAAA;KACF;IAED,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CACb,6DAA6D,SAAS,GAAG,CAC1E,CAAA;KACF;IAED,OAAO,GAAG,GAAG,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;AAC9E,CAAC;AApBD,wDAoBC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/oidc-utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare class OidcClient { 2 | private static createHttpClient; 3 | private static getRequestToken; 4 | private static getIDTokenUrl; 5 | private static getCall; 6 | static getIDToken(audience?: string): Promise; 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/oidc-utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | exports.OidcClient = void 0; 13 | const http_client_1 = require("@actions/http-client"); 14 | const auth_1 = require("@actions/http-client/lib/auth"); 15 | const core_1 = require("./core"); 16 | class OidcClient { 17 | static createHttpClient(allowRetry = true, maxRetry = 10) { 18 | const requestOptions = { 19 | allowRetries: allowRetry, 20 | maxRetries: maxRetry 21 | }; 22 | return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); 23 | } 24 | static getRequestToken() { 25 | const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; 26 | if (!token) { 27 | throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); 28 | } 29 | return token; 30 | } 31 | static getIDTokenUrl() { 32 | const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; 33 | if (!runtimeUrl) { 34 | throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); 35 | } 36 | return runtimeUrl; 37 | } 38 | static getCall(id_token_url) { 39 | var _a; 40 | return __awaiter(this, void 0, void 0, function* () { 41 | const httpclient = OidcClient.createHttpClient(); 42 | const res = yield httpclient 43 | .getJson(id_token_url) 44 | .catch(error => { 45 | throw new Error(`Failed to get ID Token. \n 46 | Error Code : ${error.statusCode}\n 47 | Error Message: ${error.message}`); 48 | }); 49 | const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; 50 | if (!id_token) { 51 | throw new Error('Response json body do not have ID Token field'); 52 | } 53 | return id_token; 54 | }); 55 | } 56 | static getIDToken(audience) { 57 | return __awaiter(this, void 0, void 0, function* () { 58 | try { 59 | // New ID Token is requested from action service 60 | let id_token_url = OidcClient.getIDTokenUrl(); 61 | if (audience) { 62 | const encodedAudience = encodeURIComponent(audience); 63 | id_token_url = `${id_token_url}&audience=${encodedAudience}`; 64 | } 65 | (0, core_1.debug)(`ID token url is ${id_token_url}`); 66 | const id_token = yield OidcClient.getCall(id_token_url); 67 | (0, core_1.setSecret)(id_token); 68 | return id_token; 69 | } 70 | catch (error) { 71 | throw new Error(`Error message: ${error.message}`); 72 | } 73 | }); 74 | } 75 | } 76 | exports.OidcClient = OidcClient; 77 | //# sourceMappingURL=oidc-utils.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/oidc-utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"oidc-utils.js","sourceRoot":"","sources":["../src/oidc-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,sDAA+C;AAC/C,wDAAqE;AACrE,iCAAuC;AAKvC,MAAa,UAAU;IACb,MAAM,CAAC,gBAAgB,CAC7B,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,EAAE;QAEb,MAAM,cAAc,GAAmB;YACrC,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;SACrB,CAAA;QAED,OAAO,IAAI,wBAAU,CACnB,qBAAqB,EACrB,CAAC,IAAI,8BAAuB,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,EAC3D,cAAc,CACf,CAAA;IACH,CAAC;IAEO,MAAM,CAAC,eAAe;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAA;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,MAAM,CAAC,aAAa;QAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC9D,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;SAC3E;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAO,OAAO,CAAC,YAAoB;;;YAC/C,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;YAEhD,MAAM,GAAG,GAAG,MAAM,UAAU;iBACzB,OAAO,CAAgB,YAAY,CAAC;iBACpC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,MAAM,IAAI,KAAK,CACb;uBACa,KAAK,CAAC,UAAU;yBACd,KAAK,CAAC,OAAO,EAAE,CAC/B,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,MAAM,QAAQ,GAAG,MAAA,GAAG,CAAC,MAAM,0CAAE,KAAK,CAAA;YAClC,IAAI,CAAC,QAAQ,EAAE;gBACb,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;aACjE;YACD,OAAO,QAAQ,CAAA;;KAChB;IAED,MAAM,CAAO,UAAU,CAAC,QAAiB;;YACvC,IAAI;gBACF,gDAAgD;gBAChD,IAAI,YAAY,GAAW,UAAU,CAAC,aAAa,EAAE,CAAA;gBACrD,IAAI,QAAQ,EAAE;oBACZ,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;oBACpD,YAAY,GAAG,GAAG,YAAY,aAAa,eAAe,EAAE,CAAA;iBAC7D;gBAED,IAAA,YAAK,EAAC,mBAAmB,YAAY,EAAE,CAAC,CAAA;gBAExC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;gBACvD,IAAA,gBAAS,EAAC,QAAQ,CAAC,CAAA;gBACnB,OAAO,QAAQ,CAAA;aAChB;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;aACnD;QACH,CAAC;KAAA;CACF;AAzED,gCAyEC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/path-utils.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * toPosixPath converts the given path to the posix form. On Windows, \\ will be 3 | * replaced with /. 4 | * 5 | * @param pth. Path to transform. 6 | * @return string Posix path. 7 | */ 8 | export declare function toPosixPath(pth: string): string; 9 | /** 10 | * toWin32Path converts the given path to the win32 form. On Linux, / will be 11 | * replaced with \\. 12 | * 13 | * @param pth. Path to transform. 14 | * @return string Win32 path. 15 | */ 16 | export declare function toWin32Path(pth: string): string; 17 | /** 18 | * toPlatformPath converts the given path to a platform-specific path. It does 19 | * this by replacing instances of / and \ with the platform-specific path 20 | * separator. 21 | * 22 | * @param pth The path to platformize. 23 | * @return string The platform-specific path. 24 | */ 25 | export declare function toPlatformPath(pth: string): string; 26 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/path-utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 14 | Object.defineProperty(o, "default", { enumerable: true, value: v }); 15 | }) : function(o, v) { 16 | o["default"] = v; 17 | }); 18 | var __importStar = (this && this.__importStar) || function (mod) { 19 | if (mod && mod.__esModule) return mod; 20 | var result = {}; 21 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 22 | __setModuleDefault(result, mod); 23 | return result; 24 | }; 25 | Object.defineProperty(exports, "__esModule", { value: true }); 26 | exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; 27 | const path = __importStar(require("path")); 28 | /** 29 | * toPosixPath converts the given path to the posix form. On Windows, \\ will be 30 | * replaced with /. 31 | * 32 | * @param pth. Path to transform. 33 | * @return string Posix path. 34 | */ 35 | function toPosixPath(pth) { 36 | return pth.replace(/[\\]/g, '/'); 37 | } 38 | exports.toPosixPath = toPosixPath; 39 | /** 40 | * toWin32Path converts the given path to the win32 form. On Linux, / will be 41 | * replaced with \\. 42 | * 43 | * @param pth. Path to transform. 44 | * @return string Win32 path. 45 | */ 46 | function toWin32Path(pth) { 47 | return pth.replace(/[/]/g, '\\'); 48 | } 49 | exports.toWin32Path = toWin32Path; 50 | /** 51 | * toPlatformPath converts the given path to a platform-specific path. It does 52 | * this by replacing instances of / and \ with the platform-specific path 53 | * separator. 54 | * 55 | * @param pth The path to platformize. 56 | * @return string The platform-specific path. 57 | */ 58 | function toPlatformPath(pth) { 59 | return pth.replace(/[/\\]/g, path.sep); 60 | } 61 | exports.toPlatformPath = toPlatformPath; 62 | //# sourceMappingURL=path-utils.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/path-utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAE5B;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,wCAEC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/platform.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const platform: NodeJS.Platform; 3 | export declare const arch: string; 4 | export declare const isWindows: boolean; 5 | export declare const isMacOS: boolean; 6 | export declare const isLinux: boolean; 7 | export declare function getDetails(): Promise<{ 8 | name: string; 9 | platform: string; 10 | arch: string; 11 | version: string; 12 | isWindows: boolean; 13 | isMacOS: boolean; 14 | isLinux: boolean; 15 | }>; 16 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/platform.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmB;AACnB,oDAAqC;AAErC,MAAM,cAAc,GAAG,GAAmD,EAAE;IAC1E,MAAM,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAChD,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAC7C,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;KACxB,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,YAAY,GAAG,GAGlB,EAAE;;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IACjE,MAAM,IAAI,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IAE3D,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,YAAY,GAAG,GAGlB,EAAE;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC3E,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;IAEF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAEjD,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAA;AACH,CAAC,CAAA,CAAA;AAEY,QAAA,QAAQ,GAAG,YAAE,CAAC,QAAQ,EAAE,CAAA;AACxB,QAAA,IAAI,GAAG,YAAE,CAAC,IAAI,EAAE,CAAA;AAChB,QAAA,SAAS,GAAG,gBAAQ,KAAK,OAAO,CAAA;AAChC,QAAA,OAAO,GAAG,gBAAQ,KAAK,QAAQ,CAAA;AAC/B,QAAA,OAAO,GAAG,gBAAQ,KAAK,OAAO,CAAA;AAE3C,SAAsB,UAAU;;QAS9B,uCACK,CAAC,MAAM,CAAC,iBAAS;YAClB,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,eAAO;gBACT,CAAC,CAAC,YAAY,EAAE;gBAChB,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,KACpB,QAAQ,EAAR,gBAAQ;YACR,IAAI,EAAJ,YAAI;YACJ,SAAS,EAAT,iBAAS;YACT,OAAO,EAAP,eAAO;YACP,OAAO,EAAP,eAAO,IACR;IACH,CAAC;CAAA;AArBD,gCAqBC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/utils.d.ts: -------------------------------------------------------------------------------- 1 | import { AnnotationProperties } from './core'; 2 | import { CommandProperties } from './command'; 3 | /** 4 | * Sanitizes an input into a string so it can be passed into issueCommand safely 5 | * @param input input to sanitize into a string 6 | */ 7 | export declare function toCommandValue(input: any): string; 8 | /** 9 | * 10 | * @param annotationProperties 11 | * @returns The command properties to send with the actual annotation command 12 | * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 13 | */ 14 | export declare function toCommandProperties(annotationProperties: AnnotationProperties): CommandProperties; 15 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // We use any as a valid input type 3 | /* eslint-disable @typescript-eslint/no-explicit-any */ 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.toCommandProperties = exports.toCommandValue = void 0; 6 | /** 7 | * Sanitizes an input into a string so it can be passed into issueCommand safely 8 | * @param input input to sanitize into a string 9 | */ 10 | function toCommandValue(input) { 11 | if (input === null || input === undefined) { 12 | return ''; 13 | } 14 | else if (typeof input === 'string' || input instanceof String) { 15 | return input; 16 | } 17 | return JSON.stringify(input); 18 | } 19 | exports.toCommandValue = toCommandValue; 20 | /** 21 | * 22 | * @param annotationProperties 23 | * @returns The command properties to send with the actual annotation command 24 | * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 25 | */ 26 | function toCommandProperties(annotationProperties) { 27 | if (!Object.keys(annotationProperties).length) { 28 | return {}; 29 | } 30 | return { 31 | title: annotationProperties.title, 32 | file: annotationProperties.file, 33 | line: annotationProperties.startLine, 34 | endLine: annotationProperties.endLine, 35 | col: annotationProperties.startColumn, 36 | endColumn: annotationProperties.endColumn 37 | }; 38 | } 39 | exports.toCommandProperties = toCommandProperties; 40 | //# sourceMappingURL=utils.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;;AAKvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,oBAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE;QAC7C,OAAO,EAAE,CAAA;KACV;IAED,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,KAAK;QACjC,IAAI,EAAE,oBAAoB,CAAC,IAAI;QAC/B,IAAI,EAAE,oBAAoB,CAAC,SAAS;QACpC,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,GAAG,EAAE,oBAAoB,CAAC,WAAW;QACrC,SAAS,EAAE,oBAAoB,CAAC,SAAS;KAC1C,CAAA;AACH,CAAC;AAfD,kDAeC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@actions/core", 3 | "version": "1.11.1", 4 | "description": "Actions core lib", 5 | "keywords": [ 6 | "github", 7 | "actions", 8 | "core" 9 | ], 10 | "homepage": "https://github.com/actions/toolkit/tree/main/packages/core", 11 | "license": "MIT", 12 | "main": "lib/core.js", 13 | "types": "lib/core.d.ts", 14 | "directories": { 15 | "lib": "lib", 16 | "test": "__tests__" 17 | }, 18 | "files": [ 19 | "lib", 20 | "!.DS_Store" 21 | ], 22 | "publishConfig": { 23 | "access": "public" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git+https://github.com/actions/toolkit.git", 28 | "directory": "packages/core" 29 | }, 30 | "scripts": { 31 | "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", 32 | "test": "echo \"Error: run tests from root\" && exit 1", 33 | "tsc": "tsc -p tsconfig.json" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/actions/toolkit/issues" 37 | }, 38 | "dependencies": { 39 | "@actions/exec": "^1.1.1", 40 | "@actions/http-client": "^2.0.1" 41 | }, 42 | "devDependencies": { 43 | "@types/node": "^16.18.112" 44 | } 45 | } -------------------------------------------------------------------------------- /node_modules/@actions/exec/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2019 GitHub 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /node_modules/@actions/exec/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/exec` 2 | 3 | ## Usage 4 | 5 | #### Basic 6 | 7 | You can use this package to execute tools in a cross platform way: 8 | 9 | ```js 10 | const exec = require('@actions/exec'); 11 | 12 | await exec.exec('node index.js'); 13 | ``` 14 | 15 | #### Args 16 | 17 | You can also pass in arg arrays: 18 | 19 | ```js 20 | const exec = require('@actions/exec'); 21 | 22 | await exec.exec('node', ['index.js', 'foo=bar']); 23 | ``` 24 | 25 | #### Output/options 26 | 27 | Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5): 28 | 29 | ```js 30 | const exec = require('@actions/exec'); 31 | 32 | let myOutput = ''; 33 | let myError = ''; 34 | 35 | const options = {}; 36 | options.listeners = { 37 | stdout: (data: Buffer) => { 38 | myOutput += data.toString(); 39 | }, 40 | stderr: (data: Buffer) => { 41 | myError += data.toString(); 42 | } 43 | }; 44 | options.cwd = './lib'; 45 | 46 | await exec.exec('node', ['index.js', 'foo=bar'], options); 47 | ``` 48 | 49 | #### Exec tools not in the PATH 50 | 51 | You can specify the full path for tools not in the PATH: 52 | 53 | ```js 54 | const exec = require('@actions/exec'); 55 | 56 | await exec.exec('"/path/to/my-tool"', ['arg1']); 57 | ``` 58 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.d.ts: -------------------------------------------------------------------------------- 1 | import { ExecOptions, ExecOutput, ExecListeners } from './interfaces'; 2 | export { ExecOptions, ExecOutput, ExecListeners }; 3 | /** 4 | * Exec a command. 5 | * Output will be streamed to the live console. 6 | * Returns promise with return code 7 | * 8 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 9 | * @param args optional arguments for tool. Escaping is handled by the lib. 10 | * @param options optional exec options. See ExecOptions 11 | * @returns Promise exit code 12 | */ 13 | export declare function exec(commandLine: string, args?: string[], options?: ExecOptions): Promise; 14 | /** 15 | * Exec a command and get the output. 16 | * Output will be streamed to the live console. 17 | * Returns promise with the exit code and collected stdout and stderr 18 | * 19 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 20 | * @param args optional arguments for tool. Escaping is handled by the lib. 21 | * @param options optional exec options. See ExecOptions 22 | * @returns Promise exit code, stdout, and stderr 23 | */ 24 | export declare function getExecOutput(commandLine: string, args?: string[], options?: ExecOptions): Promise; 25 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA4C;AAE5C,iDAAkC;AAIlC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAqB;;QAErB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAdD,oBAcC;AAED;;;;;;;;;GASG;AAEH,SAAsB,aAAa,CACjC,WAAmB,EACnB,IAAe,EACf,OAAqB;;;QAErB,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,IAAI,MAAM,GAAG,EAAE,CAAA;QAEf,2EAA2E;QAC3E,MAAM,aAAa,GAAG,IAAI,8BAAa,CAAC,MAAM,CAAC,CAAA;QAC/C,MAAM,aAAa,GAAG,IAAI,8BAAa,CAAC,MAAM,CAAC,CAAA;QAE/C,MAAM,sBAAsB,SAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA;QACzD,MAAM,sBAAsB,SAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA;QAEzD,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE;gBAC1B,sBAAsB,CAAC,IAAI,CAAC,CAAA;aAC7B;QACH,CAAC,CAAA;QAED,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE;gBAC1B,sBAAsB,CAAC,IAAI,CAAC,CAAA;aAC7B;QACH,CAAC,CAAA;QAED,MAAM,SAAS,mCACV,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,KACrB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACvB,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,kCAAM,OAAO,KAAE,SAAS,IAAE,CAAA;QAEvE,gCAAgC;QAChC,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAE7B,OAAO;YACL,QAAQ;YACR,MAAM;YACN,MAAM;SACP,CAAA;;CACF;AA9CD,sCA8CC"} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as stream from 'stream'; 3 | /** 4 | * Interface for exec options 5 | */ 6 | export interface ExecOptions { 7 | /** optional working directory. defaults to current */ 8 | cwd?: string; 9 | /** optional envvar dictionary. defaults to current process's env */ 10 | env?: { 11 | [key: string]: string; 12 | }; 13 | /** optional. defaults to false */ 14 | silent?: boolean; 15 | /** optional out stream to use. Defaults to process.stdout */ 16 | outStream?: stream.Writable; 17 | /** optional err stream to use. Defaults to process.stderr */ 18 | errStream?: stream.Writable; 19 | /** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */ 20 | windowsVerbatimArguments?: boolean; 21 | /** optional. whether to fail if output to stderr. defaults to false */ 22 | failOnStdErr?: boolean; 23 | /** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */ 24 | ignoreReturnCode?: boolean; 25 | /** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */ 26 | delay?: number; 27 | /** optional. input to write to the process on STDIN. */ 28 | input?: Buffer; 29 | /** optional. Listeners for output. Callback functions that will be called on these events */ 30 | listeners?: ExecListeners; 31 | } 32 | /** 33 | * Interface for the output of getExecOutput() 34 | */ 35 | export interface ExecOutput { 36 | /**The exit code of the process */ 37 | exitCode: number; 38 | /**The entire stdout of the process as a string */ 39 | stdout: string; 40 | /**The entire stderr of the process as a string */ 41 | stderr: string; 42 | } 43 | /** 44 | * The user defined listeners for an exec call 45 | */ 46 | export interface ExecListeners { 47 | /** A call back for each buffer of stdout */ 48 | stdout?: (data: Buffer) => void; 49 | /** A call back for each buffer of stderr */ 50 | stderr?: (data: Buffer) => void; 51 | /** A call back for each line of stdout */ 52 | stdline?: (data: string) => void; 53 | /** A call back for each line of stderr */ 54 | errline?: (data: string) => void; 55 | /** A call back for each debug log */ 56 | debug?: (data: string) => void; 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/toolrunner.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as events from 'events'; 3 | import * as im from './interfaces'; 4 | export declare class ToolRunner extends events.EventEmitter { 5 | constructor(toolPath: string, args?: string[], options?: im.ExecOptions); 6 | private toolPath; 7 | private args; 8 | private options; 9 | private _debug; 10 | private _getCommandString; 11 | private _processLineBuffer; 12 | private _getSpawnFileName; 13 | private _getSpawnArgs; 14 | private _endsWith; 15 | private _isCmdFile; 16 | private _windowsQuoteCmdArg; 17 | private _uvQuoteCmdArg; 18 | private _cloneExecOptions; 19 | private _getSpawnOptions; 20 | /** 21 | * Exec a tool. 22 | * Output will be streamed to the live console. 23 | * Returns promise with return code 24 | * 25 | * @param tool path to tool to exec 26 | * @param options optional exec options. See ExecOptions 27 | * @returns number 28 | */ 29 | exec(): Promise; 30 | } 31 | /** 32 | * Convert an arg string to an array of args. Handles escaping 33 | * 34 | * @param argString string of arguments 35 | * @returns string[] array of arguments 36 | */ 37 | export declare function argStringToArray(argString: string): string[]; 38 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@actions/exec", 3 | "version": "1.1.1", 4 | "description": "Actions exec lib", 5 | "keywords": [ 6 | "github", 7 | "actions", 8 | "exec" 9 | ], 10 | "homepage": "https://github.com/actions/toolkit/tree/main/packages/exec", 11 | "license": "MIT", 12 | "main": "lib/exec.js", 13 | "types": "lib/exec.d.ts", 14 | "directories": { 15 | "lib": "lib", 16 | "test": "__tests__" 17 | }, 18 | "files": [ 19 | "lib", 20 | "!.DS_Store" 21 | ], 22 | "publishConfig": { 23 | "access": "public" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git+https://github.com/actions/toolkit.git", 28 | "directory": "packages/exec" 29 | }, 30 | "scripts": { 31 | "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", 32 | "test": "echo \"Error: run tests from root\" && exit 1", 33 | "tsc": "tsc" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/actions/toolkit/issues" 37 | }, 38 | "dependencies": { 39 | "@actions/io": "^1.0.1" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/LICENSE: -------------------------------------------------------------------------------- 1 | Actions Http Client for Node.js 2 | 3 | Copyright (c) GitHub, Inc. 4 | 5 | All rights reserved. 6 | 7 | MIT License 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 10 | associated documentation files (the "Software"), to deal in the Software without restriction, 11 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 18 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 19 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/http-client` 2 | 3 | A lightweight HTTP client optimized for building actions. 4 | 5 | ## Features 6 | 7 | - HTTP client with TypeScript generics and async/await/Promises 8 | - Typings included! 9 | - [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner 10 | - Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+. 11 | - Basic, Bearer and PAT Support out of the box. Extensible handlers for others. 12 | - Redirects supported 13 | 14 | Features and releases [here](./RELEASES.md) 15 | 16 | ## Install 17 | 18 | ``` 19 | npm install @actions/http-client --save 20 | ``` 21 | 22 | ## Samples 23 | 24 | See the [tests](./__tests__) for detailed examples. 25 | 26 | ## Errors 27 | 28 | ### HTTP 29 | 30 | The HTTP client does not throw unless truly exceptional. 31 | 32 | * A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body. 33 | * Redirects (3xx) will be followed by default. 34 | 35 | See the [tests](./__tests__) for detailed examples. 36 | 37 | ## Debugging 38 | 39 | To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible: 40 | 41 | ```shell 42 | export NODE_DEBUG=http 43 | ``` 44 | 45 | ## Node support 46 | 47 | The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+. 48 | 49 | ## Support and Versioning 50 | 51 | We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat). 52 | 53 | ## Contributing 54 | 55 | We welcome PRs. Please create an issue and if applicable, a design before proceeding with code. 56 | 57 | once: 58 | 59 | ``` 60 | npm install 61 | ``` 62 | 63 | To build: 64 | 65 | ``` 66 | npm run build 67 | ``` 68 | 69 | To run all tests: 70 | 71 | ``` 72 | npm test 73 | ``` 74 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/auth.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as http from 'http'; 3 | import * as ifm from './interfaces'; 4 | import { HttpClientResponse } from './index'; 5 | export declare class BasicCredentialHandler implements ifm.RequestHandler { 6 | username: string; 7 | password: string; 8 | constructor(username: string, password: string); 9 | prepareRequest(options: http.RequestOptions): void; 10 | canHandleAuthentication(): boolean; 11 | handleAuthentication(): Promise; 12 | } 13 | export declare class BearerCredentialHandler implements ifm.RequestHandler { 14 | token: string; 15 | constructor(token: string); 16 | prepareRequest(options: http.RequestOptions): void; 17 | canHandleAuthentication(): boolean; 18 | handleAuthentication(): Promise; 19 | } 20 | export declare class PersonalAccessTokenCredentialHandler implements ifm.RequestHandler { 21 | token: string; 22 | constructor(token: string); 23 | prepareRequest(options: http.RequestOptions): void; 24 | canHandleAuthentication(): boolean; 25 | handleAuthentication(): Promise; 26 | } 27 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/auth.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; 13 | class BasicCredentialHandler { 14 | constructor(username, password) { 15 | this.username = username; 16 | this.password = password; 17 | } 18 | prepareRequest(options) { 19 | if (!options.headers) { 20 | throw Error('The request has no headers'); 21 | } 22 | options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; 23 | } 24 | // This handler cannot handle 401 25 | canHandleAuthentication() { 26 | return false; 27 | } 28 | handleAuthentication() { 29 | return __awaiter(this, void 0, void 0, function* () { 30 | throw new Error('not implemented'); 31 | }); 32 | } 33 | } 34 | exports.BasicCredentialHandler = BasicCredentialHandler; 35 | class BearerCredentialHandler { 36 | constructor(token) { 37 | this.token = token; 38 | } 39 | // currently implements pre-authorization 40 | // TODO: support preAuth = false where it hooks on 401 41 | prepareRequest(options) { 42 | if (!options.headers) { 43 | throw Error('The request has no headers'); 44 | } 45 | options.headers['Authorization'] = `Bearer ${this.token}`; 46 | } 47 | // This handler cannot handle 401 48 | canHandleAuthentication() { 49 | return false; 50 | } 51 | handleAuthentication() { 52 | return __awaiter(this, void 0, void 0, function* () { 53 | throw new Error('not implemented'); 54 | }); 55 | } 56 | } 57 | exports.BearerCredentialHandler = BearerCredentialHandler; 58 | class PersonalAccessTokenCredentialHandler { 59 | constructor(token) { 60 | this.token = token; 61 | } 62 | // currently implements pre-authorization 63 | // TODO: support preAuth = false where it hooks on 401 64 | prepareRequest(options) { 65 | if (!options.headers) { 66 | throw Error('The request has no headers'); 67 | } 68 | options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; 69 | } 70 | // This handler cannot handle 401 71 | canHandleAuthentication() { 72 | return false; 73 | } 74 | handleAuthentication() { 75 | return __awaiter(this, void 0, void 0, function* () { 76 | throw new Error('not implemented'); 77 | }); 78 | } 79 | } 80 | exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; 81 | //# sourceMappingURL=auth.js.map -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/auth.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,sBAAsB;IAIjC,YAAY,QAAgB,EAAE,QAAgB;QAC5C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CACpC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AA1BD,wDA0BC;AAED,MAAa,uBAAuB;IAGlC,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAA;IAC3D,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AAxBD,0DAwBC;AAED,MAAa,oCAAoC;IAK/C,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC1C;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,OAAO,IAAI,CAAC,KAAK,EAAE,CACpB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AA5BD,oFA4BC"} -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | import * as http from 'http'; 5 | import * as https from 'https'; 6 | import { HttpClientResponse } from './index'; 7 | export interface HttpClient { 8 | options(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 9 | get(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 10 | del(requestUrl: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 11 | post(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 12 | patch(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 13 | put(requestUrl: string, data: string, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 14 | sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: http.OutgoingHttpHeaders): Promise; 15 | request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: http.OutgoingHttpHeaders): Promise; 16 | requestRaw(info: RequestInfo, data: string | NodeJS.ReadableStream): Promise; 17 | requestRawWithCallback(info: RequestInfo, data: string | NodeJS.ReadableStream, onResult: (err?: Error, res?: HttpClientResponse) => void): void; 18 | } 19 | export interface RequestHandler { 20 | prepareRequest(options: http.RequestOptions): void; 21 | canHandleAuthentication(response: HttpClientResponse): boolean; 22 | handleAuthentication(httpClient: HttpClient, requestInfo: RequestInfo, data: string | NodeJS.ReadableStream | null): Promise; 23 | } 24 | export interface RequestInfo { 25 | options: http.RequestOptions; 26 | parsedUrl: URL; 27 | httpModule: typeof http | typeof https; 28 | } 29 | export interface RequestOptions { 30 | headers?: http.OutgoingHttpHeaders; 31 | socketTimeout?: number; 32 | ignoreSslError?: boolean; 33 | allowRedirects?: boolean; 34 | allowRedirectDowngrade?: boolean; 35 | maxRedirects?: number; 36 | maxSockets?: number; 37 | keepAlive?: boolean; 38 | deserializeDates?: boolean; 39 | allowRetries?: boolean; 40 | maxRetries?: number; 41 | } 42 | export interface TypedResponse { 43 | statusCode: number; 44 | result: T | null; 45 | headers: http.IncomingHttpHeaders; 46 | } 47 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/proxy.d.ts: -------------------------------------------------------------------------------- 1 | export declare function getProxyUrl(reqUrl: URL): URL | undefined; 2 | export declare function checkBypass(reqUrl: URL): boolean; 3 | -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/proxy.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.checkBypass = exports.getProxyUrl = void 0; 4 | function getProxyUrl(reqUrl) { 5 | const usingSsl = reqUrl.protocol === 'https:'; 6 | if (checkBypass(reqUrl)) { 7 | return undefined; 8 | } 9 | const proxyVar = (() => { 10 | if (usingSsl) { 11 | return process.env['https_proxy'] || process.env['HTTPS_PROXY']; 12 | } 13 | else { 14 | return process.env['http_proxy'] || process.env['HTTP_PROXY']; 15 | } 16 | })(); 17 | if (proxyVar) { 18 | try { 19 | return new DecodedURL(proxyVar); 20 | } 21 | catch (_a) { 22 | if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) 23 | return new DecodedURL(`http://${proxyVar}`); 24 | } 25 | } 26 | else { 27 | return undefined; 28 | } 29 | } 30 | exports.getProxyUrl = getProxyUrl; 31 | function checkBypass(reqUrl) { 32 | if (!reqUrl.hostname) { 33 | return false; 34 | } 35 | const reqHost = reqUrl.hostname; 36 | if (isLoopbackAddress(reqHost)) { 37 | return true; 38 | } 39 | const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; 40 | if (!noProxy) { 41 | return false; 42 | } 43 | // Determine the request port 44 | let reqPort; 45 | if (reqUrl.port) { 46 | reqPort = Number(reqUrl.port); 47 | } 48 | else if (reqUrl.protocol === 'http:') { 49 | reqPort = 80; 50 | } 51 | else if (reqUrl.protocol === 'https:') { 52 | reqPort = 443; 53 | } 54 | // Format the request hostname and hostname with port 55 | const upperReqHosts = [reqUrl.hostname.toUpperCase()]; 56 | if (typeof reqPort === 'number') { 57 | upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); 58 | } 59 | // Compare request host against noproxy 60 | for (const upperNoProxyItem of noProxy 61 | .split(',') 62 | .map(x => x.trim().toUpperCase()) 63 | .filter(x => x)) { 64 | if (upperNoProxyItem === '*' || 65 | upperReqHosts.some(x => x === upperNoProxyItem || 66 | x.endsWith(`.${upperNoProxyItem}`) || 67 | (upperNoProxyItem.startsWith('.') && 68 | x.endsWith(`${upperNoProxyItem}`)))) { 69 | return true; 70 | } 71 | } 72 | return false; 73 | } 74 | exports.checkBypass = checkBypass; 75 | function isLoopbackAddress(host) { 76 | const hostLower = host.toLowerCase(); 77 | return (hostLower === 'localhost' || 78 | hostLower.startsWith('127.') || 79 | hostLower.startsWith('[::1]') || 80 | hostLower.startsWith('[0:0:0:0:0:0:0:1]')); 81 | } 82 | class DecodedURL extends URL { 83 | constructor(url, base) { 84 | super(url, base); 85 | this._decodedUsername = decodeURIComponent(super.username); 86 | this._decodedPassword = decodeURIComponent(super.password); 87 | } 88 | get username() { 89 | return this._decodedUsername; 90 | } 91 | get password() { 92 | return this._decodedPassword; 93 | } 94 | } 95 | //# sourceMappingURL=proxy.js.map -------------------------------------------------------------------------------- /node_modules/@actions/http-client/lib/proxy.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAA;IAE7C,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ,EAAE;YACZ,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;SAC9D;IACH,CAAC,CAAC,EAAE,CAAA;IAEJ,IAAI,QAAQ,EAAE;QACZ,IAAI;YACF,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;SAChC;QAAC,WAAM;YACN,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;gBACrE,OAAO,IAAI,UAAU,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAA;SAC9C;KACF;SAAM;QACL,OAAO,SAAS,CAAA;KACjB;AACH,CAAC;AAzBD,kCAyBC;AAED,SAAgB,WAAW,CAAC,MAAW;IACrC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAA;IAC/B,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;QAC9B,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxE,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAA;KACb;IAED,6BAA6B;IAC7B,IAAI,OAA2B,CAAA;IAC/B,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KAC9B;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE;QACtC,OAAO,GAAG,EAAE,CAAA;KACb;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACvC,OAAO,GAAG,GAAG,CAAA;KACd;IAED,qDAAqD;IACrD,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAA;KACrD;IAED,uCAAuC;IACvC,KAAK,MAAM,gBAAgB,IAAI,OAAO;SACnC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACjB,IACE,gBAAgB,KAAK,GAAG;YACxB,aAAa,CAAC,IAAI,CAChB,CAAC,CAAC,EAAE,CACF,CAAC,KAAK,gBAAgB;gBACtB,CAAC,CAAC,QAAQ,CAAC,IAAI,gBAAgB,EAAE,CAAC;gBAClC,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC;oBAC/B,CAAC,CAAC,QAAQ,CAAC,GAAG,gBAAgB,EAAE,CAAC,CAAC,CACvC,EACD;YACA,OAAO,IAAI,CAAA;SACZ;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAnDD,kCAmDC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;IACpC,OAAO,CACL,SAAS,KAAK,WAAW;QACzB,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;QAC5B,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;QAC7B,SAAS,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAC1C,CAAA;AACH,CAAC;AAED,MAAM,UAAW,SAAQ,GAAG;IAI1B,YAAY,GAAiB,EAAE,IAAmB;QAChD,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QAChB,IAAI,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC1D,IAAI,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;CACF"} -------------------------------------------------------------------------------- /node_modules/@actions/http-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@actions/http-client", 3 | "version": "2.2.3", 4 | "description": "Actions Http Client", 5 | "keywords": [ 6 | "github", 7 | "actions", 8 | "http" 9 | ], 10 | "homepage": "https://github.com/actions/toolkit/tree/main/packages/http-client", 11 | "license": "MIT", 12 | "main": "lib/index.js", 13 | "types": "lib/index.d.ts", 14 | "directories": { 15 | "lib": "lib", 16 | "test": "__tests__" 17 | }, 18 | "files": [ 19 | "lib", 20 | "!.DS_Store" 21 | ], 22 | "publishConfig": { 23 | "access": "public" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "git+https://github.com/actions/toolkit.git", 28 | "directory": "packages/http-client" 29 | }, 30 | "scripts": { 31 | "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", 32 | "test": "echo \"Error: run tests from root\" && exit 1", 33 | "build": "tsc", 34 | "format": "prettier --write **/*.ts", 35 | "format-check": "prettier --check **/*.ts", 36 | "tsc": "tsc" 37 | }, 38 | "bugs": { 39 | "url": "https://github.com/actions/toolkit/issues" 40 | }, 41 | "devDependencies": { 42 | "@types/node": "20.7.1", 43 | "@types/tunnel": "0.0.3", 44 | "proxy": "^2.1.1", 45 | "@types/proxy": "^1.0.1" 46 | }, 47 | "dependencies": { 48 | "tunnel": "^0.0.6", 49 | "undici": "^5.25.4" 50 | } 51 | } -------------------------------------------------------------------------------- /node_modules/@actions/io/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2019 GitHub 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /node_modules/@actions/io/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/io` 2 | 3 | > Core functions for cli filesystem scenarios 4 | 5 | ## Usage 6 | 7 | #### mkdir -p 8 | 9 | Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified: 10 | 11 | ```js 12 | const io = require('@actions/io'); 13 | 14 | await io.mkdirP('path/to/make'); 15 | ``` 16 | 17 | #### cp/mv 18 | 19 | Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv): 20 | 21 | ```js 22 | const io = require('@actions/io'); 23 | 24 | // Recursive must be true for directories 25 | const options = { recursive: true, force: false } 26 | 27 | await io.cp('path/to/directory', 'path/to/dest', options); 28 | await io.mv('path/to/file', 'path/to/dest'); 29 | ``` 30 | 31 | #### rm -rf 32 | 33 | Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified. 34 | 35 | ```js 36 | const io = require('@actions/io'); 37 | 38 | await io.rmRF('path/to/directory'); 39 | await io.rmRF('path/to/file'); 40 | ``` 41 | 42 | #### which 43 | 44 | Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which). 45 | 46 | ```js 47 | const exec = require('@actions/exec'); 48 | const io = require('@actions/io'); 49 | 50 | const pythonPath: string = await io.which('python', true) 51 | 52 | await exec.exec(`"${pythonPath}"`, ['main.py']); 53 | ``` 54 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as fs from 'fs'; 3 | export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, open: typeof fs.promises.open, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rm: typeof fs.promises.rm, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink; 4 | export declare const IS_WINDOWS: boolean; 5 | export declare const UV_FS_O_EXLOCK = 268435456; 6 | export declare const READONLY: number; 7 | export declare function exists(fsPath: string): Promise; 8 | export declare function isDirectory(fsPath: string, useStat?: boolean): Promise; 9 | /** 10 | * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: 11 | * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). 12 | */ 13 | export declare function isRooted(p: string): boolean; 14 | /** 15 | * Best effort attempt to determine whether a file exists and is executable. 16 | * @param filePath file path to check 17 | * @param extensions additional file extensions to try 18 | * @return if file exists and is executable, returns the file path. otherwise empty string. 19 | */ 20 | export declare function tryGetExecutablePath(filePath: string, extensions: string[]): Promise; 21 | export declare function getCmdPath(): string; 22 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAEf,KAcT,EAAE,CAAC,QAAQ;AACf,6BAA6B;EAd3B,aAAK,aACL,gBAAQ,gBACR,aAAK,aACL,aAAK,aACL,YAAI,YACJ,eAAO,eACP,gBAAQ,gBACR,cAAM,cACN,UAAE,UACF,aAAK,aACL,YAAI,YACJ,eAAO,eACP,cAAM,aACO;AACf,6BAA6B;AAChB,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AACtD,iHAAiH;AACpG,QAAA,cAAc,GAAG,UAAU,CAAA;AAC3B,QAAA,QAAQ,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAA;AAE7C,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,OAAO,GAAG,KAAK;;QAEf,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,YAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;CAAA;AAND,kCAMC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,CAAS;IAChC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;KAC5D;IAED,IAAI,kBAAU,EAAE;QACd,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B;SACxE,CAAA,CAAC,sBAAsB;KACzB;IAED,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAbD,4BAaC;AAED;;;;;GAKG;AACH,SAAsB,oBAAoB,CACxC,QAAgB,EAChB,UAAoB;;QAEpB,IAAI,KAAK,GAAyB,SAAS,CAAA;QAC3C,IAAI;YACF,mBAAmB;YACnB,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;aACF;SACF;QACD,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,kBAAU,EAAE;gBACd,uCAAuC;gBACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;gBACrD,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,EAAE;oBACpE,OAAO,QAAQ,CAAA;iBAChB;aACF;iBAAM;gBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBAC3B,OAAO,QAAQ,CAAA;iBAChB;aACF;SACF;QAED,qBAAqB;QACrB,MAAM,gBAAgB,GAAG,QAAQ,CAAA;QACjC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAAA;YAEvC,KAAK,GAAG,SAAS,CAAA;YACjB,IAAI;gBACF,KAAK,GAAG,MAAM,YAAI,CAAC,QAAQ,CAAC,CAAA;aAC7B;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACzB,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CACT,uEAAuE,QAAQ,MAAM,GAAG,EAAE,CAC3F,CAAA;iBACF;aACF;YAED,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;gBAC3B,IAAI,kBAAU,EAAE;oBACd,yEAAyE;oBACzE,IAAI;wBACF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;wBACxC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAA;wBACvD,KAAK,MAAM,UAAU,IAAI,MAAM,eAAO,CAAC,SAAS,CAAC,EAAE;4BACjD,IAAI,SAAS,KAAK,UAAU,CAAC,WAAW,EAAE,EAAE;gCAC1C,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;gCAC3C,MAAK;6BACN;yBACF;qBACF;oBAAC,OAAO,GAAG,EAAE;wBACZ,sCAAsC;wBACtC,OAAO,CAAC,GAAG,CACT,yEAAyE,QAAQ,MAAM,GAAG,EAAE,CAC7F,CAAA;qBACF;oBAED,OAAO,QAAQ,CAAA;iBAChB;qBAAM;oBACL,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;wBAC3B,OAAO,QAAQ,CAAA;qBAChB;iBACF;aACF;SACF;QAED,OAAO,EAAE,CAAA;IACX,CAAC;CAAA;AA5ED,oDA4EC;AAED,SAAS,mBAAmB,CAAC,CAAS;IACpC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACX,IAAI,kBAAU,EAAE;QACd,6BAA6B;QAC7B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1B,2BAA2B;QAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;KACjC;IAED,2BAA2B;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC;AAED,qCAAqC;AACrC,SAAgB,UAAU;;IACxB,aAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAA;AAC5C,CAAC;AAFD,gCAEC"} -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for cp/mv options 3 | */ 4 | export interface CopyOptions { 5 | /** Optional. Whether to recursively copy all subdirectories. Defaults to false */ 6 | recursive?: boolean; 7 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 8 | force?: boolean; 9 | /** Optional. Whether to copy the source directory along with all the files. Only takes effect when recursive=true and copying a directory. Default is true*/ 10 | copySourceDirectory?: boolean; 11 | } 12 | /** 13 | * Interface for cp/mv options 14 | */ 15 | export interface MoveOptions { 16 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 17 | force?: boolean; 18 | } 19 | /** 20 | * Copies a file or folder. 21 | * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js 22 | * 23 | * @param source source path 24 | * @param dest destination path 25 | * @param options optional. See CopyOptions. 26 | */ 27 | export declare function cp(source: string, dest: string, options?: CopyOptions): Promise; 28 | /** 29 | * Moves a path. 30 | * 31 | * @param source source path 32 | * @param dest destination path 33 | * @param options optional. See MoveOptions. 34 | */ 35 | export declare function mv(source: string, dest: string, options?: MoveOptions): Promise; 36 | /** 37 | * Remove a path recursively with force 38 | * 39 | * @param inputPath path to remove 40 | */ 41 | export declare function rmRF(inputPath: string): Promise; 42 | /** 43 | * Make a directory. Creates the full path with folders in between 44 | * Will throw if it fails 45 | * 46 | * @param fsPath path to create 47 | * @returns Promise 48 | */ 49 | export declare function mkdirP(fsPath: string): Promise; 50 | /** 51 | * Returns path of a tool had the tool actually been invoked. Resolves via paths. 52 | * If you check and the tool does not exist, it will throw. 53 | * 54 | * @param tool name of the tool 55 | * @param check whether to check if tool exists 56 | * @returns Promise path to tool 57 | */ 58 | export declare function which(tool: string, check?: boolean): Promise; 59 | /** 60 | * Returns a list of all occurrences of the given tool on the system path. 61 | * 62 | * @returns Promise the paths of the tool 63 | */ 64 | export declare function findInPath(tool: string): Promise; 65 | -------------------------------------------------------------------------------- /node_modules/@actions/io/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@actions/io", 3 | "version": "1.1.3", 4 | "description": "Actions io lib", 5 | "keywords": [ 6 | "github", 7 | "actions", 8 | "io" 9 | ], 10 | "homepage": "https://github.com/actions/toolkit/tree/main/packages/io", 11 | "license": "MIT", 12 | "main": "lib/io.js", 13 | "types": "lib/io.d.ts", 14 | "directories": { 15 | "lib": "lib", 16 | "test": "__tests__" 17 | }, 18 | "files": [ 19 | "lib" 20 | ], 21 | "publishConfig": { 22 | "access": "public" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/actions/toolkit.git", 27 | "directory": "packages/io" 28 | }, 29 | "scripts": { 30 | "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", 31 | "test": "echo \"Error: run tests from root\" && exit 1", 32 | "tsc": "tsc" 33 | }, 34 | "bugs": { 35 | "url": "https://github.com/actions/toolkit/issues" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Brian White. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/deps/dicer/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Brian White. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const EventEmitter = require('node:events').EventEmitter 4 | const inherits = require('node:util').inherits 5 | const getLimit = require('../../../lib/utils/getLimit') 6 | 7 | const StreamSearch = require('../../streamsearch/sbmh') 8 | 9 | const B_DCRLF = Buffer.from('\r\n\r\n') 10 | const RE_CRLF = /\r\n/g 11 | const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex 12 | 13 | function HeaderParser (cfg) { 14 | EventEmitter.call(this) 15 | 16 | cfg = cfg || {} 17 | const self = this 18 | this.nread = 0 19 | this.maxed = false 20 | this.npairs = 0 21 | this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) 22 | this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) 23 | this.buffer = '' 24 | this.header = {} 25 | this.finished = false 26 | this.ss = new StreamSearch(B_DCRLF) 27 | this.ss.on('info', function (isMatch, data, start, end) { 28 | if (data && !self.maxed) { 29 | if (self.nread + end - start >= self.maxHeaderSize) { 30 | end = self.maxHeaderSize - self.nread + start 31 | self.nread = self.maxHeaderSize 32 | self.maxed = true 33 | } else { self.nread += (end - start) } 34 | 35 | self.buffer += data.toString('binary', start, end) 36 | } 37 | if (isMatch) { self._finish() } 38 | }) 39 | } 40 | inherits(HeaderParser, EventEmitter) 41 | 42 | HeaderParser.prototype.push = function (data) { 43 | const r = this.ss.push(data) 44 | if (this.finished) { return r } 45 | } 46 | 47 | HeaderParser.prototype.reset = function () { 48 | this.finished = false 49 | this.buffer = '' 50 | this.header = {} 51 | this.ss.reset() 52 | } 53 | 54 | HeaderParser.prototype._finish = function () { 55 | if (this.buffer) { this._parseHeader() } 56 | this.ss.matches = this.ss.maxMatches 57 | const header = this.header 58 | this.header = {} 59 | this.buffer = '' 60 | this.finished = true 61 | this.nread = this.npairs = 0 62 | this.maxed = false 63 | this.emit('header', header) 64 | } 65 | 66 | HeaderParser.prototype._parseHeader = function () { 67 | if (this.npairs === this.maxHeaderPairs) { return } 68 | 69 | const lines = this.buffer.split(RE_CRLF) 70 | const len = lines.length 71 | let m, h 72 | 73 | for (var i = 0; i < len; ++i) { // eslint-disable-line no-var 74 | if (lines[i].length === 0) { continue } 75 | if (lines[i][0] === '\t' || lines[i][0] === ' ') { 76 | // folded header content 77 | // RFC2822 says to just remove the CRLF and not the whitespace following 78 | // it, so we follow the RFC and include the leading whitespace ... 79 | if (h) { 80 | this.header[h][this.header[h].length - 1] += lines[i] 81 | continue 82 | } 83 | } 84 | 85 | const posColon = lines[i].indexOf(':') 86 | if ( 87 | posColon === -1 || 88 | posColon === 0 89 | ) { 90 | return 91 | } 92 | m = RE_HDR.exec(lines[i]) 93 | h = m[1].toLowerCase() 94 | this.header[h] = this.header[h] || [] 95 | this.header[h].push((m[2] || '')) 96 | if (++this.npairs === this.maxHeaderPairs) { break } 97 | } 98 | } 99 | 100 | module.exports = HeaderParser 101 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const inherits = require('node:util').inherits 4 | const ReadableStream = require('node:stream').Readable 5 | 6 | function PartStream (opts) { 7 | ReadableStream.call(this, opts) 8 | } 9 | inherits(PartStream, ReadableStream) 10 | 11 | PartStream.prototype._read = function (n) {} 12 | 13 | module.exports = PartStream 14 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/lib/main.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const WritableStream = require('node:stream').Writable 4 | const { inherits } = require('node:util') 5 | const Dicer = require('../deps/dicer/lib/Dicer') 6 | 7 | const MultipartParser = require('./types/multipart') 8 | const UrlencodedParser = require('./types/urlencoded') 9 | const parseParams = require('./utils/parseParams') 10 | 11 | function Busboy (opts) { 12 | if (!(this instanceof Busboy)) { return new Busboy(opts) } 13 | 14 | if (typeof opts !== 'object') { 15 | throw new TypeError('Busboy expected an options-Object.') 16 | } 17 | if (typeof opts.headers !== 'object') { 18 | throw new TypeError('Busboy expected an options-Object with headers-attribute.') 19 | } 20 | if (typeof opts.headers['content-type'] !== 'string') { 21 | throw new TypeError('Missing Content-Type-header.') 22 | } 23 | 24 | const { 25 | headers, 26 | ...streamOptions 27 | } = opts 28 | 29 | this.opts = { 30 | autoDestroy: false, 31 | ...streamOptions 32 | } 33 | WritableStream.call(this, this.opts) 34 | 35 | this._done = false 36 | this._parser = this.getParserByHeaders(headers) 37 | this._finished = false 38 | } 39 | inherits(Busboy, WritableStream) 40 | 41 | Busboy.prototype.emit = function (ev) { 42 | if (ev === 'finish') { 43 | if (!this._done) { 44 | this._parser?.end() 45 | return 46 | } else if (this._finished) { 47 | return 48 | } 49 | this._finished = true 50 | } 51 | WritableStream.prototype.emit.apply(this, arguments) 52 | } 53 | 54 | Busboy.prototype.getParserByHeaders = function (headers) { 55 | const parsed = parseParams(headers['content-type']) 56 | 57 | const cfg = { 58 | defCharset: this.opts.defCharset, 59 | fileHwm: this.opts.fileHwm, 60 | headers, 61 | highWaterMark: this.opts.highWaterMark, 62 | isPartAFile: this.opts.isPartAFile, 63 | limits: this.opts.limits, 64 | parsedConType: parsed, 65 | preservePath: this.opts.preservePath 66 | } 67 | 68 | if (MultipartParser.detect.test(parsed[0])) { 69 | return new MultipartParser(this, cfg) 70 | } 71 | if (UrlencodedParser.detect.test(parsed[0])) { 72 | return new UrlencodedParser(this, cfg) 73 | } 74 | throw new Error('Unsupported Content-Type.') 75 | } 76 | 77 | Busboy.prototype._write = function (chunk, encoding, cb) { 78 | this._parser.write(chunk, cb) 79 | } 80 | 81 | module.exports = Busboy 82 | module.exports.default = Busboy 83 | module.exports.Busboy = Busboy 84 | 85 | module.exports.Dicer = Dicer 86 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/lib/utils/Decoder.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const RE_PLUS = /\+/g 4 | 5 | const HEX = [ 6 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 10 | 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12 | 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 14 | ] 15 | 16 | function Decoder () { 17 | this.buffer = undefined 18 | } 19 | Decoder.prototype.write = function (str) { 20 | // Replace '+' with ' ' before decoding 21 | str = str.replace(RE_PLUS, ' ') 22 | let res = '' 23 | let i = 0; let p = 0; const len = str.length 24 | for (; i < len; ++i) { 25 | if (this.buffer !== undefined) { 26 | if (!HEX[str.charCodeAt(i)]) { 27 | res += '%' + this.buffer 28 | this.buffer = undefined 29 | --i // retry character 30 | } else { 31 | this.buffer += str[i] 32 | ++p 33 | if (this.buffer.length === 2) { 34 | res += String.fromCharCode(parseInt(this.buffer, 16)) 35 | this.buffer = undefined 36 | } 37 | } 38 | } else if (str[i] === '%') { 39 | if (i > p) { 40 | res += str.substring(p, i) 41 | p = i 42 | } 43 | this.buffer = '' 44 | ++p 45 | } 46 | } 47 | if (p < len && this.buffer === undefined) { res += str.substring(p) } 48 | return res 49 | } 50 | Decoder.prototype.reset = function () { 51 | this.buffer = undefined 52 | } 53 | 54 | module.exports = Decoder 55 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/lib/utils/basename.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function basename (path) { 4 | if (typeof path !== 'string') { return '' } 5 | for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var 6 | switch (path.charCodeAt(i)) { 7 | case 0x2F: // '/' 8 | case 0x5C: // '\' 9 | path = path.slice(i + 1) 10 | return (path === '..' || path === '.' ? '' : path) 11 | } 12 | } 13 | return (path === '..' || path === '.' ? '' : path) 14 | } 15 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/lib/utils/decodeText.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // Node has always utf-8 4 | const utf8Decoder = new TextDecoder('utf-8') 5 | const textDecoders = new Map([ 6 | ['utf-8', utf8Decoder], 7 | ['utf8', utf8Decoder] 8 | ]) 9 | 10 | function getDecoder (charset) { 11 | let lc 12 | while (true) { 13 | switch (charset) { 14 | case 'utf-8': 15 | case 'utf8': 16 | return decoders.utf8 17 | case 'latin1': 18 | case 'ascii': // TODO: Make these a separate, strict decoder? 19 | case 'us-ascii': 20 | case 'iso-8859-1': 21 | case 'iso8859-1': 22 | case 'iso88591': 23 | case 'iso_8859-1': 24 | case 'windows-1252': 25 | case 'iso_8859-1:1987': 26 | case 'cp1252': 27 | case 'x-cp1252': 28 | return decoders.latin1 29 | case 'utf16le': 30 | case 'utf-16le': 31 | case 'ucs2': 32 | case 'ucs-2': 33 | return decoders.utf16le 34 | case 'base64': 35 | return decoders.base64 36 | default: 37 | if (lc === undefined) { 38 | lc = true 39 | charset = charset.toLowerCase() 40 | continue 41 | } 42 | return decoders.other.bind(charset) 43 | } 44 | } 45 | } 46 | 47 | const decoders = { 48 | utf8: (data, sourceEncoding) => { 49 | if (data.length === 0) { 50 | return '' 51 | } 52 | if (typeof data === 'string') { 53 | data = Buffer.from(data, sourceEncoding) 54 | } 55 | return data.utf8Slice(0, data.length) 56 | }, 57 | 58 | latin1: (data, sourceEncoding) => { 59 | if (data.length === 0) { 60 | return '' 61 | } 62 | if (typeof data === 'string') { 63 | return data 64 | } 65 | return data.latin1Slice(0, data.length) 66 | }, 67 | 68 | utf16le: (data, sourceEncoding) => { 69 | if (data.length === 0) { 70 | return '' 71 | } 72 | if (typeof data === 'string') { 73 | data = Buffer.from(data, sourceEncoding) 74 | } 75 | return data.ucs2Slice(0, data.length) 76 | }, 77 | 78 | base64: (data, sourceEncoding) => { 79 | if (data.length === 0) { 80 | return '' 81 | } 82 | if (typeof data === 'string') { 83 | data = Buffer.from(data, sourceEncoding) 84 | } 85 | return data.base64Slice(0, data.length) 86 | }, 87 | 88 | other: (data, sourceEncoding) => { 89 | if (data.length === 0) { 90 | return '' 91 | } 92 | if (typeof data === 'string') { 93 | data = Buffer.from(data, sourceEncoding) 94 | } 95 | 96 | if (textDecoders.has(this.toString())) { 97 | try { 98 | return textDecoders.get(this).decode(data) 99 | } catch {} 100 | } 101 | return typeof data === 'string' 102 | ? data 103 | : data.toString() 104 | } 105 | } 106 | 107 | function decodeText (text, sourceEncoding, destEncoding) { 108 | if (text) { 109 | return getDecoder(destEncoding)(text, sourceEncoding) 110 | } 111 | return text 112 | } 113 | 114 | module.exports = decodeText 115 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/lib/utils/getLimit.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function getLimit (limits, name, defaultLimit) { 4 | if ( 5 | !limits || 6 | limits[name] === undefined || 7 | limits[name] === null 8 | ) { return defaultLimit } 9 | 10 | if ( 11 | typeof limits[name] !== 'number' || 12 | isNaN(limits[name]) 13 | ) { throw new TypeError('Limit ' + name + ' is not a valid number') } 14 | 15 | return limits[name] 16 | } 17 | -------------------------------------------------------------------------------- /node_modules/@fastify/busboy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fastify/busboy", 3 | "version": "2.1.1", 4 | "private": false, 5 | "author": "Brian White ", 6 | "contributors": [ 7 | { 8 | "name": "Igor Savin", 9 | "email": "kibertoad@gmail.com", 10 | "url": "https://github.com/kibertoad" 11 | }, 12 | { 13 | "name": "Aras Abbasi", 14 | "email": "aras.abbasi@gmail.com", 15 | "url": "https://github.com/uzlopak" 16 | } 17 | ], 18 | "description": "A streaming parser for HTML form data for node.js", 19 | "main": "lib/main", 20 | "type": "commonjs", 21 | "types": "lib/main.d.ts", 22 | "scripts": { 23 | "bench:busboy": "cd benchmarks && npm install && npm run benchmark-fastify", 24 | "bench:dicer": "node bench/dicer/dicer-bench-multipart-parser.js", 25 | "coveralls": "nyc report --reporter=lcov", 26 | "lint": "npm run lint:standard", 27 | "lint:everything": "npm run lint && npm run test:types", 28 | "lint:fix": "standard --fix", 29 | "lint:standard": "standard --verbose | snazzy", 30 | "test:mocha": "tap", 31 | "test:types": "tsd", 32 | "test:coverage": "nyc npm run test", 33 | "test": "npm run test:mocha" 34 | }, 35 | "engines": { 36 | "node": ">=14" 37 | }, 38 | "devDependencies": { 39 | "@types/node": "^20.1.0", 40 | "busboy": "^1.0.0", 41 | "photofinish": "^1.8.0", 42 | "snazzy": "^9.0.0", 43 | "standard": "^17.0.0", 44 | "tap": "^16.3.8", 45 | "tinybench": "^2.5.1", 46 | "tsd": "^0.30.0", 47 | "typescript": "^5.0.2" 48 | }, 49 | "keywords": [ 50 | "uploads", 51 | "forms", 52 | "multipart", 53 | "form-data" 54 | ], 55 | "license": "MIT", 56 | "repository": { 57 | "type": "git", 58 | "url": "git+https://github.com/fastify/busboy.git" 59 | }, 60 | "tsd": { 61 | "directory": "test/types", 62 | "compilerOptions": { 63 | "esModuleInterop": false, 64 | "module": "commonjs", 65 | "target": "ES2017" 66 | } 67 | }, 68 | "standard": { 69 | "globals": [ 70 | "describe", 71 | "it" 72 | ], 73 | "ignore": [ 74 | "bench" 75 | ] 76 | }, 77 | "files": [ 78 | "README.md", 79 | "LICENSE", 80 | "lib/*", 81 | "deps/encoding/*", 82 | "deps/dicer/lib", 83 | "deps/streamsearch/", 84 | "deps/dicer/LICENSE" 85 | ] 86 | } 87 | -------------------------------------------------------------------------------- /node_modules/tunnel/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /node_modules/tunnel/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /node_modules/tunnel/.idea/node-tunnel.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /node_modules/tunnel/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /node_modules/tunnel/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4" 4 | - "6" 5 | - "8" 6 | - "10" 7 | -------------------------------------------------------------------------------- /node_modules/tunnel/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | - 0.0.6 (2018/09/11) 4 | - Fix `localAddress` not working (#25) 5 | - Fix `Host:` header for CONNECT method by @tmurakam (#29, #30) 6 | - Fix default port for https (#32) 7 | - Fix error handling when the proxy send illegal response body (#33) 8 | 9 | - 0.0.5 (2017/06/12) 10 | - Fix socket leak. 11 | 12 | - 0.0.4 (2016/01/23) 13 | - supported Node v0.12 or later. 14 | 15 | - 0.0.3 (2014/01/20) 16 | - fixed package.json 17 | 18 | - 0.0.1 (2012/02/18) 19 | - supported Node v0.6.x (0.6.11 or later). 20 | 21 | - 0.0.0 (2012/02/11) 22 | - first release. 23 | -------------------------------------------------------------------------------- /node_modules/tunnel/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012 Koichi Kobayashi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/tunnel/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/tunnel'); 2 | -------------------------------------------------------------------------------- /node_modules/tunnel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tunnel", 3 | "version": "0.0.6", 4 | "description": "Node HTTP/HTTPS Agents for tunneling proxies", 5 | "keywords": [ 6 | "http", 7 | "https", 8 | "agent", 9 | "proxy", 10 | "tunnel" 11 | ], 12 | "homepage": "https://github.com/koichik/node-tunnel/", 13 | "bugs": "https://github.com/koichik/node-tunnel/issues", 14 | "license": "MIT", 15 | "author": "Koichi Kobayashi ", 16 | "main": "./index.js", 17 | "directories": { 18 | "lib": "./lib" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/koichik/node-tunnel.git" 23 | }, 24 | "scripts": { 25 | "test": "mocha" 26 | }, 27 | "devDependencies": { 28 | "mocha": "^5.2.0", 29 | "should": "^13.2.3" 30 | }, 31 | "engines": { 32 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/undici/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Matteo Collina and Undici contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/Agent.md: -------------------------------------------------------------------------------- 1 | # Agent 2 | 3 | Extends: `undici.Dispatcher` 4 | 5 | Agent allow dispatching requests against multiple different origins. 6 | 7 | Requests are not guaranteed to be dispatched in order of invocation. 8 | 9 | ## `new undici.Agent([options])` 10 | 11 | Arguments: 12 | 13 | * **options** `AgentOptions` (optional) 14 | 15 | Returns: `Agent` 16 | 17 | ### Parameter: `AgentOptions` 18 | 19 | Extends: [`PoolOptions`](Pool.md#parameter-pooloptions) 20 | 21 | * **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)` 22 | * **maxRedirections** `Integer` - Default: `0`. The number of HTTP redirection to follow unless otherwise specified in `DispatchOptions`. 23 | * **interceptors** `{ Agent: DispatchInterceptor[] }` - Default: `[RedirectInterceptor]` - A list of interceptors that are applied to the dispatch method. Additional logic can be applied (such as, but not limited to: 302 status code handling, authentication, cookies, compression and caching). Note that the behavior of interceptors is Experimental and might change at any given time. 24 | 25 | ## Instance Properties 26 | 27 | ### `Agent.closed` 28 | 29 | Implements [Client.closed](Client.md#clientclosed) 30 | 31 | ### `Agent.destroyed` 32 | 33 | Implements [Client.destroyed](Client.md#clientdestroyed) 34 | 35 | ## Instance Methods 36 | 37 | ### `Agent.close([callback])` 38 | 39 | Implements [`Dispatcher.close([callback])`](Dispatcher.md#dispatcherclosecallback-promise). 40 | 41 | ### `Agent.destroy([error, callback])` 42 | 43 | Implements [`Dispatcher.destroy([error, callback])`](Dispatcher.md#dispatcherdestroyerror-callback-promise). 44 | 45 | ### `Agent.dispatch(options, handler: AgentDispatchOptions)` 46 | 47 | Implements [`Dispatcher.dispatch(options, handler)`](Dispatcher.md#dispatcherdispatchoptions-handler). 48 | 49 | #### Parameter: `AgentDispatchOptions` 50 | 51 | Extends: [`DispatchOptions`](Dispatcher.md#parameter-dispatchoptions) 52 | 53 | * **origin** `string | URL` 54 | * **maxRedirections** `Integer`. 55 | 56 | Implements [`Dispatcher.destroy([error, callback])`](Dispatcher.md#dispatcherdestroyerror-callback-promise). 57 | 58 | ### `Agent.connect(options[, callback])` 59 | 60 | See [`Dispatcher.connect(options[, callback])`](Dispatcher.md#dispatcherconnectoptions-callback). 61 | 62 | ### `Agent.dispatch(options, handler)` 63 | 64 | Implements [`Dispatcher.dispatch(options, handler)`](Dispatcher.md#dispatcherdispatchoptions-handler). 65 | 66 | ### `Agent.pipeline(options, handler)` 67 | 68 | See [`Dispatcher.pipeline(options, handler)`](Dispatcher.md#dispatcherpipelineoptions-handler). 69 | 70 | ### `Agent.request(options[, callback])` 71 | 72 | See [`Dispatcher.request(options [, callback])`](Dispatcher.md#dispatcherrequestoptions-callback). 73 | 74 | ### `Agent.stream(options, factory[, callback])` 75 | 76 | See [`Dispatcher.stream(options, factory[, callback])`](Dispatcher.md#dispatcherstreamoptions-factory-callback). 77 | 78 | ### `Agent.upgrade(options[, callback])` 79 | 80 | See [`Dispatcher.upgrade(options[, callback])`](Dispatcher.md#dispatcherupgradeoptions-callback). 81 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/BalancedPool.md: -------------------------------------------------------------------------------- 1 | # Class: BalancedPool 2 | 3 | Extends: `undici.Dispatcher` 4 | 5 | A pool of [Pool](Pool.md) instances connected to multiple upstreams. 6 | 7 | Requests are not guaranteed to be dispatched in order of invocation. 8 | 9 | ## `new BalancedPool(upstreams [, options])` 10 | 11 | Arguments: 12 | 13 | * **upstreams** `URL | string | string[]` - It should only include the **protocol, hostname, and port**. 14 | * **options** `BalancedPoolOptions` (optional) 15 | 16 | ### Parameter: `BalancedPoolOptions` 17 | 18 | Extends: [`PoolOptions`](Pool.md#parameter-pooloptions) 19 | 20 | * **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)` 21 | 22 | The `PoolOptions` are passed to each of the `Pool` instances being created. 23 | ## Instance Properties 24 | 25 | ### `BalancedPool.upstreams` 26 | 27 | Returns an array of upstreams that were previously added. 28 | 29 | ### `BalancedPool.closed` 30 | 31 | Implements [Client.closed](Client.md#clientclosed) 32 | 33 | ### `BalancedPool.destroyed` 34 | 35 | Implements [Client.destroyed](Client.md#clientdestroyed) 36 | 37 | ### `Pool.stats` 38 | 39 | Returns [`PoolStats`](PoolStats.md) instance for this pool. 40 | 41 | ## Instance Methods 42 | 43 | ### `BalancedPool.addUpstream(upstream)` 44 | 45 | Add an upstream. 46 | 47 | Arguments: 48 | 49 | * **upstream** `string` - It should only include the **protocol, hostname, and port**. 50 | 51 | ### `BalancedPool.removeUpstream(upstream)` 52 | 53 | Removes an upstream that was previously addded. 54 | 55 | ### `BalancedPool.close([callback])` 56 | 57 | Implements [`Dispatcher.close([callback])`](Dispatcher.md#dispatcherclosecallback-promise). 58 | 59 | ### `BalancedPool.destroy([error, callback])` 60 | 61 | Implements [`Dispatcher.destroy([error, callback])`](Dispatcher.md#dispatcherdestroyerror-callback-promise). 62 | 63 | ### `BalancedPool.connect(options[, callback])` 64 | 65 | See [`Dispatcher.connect(options[, callback])`](Dispatcher.md#dispatcherconnectoptions-callback). 66 | 67 | ### `BalancedPool.dispatch(options, handlers)` 68 | 69 | Implements [`Dispatcher.dispatch(options, handlers)`](Dispatcher.md#dispatcherdispatchoptions-handler). 70 | 71 | ### `BalancedPool.pipeline(options, handler)` 72 | 73 | See [`Dispatcher.pipeline(options, handler)`](Dispatcher.md#dispatcherpipelineoptions-handler). 74 | 75 | ### `BalancedPool.request(options[, callback])` 76 | 77 | See [`Dispatcher.request(options [, callback])`](Dispatcher.md#dispatcherrequestoptions-callback). 78 | 79 | ### `BalancedPool.stream(options, factory[, callback])` 80 | 81 | See [`Dispatcher.stream(options, factory[, callback])`](Dispatcher.md#dispatcherstreamoptions-factory-callback). 82 | 83 | ### `BalancedPool.upgrade(options[, callback])` 84 | 85 | See [`Dispatcher.upgrade(options[, callback])`](Dispatcher.md#dispatcherupgradeoptions-callback). 86 | 87 | ## Instance Events 88 | 89 | ### Event: `'connect'` 90 | 91 | See [Dispatcher Event: `'connect'`](Dispatcher.md#event-connect). 92 | 93 | ### Event: `'disconnect'` 94 | 95 | See [Dispatcher Event: `'disconnect'`](Dispatcher.md#event-disconnect). 96 | 97 | ### Event: `'drain'` 98 | 99 | See [Dispatcher Event: `'drain'`](Dispatcher.md#event-drain). 100 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/CacheStorage.md: -------------------------------------------------------------------------------- 1 | # CacheStorage 2 | 3 | Undici exposes a W3C spec-compliant implementation of [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) and [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache). 4 | 5 | ## Opening a Cache 6 | 7 | Undici exports a top-level CacheStorage instance. You can open a new Cache, or duplicate a Cache with an existing name, by using `CacheStorage.prototype.open`. If you open a Cache with the same name as an already-existing Cache, its list of cached Responses will be shared between both instances. 8 | 9 | ```mjs 10 | import { caches } from 'undici' 11 | 12 | const cache_1 = await caches.open('v1') 13 | const cache_2 = await caches.open('v1') 14 | 15 | // Although .open() creates a new instance, 16 | assert(cache_1 !== cache_2) 17 | // The same Response is matched in both. 18 | assert.deepStrictEqual(await cache_1.match('/req'), await cache_2.match('/req')) 19 | ``` 20 | 21 | ## Deleting a Cache 22 | 23 | If a Cache is deleted, the cached Responses/Requests can still be used. 24 | 25 | ```mjs 26 | const response = await cache_1.match('/req') 27 | await caches.delete('v1') 28 | 29 | await response.text() // the Response's body 30 | ``` 31 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/ContentType.md: -------------------------------------------------------------------------------- 1 | # MIME Type Parsing 2 | 3 | ## `MIMEType` interface 4 | 5 | * **type** `string` 6 | * **subtype** `string` 7 | * **parameters** `Map` 8 | * **essence** `string` 9 | 10 | ## `parseMIMEType(input)` 11 | 12 | Implements [parse a MIME type](https://mimesniff.spec.whatwg.org/#parse-a-mime-type). 13 | 14 | Parses a MIME type, returning its type, subtype, and any associated parameters. If the parser can't parse an input it returns the string literal `'failure'`. 15 | 16 | ```js 17 | import { parseMIMEType } from 'undici' 18 | 19 | parseMIMEType('text/html; charset=gbk') 20 | // { 21 | // type: 'text', 22 | // subtype: 'html', 23 | // parameters: Map(1) { 'charset' => 'gbk' }, 24 | // essence: 'text/html' 25 | // } 26 | ``` 27 | 28 | Arguments: 29 | 30 | * **input** `string` 31 | 32 | Returns: `MIMEType|'failure'` 33 | 34 | ## `serializeAMimeType(input)` 35 | 36 | Implements [serialize a MIME type](https://mimesniff.spec.whatwg.org/#serialize-a-mime-type). 37 | 38 | Serializes a MIMEType object. 39 | 40 | ```js 41 | import { serializeAMimeType } from 'undici' 42 | 43 | serializeAMimeType({ 44 | type: 'text', 45 | subtype: 'html', 46 | parameters: new Map([['charset', 'gbk']]), 47 | essence: 'text/html' 48 | }) 49 | // text/html;charset=gbk 50 | 51 | ``` 52 | 53 | Arguments: 54 | 55 | * **mimeType** `MIMEType` 56 | 57 | Returns: `string` 58 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/Cookies.md: -------------------------------------------------------------------------------- 1 | # Cookie Handling 2 | 3 | ## `Cookie` interface 4 | 5 | * **name** `string` 6 | * **value** `string` 7 | * **expires** `Date|number` (optional) 8 | * **maxAge** `number` (optional) 9 | * **domain** `string` (optional) 10 | * **path** `string` (optional) 11 | * **secure** `boolean` (optional) 12 | * **httpOnly** `boolean` (optional) 13 | * **sameSite** `'String'|'Lax'|'None'` (optional) 14 | * **unparsed** `string[]` (optional) Left over attributes that weren't parsed. 15 | 16 | ## `deleteCookie(headers, name[, attributes])` 17 | 18 | Sets the expiry time of the cookie to the unix epoch, causing browsers to delete it when received. 19 | 20 | ```js 21 | import { deleteCookie, Headers } from 'undici' 22 | 23 | const headers = new Headers() 24 | deleteCookie(headers, 'name') 25 | 26 | console.log(headers.get('set-cookie')) // name=; Expires=Thu, 01 Jan 1970 00:00:00 GMT 27 | ``` 28 | 29 | Arguments: 30 | 31 | * **headers** `Headers` 32 | * **name** `string` 33 | * **attributes** `{ path?: string, domain?: string }` (optional) 34 | 35 | Returns: `void` 36 | 37 | ## `getCookies(headers)` 38 | 39 | Parses the `Cookie` header and returns a list of attributes and values. 40 | 41 | ```js 42 | import { getCookies, Headers } from 'undici' 43 | 44 | const headers = new Headers({ 45 | cookie: 'get=cookies; and=attributes' 46 | }) 47 | 48 | console.log(getCookies(headers)) // { get: 'cookies', and: 'attributes' } 49 | ``` 50 | 51 | Arguments: 52 | 53 | * **headers** `Headers` 54 | 55 | Returns: `Record` 56 | 57 | ## `getSetCookies(headers)` 58 | 59 | Parses all `Set-Cookie` headers. 60 | 61 | ```js 62 | import { getSetCookies, Headers } from 'undici' 63 | 64 | const headers = new Headers({ 'set-cookie': 'undici=getSetCookies; Secure' }) 65 | 66 | console.log(getSetCookies(headers)) 67 | // [ 68 | // { 69 | // name: 'undici', 70 | // value: 'getSetCookies', 71 | // secure: true 72 | // } 73 | // ] 74 | 75 | ``` 76 | 77 | Arguments: 78 | 79 | * **headers** `Headers` 80 | 81 | Returns: `Cookie[]` 82 | 83 | ## `setCookie(headers, cookie)` 84 | 85 | Appends a cookie to the `Set-Cookie` header. 86 | 87 | ```js 88 | import { setCookie, Headers } from 'undici' 89 | 90 | const headers = new Headers() 91 | setCookie(headers, { name: 'undici', value: 'setCookie' }) 92 | 93 | console.log(headers.get('Set-Cookie')) // undici=setCookie 94 | ``` 95 | 96 | Arguments: 97 | 98 | * **headers** `Headers` 99 | * **cookie** `Cookie` 100 | 101 | Returns: `void` 102 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/DispatchInterceptor.md: -------------------------------------------------------------------------------- 1 | # Interface: DispatchInterceptor 2 | 3 | Extends: `Function` 4 | 5 | A function that can be applied to the `Dispatcher.Dispatch` function before it is invoked with a dispatch request. 6 | 7 | This allows one to write logic to intercept both the outgoing request, and the incoming response. 8 | 9 | ### Parameter: `Dispatcher.Dispatch` 10 | 11 | The base dispatch function you are decorating. 12 | 13 | ### ReturnType: `Dispatcher.Dispatch` 14 | 15 | A dispatch function that has been altered to provide additional logic 16 | 17 | ### Basic Example 18 | 19 | Here is an example of an interceptor being used to provide a JWT bearer token 20 | 21 | ```js 22 | 'use strict' 23 | 24 | const insertHeaderInterceptor = dispatch => { 25 | return function InterceptedDispatch(opts, handler){ 26 | opts.headers.push('Authorization', 'Bearer [Some token]') 27 | return dispatch(opts, handler) 28 | } 29 | } 30 | 31 | const client = new Client('https://localhost:3000', { 32 | interceptors: { Client: [insertHeaderInterceptor] } 33 | }) 34 | 35 | ``` 36 | 37 | ### Basic Example 2 38 | 39 | Here is a contrived example of an interceptor stripping the headers from a response. 40 | 41 | ```js 42 | 'use strict' 43 | 44 | const clearHeadersInterceptor = dispatch => { 45 | const { DecoratorHandler } = require('undici') 46 | class ResultInterceptor extends DecoratorHandler { 47 | onHeaders (statusCode, headers, resume) { 48 | return super.onHeaders(statusCode, [], resume) 49 | } 50 | } 51 | return function InterceptedDispatch(opts, handler){ 52 | return dispatch(opts, new ResultInterceptor(handler)) 53 | } 54 | } 55 | 56 | const client = new Client('https://localhost:3000', { 57 | interceptors: { Client: [clearHeadersInterceptor] } 58 | }) 59 | 60 | ``` 61 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/Errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | Undici exposes a variety of error objects that you can use to enhance your error handling. 4 | You can find all the error objects inside the `errors` key. 5 | 6 | ```js 7 | import { errors } from 'undici' 8 | ``` 9 | 10 | | Error | Error Codes | Description | 11 | | ------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------- | 12 | | `UndiciError` | `UND_ERR` | all errors below are extended from `UndiciError`. | 13 | | `ConnectTimeoutError` | `UND_ERR_CONNECT_TIMEOUT` | socket is destroyed due to connect timeout. | 14 | | `HeadersTimeoutError` | `UND_ERR_HEADERS_TIMEOUT` | socket is destroyed due to headers timeout. | 15 | | `HeadersOverflowError` | `UND_ERR_HEADERS_OVERFLOW` | socket is destroyed due to headers' max size being exceeded. | 16 | | `BodyTimeoutError` | `UND_ERR_BODY_TIMEOUT` | socket is destroyed due to body timeout. | 17 | | `ResponseStatusCodeError` | `UND_ERR_RESPONSE_STATUS_CODE` | an error is thrown when `throwOnError` is `true` for status codes >= 400. | 18 | | `InvalidArgumentError` | `UND_ERR_INVALID_ARG` | passed an invalid argument. | 19 | | `InvalidReturnValueError` | `UND_ERR_INVALID_RETURN_VALUE` | returned an invalid value. | 20 | | `RequestAbortedError` | `UND_ERR_ABORTED` | the request has been aborted by the user | 21 | | `ClientDestroyedError` | `UND_ERR_DESTROYED` | trying to use a destroyed client. | 22 | | `ClientClosedError` | `UND_ERR_CLOSED` | trying to use a closed client. | 23 | | `SocketError` | `UND_ERR_SOCKET` | there is an error with the socket. | 24 | | `NotSupportedError` | `UND_ERR_NOT_SUPPORTED` | encountered unsupported functionality. | 25 | | `RequestContentLengthMismatchError` | `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH` | request body does not match content-length header | 26 | | `ResponseContentLengthMismatchError` | `UND_ERR_RES_CONTENT_LENGTH_MISMATCH` | response body does not match content-length header | 27 | | `InformationalError` | `UND_ERR_INFO` | expected error with reason | 28 | | `ResponseExceededMaxSizeError` | `UND_ERR_RES_EXCEEDED_MAX_SIZE` | response body exceed the max size allowed | 29 | 30 | ### `SocketError` 31 | 32 | The `SocketError` has a `.socket` property which holds socket metadata: 33 | 34 | ```ts 35 | interface SocketInfo { 36 | localAddress?: string 37 | localPort?: number 38 | remoteAddress?: string 39 | remotePort?: number 40 | remoteFamily?: string 41 | timeout?: number 42 | bytesWritten?: number 43 | bytesRead?: number 44 | } 45 | ``` 46 | 47 | Be aware that in some cases the `.socket` property can be `null`. 48 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/Fetch.md: -------------------------------------------------------------------------------- 1 | # Fetch 2 | 3 | Undici exposes a fetch() method starts the process of fetching a resource from the network. 4 | 5 | Documentation and examples can be found on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/fetch). 6 | 7 | ## File 8 | 9 | This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/File) 10 | 11 | In Node versions v18.13.0 and above and v19.2.0 and above, undici will default to using Node's [File](https://nodejs.org/api/buffer.html#class-file) class. In versions where it's not available, it will default to the undici one. 12 | 13 | ## FormData 14 | 15 | This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/FormData) 16 | 17 | ## Response 18 | 19 | This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Response) 20 | 21 | ## Request 22 | 23 | This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Request) 24 | 25 | ## Header 26 | 27 | This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Headers) 28 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/MockClient.md: -------------------------------------------------------------------------------- 1 | # Class: MockClient 2 | 3 | Extends: `undici.Client` 4 | 5 | A mock client class that implements the same api as [MockPool](MockPool.md). 6 | 7 | ## `new MockClient(origin, [options])` 8 | 9 | Arguments: 10 | 11 | * **origin** `string` - It should only include the **protocol, hostname, and port**. 12 | * **options** `MockClientOptions` - It extends the `Client` options. 13 | 14 | Returns: `MockClient` 15 | 16 | ### Parameter: `MockClientOptions` 17 | 18 | Extends: `ClientOptions` 19 | 20 | * **agent** `Agent` - the agent to associate this MockClient with. 21 | 22 | ### Example - Basic MockClient instantiation 23 | 24 | We can use MockAgent to instantiate a MockClient ready to be used to intercept specified requests. It will not do anything until registered as the agent to use and any mock request are registered. 25 | 26 | ```js 27 | import { MockAgent } from 'undici' 28 | 29 | // Connections must be set to 1 to return a MockClient instance 30 | const mockAgent = new MockAgent({ connections: 1 }) 31 | 32 | const mockClient = mockAgent.get('http://localhost:3000') 33 | ``` 34 | 35 | ## Instance Methods 36 | 37 | ### `MockClient.intercept(options)` 38 | 39 | Implements: [`MockPool.intercept(options)`](MockPool.md#mockpoolinterceptoptions) 40 | 41 | ### `MockClient.close()` 42 | 43 | Implements: [`MockPool.close()`](MockPool.md#mockpoolclose) 44 | 45 | ### `MockClient.dispatch(options, handlers)` 46 | 47 | Implements [`Dispatcher.dispatch(options, handlers)`](Dispatcher.md#dispatcherdispatchoptions-handler). 48 | 49 | ### `MockClient.request(options[, callback])` 50 | 51 | See [`Dispatcher.request(options [, callback])`](Dispatcher.md#dispatcherrequestoptions-callback). 52 | 53 | #### Example - MockClient request 54 | 55 | ```js 56 | import { MockAgent } from 'undici' 57 | 58 | const mockAgent = new MockAgent({ connections: 1 }) 59 | 60 | const mockClient = mockAgent.get('http://localhost:3000') 61 | mockClient.intercept({ path: '/foo' }).reply(200, 'foo') 62 | 63 | const { 64 | statusCode, 65 | body 66 | } = await mockClient.request({ 67 | origin: 'http://localhost:3000', 68 | path: '/foo', 69 | method: 'GET' 70 | }) 71 | 72 | console.log('response received', statusCode) // response received 200 73 | 74 | for await (const data of body) { 75 | console.log('data', data.toString('utf8')) // data foo 76 | } 77 | ``` 78 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/MockErrors.md: -------------------------------------------------------------------------------- 1 | # MockErrors 2 | 3 | Undici exposes a variety of mock error objects that you can use to enhance your mock error handling. 4 | You can find all the mock error objects inside the `mockErrors` key. 5 | 6 | ```js 7 | import { mockErrors } from 'undici' 8 | ``` 9 | 10 | | Mock Error | Mock Error Codes | Description | 11 | | --------------------- | ------------------------------- | ---------------------------------------------------------- | 12 | | `MockNotMatchedError` | `UND_MOCK_ERR_MOCK_NOT_MATCHED` | The request does not match any registered mock dispatches. | 13 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/Pool.md: -------------------------------------------------------------------------------- 1 | # Class: Pool 2 | 3 | Extends: `undici.Dispatcher` 4 | 5 | A pool of [Client](Client.md) instances connected to the same upstream target. 6 | 7 | Requests are not guaranteed to be dispatched in order of invocation. 8 | 9 | ## `new Pool(url[, options])` 10 | 11 | Arguments: 12 | 13 | * **url** `URL | string` - It should only include the **protocol, hostname, and port**. 14 | * **options** `PoolOptions` (optional) 15 | 16 | ### Parameter: `PoolOptions` 17 | 18 | Extends: [`ClientOptions`](Client.md#parameter-clientoptions) 19 | 20 | * **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Client(origin, opts)` 21 | * **connections** `number | null` (optional) - Default: `null` - The number of `Client` instances to create. When set to `null`, the `Pool` instance will create an unlimited amount of `Client` instances. 22 | * **interceptors** `{ Pool: DispatchInterceptor[] } }` - Default: `{ Pool: [] }` - A list of interceptors that are applied to the dispatch method. Additional logic can be applied (such as, but not limited to: 302 status code handling, authentication, cookies, compression and caching). 23 | 24 | ## Instance Properties 25 | 26 | ### `Pool.closed` 27 | 28 | Implements [Client.closed](Client.md#clientclosed) 29 | 30 | ### `Pool.destroyed` 31 | 32 | Implements [Client.destroyed](Client.md#clientdestroyed) 33 | 34 | ### `Pool.stats` 35 | 36 | Returns [`PoolStats`](PoolStats.md) instance for this pool. 37 | 38 | ## Instance Methods 39 | 40 | ### `Pool.close([callback])` 41 | 42 | Implements [`Dispatcher.close([callback])`](Dispatcher.md#dispatcherclosecallback-promise). 43 | 44 | ### `Pool.destroy([error, callback])` 45 | 46 | Implements [`Dispatcher.destroy([error, callback])`](Dispatcher.md#dispatcherdestroyerror-callback-promise). 47 | 48 | ### `Pool.connect(options[, callback])` 49 | 50 | See [`Dispatcher.connect(options[, callback])`](Dispatcher.md#dispatcherconnectoptions-callback). 51 | 52 | ### `Pool.dispatch(options, handler)` 53 | 54 | Implements [`Dispatcher.dispatch(options, handler)`](Dispatcher.md#dispatcherdispatchoptions-handler). 55 | 56 | ### `Pool.pipeline(options, handler)` 57 | 58 | See [`Dispatcher.pipeline(options, handler)`](Dispatcher.md#dispatcherpipelineoptions-handler). 59 | 60 | ### `Pool.request(options[, callback])` 61 | 62 | See [`Dispatcher.request(options [, callback])`](Dispatcher.md#dispatcherrequestoptions-callback). 63 | 64 | ### `Pool.stream(options, factory[, callback])` 65 | 66 | See [`Dispatcher.stream(options, factory[, callback])`](Dispatcher.md#dispatcherstreamoptions-factory-callback). 67 | 68 | ### `Pool.upgrade(options[, callback])` 69 | 70 | See [`Dispatcher.upgrade(options[, callback])`](Dispatcher.md#dispatcherupgradeoptions-callback). 71 | 72 | ## Instance Events 73 | 74 | ### Event: `'connect'` 75 | 76 | See [Dispatcher Event: `'connect'`](Dispatcher.md#event-connect). 77 | 78 | ### Event: `'disconnect'` 79 | 80 | See [Dispatcher Event: `'disconnect'`](Dispatcher.md#event-disconnect). 81 | 82 | ### Event: `'drain'` 83 | 84 | See [Dispatcher Event: `'drain'`](Dispatcher.md#event-drain). 85 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/PoolStats.md: -------------------------------------------------------------------------------- 1 | # Class: PoolStats 2 | 3 | Aggregate stats for a [Pool](Pool.md) or [BalancedPool](BalancedPool.md). 4 | 5 | ## `new PoolStats(pool)` 6 | 7 | Arguments: 8 | 9 | * **pool** `Pool` - Pool or BalancedPool from which to return stats. 10 | 11 | ## Instance Properties 12 | 13 | ### `PoolStats.connected` 14 | 15 | Number of open socket connections in this pool. 16 | 17 | ### `PoolStats.free` 18 | 19 | Number of open socket connections in this pool that do not have an active request. 20 | 21 | ### `PoolStats.pending` 22 | 23 | Number of pending requests across all clients in this pool. 24 | 25 | ### `PoolStats.queued` 26 | 27 | Number of queued requests across all clients in this pool. 28 | 29 | ### `PoolStats.running` 30 | 31 | Number of currently active requests across all clients in this pool. 32 | 33 | ### `PoolStats.size` 34 | 35 | Number of active, pending, or queued requests across all clients in this pool. 36 | -------------------------------------------------------------------------------- /node_modules/undici/docs/api/WebSocket.md: -------------------------------------------------------------------------------- 1 | # Class: WebSocket 2 | 3 | > ⚠️ Warning: the WebSocket API is experimental. 4 | 5 | Extends: [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) 6 | 7 | The WebSocket object provides a way to manage a WebSocket connection to a server, allowing bidirectional communication. The API follows the [WebSocket spec](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) and [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455). 8 | 9 | ## `new WebSocket(url[, protocol])` 10 | 11 | Arguments: 12 | 13 | * **url** `URL | string` - The url's protocol *must* be `ws` or `wss`. 14 | * **protocol** `string | string[] | WebSocketInit` (optional) - Subprotocol(s) to request the server use, or a [`Dispatcher`](./Dispatcher.md). 15 | 16 | ### Example: 17 | 18 | This example will not work in browsers or other platforms that don't allow passing an object. 19 | 20 | ```mjs 21 | import { WebSocket, ProxyAgent } from 'undici' 22 | 23 | const proxyAgent = new ProxyAgent('my.proxy.server') 24 | 25 | const ws = new WebSocket('wss://echo.websocket.events', { 26 | dispatcher: proxyAgent, 27 | protocols: ['echo', 'chat'] 28 | }) 29 | ``` 30 | 31 | If you do not need a custom Dispatcher, it's recommended to use the following pattern: 32 | 33 | ```mjs 34 | import { WebSocket } from 'undici' 35 | 36 | const ws = new WebSocket('wss://echo.websocket.events', ['echo', 'chat']) 37 | ``` 38 | 39 | ## Read More 40 | 41 | - [MDN - WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) 42 | - [The WebSocket Specification](https://www.rfc-editor.org/rfc/rfc6455) 43 | - [The WHATWG WebSocket Specification](https://websockets.spec.whatwg.org/) 44 | -------------------------------------------------------------------------------- /node_modules/undici/docs/assets/lifecycle-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leotaku/elisp-check/cbcda75256a9195b5e6d7e6fa39390b32e08a4f3/node_modules/undici/docs/assets/lifecycle-diagram.png -------------------------------------------------------------------------------- /node_modules/undici/docs/best-practices/client-certificate.md: -------------------------------------------------------------------------------- 1 | # Client certificate 2 | 3 | Client certificate authentication can be configured with the `Client`, the required options are passed along through the `connect` option. 4 | 5 | The client certificates must be signed by a trusted CA. The Node.js default is to trust the well-known CAs curated by Mozilla. 6 | 7 | Setting the server option `requestCert: true` tells the server to request the client certificate. 8 | 9 | The server option `rejectUnauthorized: false` allows us to handle any invalid certificate errors in client code. The `authorized` property on the socket of the incoming request will show if the client certificate was valid. The `authorizationError` property will give the reason if the certificate was not valid. 10 | 11 | ### Client Certificate Authentication 12 | 13 | ```js 14 | const { readFileSync } = require('fs') 15 | const { join } = require('path') 16 | const { createServer } = require('https') 17 | const { Client } = require('undici') 18 | 19 | const serverOptions = { 20 | ca: [ 21 | readFileSync(join(__dirname, 'client-ca-crt.pem'), 'utf8') 22 | ], 23 | key: readFileSync(join(__dirname, 'server-key.pem'), 'utf8'), 24 | cert: readFileSync(join(__dirname, 'server-crt.pem'), 'utf8'), 25 | requestCert: true, 26 | rejectUnauthorized: false 27 | } 28 | 29 | const server = createServer(serverOptions, (req, res) => { 30 | // true if client cert is valid 31 | if(req.client.authorized === true) { 32 | console.log('valid') 33 | } else { 34 | console.error(req.client.authorizationError) 35 | } 36 | res.end() 37 | }) 38 | 39 | server.listen(0, function () { 40 | const tls = { 41 | ca: [ 42 | readFileSync(join(__dirname, 'server-ca-crt.pem'), 'utf8') 43 | ], 44 | key: readFileSync(join(__dirname, 'client-key.pem'), 'utf8'), 45 | cert: readFileSync(join(__dirname, 'client-crt.pem'), 'utf8'), 46 | rejectUnauthorized: false, 47 | servername: 'agent1' 48 | } 49 | const client = new Client(`https://localhost:${server.address().port}`, { 50 | connect: tls 51 | }) 52 | 53 | client.request({ 54 | path: '/', 55 | method: 'GET' 56 | }, (err, { body }) => { 57 | body.on('data', (buf) => {}) 58 | body.on('end', () => { 59 | client.close() 60 | server.close() 61 | }) 62 | }) 63 | }) 64 | ``` 65 | -------------------------------------------------------------------------------- /node_modules/undici/docs/best-practices/writing-tests.md: -------------------------------------------------------------------------------- 1 | # Writing tests 2 | 3 | Undici is tuned for a production use case and its default will keep 4 | a socket open for a few seconds after an HTTP request is completed to 5 | remove the overhead of opening up a new socket. These settings that makes 6 | Undici shine in production are not a good fit for using Undici in automated 7 | tests, as it will result in longer execution times. 8 | 9 | The following are good defaults that will keep the socket open for only 10ms: 10 | 11 | ```js 12 | import { request, setGlobalDispatcher, Agent } from 'undici' 13 | 14 | const agent = new Agent({ 15 | keepAliveTimeout: 10, // milliseconds 16 | keepAliveMaxTimeout: 10 // milliseconds 17 | }) 18 | 19 | setGlobalDispatcher(agent) 20 | ``` 21 | -------------------------------------------------------------------------------- /node_modules/undici/index-fetch.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const fetchImpl = require('./lib/fetch').fetch 4 | 5 | module.exports.fetch = function fetch (resource, init = undefined) { 6 | return fetchImpl(resource, init).catch((err) => { 7 | Error.captureStackTrace(err, this) 8 | throw err 9 | }) 10 | } 11 | module.exports.FormData = require('./lib/fetch/formdata').FormData 12 | module.exports.Headers = require('./lib/fetch/headers').Headers 13 | module.exports.Response = require('./lib/fetch/response').Response 14 | module.exports.Request = require('./lib/fetch/request').Request 15 | module.exports.WebSocket = require('./lib/websocket/websocket').WebSocket 16 | -------------------------------------------------------------------------------- /node_modules/undici/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './types/index' 2 | import Undici from './types/index' 3 | export default Undici 4 | -------------------------------------------------------------------------------- /node_modules/undici/lib/api/abort-signal.js: -------------------------------------------------------------------------------- 1 | const { addAbortListener } = require('../core/util') 2 | const { RequestAbortedError } = require('../core/errors') 3 | 4 | const kListener = Symbol('kListener') 5 | const kSignal = Symbol('kSignal') 6 | 7 | function abort (self) { 8 | if (self.abort) { 9 | self.abort() 10 | } else { 11 | self.onError(new RequestAbortedError()) 12 | } 13 | } 14 | 15 | function addSignal (self, signal) { 16 | self[kSignal] = null 17 | self[kListener] = null 18 | 19 | if (!signal) { 20 | return 21 | } 22 | 23 | if (signal.aborted) { 24 | abort(self) 25 | return 26 | } 27 | 28 | self[kSignal] = signal 29 | self[kListener] = () => { 30 | abort(self) 31 | } 32 | 33 | addAbortListener(self[kSignal], self[kListener]) 34 | } 35 | 36 | function removeSignal (self) { 37 | if (!self[kSignal]) { 38 | return 39 | } 40 | 41 | if ('removeEventListener' in self[kSignal]) { 42 | self[kSignal].removeEventListener('abort', self[kListener]) 43 | } else { 44 | self[kSignal].removeListener('abort', self[kListener]) 45 | } 46 | 47 | self[kSignal] = null 48 | self[kListener] = null 49 | } 50 | 51 | module.exports = { 52 | addSignal, 53 | removeSignal 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/undici/lib/api/api-connect.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { AsyncResource } = require('async_hooks') 4 | const { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors') 5 | const util = require('../core/util') 6 | const { addSignal, removeSignal } = require('./abort-signal') 7 | 8 | class ConnectHandler extends AsyncResource { 9 | constructor (opts, callback) { 10 | if (!opts || typeof opts !== 'object') { 11 | throw new InvalidArgumentError('invalid opts') 12 | } 13 | 14 | if (typeof callback !== 'function') { 15 | throw new InvalidArgumentError('invalid callback') 16 | } 17 | 18 | const { signal, opaque, responseHeaders } = opts 19 | 20 | if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { 21 | throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') 22 | } 23 | 24 | super('UNDICI_CONNECT') 25 | 26 | this.opaque = opaque || null 27 | this.responseHeaders = responseHeaders || null 28 | this.callback = callback 29 | this.abort = null 30 | 31 | addSignal(this, signal) 32 | } 33 | 34 | onConnect (abort, context) { 35 | if (!this.callback) { 36 | throw new RequestAbortedError() 37 | } 38 | 39 | this.abort = abort 40 | this.context = context 41 | } 42 | 43 | onHeaders () { 44 | throw new SocketError('bad connect', null) 45 | } 46 | 47 | onUpgrade (statusCode, rawHeaders, socket) { 48 | const { callback, opaque, context } = this 49 | 50 | removeSignal(this) 51 | 52 | this.callback = null 53 | 54 | let headers = rawHeaders 55 | // Indicates is an HTTP2Session 56 | if (headers != null) { 57 | headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) 58 | } 59 | 60 | this.runInAsyncScope(callback, null, null, { 61 | statusCode, 62 | headers, 63 | socket, 64 | opaque, 65 | context 66 | }) 67 | } 68 | 69 | onError (err) { 70 | const { callback, opaque } = this 71 | 72 | removeSignal(this) 73 | 74 | if (callback) { 75 | this.callback = null 76 | queueMicrotask(() => { 77 | this.runInAsyncScope(callback, null, err, { opaque }) 78 | }) 79 | } 80 | } 81 | } 82 | 83 | function connect (opts, callback) { 84 | if (callback === undefined) { 85 | return new Promise((resolve, reject) => { 86 | connect.call(this, opts, (err, data) => { 87 | return err ? reject(err) : resolve(data) 88 | }) 89 | }) 90 | } 91 | 92 | try { 93 | const connectHandler = new ConnectHandler(opts, callback) 94 | this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) 95 | } catch (err) { 96 | if (typeof callback !== 'function') { 97 | throw err 98 | } 99 | const opaque = opts && opts.opaque 100 | queueMicrotask(() => callback(err, { opaque })) 101 | } 102 | } 103 | 104 | module.exports = connect 105 | -------------------------------------------------------------------------------- /node_modules/undici/lib/api/api-upgrade.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors') 4 | const { AsyncResource } = require('async_hooks') 5 | const util = require('../core/util') 6 | const { addSignal, removeSignal } = require('./abort-signal') 7 | const assert = require('assert') 8 | 9 | class UpgradeHandler extends AsyncResource { 10 | constructor (opts, callback) { 11 | if (!opts || typeof opts !== 'object') { 12 | throw new InvalidArgumentError('invalid opts') 13 | } 14 | 15 | if (typeof callback !== 'function') { 16 | throw new InvalidArgumentError('invalid callback') 17 | } 18 | 19 | const { signal, opaque, responseHeaders } = opts 20 | 21 | if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { 22 | throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') 23 | } 24 | 25 | super('UNDICI_UPGRADE') 26 | 27 | this.responseHeaders = responseHeaders || null 28 | this.opaque = opaque || null 29 | this.callback = callback 30 | this.abort = null 31 | this.context = null 32 | 33 | addSignal(this, signal) 34 | } 35 | 36 | onConnect (abort, context) { 37 | if (!this.callback) { 38 | throw new RequestAbortedError() 39 | } 40 | 41 | this.abort = abort 42 | this.context = null 43 | } 44 | 45 | onHeaders () { 46 | throw new SocketError('bad upgrade', null) 47 | } 48 | 49 | onUpgrade (statusCode, rawHeaders, socket) { 50 | const { callback, opaque, context } = this 51 | 52 | assert.strictEqual(statusCode, 101) 53 | 54 | removeSignal(this) 55 | 56 | this.callback = null 57 | const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) 58 | this.runInAsyncScope(callback, null, null, { 59 | headers, 60 | socket, 61 | opaque, 62 | context 63 | }) 64 | } 65 | 66 | onError (err) { 67 | const { callback, opaque } = this 68 | 69 | removeSignal(this) 70 | 71 | if (callback) { 72 | this.callback = null 73 | queueMicrotask(() => { 74 | this.runInAsyncScope(callback, null, err, { opaque }) 75 | }) 76 | } 77 | } 78 | } 79 | 80 | function upgrade (opts, callback) { 81 | if (callback === undefined) { 82 | return new Promise((resolve, reject) => { 83 | upgrade.call(this, opts, (err, data) => { 84 | return err ? reject(err) : resolve(data) 85 | }) 86 | }) 87 | } 88 | 89 | try { 90 | const upgradeHandler = new UpgradeHandler(opts, callback) 91 | this.dispatch({ 92 | ...opts, 93 | method: opts.method || 'GET', 94 | upgrade: opts.protocol || 'Websocket' 95 | }, upgradeHandler) 96 | } catch (err) { 97 | if (typeof callback !== 'function') { 98 | throw err 99 | } 100 | const opaque = opts && opts.opaque 101 | queueMicrotask(() => callback(err, { opaque })) 102 | } 103 | } 104 | 105 | module.exports = upgrade 106 | -------------------------------------------------------------------------------- /node_modules/undici/lib/api/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports.request = require('./api-request') 4 | module.exports.stream = require('./api-stream') 5 | module.exports.pipeline = require('./api-pipeline') 6 | module.exports.upgrade = require('./api-upgrade') 7 | module.exports.connect = require('./api-connect') 8 | -------------------------------------------------------------------------------- /node_modules/undici/lib/api/util.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert') 2 | const { 3 | ResponseStatusCodeError 4 | } = require('../core/errors') 5 | const { toUSVString } = require('../core/util') 6 | 7 | async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { 8 | assert(body) 9 | 10 | let chunks = [] 11 | let limit = 0 12 | 13 | for await (const chunk of body) { 14 | chunks.push(chunk) 15 | limit += chunk.length 16 | if (limit > 128 * 1024) { 17 | chunks = null 18 | break 19 | } 20 | } 21 | 22 | if (statusCode === 204 || !contentType || !chunks) { 23 | process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) 24 | return 25 | } 26 | 27 | try { 28 | if (contentType.startsWith('application/json')) { 29 | const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) 30 | process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) 31 | return 32 | } 33 | 34 | if (contentType.startsWith('text/')) { 35 | const payload = toUSVString(Buffer.concat(chunks)) 36 | process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) 37 | return 38 | } 39 | } catch (err) { 40 | // Process in a fallback if error 41 | } 42 | 43 | process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) 44 | } 45 | 46 | module.exports = { getResolveErrorBodyCallback } 47 | -------------------------------------------------------------------------------- /node_modules/undici/lib/cache/symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | kConstruct: require('../core/symbols').kConstruct 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/undici/lib/cache/util.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const assert = require('assert') 4 | const { URLSerializer } = require('../fetch/dataURL') 5 | const { isValidHeaderName } = require('../fetch/util') 6 | 7 | /** 8 | * @see https://url.spec.whatwg.org/#concept-url-equals 9 | * @param {URL} A 10 | * @param {URL} B 11 | * @param {boolean | undefined} excludeFragment 12 | * @returns {boolean} 13 | */ 14 | function urlEquals (A, B, excludeFragment = false) { 15 | const serializedA = URLSerializer(A, excludeFragment) 16 | 17 | const serializedB = URLSerializer(B, excludeFragment) 18 | 19 | return serializedA === serializedB 20 | } 21 | 22 | /** 23 | * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 24 | * @param {string} header 25 | */ 26 | function fieldValues (header) { 27 | assert(header !== null) 28 | 29 | const values = [] 30 | 31 | for (let value of header.split(',')) { 32 | value = value.trim() 33 | 34 | if (!value.length) { 35 | continue 36 | } else if (!isValidHeaderName(value)) { 37 | continue 38 | } 39 | 40 | values.push(value) 41 | } 42 | 43 | return values 44 | } 45 | 46 | module.exports = { 47 | urlEquals, 48 | fieldValues 49 | } 50 | -------------------------------------------------------------------------------- /node_modules/undici/lib/compat/dispatcher-weakref.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /* istanbul ignore file: only for Node 12 */ 4 | 5 | const { kConnected, kSize } = require('../core/symbols') 6 | 7 | class CompatWeakRef { 8 | constructor (value) { 9 | this.value = value 10 | } 11 | 12 | deref () { 13 | return this.value[kConnected] === 0 && this.value[kSize] === 0 14 | ? undefined 15 | : this.value 16 | } 17 | } 18 | 19 | class CompatFinalizer { 20 | constructor (finalizer) { 21 | this.finalizer = finalizer 22 | } 23 | 24 | register (dispatcher, key) { 25 | if (dispatcher.on) { 26 | dispatcher.on('disconnect', () => { 27 | if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { 28 | this.finalizer(key) 29 | } 30 | }) 31 | } 32 | } 33 | } 34 | 35 | module.exports = function () { 36 | // FIXME: remove workaround when the Node bug is fixed 37 | // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 38 | if (process.env.NODE_V8_COVERAGE) { 39 | return { 40 | WeakRef: CompatWeakRef, 41 | FinalizationRegistry: CompatFinalizer 42 | } 43 | } 44 | return { 45 | WeakRef: global.WeakRef || CompatWeakRef, 46 | FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /node_modules/undici/lib/cookies/constants.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size 4 | const maxAttributeValueSize = 1024 5 | 6 | // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size 7 | const maxNameValuePairSize = 4096 8 | 9 | module.exports = { 10 | maxAttributeValueSize, 11 | maxNameValuePairSize 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/undici/lib/core/constants.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** @type {Record} */ 4 | const headerNameLowerCasedRecord = {} 5 | 6 | // https://developer.mozilla.org/docs/Web/HTTP/Headers 7 | const wellknownHeaderNames = [ 8 | 'Accept', 9 | 'Accept-Encoding', 10 | 'Accept-Language', 11 | 'Accept-Ranges', 12 | 'Access-Control-Allow-Credentials', 13 | 'Access-Control-Allow-Headers', 14 | 'Access-Control-Allow-Methods', 15 | 'Access-Control-Allow-Origin', 16 | 'Access-Control-Expose-Headers', 17 | 'Access-Control-Max-Age', 18 | 'Access-Control-Request-Headers', 19 | 'Access-Control-Request-Method', 20 | 'Age', 21 | 'Allow', 22 | 'Alt-Svc', 23 | 'Alt-Used', 24 | 'Authorization', 25 | 'Cache-Control', 26 | 'Clear-Site-Data', 27 | 'Connection', 28 | 'Content-Disposition', 29 | 'Content-Encoding', 30 | 'Content-Language', 31 | 'Content-Length', 32 | 'Content-Location', 33 | 'Content-Range', 34 | 'Content-Security-Policy', 35 | 'Content-Security-Policy-Report-Only', 36 | 'Content-Type', 37 | 'Cookie', 38 | 'Cross-Origin-Embedder-Policy', 39 | 'Cross-Origin-Opener-Policy', 40 | 'Cross-Origin-Resource-Policy', 41 | 'Date', 42 | 'Device-Memory', 43 | 'Downlink', 44 | 'ECT', 45 | 'ETag', 46 | 'Expect', 47 | 'Expect-CT', 48 | 'Expires', 49 | 'Forwarded', 50 | 'From', 51 | 'Host', 52 | 'If-Match', 53 | 'If-Modified-Since', 54 | 'If-None-Match', 55 | 'If-Range', 56 | 'If-Unmodified-Since', 57 | 'Keep-Alive', 58 | 'Last-Modified', 59 | 'Link', 60 | 'Location', 61 | 'Max-Forwards', 62 | 'Origin', 63 | 'Permissions-Policy', 64 | 'Pragma', 65 | 'Proxy-Authenticate', 66 | 'Proxy-Authorization', 67 | 'RTT', 68 | 'Range', 69 | 'Referer', 70 | 'Referrer-Policy', 71 | 'Refresh', 72 | 'Retry-After', 73 | 'Sec-WebSocket-Accept', 74 | 'Sec-WebSocket-Extensions', 75 | 'Sec-WebSocket-Key', 76 | 'Sec-WebSocket-Protocol', 77 | 'Sec-WebSocket-Version', 78 | 'Server', 79 | 'Server-Timing', 80 | 'Service-Worker-Allowed', 81 | 'Service-Worker-Navigation-Preload', 82 | 'Set-Cookie', 83 | 'SourceMap', 84 | 'Strict-Transport-Security', 85 | 'Supports-Loading-Mode', 86 | 'TE', 87 | 'Timing-Allow-Origin', 88 | 'Trailer', 89 | 'Transfer-Encoding', 90 | 'Upgrade', 91 | 'Upgrade-Insecure-Requests', 92 | 'User-Agent', 93 | 'Vary', 94 | 'Via', 95 | 'WWW-Authenticate', 96 | 'X-Content-Type-Options', 97 | 'X-DNS-Prefetch-Control', 98 | 'X-Frame-Options', 99 | 'X-Permitted-Cross-Domain-Policies', 100 | 'X-Powered-By', 101 | 'X-Requested-With', 102 | 'X-XSS-Protection' 103 | ] 104 | 105 | for (let i = 0; i < wellknownHeaderNames.length; ++i) { 106 | const key = wellknownHeaderNames[i] 107 | const lowerCasedKey = key.toLowerCase() 108 | headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = 109 | lowerCasedKey 110 | } 111 | 112 | // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. 113 | Object.setPrototypeOf(headerNameLowerCasedRecord, null) 114 | 115 | module.exports = { 116 | wellknownHeaderNames, 117 | headerNameLowerCasedRecord 118 | } 119 | -------------------------------------------------------------------------------- /node_modules/undici/lib/core/symbols.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | kClose: Symbol('close'), 3 | kDestroy: Symbol('destroy'), 4 | kDispatch: Symbol('dispatch'), 5 | kUrl: Symbol('url'), 6 | kWriting: Symbol('writing'), 7 | kResuming: Symbol('resuming'), 8 | kQueue: Symbol('queue'), 9 | kConnect: Symbol('connect'), 10 | kConnecting: Symbol('connecting'), 11 | kHeadersList: Symbol('headers list'), 12 | kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), 13 | kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), 14 | kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), 15 | kKeepAliveTimeoutValue: Symbol('keep alive timeout'), 16 | kKeepAlive: Symbol('keep alive'), 17 | kHeadersTimeout: Symbol('headers timeout'), 18 | kBodyTimeout: Symbol('body timeout'), 19 | kServerName: Symbol('server name'), 20 | kLocalAddress: Symbol('local address'), 21 | kHost: Symbol('host'), 22 | kNoRef: Symbol('no ref'), 23 | kBodyUsed: Symbol('used'), 24 | kRunning: Symbol('running'), 25 | kBlocking: Symbol('blocking'), 26 | kPending: Symbol('pending'), 27 | kSize: Symbol('size'), 28 | kBusy: Symbol('busy'), 29 | kQueued: Symbol('queued'), 30 | kFree: Symbol('free'), 31 | kConnected: Symbol('connected'), 32 | kClosed: Symbol('closed'), 33 | kNeedDrain: Symbol('need drain'), 34 | kReset: Symbol('reset'), 35 | kDestroyed: Symbol.for('nodejs.stream.destroyed'), 36 | kMaxHeadersSize: Symbol('max headers size'), 37 | kRunningIdx: Symbol('running index'), 38 | kPendingIdx: Symbol('pending index'), 39 | kError: Symbol('error'), 40 | kClients: Symbol('clients'), 41 | kClient: Symbol('client'), 42 | kParser: Symbol('parser'), 43 | kOnDestroyed: Symbol('destroy callbacks'), 44 | kPipelining: Symbol('pipelining'), 45 | kSocket: Symbol('socket'), 46 | kHostHeader: Symbol('host header'), 47 | kConnector: Symbol('connector'), 48 | kStrictContentLength: Symbol('strict content length'), 49 | kMaxRedirections: Symbol('maxRedirections'), 50 | kMaxRequests: Symbol('maxRequestsPerClient'), 51 | kProxy: Symbol('proxy agent options'), 52 | kCounter: Symbol('socket request counter'), 53 | kInterceptors: Symbol('dispatch interceptors'), 54 | kMaxResponseSize: Symbol('max response size'), 55 | kHTTP2Session: Symbol('http2Session'), 56 | kHTTP2SessionState: Symbol('http2Session state'), 57 | kHTTP2BuildRequest: Symbol('http2 build request'), 58 | kHTTP1BuildRequest: Symbol('http1 build request'), 59 | kHTTP2CopyHeaders: Symbol('http2 copy headers'), 60 | kHTTPConnVersion: Symbol('http connection version'), 61 | kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), 62 | kConstruct: Symbol('constructable') 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/undici/lib/dispatcher.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const EventEmitter = require('events') 4 | 5 | class Dispatcher extends EventEmitter { 6 | dispatch () { 7 | throw new Error('not implemented') 8 | } 9 | 10 | close () { 11 | throw new Error('not implemented') 12 | } 13 | 14 | destroy () { 15 | throw new Error('not implemented') 16 | } 17 | } 18 | 19 | module.exports = Dispatcher 20 | -------------------------------------------------------------------------------- /node_modules/undici/lib/fetch/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ethan Arrowood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/undici/lib/fetch/global.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // In case of breaking changes, increase the version 4 | // number to avoid conflicts. 5 | const globalOrigin = Symbol.for('undici.globalOrigin.1') 6 | 7 | function getGlobalOrigin () { 8 | return globalThis[globalOrigin] 9 | } 10 | 11 | function setGlobalOrigin (newOrigin) { 12 | if (newOrigin === undefined) { 13 | Object.defineProperty(globalThis, globalOrigin, { 14 | value: undefined, 15 | writable: true, 16 | enumerable: false, 17 | configurable: false 18 | }) 19 | 20 | return 21 | } 22 | 23 | const parsedURL = new URL(newOrigin) 24 | 25 | if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { 26 | throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) 27 | } 28 | 29 | Object.defineProperty(globalThis, globalOrigin, { 30 | value: parsedURL, 31 | writable: true, 32 | enumerable: false, 33 | configurable: false 34 | }) 35 | } 36 | 37 | module.exports = { 38 | getGlobalOrigin, 39 | setGlobalOrigin 40 | } 41 | -------------------------------------------------------------------------------- /node_modules/undici/lib/fetch/symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | kUrl: Symbol('url'), 5 | kHeaders: Symbol('headers'), 6 | kSignal: Symbol('signal'), 7 | kState: Symbol('state'), 8 | kGuard: Symbol('guard'), 9 | kRealm: Symbol('realm') 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/undici/lib/fileapi/progressevent.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { webidl } = require('../fetch/webidl') 4 | 5 | const kState = Symbol('ProgressEvent state') 6 | 7 | /** 8 | * @see https://xhr.spec.whatwg.org/#progressevent 9 | */ 10 | class ProgressEvent extends Event { 11 | constructor (type, eventInitDict = {}) { 12 | type = webidl.converters.DOMString(type) 13 | eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) 14 | 15 | super(type, eventInitDict) 16 | 17 | this[kState] = { 18 | lengthComputable: eventInitDict.lengthComputable, 19 | loaded: eventInitDict.loaded, 20 | total: eventInitDict.total 21 | } 22 | } 23 | 24 | get lengthComputable () { 25 | webidl.brandCheck(this, ProgressEvent) 26 | 27 | return this[kState].lengthComputable 28 | } 29 | 30 | get loaded () { 31 | webidl.brandCheck(this, ProgressEvent) 32 | 33 | return this[kState].loaded 34 | } 35 | 36 | get total () { 37 | webidl.brandCheck(this, ProgressEvent) 38 | 39 | return this[kState].total 40 | } 41 | } 42 | 43 | webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ 44 | { 45 | key: 'lengthComputable', 46 | converter: webidl.converters.boolean, 47 | defaultValue: false 48 | }, 49 | { 50 | key: 'loaded', 51 | converter: webidl.converters['unsigned long long'], 52 | defaultValue: 0 53 | }, 54 | { 55 | key: 'total', 56 | converter: webidl.converters['unsigned long long'], 57 | defaultValue: 0 58 | }, 59 | { 60 | key: 'bubbles', 61 | converter: webidl.converters.boolean, 62 | defaultValue: false 63 | }, 64 | { 65 | key: 'cancelable', 66 | converter: webidl.converters.boolean, 67 | defaultValue: false 68 | }, 69 | { 70 | key: 'composed', 71 | converter: webidl.converters.boolean, 72 | defaultValue: false 73 | } 74 | ]) 75 | 76 | module.exports = { 77 | ProgressEvent 78 | } 79 | -------------------------------------------------------------------------------- /node_modules/undici/lib/fileapi/symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | kState: Symbol('FileReader state'), 5 | kResult: Symbol('FileReader result'), 6 | kError: Symbol('FileReader error'), 7 | kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), 8 | kEvents: Symbol('FileReader events'), 9 | kAborted: Symbol('FileReader aborted') 10 | } 11 | -------------------------------------------------------------------------------- /node_modules/undici/lib/global.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // We include a version number for the Dispatcher API. In case of breaking changes, 4 | // this version number must be increased to avoid conflicts. 5 | const globalDispatcher = Symbol.for('undici.globalDispatcher.1') 6 | const { InvalidArgumentError } = require('./core/errors') 7 | const Agent = require('./agent') 8 | 9 | if (getGlobalDispatcher() === undefined) { 10 | setGlobalDispatcher(new Agent()) 11 | } 12 | 13 | function setGlobalDispatcher (agent) { 14 | if (!agent || typeof agent.dispatch !== 'function') { 15 | throw new InvalidArgumentError('Argument agent must implement Agent') 16 | } 17 | Object.defineProperty(globalThis, globalDispatcher, { 18 | value: agent, 19 | writable: true, 20 | enumerable: false, 21 | configurable: false 22 | }) 23 | } 24 | 25 | function getGlobalDispatcher () { 26 | return globalThis[globalDispatcher] 27 | } 28 | 29 | module.exports = { 30 | setGlobalDispatcher, 31 | getGlobalDispatcher 32 | } 33 | -------------------------------------------------------------------------------- /node_modules/undici/lib/handler/DecoratorHandler.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = class DecoratorHandler { 4 | constructor (handler) { 5 | this.handler = handler 6 | } 7 | 8 | onConnect (...args) { 9 | return this.handler.onConnect(...args) 10 | } 11 | 12 | onError (...args) { 13 | return this.handler.onError(...args) 14 | } 15 | 16 | onUpgrade (...args) { 17 | return this.handler.onUpgrade(...args) 18 | } 19 | 20 | onHeaders (...args) { 21 | return this.handler.onHeaders(...args) 22 | } 23 | 24 | onData (...args) { 25 | return this.handler.onData(...args) 26 | } 27 | 28 | onComplete (...args) { 29 | return this.handler.onComplete(...args) 30 | } 31 | 32 | onBodySent (...args) { 33 | return this.handler.onBodySent(...args) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /node_modules/undici/lib/interceptor/redirectInterceptor.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const RedirectHandler = require('../handler/RedirectHandler') 4 | 5 | function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { 6 | return (dispatch) => { 7 | return function Intercept (opts, handler) { 8 | const { maxRedirections = defaultMaxRedirections } = opts 9 | 10 | if (!maxRedirections) { 11 | return dispatch(opts, handler) 12 | } 13 | 14 | const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) 15 | opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. 16 | return dispatch(opts, redirectHandler) 17 | } 18 | } 19 | } 20 | 21 | module.exports = createRedirectInterceptor 22 | -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/llhttp.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leotaku/elisp-check/cbcda75256a9195b5e6d7e6fa39390b32e08a4f3/node_modules/undici/lib/llhttp/llhttp.wasm -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/llhttp_simd.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leotaku/elisp-check/cbcda75256a9195b5e6d7e6fa39390b32e08a4f3/node_modules/undici/lib/llhttp/llhttp_simd.wasm -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/utils.d.ts: -------------------------------------------------------------------------------- 1 | export interface IEnumMap { 2 | [key: string]: number; 3 | } 4 | export declare function enumToMap(obj: any): IEnumMap; 5 | -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.enumToMap = void 0; 4 | function enumToMap(obj) { 5 | const res = {}; 6 | Object.keys(obj).forEach((key) => { 7 | const value = obj[key]; 8 | if (typeof value === 'number') { 9 | res[key] = value; 10 | } 11 | }); 12 | return res; 13 | } 14 | exports.enumToMap = enumToMap; 15 | //# sourceMappingURL=utils.js.map -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/llhttp/utils.ts"],"names":[],"mappings":";;;AAIA,SAAgB,SAAS,CAAC,GAAQ;IAChC,MAAM,GAAG,GAAa,EAAE,CAAC;IAEzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAClB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AAXD,8BAWC"} -------------------------------------------------------------------------------- /node_modules/undici/lib/llhttp/wasm_build_env.txt: -------------------------------------------------------------------------------- 1 | alpine-baselayout-data-3.4.0-r0 2 | musl-1.2.3-r4 3 | busybox-1.35.0-r29 4 | busybox-binsh-1.35.0-r29 5 | alpine-baselayout-3.4.0-r0 6 | alpine-keys-2.4-r1 7 | ca-certificates-bundle-20220614-r4 8 | libcrypto3-3.0.8-r3 9 | libssl3-3.0.8-r3 10 | ssl_client-1.35.0-r29 11 | zlib-1.2.13-r0 12 | apk-tools-2.12.10-r1 13 | scanelf-1.3.5-r1 14 | musl-utils-1.2.3-r4 15 | libc-utils-0.7.2-r3 16 | libgcc-12.2.1_git20220924-r4 17 | libstdc++-12.2.1_git20220924-r4 18 | libffi-3.4.4-r0 19 | xz-libs-5.2.9-r0 20 | libxml2-2.10.4-r0 21 | zstd-libs-1.5.5-r0 22 | llvm15-libs-15.0.7-r0 23 | clang15-libs-15.0.7-r0 24 | libstdc++-dev-12.2.1_git20220924-r4 25 | clang15-15.0.7-r0 26 | lld-libs-15.0.7-r0 27 | lld-15.0.7-r0 28 | wasi-libc-0.20220525-r1 29 | wasi-libcxx-15.0.7-r0 30 | wasi-libcxxabi-15.0.7-r0 31 | wasi-compiler-rt-15.0.7-r0 32 | wasi-sdk-16-r0 33 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/mock-client.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { promisify } = require('util') 4 | const Client = require('../client') 5 | const { buildMockDispatch } = require('./mock-utils') 6 | const { 7 | kDispatches, 8 | kMockAgent, 9 | kClose, 10 | kOriginalClose, 11 | kOrigin, 12 | kOriginalDispatch, 13 | kConnected 14 | } = require('./mock-symbols') 15 | const { MockInterceptor } = require('./mock-interceptor') 16 | const Symbols = require('../core/symbols') 17 | const { InvalidArgumentError } = require('../core/errors') 18 | 19 | /** 20 | * MockClient provides an API that extends the Client to influence the mockDispatches. 21 | */ 22 | class MockClient extends Client { 23 | constructor (origin, opts) { 24 | super(origin, opts) 25 | 26 | if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { 27 | throw new InvalidArgumentError('Argument opts.agent must implement Agent') 28 | } 29 | 30 | this[kMockAgent] = opts.agent 31 | this[kOrigin] = origin 32 | this[kDispatches] = [] 33 | this[kConnected] = 1 34 | this[kOriginalDispatch] = this.dispatch 35 | this[kOriginalClose] = this.close.bind(this) 36 | 37 | this.dispatch = buildMockDispatch.call(this) 38 | this.close = this[kClose] 39 | } 40 | 41 | get [Symbols.kConnected] () { 42 | return this[kConnected] 43 | } 44 | 45 | /** 46 | * Sets up the base interceptor for mocking replies from undici. 47 | */ 48 | intercept (opts) { 49 | return new MockInterceptor(opts, this[kDispatches]) 50 | } 51 | 52 | async [kClose] () { 53 | await promisify(this[kOriginalClose])() 54 | this[kConnected] = 0 55 | this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) 56 | } 57 | } 58 | 59 | module.exports = MockClient 60 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/mock-errors.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { UndiciError } = require('../core/errors') 4 | 5 | class MockNotMatchedError extends UndiciError { 6 | constructor (message) { 7 | super(message) 8 | Error.captureStackTrace(this, MockNotMatchedError) 9 | this.name = 'MockNotMatchedError' 10 | this.message = message || 'The request does not match any registered mock dispatches' 11 | this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' 12 | } 13 | } 14 | 15 | module.exports = { 16 | MockNotMatchedError 17 | } 18 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/mock-pool.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { promisify } = require('util') 4 | const Pool = require('../pool') 5 | const { buildMockDispatch } = require('./mock-utils') 6 | const { 7 | kDispatches, 8 | kMockAgent, 9 | kClose, 10 | kOriginalClose, 11 | kOrigin, 12 | kOriginalDispatch, 13 | kConnected 14 | } = require('./mock-symbols') 15 | const { MockInterceptor } = require('./mock-interceptor') 16 | const Symbols = require('../core/symbols') 17 | const { InvalidArgumentError } = require('../core/errors') 18 | 19 | /** 20 | * MockPool provides an API that extends the Pool to influence the mockDispatches. 21 | */ 22 | class MockPool extends Pool { 23 | constructor (origin, opts) { 24 | super(origin, opts) 25 | 26 | if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { 27 | throw new InvalidArgumentError('Argument opts.agent must implement Agent') 28 | } 29 | 30 | this[kMockAgent] = opts.agent 31 | this[kOrigin] = origin 32 | this[kDispatches] = [] 33 | this[kConnected] = 1 34 | this[kOriginalDispatch] = this.dispatch 35 | this[kOriginalClose] = this.close.bind(this) 36 | 37 | this.dispatch = buildMockDispatch.call(this) 38 | this.close = this[kClose] 39 | } 40 | 41 | get [Symbols.kConnected] () { 42 | return this[kConnected] 43 | } 44 | 45 | /** 46 | * Sets up the base interceptor for mocking replies from undici. 47 | */ 48 | intercept (opts) { 49 | return new MockInterceptor(opts, this[kDispatches]) 50 | } 51 | 52 | async [kClose] () { 53 | await promisify(this[kOriginalClose])() 54 | this[kConnected] = 0 55 | this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) 56 | } 57 | } 58 | 59 | module.exports = MockPool 60 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/mock-symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | kAgent: Symbol('agent'), 5 | kOptions: Symbol('options'), 6 | kFactory: Symbol('factory'), 7 | kDispatches: Symbol('dispatches'), 8 | kDispatchKey: Symbol('dispatch key'), 9 | kDefaultHeaders: Symbol('default headers'), 10 | kDefaultTrailers: Symbol('default trailers'), 11 | kContentLength: Symbol('content length'), 12 | kMockAgent: Symbol('mock agent'), 13 | kMockAgentSet: Symbol('mock agent set'), 14 | kMockAgentGet: Symbol('mock agent get'), 15 | kMockDispatch: Symbol('mock dispatch'), 16 | kClose: Symbol('close'), 17 | kOriginalClose: Symbol('original agent close'), 18 | kOrigin: Symbol('origin'), 19 | kIsMockActive: Symbol('is mock active'), 20 | kNetConnect: Symbol('net connect'), 21 | kGetNetConnect: Symbol('get net connect'), 22 | kConnected: Symbol('connected') 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/pending-interceptors-formatter.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { Transform } = require('stream') 4 | const { Console } = require('console') 5 | 6 | /** 7 | * Gets the output of `console.table(…)` as a string. 8 | */ 9 | module.exports = class PendingInterceptorsFormatter { 10 | constructor ({ disableColors } = {}) { 11 | this.transform = new Transform({ 12 | transform (chunk, _enc, cb) { 13 | cb(null, chunk) 14 | } 15 | }) 16 | 17 | this.logger = new Console({ 18 | stdout: this.transform, 19 | inspectOptions: { 20 | colors: !disableColors && !process.env.CI 21 | } 22 | }) 23 | } 24 | 25 | format (pendingInterceptors) { 26 | const withPrettyHeaders = pendingInterceptors.map( 27 | ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ 28 | Method: method, 29 | Origin: origin, 30 | Path: path, 31 | 'Status code': statusCode, 32 | Persistent: persist ? '✅' : '❌', 33 | Invocations: timesInvoked, 34 | Remaining: persist ? Infinity : times - timesInvoked 35 | })) 36 | 37 | this.logger.table(withPrettyHeaders) 38 | return this.transform.read().toString() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /node_modules/undici/lib/mock/pluralizer.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const singulars = { 4 | pronoun: 'it', 5 | is: 'is', 6 | was: 'was', 7 | this: 'this' 8 | } 9 | 10 | const plurals = { 11 | pronoun: 'they', 12 | is: 'are', 13 | was: 'were', 14 | this: 'these' 15 | } 16 | 17 | module.exports = class Pluralizer { 18 | constructor (singular, plural) { 19 | this.singular = singular 20 | this.plural = plural 21 | } 22 | 23 | pluralize (count) { 24 | const one = count === 1 25 | const keys = one ? singulars : plurals 26 | const noun = one ? this.singular : this.plural 27 | return { ...keys, count, noun } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /node_modules/undici/lib/pool-stats.js: -------------------------------------------------------------------------------- 1 | const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('./core/symbols') 2 | const kPool = Symbol('pool') 3 | 4 | class PoolStats { 5 | constructor (pool) { 6 | this[kPool] = pool 7 | } 8 | 9 | get connected () { 10 | return this[kPool][kConnected] 11 | } 12 | 13 | get free () { 14 | return this[kPool][kFree] 15 | } 16 | 17 | get pending () { 18 | return this[kPool][kPending] 19 | } 20 | 21 | get queued () { 22 | return this[kPool][kQueued] 23 | } 24 | 25 | get running () { 26 | return this[kPool][kRunning] 27 | } 28 | 29 | get size () { 30 | return this[kPool][kSize] 31 | } 32 | } 33 | 34 | module.exports = PoolStats 35 | -------------------------------------------------------------------------------- /node_modules/undici/lib/pool.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { 4 | PoolBase, 5 | kClients, 6 | kNeedDrain, 7 | kAddClient, 8 | kGetDispatcher 9 | } = require('./pool-base') 10 | const Client = require('./client') 11 | const { 12 | InvalidArgumentError 13 | } = require('./core/errors') 14 | const util = require('./core/util') 15 | const { kUrl, kInterceptors } = require('./core/symbols') 16 | const buildConnector = require('./core/connect') 17 | 18 | const kOptions = Symbol('options') 19 | const kConnections = Symbol('connections') 20 | const kFactory = Symbol('factory') 21 | 22 | function defaultFactory (origin, opts) { 23 | return new Client(origin, opts) 24 | } 25 | 26 | class Pool extends PoolBase { 27 | constructor (origin, { 28 | connections, 29 | factory = defaultFactory, 30 | connect, 31 | connectTimeout, 32 | tls, 33 | maxCachedSessions, 34 | socketPath, 35 | autoSelectFamily, 36 | autoSelectFamilyAttemptTimeout, 37 | allowH2, 38 | ...options 39 | } = {}) { 40 | super() 41 | 42 | if (connections != null && (!Number.isFinite(connections) || connections < 0)) { 43 | throw new InvalidArgumentError('invalid connections') 44 | } 45 | 46 | if (typeof factory !== 'function') { 47 | throw new InvalidArgumentError('factory must be a function.') 48 | } 49 | 50 | if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { 51 | throw new InvalidArgumentError('connect must be a function or an object') 52 | } 53 | 54 | if (typeof connect !== 'function') { 55 | connect = buildConnector({ 56 | ...tls, 57 | maxCachedSessions, 58 | allowH2, 59 | socketPath, 60 | timeout: connectTimeout, 61 | ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), 62 | ...connect 63 | }) 64 | } 65 | 66 | this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) 67 | ? options.interceptors.Pool 68 | : [] 69 | this[kConnections] = connections || null 70 | this[kUrl] = util.parseOrigin(origin) 71 | this[kOptions] = { ...util.deepClone(options), connect, allowH2 } 72 | this[kOptions].interceptors = options.interceptors 73 | ? { ...options.interceptors } 74 | : undefined 75 | this[kFactory] = factory 76 | } 77 | 78 | [kGetDispatcher] () { 79 | let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) 80 | 81 | if (dispatcher) { 82 | return dispatcher 83 | } 84 | 85 | if (!this[kConnections] || this[kClients].length < this[kConnections]) { 86 | dispatcher = this[kFactory](this[kUrl], this[kOptions]) 87 | this[kAddClient](dispatcher) 88 | } 89 | 90 | return dispatcher 91 | } 92 | } 93 | 94 | module.exports = Pool 95 | -------------------------------------------------------------------------------- /node_modules/undici/lib/timers.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | let fastNow = Date.now() 4 | let fastNowTimeout 5 | 6 | const fastTimers = [] 7 | 8 | function onTimeout () { 9 | fastNow = Date.now() 10 | 11 | let len = fastTimers.length 12 | let idx = 0 13 | while (idx < len) { 14 | const timer = fastTimers[idx] 15 | 16 | if (timer.state === 0) { 17 | timer.state = fastNow + timer.delay 18 | } else if (timer.state > 0 && fastNow >= timer.state) { 19 | timer.state = -1 20 | timer.callback(timer.opaque) 21 | } 22 | 23 | if (timer.state === -1) { 24 | timer.state = -2 25 | if (idx !== len - 1) { 26 | fastTimers[idx] = fastTimers.pop() 27 | } else { 28 | fastTimers.pop() 29 | } 30 | len -= 1 31 | } else { 32 | idx += 1 33 | } 34 | } 35 | 36 | if (fastTimers.length > 0) { 37 | refreshTimeout() 38 | } 39 | } 40 | 41 | function refreshTimeout () { 42 | if (fastNowTimeout && fastNowTimeout.refresh) { 43 | fastNowTimeout.refresh() 44 | } else { 45 | clearTimeout(fastNowTimeout) 46 | fastNowTimeout = setTimeout(onTimeout, 1e3) 47 | if (fastNowTimeout.unref) { 48 | fastNowTimeout.unref() 49 | } 50 | } 51 | } 52 | 53 | class Timeout { 54 | constructor (callback, delay, opaque) { 55 | this.callback = callback 56 | this.delay = delay 57 | this.opaque = opaque 58 | 59 | // -2 not in timer list 60 | // -1 in timer list but inactive 61 | // 0 in timer list waiting for time 62 | // > 0 in timer list waiting for time to expire 63 | this.state = -2 64 | 65 | this.refresh() 66 | } 67 | 68 | refresh () { 69 | if (this.state === -2) { 70 | fastTimers.push(this) 71 | if (!fastNowTimeout || fastTimers.length === 1) { 72 | refreshTimeout() 73 | } 74 | } 75 | 76 | this.state = 0 77 | } 78 | 79 | clear () { 80 | this.state = -1 81 | } 82 | } 83 | 84 | module.exports = { 85 | setTimeout (callback, delay, opaque) { 86 | return delay < 1e3 87 | ? setTimeout(callback, delay, opaque) 88 | : new Timeout(callback, delay, opaque) 89 | }, 90 | clearTimeout (timeout) { 91 | if (timeout instanceof Timeout) { 92 | timeout.clear() 93 | } else { 94 | clearTimeout(timeout) 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /node_modules/undici/lib/websocket/constants.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This is a Globally Unique Identifier unique used 4 | // to validate that the endpoint accepts websocket 5 | // connections. 6 | // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 7 | const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' 8 | 9 | /** @type {PropertyDescriptor} */ 10 | const staticPropertyDescriptors = { 11 | enumerable: true, 12 | writable: false, 13 | configurable: false 14 | } 15 | 16 | const states = { 17 | CONNECTING: 0, 18 | OPEN: 1, 19 | CLOSING: 2, 20 | CLOSED: 3 21 | } 22 | 23 | const opcodes = { 24 | CONTINUATION: 0x0, 25 | TEXT: 0x1, 26 | BINARY: 0x2, 27 | CLOSE: 0x8, 28 | PING: 0x9, 29 | PONG: 0xA 30 | } 31 | 32 | const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 33 | 34 | const parserStates = { 35 | INFO: 0, 36 | PAYLOADLENGTH_16: 2, 37 | PAYLOADLENGTH_64: 3, 38 | READ_DATA: 4 39 | } 40 | 41 | const emptyBuffer = Buffer.allocUnsafe(0) 42 | 43 | module.exports = { 44 | uid, 45 | staticPropertyDescriptors, 46 | states, 47 | opcodes, 48 | maxUnsigned16Bit, 49 | parserStates, 50 | emptyBuffer 51 | } 52 | -------------------------------------------------------------------------------- /node_modules/undici/lib/websocket/frame.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const { maxUnsigned16Bit } = require('./constants') 4 | 5 | /** @type {import('crypto')} */ 6 | let crypto 7 | try { 8 | crypto = require('crypto') 9 | } catch { 10 | 11 | } 12 | 13 | class WebsocketFrameSend { 14 | /** 15 | * @param {Buffer|undefined} data 16 | */ 17 | constructor (data) { 18 | this.frameData = data 19 | this.maskKey = crypto.randomBytes(4) 20 | } 21 | 22 | createFrame (opcode) { 23 | const bodyLength = this.frameData?.byteLength ?? 0 24 | 25 | /** @type {number} */ 26 | let payloadLength = bodyLength // 0-125 27 | let offset = 6 28 | 29 | if (bodyLength > maxUnsigned16Bit) { 30 | offset += 8 // payload length is next 8 bytes 31 | payloadLength = 127 32 | } else if (bodyLength > 125) { 33 | offset += 2 // payload length is next 2 bytes 34 | payloadLength = 126 35 | } 36 | 37 | const buffer = Buffer.allocUnsafe(bodyLength + offset) 38 | 39 | // Clear first 2 bytes, everything else is overwritten 40 | buffer[0] = buffer[1] = 0 41 | buffer[0] |= 0x80 // FIN 42 | buffer[0] = (buffer[0] & 0xF0) + opcode // opcode 43 | 44 | /*! ws. MIT License. Einar Otto Stangvik */ 45 | buffer[offset - 4] = this.maskKey[0] 46 | buffer[offset - 3] = this.maskKey[1] 47 | buffer[offset - 2] = this.maskKey[2] 48 | buffer[offset - 1] = this.maskKey[3] 49 | 50 | buffer[1] = payloadLength 51 | 52 | if (payloadLength === 126) { 53 | buffer.writeUInt16BE(bodyLength, 2) 54 | } else if (payloadLength === 127) { 55 | // Clear extended payload length 56 | buffer[2] = buffer[3] = 0 57 | buffer.writeUIntBE(bodyLength, 4, 6) 58 | } 59 | 60 | buffer[1] |= 0x80 // MASK 61 | 62 | // mask body 63 | for (let i = 0; i < bodyLength; i++) { 64 | buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] 65 | } 66 | 67 | return buffer 68 | } 69 | } 70 | 71 | module.exports = { 72 | WebsocketFrameSend 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/undici/lib/websocket/symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | kWebSocketURL: Symbol('url'), 5 | kReadyState: Symbol('ready state'), 6 | kController: Symbol('controller'), 7 | kResponse: Symbol('response'), 8 | kBinaryType: Symbol('binary type'), 9 | kSentClose: Symbol('sent close'), 10 | kReceivedClose: Symbol('received close'), 11 | kByteParser: Symbol('byte parser') 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/undici/types/README.md: -------------------------------------------------------------------------------- 1 | # undici-types 2 | 3 | This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version. 4 | 5 | - [GitHub nodejs/undici](https://github.com/nodejs/undici) 6 | - [Undici Documentation](https://undici.nodejs.org/#/) 7 | -------------------------------------------------------------------------------- /node_modules/undici/types/agent.d.ts: -------------------------------------------------------------------------------- 1 | import { URL } from 'url' 2 | import Pool from './pool' 3 | import Dispatcher from "./dispatcher"; 4 | 5 | export default Agent 6 | 7 | declare class Agent extends Dispatcher{ 8 | constructor(opts?: Agent.Options) 9 | /** `true` after `dispatcher.close()` has been called. */ 10 | closed: boolean; 11 | /** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */ 12 | destroyed: boolean; 13 | /** Dispatches a request. */ 14 | dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; 15 | } 16 | 17 | declare namespace Agent { 18 | export interface Options extends Pool.Options { 19 | /** Default: `(origin, opts) => new Pool(origin, opts)`. */ 20 | factory?(origin: string | URL, opts: Object): Dispatcher; 21 | /** Integer. Default: `0` */ 22 | maxRedirections?: number; 23 | 24 | interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options["interceptors"] 25 | } 26 | 27 | export interface DispatchOptions extends Dispatcher.DispatchOptions { 28 | /** Integer. */ 29 | maxRedirections?: number; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /node_modules/undici/types/api.d.ts: -------------------------------------------------------------------------------- 1 | import { URL, UrlObject } from 'url' 2 | import { Duplex } from 'stream' 3 | import Dispatcher from './dispatcher' 4 | 5 | export { 6 | request, 7 | stream, 8 | pipeline, 9 | connect, 10 | upgrade, 11 | } 12 | 13 | /** Performs an HTTP request. */ 14 | declare function request( 15 | url: string | URL | UrlObject, 16 | options?: { dispatcher?: Dispatcher } & Omit & Partial>, 17 | ): Promise; 18 | 19 | /** A faster version of `request`. */ 20 | declare function stream( 21 | url: string | URL | UrlObject, 22 | options: { dispatcher?: Dispatcher } & Omit, 23 | factory: Dispatcher.StreamFactory 24 | ): Promise; 25 | 26 | /** For easy use with `stream.pipeline`. */ 27 | declare function pipeline( 28 | url: string | URL | UrlObject, 29 | options: { dispatcher?: Dispatcher } & Omit, 30 | handler: Dispatcher.PipelineHandler 31 | ): Duplex; 32 | 33 | /** Starts two-way communications with the requested resource. */ 34 | declare function connect( 35 | url: string | URL | UrlObject, 36 | options?: { dispatcher?: Dispatcher } & Omit 37 | ): Promise; 38 | 39 | /** Upgrade to a different protocol. */ 40 | declare function upgrade( 41 | url: string | URL | UrlObject, 42 | options?: { dispatcher?: Dispatcher } & Omit 43 | ): Promise; 44 | -------------------------------------------------------------------------------- /node_modules/undici/types/balanced-pool.d.ts: -------------------------------------------------------------------------------- 1 | import Pool from './pool' 2 | import Dispatcher from './dispatcher' 3 | import { URL } from 'url' 4 | 5 | export default BalancedPool 6 | 7 | declare class BalancedPool extends Dispatcher { 8 | constructor(url: string | string[] | URL | URL[], options?: Pool.Options); 9 | 10 | addUpstream(upstream: string | URL): BalancedPool; 11 | removeUpstream(upstream: string | URL): BalancedPool; 12 | upstreams: Array; 13 | 14 | /** `true` after `pool.close()` has been called. */ 15 | closed: boolean; 16 | /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ 17 | destroyed: boolean; 18 | } 19 | -------------------------------------------------------------------------------- /node_modules/undici/types/cache.d.ts: -------------------------------------------------------------------------------- 1 | import type { RequestInfo, Response, Request } from './fetch' 2 | 3 | export interface CacheStorage { 4 | match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise, 5 | has (cacheName: string): Promise, 6 | open (cacheName: string): Promise, 7 | delete (cacheName: string): Promise, 8 | keys (): Promise 9 | } 10 | 11 | declare const CacheStorage: { 12 | prototype: CacheStorage 13 | new(): CacheStorage 14 | } 15 | 16 | export interface Cache { 17 | match (request: RequestInfo, options?: CacheQueryOptions): Promise, 18 | matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise, 19 | add (request: RequestInfo): Promise, 20 | addAll (requests: RequestInfo[]): Promise, 21 | put (request: RequestInfo, response: Response): Promise, 22 | delete (request: RequestInfo, options?: CacheQueryOptions): Promise, 23 | keys (request?: RequestInfo, options?: CacheQueryOptions): Promise 24 | } 25 | 26 | export interface CacheQueryOptions { 27 | ignoreSearch?: boolean, 28 | ignoreMethod?: boolean, 29 | ignoreVary?: boolean 30 | } 31 | 32 | export interface MultiCacheQueryOptions extends CacheQueryOptions { 33 | cacheName?: string 34 | } 35 | 36 | export declare const caches: CacheStorage 37 | -------------------------------------------------------------------------------- /node_modules/undici/types/connector.d.ts: -------------------------------------------------------------------------------- 1 | import { TLSSocket, ConnectionOptions } from 'tls' 2 | import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'net' 3 | 4 | export default buildConnector 5 | declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector 6 | 7 | declare namespace buildConnector { 8 | export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & { 9 | allowH2?: boolean; 10 | maxCachedSessions?: number | null; 11 | socketPath?: string | null; 12 | timeout?: number | null; 13 | port?: number; 14 | keepAlive?: boolean | null; 15 | keepAliveInitialDelay?: number | null; 16 | } 17 | 18 | export interface Options { 19 | hostname: string 20 | host?: string 21 | protocol: string 22 | port: string 23 | servername?: string 24 | localAddress?: string | null 25 | httpSocket?: Socket 26 | } 27 | 28 | export type Callback = (...args: CallbackArgs) => void 29 | type CallbackArgs = [null, Socket | TLSSocket] | [Error, null] 30 | 31 | export interface connector { 32 | (options: buildConnector.Options, callback: buildConnector.Callback): void 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /node_modules/undici/types/content-type.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | interface MIMEType { 4 | type: string 5 | subtype: string 6 | parameters: Map 7 | essence: string 8 | } 9 | 10 | /** 11 | * Parse a string to a {@link MIMEType} object. Returns `failure` if the string 12 | * couldn't be parsed. 13 | * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type 14 | */ 15 | export function parseMIMEType (input: string): 'failure' | MIMEType 16 | 17 | /** 18 | * Convert a MIMEType object to a string. 19 | * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type 20 | */ 21 | export function serializeAMimeType (mimeType: MIMEType): string 22 | -------------------------------------------------------------------------------- /node_modules/undici/types/cookies.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import type { Headers } from './fetch' 4 | 5 | export interface Cookie { 6 | name: string 7 | value: string 8 | expires?: Date | number 9 | maxAge?: number 10 | domain?: string 11 | path?: string 12 | secure?: boolean 13 | httpOnly?: boolean 14 | sameSite?: 'Strict' | 'Lax' | 'None' 15 | unparsed?: string[] 16 | } 17 | 18 | export function deleteCookie ( 19 | headers: Headers, 20 | name: string, 21 | attributes?: { name?: string, domain?: string } 22 | ): void 23 | 24 | export function getCookies (headers: Headers): Record 25 | 26 | export function getSetCookies (headers: Headers): Cookie[] 27 | 28 | export function setCookie (headers: Headers, cookie: Cookie): void 29 | -------------------------------------------------------------------------------- /node_modules/undici/types/diagnostics-channel.d.ts: -------------------------------------------------------------------------------- 1 | import { Socket } from "net"; 2 | import { URL } from "url"; 3 | import Connector from "./connector"; 4 | import Dispatcher from "./dispatcher"; 5 | 6 | declare namespace DiagnosticsChannel { 7 | interface Request { 8 | origin?: string | URL; 9 | completed: boolean; 10 | method?: Dispatcher.HttpMethod; 11 | path: string; 12 | headers: string; 13 | addHeader(key: string, value: string): Request; 14 | } 15 | interface Response { 16 | statusCode: number; 17 | statusText: string; 18 | headers: Array; 19 | } 20 | type Error = unknown; 21 | interface ConnectParams { 22 | host: URL["host"]; 23 | hostname: URL["hostname"]; 24 | protocol: URL["protocol"]; 25 | port: URL["port"]; 26 | servername: string | null; 27 | } 28 | type Connector = Connector.connector; 29 | export interface RequestCreateMessage { 30 | request: Request; 31 | } 32 | export interface RequestBodySentMessage { 33 | request: Request; 34 | } 35 | export interface RequestHeadersMessage { 36 | request: Request; 37 | response: Response; 38 | } 39 | export interface RequestTrailersMessage { 40 | request: Request; 41 | trailers: Array; 42 | } 43 | export interface RequestErrorMessage { 44 | request: Request; 45 | error: Error; 46 | } 47 | export interface ClientSendHeadersMessage { 48 | request: Request; 49 | headers: string; 50 | socket: Socket; 51 | } 52 | export interface ClientBeforeConnectMessage { 53 | connectParams: ConnectParams; 54 | connector: Connector; 55 | } 56 | export interface ClientConnectedMessage { 57 | socket: Socket; 58 | connectParams: ConnectParams; 59 | connector: Connector; 60 | } 61 | export interface ClientConnectErrorMessage { 62 | error: Error; 63 | socket: Socket; 64 | connectParams: ConnectParams; 65 | connector: Connector; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/undici/types/file.d.ts: -------------------------------------------------------------------------------- 1 | // Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT) 2 | /// 3 | 4 | import { Blob } from 'buffer' 5 | 6 | export interface BlobPropertyBag { 7 | type?: string 8 | endings?: 'native' | 'transparent' 9 | } 10 | 11 | export interface FilePropertyBag extends BlobPropertyBag { 12 | /** 13 | * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. 14 | */ 15 | lastModified?: number 16 | } 17 | 18 | export declare class File extends Blob { 19 | /** 20 | * Creates a new File instance. 21 | * 22 | * @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). 23 | * @param fileName The name of the file. 24 | * @param options An options object containing optional attributes for the file. 25 | */ 26 | constructor(fileBits: ReadonlyArray, fileName: string, options?: FilePropertyBag) 27 | 28 | /** 29 | * Name of the file referenced by the File object. 30 | */ 31 | readonly name: string 32 | 33 | /** 34 | * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. 35 | */ 36 | readonly lastModified: number 37 | 38 | readonly [Symbol.toStringTag]: string 39 | } 40 | -------------------------------------------------------------------------------- /node_modules/undici/types/filereader.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { Blob } from 'buffer' 4 | import { DOMException, Event, EventInit, EventTarget } from './patch' 5 | 6 | export declare class FileReader { 7 | __proto__: EventTarget & FileReader 8 | 9 | constructor () 10 | 11 | readAsArrayBuffer (blob: Blob): void 12 | readAsBinaryString (blob: Blob): void 13 | readAsText (blob: Blob, encoding?: string): void 14 | readAsDataURL (blob: Blob): void 15 | 16 | abort (): void 17 | 18 | static readonly EMPTY = 0 19 | static readonly LOADING = 1 20 | static readonly DONE = 2 21 | 22 | readonly EMPTY = 0 23 | readonly LOADING = 1 24 | readonly DONE = 2 25 | 26 | readonly readyState: number 27 | 28 | readonly result: string | ArrayBuffer | null 29 | 30 | readonly error: DOMException | null 31 | 32 | onloadstart: null | ((this: FileReader, event: ProgressEvent) => void) 33 | onprogress: null | ((this: FileReader, event: ProgressEvent) => void) 34 | onload: null | ((this: FileReader, event: ProgressEvent) => void) 35 | onabort: null | ((this: FileReader, event: ProgressEvent) => void) 36 | onerror: null | ((this: FileReader, event: ProgressEvent) => void) 37 | onloadend: null | ((this: FileReader, event: ProgressEvent) => void) 38 | } 39 | 40 | export interface ProgressEventInit extends EventInit { 41 | lengthComputable?: boolean 42 | loaded?: number 43 | total?: number 44 | } 45 | 46 | export declare class ProgressEvent { 47 | __proto__: Event & ProgressEvent 48 | 49 | constructor (type: string, eventInitDict?: ProgressEventInit) 50 | 51 | readonly lengthComputable: boolean 52 | readonly loaded: number 53 | readonly total: number 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/undici/types/global-dispatcher.d.ts: -------------------------------------------------------------------------------- 1 | import Dispatcher from "./dispatcher"; 2 | 3 | export { 4 | getGlobalDispatcher, 5 | setGlobalDispatcher 6 | } 7 | 8 | declare function setGlobalDispatcher(dispatcher: DispatcherImplementation): void; 9 | declare function getGlobalDispatcher(): Dispatcher; 10 | -------------------------------------------------------------------------------- /node_modules/undici/types/global-origin.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | setGlobalOrigin, 3 | getGlobalOrigin 4 | } 5 | 6 | declare function setGlobalOrigin(origin: string | URL | undefined): void; 7 | declare function getGlobalOrigin(): URL | undefined; -------------------------------------------------------------------------------- /node_modules/undici/types/handlers.d.ts: -------------------------------------------------------------------------------- 1 | import Dispatcher from "./dispatcher"; 2 | 3 | export declare class RedirectHandler implements Dispatcher.DispatchHandlers{ 4 | constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers) 5 | } 6 | 7 | export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{ 8 | constructor (handler: Dispatcher.DispatchHandlers) 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/undici/types/header.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The header type declaration of `undici`. 3 | */ 4 | export type IncomingHttpHeaders = Record; 5 | -------------------------------------------------------------------------------- /node_modules/undici/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import Dispatcher from'./dispatcher' 2 | import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher' 3 | import { setGlobalOrigin, getGlobalOrigin } from './global-origin' 4 | import Pool from'./pool' 5 | import { RedirectHandler, DecoratorHandler } from './handlers' 6 | 7 | import BalancedPool from './balanced-pool' 8 | import Client from'./client' 9 | import buildConnector from'./connector' 10 | import errors from'./errors' 11 | import Agent from'./agent' 12 | import MockClient from'./mock-client' 13 | import MockPool from'./mock-pool' 14 | import MockAgent from'./mock-agent' 15 | import mockErrors from'./mock-errors' 16 | import ProxyAgent from'./proxy-agent' 17 | import RetryHandler from'./retry-handler' 18 | import { request, pipeline, stream, connect, upgrade } from './api' 19 | 20 | export * from './cookies' 21 | export * from './fetch' 22 | export * from './file' 23 | export * from './filereader' 24 | export * from './formdata' 25 | export * from './diagnostics-channel' 26 | export * from './websocket' 27 | export * from './content-type' 28 | export * from './cache' 29 | export { Interceptable } from './mock-interceptor' 30 | 31 | export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler } 32 | export default Undici 33 | 34 | declare namespace Undici { 35 | var Dispatcher: typeof import('./dispatcher').default 36 | var Pool: typeof import('./pool').default; 37 | var RedirectHandler: typeof import ('./handlers').RedirectHandler 38 | var DecoratorHandler: typeof import ('./handlers').DecoratorHandler 39 | var RetryHandler: typeof import ('./retry-handler').default 40 | var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor 41 | var BalancedPool: typeof import('./balanced-pool').default; 42 | var Client: typeof import('./client').default; 43 | var buildConnector: typeof import('./connector').default; 44 | var errors: typeof import('./errors').default; 45 | var Agent: typeof import('./agent').default; 46 | var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher; 47 | var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher; 48 | var request: typeof import('./api').request; 49 | var stream: typeof import('./api').stream; 50 | var pipeline: typeof import('./api').pipeline; 51 | var connect: typeof import('./api').connect; 52 | var upgrade: typeof import('./api').upgrade; 53 | var MockClient: typeof import('./mock-client').default; 54 | var MockPool: typeof import('./mock-pool').default; 55 | var MockAgent: typeof import('./mock-agent').default; 56 | var mockErrors: typeof import('./mock-errors').default; 57 | var fetch: typeof import('./fetch').fetch; 58 | var Headers: typeof import('./fetch').Headers; 59 | var Response: typeof import('./fetch').Response; 60 | var Request: typeof import('./fetch').Request; 61 | var FormData: typeof import('./formdata').FormData; 62 | var File: typeof import('./file').File; 63 | var FileReader: typeof import('./filereader').FileReader; 64 | var caches: typeof import('./cache').caches; 65 | } 66 | -------------------------------------------------------------------------------- /node_modules/undici/types/interceptors.d.ts: -------------------------------------------------------------------------------- 1 | import Dispatcher from "./dispatcher"; 2 | 3 | type RedirectInterceptorOpts = { maxRedirections?: number } 4 | 5 | export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor 6 | -------------------------------------------------------------------------------- /node_modules/undici/types/mock-agent.d.ts: -------------------------------------------------------------------------------- 1 | import Agent from './agent' 2 | import Dispatcher from './dispatcher' 3 | import { Interceptable, MockInterceptor } from './mock-interceptor' 4 | import MockDispatch = MockInterceptor.MockDispatch; 5 | 6 | export default MockAgent 7 | 8 | interface PendingInterceptor extends MockDispatch { 9 | origin: string; 10 | } 11 | 12 | /** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */ 13 | declare class MockAgent extends Dispatcher { 14 | constructor(options?: MockAgent.Options) 15 | /** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */ 16 | get(origin: string): TInterceptable; 17 | get(origin: RegExp): TInterceptable; 18 | get(origin: ((origin: string) => boolean)): TInterceptable; 19 | /** Dispatches a mocked request. */ 20 | dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; 21 | /** Closes the mock agent and waits for registered mock pools and clients to also close before resolving. */ 22 | close(): Promise; 23 | /** Disables mocking in MockAgent. */ 24 | deactivate(): void; 25 | /** Enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called. */ 26 | activate(): void; 27 | /** Define host matchers so only matching requests that aren't intercepted by the mock dispatchers will be attempted. */ 28 | enableNetConnect(): void; 29 | enableNetConnect(host: string): void; 30 | enableNetConnect(host: RegExp): void; 31 | enableNetConnect(host: ((host: string) => boolean)): void; 32 | /** Causes all requests to throw when requests are not matched in a MockAgent intercept. */ 33 | disableNetConnect(): void; 34 | pendingInterceptors(): PendingInterceptor[]; 35 | assertNoPendingInterceptors(options?: { 36 | pendingInterceptorsFormatter?: PendingInterceptorsFormatter; 37 | }): void; 38 | } 39 | 40 | interface PendingInterceptorsFormatter { 41 | format(pendingInterceptors: readonly PendingInterceptor[]): string; 42 | } 43 | 44 | declare namespace MockAgent { 45 | /** MockAgent options. */ 46 | export interface Options extends Agent.Options { 47 | /** A custom agent to be encapsulated by the MockAgent. */ 48 | agent?: Agent; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/undici/types/mock-client.d.ts: -------------------------------------------------------------------------------- 1 | import Client from './client' 2 | import Dispatcher from './dispatcher' 3 | import MockAgent from './mock-agent' 4 | import { MockInterceptor, Interceptable } from './mock-interceptor' 5 | 6 | export default MockClient 7 | 8 | /** MockClient extends the Client API and allows one to mock requests. */ 9 | declare class MockClient extends Client implements Interceptable { 10 | constructor(origin: string, options: MockClient.Options); 11 | /** Intercepts any matching requests that use the same origin as this mock client. */ 12 | intercept(options: MockInterceptor.Options): MockInterceptor; 13 | /** Dispatches a mocked request. */ 14 | dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; 15 | /** Closes the mock client and gracefully waits for enqueued requests to complete. */ 16 | close(): Promise; 17 | } 18 | 19 | declare namespace MockClient { 20 | /** MockClient options. */ 21 | export interface Options extends Client.Options { 22 | /** The agent to associate this MockClient with. */ 23 | agent: MockAgent; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /node_modules/undici/types/mock-errors.d.ts: -------------------------------------------------------------------------------- 1 | import Errors from './errors' 2 | 3 | export default MockErrors 4 | 5 | declare namespace MockErrors { 6 | /** The request does not match any registered mock dispatches. */ 7 | export class MockNotMatchedError extends Errors.UndiciError { 8 | constructor(message?: string); 9 | name: 'MockNotMatchedError'; 10 | code: 'UND_MOCK_ERR_MOCK_NOT_MATCHED'; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/undici/types/mock-pool.d.ts: -------------------------------------------------------------------------------- 1 | import Pool from './pool' 2 | import MockAgent from './mock-agent' 3 | import { Interceptable, MockInterceptor } from './mock-interceptor' 4 | import Dispatcher from './dispatcher' 5 | 6 | export default MockPool 7 | 8 | /** MockPool extends the Pool API and allows one to mock requests. */ 9 | declare class MockPool extends Pool implements Interceptable { 10 | constructor(origin: string, options: MockPool.Options); 11 | /** Intercepts any matching requests that use the same origin as this mock pool. */ 12 | intercept(options: MockInterceptor.Options): MockInterceptor; 13 | /** Dispatches a mocked request. */ 14 | dispatch(options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandlers): boolean; 15 | /** Closes the mock pool and gracefully waits for enqueued requests to complete. */ 16 | close(): Promise; 17 | } 18 | 19 | declare namespace MockPool { 20 | /** MockPool options. */ 21 | export interface Options extends Pool.Options { 22 | /** The agent to associate this MockPool with. */ 23 | agent: MockAgent; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /node_modules/undici/types/patch.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | // See https://github.com/nodejs/undici/issues/1740 4 | 5 | export type DOMException = typeof globalThis extends { DOMException: infer T } 6 | ? T 7 | : any 8 | 9 | export type EventTarget = typeof globalThis extends { EventTarget: infer T } 10 | ? T 11 | : { 12 | addEventListener( 13 | type: string, 14 | listener: any, 15 | options?: any, 16 | ): void 17 | dispatchEvent(event: Event): boolean 18 | removeEventListener( 19 | type: string, 20 | listener: any, 21 | options?: any | boolean, 22 | ): void 23 | } 24 | 25 | export type Event = typeof globalThis extends { Event: infer T } 26 | ? T 27 | : { 28 | readonly bubbles: boolean 29 | cancelBubble: () => void 30 | readonly cancelable: boolean 31 | readonly composed: boolean 32 | composedPath(): [EventTarget?] 33 | readonly currentTarget: EventTarget | null 34 | readonly defaultPrevented: boolean 35 | readonly eventPhase: 0 | 2 36 | readonly isTrusted: boolean 37 | preventDefault(): void 38 | returnValue: boolean 39 | readonly srcElement: EventTarget | null 40 | stopImmediatePropagation(): void 41 | stopPropagation(): void 42 | readonly target: EventTarget | null 43 | readonly timeStamp: number 44 | readonly type: string 45 | } 46 | 47 | export interface EventInit { 48 | bubbles?: boolean 49 | cancelable?: boolean 50 | composed?: boolean 51 | } 52 | 53 | export interface EventListenerOptions { 54 | capture?: boolean 55 | } 56 | 57 | export interface AddEventListenerOptions extends EventListenerOptions { 58 | once?: boolean 59 | passive?: boolean 60 | signal?: AbortSignal 61 | } 62 | 63 | export type EventListenerOrEventListenerObject = EventListener | EventListenerObject 64 | 65 | export interface EventListenerObject { 66 | handleEvent (object: Event): void 67 | } 68 | 69 | export interface EventListener { 70 | (evt: Event): void 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/undici/types/pool-stats.d.ts: -------------------------------------------------------------------------------- 1 | import Pool from "./pool" 2 | 3 | export default PoolStats 4 | 5 | declare class PoolStats { 6 | constructor(pool: Pool); 7 | /** Number of open socket connections in this pool. */ 8 | connected: number; 9 | /** Number of open socket connections in this pool that do not have an active request. */ 10 | free: number; 11 | /** Number of pending requests across all clients in this pool. */ 12 | pending: number; 13 | /** Number of queued requests across all clients in this pool. */ 14 | queued: number; 15 | /** Number of currently active requests across all clients in this pool. */ 16 | running: number; 17 | /** Number of active, pending, or queued requests across all clients in this pool. */ 18 | size: number; 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/undici/types/pool.d.ts: -------------------------------------------------------------------------------- 1 | import Client from './client' 2 | import TPoolStats from './pool-stats' 3 | import { URL } from 'url' 4 | import Dispatcher from "./dispatcher"; 5 | 6 | export default Pool 7 | 8 | declare class Pool extends Dispatcher { 9 | constructor(url: string | URL, options?: Pool.Options) 10 | /** `true` after `pool.close()` has been called. */ 11 | closed: boolean; 12 | /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */ 13 | destroyed: boolean; 14 | /** Aggregate stats for a Pool. */ 15 | readonly stats: TPoolStats; 16 | } 17 | 18 | declare namespace Pool { 19 | export type PoolStats = TPoolStats; 20 | export interface Options extends Client.Options { 21 | /** Default: `(origin, opts) => new Client(origin, opts)`. */ 22 | factory?(origin: URL, opts: object): Dispatcher; 23 | /** The max number of clients to create. `null` if no limit. Default `null`. */ 24 | connections?: number | null; 25 | 26 | interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /node_modules/undici/types/proxy-agent.d.ts: -------------------------------------------------------------------------------- 1 | import Agent from './agent' 2 | import buildConnector from './connector'; 3 | import Client from './client' 4 | import Dispatcher from './dispatcher' 5 | import { IncomingHttpHeaders } from './header' 6 | import Pool from './pool' 7 | 8 | export default ProxyAgent 9 | 10 | declare class ProxyAgent extends Dispatcher { 11 | constructor(options: ProxyAgent.Options | string) 12 | 13 | dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean; 14 | close(): Promise; 15 | } 16 | 17 | declare namespace ProxyAgent { 18 | export interface Options extends Agent.Options { 19 | uri: string; 20 | /** 21 | * @deprecated use opts.token 22 | */ 23 | auth?: string; 24 | token?: string; 25 | headers?: IncomingHttpHeaders; 26 | requestTls?: buildConnector.BuildOptions; 27 | proxyTls?: buildConnector.BuildOptions; 28 | clientFactory?(origin: URL, opts: object): Dispatcher; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/undici/types/readable.d.ts: -------------------------------------------------------------------------------- 1 | import { Readable } from "stream"; 2 | import { Blob } from 'buffer' 3 | 4 | export default BodyReadable 5 | 6 | declare class BodyReadable extends Readable { 7 | constructor( 8 | resume?: (this: Readable, size: number) => void | null, 9 | abort?: () => void | null, 10 | contentType?: string 11 | ) 12 | 13 | /** Consumes and returns the body as a string 14 | * https://fetch.spec.whatwg.org/#dom-body-text 15 | */ 16 | text(): Promise 17 | 18 | /** Consumes and returns the body as a JavaScript Object 19 | * https://fetch.spec.whatwg.org/#dom-body-json 20 | */ 21 | json(): Promise 22 | 23 | /** Consumes and returns the body as a Blob 24 | * https://fetch.spec.whatwg.org/#dom-body-blob 25 | */ 26 | blob(): Promise 27 | 28 | /** Consumes and returns the body as an ArrayBuffer 29 | * https://fetch.spec.whatwg.org/#dom-body-arraybuffer 30 | */ 31 | arrayBuffer(): Promise 32 | 33 | /** Not implemented 34 | * 35 | * https://fetch.spec.whatwg.org/#dom-body-formdata 36 | */ 37 | formData(): Promise 38 | 39 | /** Returns true if the body is not null and the body has been consumed 40 | * 41 | * Otherwise, returns false 42 | * 43 | * https://fetch.spec.whatwg.org/#dom-body-bodyused 44 | */ 45 | readonly bodyUsed: boolean 46 | 47 | /** Throws on node 16.6.0 48 | * 49 | * If body is null, it should return null as the body 50 | * 51 | * If body is not null, should return the body as a ReadableStream 52 | * 53 | * https://fetch.spec.whatwg.org/#dom-body-body 54 | */ 55 | readonly body: never | undefined 56 | 57 | /** Dumps the response body by reading `limit` number of bytes. 58 | * @param opts.limit Number of bytes to read (optional) - Default: 262144 59 | */ 60 | dump(opts?: { limit: number }): Promise 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/undici/types/retry-handler.d.ts: -------------------------------------------------------------------------------- 1 | import Dispatcher from "./dispatcher"; 2 | 3 | export default RetryHandler; 4 | 5 | declare class RetryHandler implements Dispatcher.DispatchHandlers { 6 | constructor( 7 | options: Dispatcher.DispatchOptions & { 8 | retryOptions?: RetryHandler.RetryOptions; 9 | }, 10 | retryHandlers: RetryHandler.RetryHandlers 11 | ); 12 | } 13 | 14 | declare namespace RetryHandler { 15 | export type RetryState = { counter: number; currentTimeout: number }; 16 | 17 | export type RetryContext = { 18 | state: RetryState; 19 | opts: Dispatcher.DispatchOptions & { 20 | retryOptions?: RetryHandler.RetryOptions; 21 | }; 22 | } 23 | 24 | export type OnRetryCallback = (result?: Error | null) => void; 25 | 26 | export type RetryCallback = ( 27 | err: Error, 28 | context: { 29 | state: RetryState; 30 | opts: Dispatcher.DispatchOptions & { 31 | retryOptions?: RetryHandler.RetryOptions; 32 | }; 33 | }, 34 | callback: OnRetryCallback 35 | ) => number | null; 36 | 37 | export interface RetryOptions { 38 | /** 39 | * Callback to be invoked on every retry iteration. 40 | * It receives the error, current state of the retry object and the options object 41 | * passed when instantiating the retry handler. 42 | * 43 | * @type {RetryCallback} 44 | * @memberof RetryOptions 45 | */ 46 | retry?: RetryCallback; 47 | /** 48 | * Maximum number of retries to allow. 49 | * 50 | * @type {number} 51 | * @memberof RetryOptions 52 | * @default 5 53 | */ 54 | maxRetries?: number; 55 | /** 56 | * Max number of milliseconds allow between retries 57 | * 58 | * @type {number} 59 | * @memberof RetryOptions 60 | * @default 30000 61 | */ 62 | maxTimeout?: number; 63 | /** 64 | * Initial number of milliseconds to wait before retrying for the first time. 65 | * 66 | * @type {number} 67 | * @memberof RetryOptions 68 | * @default 500 69 | */ 70 | minTimeout?: number; 71 | /** 72 | * Factior to multiply the timeout factor between retries. 73 | * 74 | * @type {number} 75 | * @memberof RetryOptions 76 | * @default 2 77 | */ 78 | timeoutFactor?: number; 79 | /** 80 | * It enables to automatically infer timeout between retries based on the `Retry-After` header. 81 | * 82 | * @type {boolean} 83 | * @memberof RetryOptions 84 | * @default true 85 | */ 86 | retryAfter?: boolean; 87 | /** 88 | * HTTP methods to retry. 89 | * 90 | * @type {Dispatcher.HttpMethod[]} 91 | * @memberof RetryOptions 92 | * @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], 93 | */ 94 | methods?: Dispatcher.HttpMethod[]; 95 | /** 96 | * Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc. 97 | * 98 | * @type {string[]} 99 | * @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE'] 100 | */ 101 | errorCodes?: string[]; 102 | /** 103 | * HTTP status codes to be retried. 104 | * 105 | * @type {number[]} 106 | * @memberof RetryOptions 107 | * @default [500, 502, 503, 504, 429], 108 | */ 109 | statusCodes?: number[]; 110 | } 111 | 112 | export interface RetryHandlers { 113 | dispatch: Dispatcher["dispatch"]; 114 | handler: Dispatcher.DispatchHandlers; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elisp-check", 3 | "version": "1.4.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "elisp-check", 9 | "version": "1.4.0", 10 | "license": "GPL-3.0-or-later", 11 | "dependencies": { 12 | "@actions/core": "^1.11.1", 13 | "@actions/exec": "^1.1.1" 14 | }, 15 | "devDependencies": {} 16 | }, 17 | "node_modules/@actions/core": { 18 | "version": "1.11.1", 19 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", 20 | "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", 21 | "license": "MIT", 22 | "dependencies": { 23 | "@actions/exec": "^1.1.1", 24 | "@actions/http-client": "^2.0.1" 25 | } 26 | }, 27 | "node_modules/@actions/exec": { 28 | "version": "1.1.1", 29 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", 30 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", 31 | "license": "MIT", 32 | "dependencies": { 33 | "@actions/io": "^1.0.1" 34 | } 35 | }, 36 | "node_modules/@actions/http-client": { 37 | "version": "2.2.3", 38 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", 39 | "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", 40 | "license": "MIT", 41 | "dependencies": { 42 | "tunnel": "^0.0.6", 43 | "undici": "^5.25.4" 44 | } 45 | }, 46 | "node_modules/@actions/io": { 47 | "version": "1.1.3", 48 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", 49 | "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", 50 | "license": "MIT" 51 | }, 52 | "node_modules/@fastify/busboy": { 53 | "version": "2.1.1", 54 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 55 | "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 56 | "license": "MIT", 57 | "engines": { 58 | "node": ">=14" 59 | } 60 | }, 61 | "node_modules/tunnel": { 62 | "version": "0.0.6", 63 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 64 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", 65 | "license": "MIT", 66 | "engines": { 67 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3" 68 | } 69 | }, 70 | "node_modules/undici": { 71 | "version": "5.28.5", 72 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", 73 | "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", 74 | "license": "MIT", 75 | "dependencies": { 76 | "@fastify/busboy": "^2.0.0" 77 | }, 78 | "engines": { 79 | "node": ">=14.0" 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elisp-check", 3 | "version": "1.4.0", 4 | "description": "GitHub Actions for Emacs Lisp checks", 5 | "main": "index.js", 6 | "scripts": {}, 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/leotaku/elisp-check.git" 10 | }, 11 | "keywords": [ 12 | "emacs", 13 | "emacs-lisp", 14 | "github-actions", 15 | "linting", 16 | "testing" 17 | ], 18 | "author": "Leo Gaskin ", 19 | "license": "GPL-3.0-or-later", 20 | "bugs": { 21 | "url": "https://github.com/leotaku/elisp-check/issues" 22 | }, 23 | "homepage": "https://github.com/leotaku/elisp-check#readme", 24 | "dependencies": { 25 | "@actions/core": "^1.11.1", 26 | "@actions/exec": "^1.1.1" 27 | }, 28 | "devDependencies": {} 29 | } 30 | --------------------------------------------------------------------------------