Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot af35edadc0 build(release): 1.11.7 [skip ci]
## [1.11.7](https://github.com/actions/create-github-app-token/compare/v1.11.6...v1.11.7) (2025-03-20)

### Bug Fixes

* **deps:** bump undici from 5.28.4 to 7.5.0 ([#214](https://github.com/actions/create-github-app-token/issues/214)) ([a24b46a](https://github.com/actions/create-github-app-token/commit/a24b46a4626bf0f67abb297b82d863218920d5e2))
2025-03-20 05:59:25 +00:00
dependabot[bot] a24b46a462 fix(deps): bump undici from 5.28.4 to 7.5.0 (#214)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 7.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodejs/undici/releases">undici's
releases</a>.</em></p>
<blockquote>
<h2>v7.5.0</h2>
<h2>What's Changed</h2>
<ul>
<li>feat(docs): button to switch dark and light mode by <a
href="https://github.com/shivarm"><code>@​shivarm</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4044">nodejs/undici#4044</a></li>
<li>feat: add mock call history to access request configuration in test
by <a href="https://github.com/blephy"><code>@​blephy</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4029">nodejs/undici#4029</a></li>
<li>fix: Fix retry-handler.js when retry-after header is a Date by <a
href="https://github.com/fgiova"><code>@​fgiova</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4084">nodejs/undici#4084</a></li>
<li>Update Cache Tests by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4027">nodejs/undici#4027</a></li>
<li>Allow disabling autoSelectFamily in an Agent by <a
href="https://github.com/hitsthings"><code>@​hitsthings</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4070">nodejs/undici#4070</a></li>
<li>Removed clients with unrecoverable errors from the Pool by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4088">nodejs/undici#4088</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/blephy"><code>@​blephy</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4029">nodejs/undici#4029</a></li>
<li><a href="https://github.com/fgiova"><code>@​fgiova</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4084">nodejs/undici#4084</a></li>
<li><a
href="https://github.com/hitsthings"><code>@​hitsthings</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4070">nodejs/undici#4070</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v7.4.0...v7.5.0">https://github.com/nodejs/undici/compare/v7.4.0...v7.5.0</a></p>
<h2>v7.4.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: apply byte offset on Buffer.from by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4019">nodejs/undici#4019</a></li>
<li>fix: fetch body fallback random number generation by <a
href="https://github.com/Uzlopak"><code>@​Uzlopak</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4023">nodejs/undici#4023</a></li>
<li>Add release instructions by <a
href="https://github.com/mcollina"><code>@​mcollina</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4022">nodejs/undici#4022</a></li>
<li>Update Cache Tests by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4020">nodejs/undici#4020</a></li>
<li>Update WPT by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4011">nodejs/undici#4011</a></li>
<li>docs: document about global dispatcher and errors (<a
href="https://redirect.github.com/nodejs/undici/issues/3987">#3987</a>)
by <a href="https://github.com/zuozp8"><code>@​zuozp8</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4014">nodejs/undici#4014</a></li>
<li>docs: fix incorrect method signature of <code>onResponseError</code>
by <a href="https://github.com/tmair"><code>@​tmair</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4030">nodejs/undici#4030</a></li>
<li>feat(docs): copy to clipboard button by <a
href="https://github.com/shivarm"><code>@​shivarm</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4037">nodejs/undici#4037</a></li>
<li>don't check AbortSignal maxListeners on some node versions by <a
href="https://github.com/KhafraDev"><code>@​KhafraDev</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4045">nodejs/undici#4045</a></li>
<li>feat: mark <code>EnvHttpProxyAgent</code> as stable by <a
href="https://github.com/aduh95"><code>@​aduh95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4049">nodejs/undici#4049</a></li>
<li>test: fix windows wpt by <a
href="https://github.com/metcoder95"><code>@​metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4050">nodejs/undici#4050</a></li>
<li>fix: do not throw unhandled exception when data is undefined in
interceptor.reply by <a
href="https://github.com/frederikprijck"><code>@​frederikprijck</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4036">nodejs/undici#4036</a></li>
<li>fix: handle missing vary header values by <a
href="https://github.com/gurgunday"><code>@​gurgunday</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4031">nodejs/undici#4031</a></li>
<li>Update WPT by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4028">nodejs/undici#4028</a></li>
<li>Update WPT by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/4062">nodejs/undici#4062</a></li>
<li>fix: fix EnvHttpProxyAgent for the Node.js bundle by <a
href="https://github.com/joyeecheung"><code>@​joyeecheung</code></a> in
<a
href="https://redirect.github.com/nodejs/undici/pull/4064">nodejs/undici#4064</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/zuozp8"><code>@​zuozp8</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4014">nodejs/undici#4014</a></li>
<li><a href="https://github.com/tmair"><code>@​tmair</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4030">nodejs/undici#4030</a></li>
<li><a href="https://github.com/shivarm"><code>@​shivarm</code></a> made
their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4037">nodejs/undici#4037</a></li>
<li><a
href="https://github.com/frederikprijck"><code>@​frederikprijck</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4036">nodejs/undici#4036</a></li>
<li><a
href="https://github.com/joyeecheung"><code>@​joyeecheung</code></a>
made their first contribution in <a
href="https://redirect.github.com/nodejs/undici/pull/4064">nodejs/undici#4064</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v7.3.0...v7.4.0">https://github.com/nodejs/undici/compare/v7.3.0...v7.4.0</a></p>
<h2>v7.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: sqlite null ref by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4016">nodejs/undici#4016</a></li>
<li>fix: sqlite remove unnecessary parameter by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4017">nodejs/undici#4017</a></li>
<li>feat: sqlite add set and minor cleanup by <a
href="https://github.com/ronag"><code>@​ronag</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/4018">nodejs/undici#4018</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/nodejs/undici/commit/a180465f3ae472d1cc860badcc36bda5566ff2a5"><code>a180465</code></a>
Bumped v7.5.0 (<a
href="https://redirect.github.com/nodejs/undici/issues/4091">#4091</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/f317618ec28753a4218beccea048bcf89c36db25"><code>f317618</code></a>
Removed clients with unrecoverable errors from the Pool (<a
href="https://redirect.github.com/nodejs/undici/issues/4088">#4088</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/1e58b58523c59fa49ce5de61fefbae6825052633"><code>1e58b58</code></a>
feat: Allow disabling autoSelectFamily in an Agent (<a
href="https://redirect.github.com/nodejs/undici/issues/4070">#4070</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/2767d0e4e9214bf36e446f82675e758c8ef2f49e"><code>2767d0e</code></a>
chore: update cache tests (<a
href="https://redirect.github.com/nodejs/undici/issues/4027">#4027</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/ef276d4a296b99f547ed563a11e74ae71bc84bc1"><code>ef276d4</code></a>
fix: Fix retry-handler.js when retry-after header is a Date (<a
href="https://redirect.github.com/nodejs/undici/issues/4084">#4084</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/61797882f210e7e6f2b34158c0f25336ff72a751"><code>6179788</code></a>
feat: add mock call history to access request configuration in test (<a
href="https://redirect.github.com/nodejs/undici/issues/4029">#4029</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/f11ae944dab697d2dc22318403200b144b4b2b91"><code>f11ae94</code></a>
feat(docs): button to switch dark and light mode (<a
href="https://redirect.github.com/nodejs/undici/issues/4044">#4044</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/6bb527e9d768c5ca5b98765c28cf403ad8b250fb"><code>6bb527e</code></a>
Bumped v7.4.0 (<a
href="https://redirect.github.com/nodejs/undici/issues/4071">#4071</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/a217002369c403f5a84a870520294435632ef6eb"><code>a217002</code></a>
fix: fix EnvHttpProxyAgent for the Node.js bundle (<a
href="https://redirect.github.com/nodejs/undici/issues/4064">#4064</a>)</li>
<li><a
href="https://github.com/nodejs/undici/commit/782f06b1ec44043f858b8ad1f76225919ecd55db"><code>782f06b</code></a>
chore: update WPT (<a
href="https://redirect.github.com/nodejs/undici/issues/4062">#4062</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodejs/undici/compare/v5.28.4...v7.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=undici&package-manager=npm_and_yarn&previous-version=5.28.4&new-version=7.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/actions/create-github-app-token/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-19 22:58:51 -07:00
4 changed files with 608 additions and 77 deletions
+299 -34
View File
@@ -5260,6 +5260,13 @@ var require_body = __commonJS({
var { isUint8Array, isArrayBuffer } = require("util/types");
var { File: UndiciFile } = require_file();
var { parseMIMEType, serializeAMimeType } = require_dataURL();
var random;
try {
const crypto = require("node:crypto");
random = (max) => crypto.randomInt(0, max);
} catch {
random = (max) => Math.floor(Math.random(max));
}
var ReadableStream2 = globalThis.ReadableStream;
var File = NativeFile ?? UndiciFile;
var textEncoder = new TextEncoder();
@@ -5302,7 +5309,7 @@ var require_body = __commonJS({
} else if (ArrayBuffer.isView(object)) {
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));
} else if (util.isFormDataLike(object)) {
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`;
const prefix = `--${boundary}\r
Content-Disposition: form-data`;
const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
@@ -8858,6 +8865,14 @@ var require_pool = __commonJS({
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
this[kFactory] = factory;
this.on("connectionError", (origin2, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target);
if (idx !== -1) {
this[kClients].splice(idx, 1);
}
}
});
}
[kGetDispatcher]() {
let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]);
@@ -11528,6 +11543,7 @@ var require_headers = __commonJS({
isValidHeaderName,
isValidHeaderValue
} = require_util2();
var util = require("util");
var { webidl } = require_webidl();
var assert = require("assert");
var kHeadersMap = Symbol("headers map");
@@ -11879,6 +11895,9 @@ var require_headers = __commonJS({
[Symbol.toStringTag]: {
value: "Headers",
configurable: true
},
[util.inspect.custom]: {
enumerable: false
}
});
webidl.converters.HeadersInit = function(V) {
@@ -15468,8 +15487,6 @@ var require_constants4 = __commonJS({
var require_util6 = __commonJS({
"node_modules/@actions/http-client/node_modules/undici/lib/cookies/util.js"(exports2, module2) {
"use strict";
var assert = require("assert");
var { kHeadersList } = require_symbols();
function isCTLExcludingHtab(value) {
if (value.length === 0) {
return false;
@@ -15600,25 +15617,13 @@ var require_util6 = __commonJS({
}
return out.join("; ");
}
var kHeadersListNode;
function getHeadersList(headers) {
if (headers[kHeadersList]) {
return headers[kHeadersList];
}
if (!kHeadersListNode) {
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
(symbol) => symbol.description === "headers list"
);
assert(kHeadersListNode, "Headers cannot be parsed");
}
const headersList = headers[kHeadersListNode];
assert(headersList);
return headersList;
}
module2.exports = {
isCTLExcludingHtab,
stringify,
getHeadersList
validateCookieName,
validateCookiePath,
validateCookieValue,
toIMFDate,
stringify
};
}
});
@@ -15768,7 +15773,7 @@ var require_cookies = __commonJS({
"node_modules/@actions/http-client/node_modules/undici/lib/cookies/index.js"(exports2, module2) {
"use strict";
var { parseSetCookie } = require_parse();
var { stringify, getHeadersList } = require_util6();
var { stringify } = require_util6();
var { webidl } = require_webidl();
var { Headers } = require_headers();
function getCookies(headers) {
@@ -15800,11 +15805,11 @@ var require_cookies = __commonJS({
function getSetCookies(headers) {
webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" });
webidl.brandCheck(headers, Headers, { strict: false });
const cookies = getHeadersList(headers).cookies;
const cookies = headers.getSetCookie();
if (!cookies) {
return [];
}
return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair));
return cookies.map((pair) => parseSetCookie(pair));
}
function setCookie(headers, cookie) {
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
@@ -27754,7 +27759,7 @@ var require_client2 = __commonJS({
allowH2,
socketPath,
timeout: connectTimeout,
...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...connect2
});
}
@@ -28390,7 +28395,7 @@ var require_pool2 = __commonJS({
allowH2,
socketPath,
timeout: connectTimeout,
...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...connect
});
}
@@ -28399,6 +28404,14 @@ var require_pool2 = __commonJS({
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
this[kFactory] = factory;
this.on("connectionError", (origin2, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target);
if (idx !== -1) {
this[kClients].splice(idx, 1);
}
}
});
}
[kGetDispatcher]() {
for (const client of this[kClients]) {
@@ -28946,8 +28959,8 @@ var require_retry_handler = __commonJS({
wrapRequestBody
} = require_util8();
function calculateRetryAfterHeader(retryAfter) {
const current = Date.now();
return new Date(retryAfter).getTime() - current;
const retryTime = new Date(retryAfter).getTime();
return isNaN(retryTime) ? 0 : retryTime - Date.now();
}
var RetryHandler = class _RetryHandler {
constructor(opts, { dispatch, handler }) {
@@ -29041,7 +29054,7 @@ var require_retry_handler = __commonJS({
let retryAfterHeader = headers?.["retry-after"];
if (retryAfterHeader) {
retryAfterHeader = Number(retryAfterHeader);
retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3;
retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(headers["retry-after"]) : retryAfterHeader * 1e3;
}
const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
setTimeout(() => cb(null), retryTimeout);
@@ -30458,7 +30471,12 @@ var require_mock_symbols2 = __commonJS({
kNetConnect: Symbol("net connect"),
kGetNetConnect: Symbol("get net connect"),
kConnected: Symbol("connected"),
kIgnoreTrailingSlash: Symbol("ignore trailing slash")
kIgnoreTrailingSlash: Symbol("ignore trailing slash"),
kMockAgentMockCallHistoryInstance: Symbol("mock agent mock call history name"),
kMockAgentRegisterCallHistory: Symbol("mock agent register mock call history"),
kMockAgentAddCallHistoryLog: Symbol("mock agent add call history log"),
kMockAgentIsCallHistoryEnabled: Symbol("mock agent is call history enabled"),
kMockCallHistoryAddLog: Symbol("mock call history add log")
};
}
});
@@ -30482,6 +30500,7 @@ var require_mock_utils2 = __commonJS({
isPromise
}
} = require("node:util");
var { InvalidArgumentError } = require_errors2();
function matchValue(match, value) {
if (typeof match === "string") {
return match === value;
@@ -30747,9 +30766,12 @@ var require_mock_utils2 = __commonJS({
}
return false;
}
function buildMockOptions(opts) {
function buildAndValidateMockOptions(opts) {
if (opts) {
const { agent, ...mockOptions } = opts;
if ("enableCallHistory" in mockOptions && typeof mockOptions.enableCallHistory !== "boolean") {
throw new InvalidArgumentError("options.enableCallHistory must to be a boolean");
}
return mockOptions;
}
}
@@ -30766,7 +30788,7 @@ var require_mock_utils2 = __commonJS({
mockDispatch,
buildMockDispatch,
checkNetConnect,
buildMockOptions,
buildAndValidateMockOptions,
getHeaderByName,
buildHeadersFromArray
};
@@ -30995,6 +31017,206 @@ var require_mock_client2 = __commonJS({
}
});
// node_modules/undici/lib/mock/mock-call-history.js
var require_mock_call_history = __commonJS({
"node_modules/undici/lib/mock/mock-call-history.js"(exports2, module2) {
"use strict";
var { kMockCallHistoryAddLog } = require_mock_symbols2();
var { InvalidArgumentError } = require_errors2();
function handleFilterCallsWithOptions(criteria, options, handler, store) {
switch (options.operator) {
case "OR":
store.push(...handler(criteria));
return store;
case "AND":
return handler.call({ logs: store }, criteria);
default:
throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
}
}
function buildAndValidateFilterCallsOptions(options = {}) {
const finalOptions = {};
if ("operator" in options) {
if (typeof options.operator !== "string" || options.operator.toUpperCase() !== "OR" && options.operator.toUpperCase() !== "AND") {
throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
}
return {
...finalOptions,
operator: options.operator.toUpperCase()
};
}
return finalOptions;
}
function makeFilterCalls(parameterName) {
return (parameterValue) => {
if (typeof parameterValue === "string" || parameterValue == null) {
return this.logs.filter((log) => {
return log[parameterName] === parameterValue;
});
}
if (parameterValue instanceof RegExp) {
return this.logs.filter((log) => {
return parameterValue.test(log[parameterName]);
});
}
throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
};
}
function computeUrlWithMaybeSearchParameters(requestInit) {
try {
const url = new URL(requestInit.path, requestInit.origin);
if (url.search.length !== 0) {
return url;
}
url.search = new URLSearchParams(requestInit.query).toString();
return url;
} catch (error) {
throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error });
}
}
var MockCallHistoryLog = class {
constructor(requestInit = {}) {
this.body = requestInit.body;
this.headers = requestInit.headers;
this.method = requestInit.method;
const url = computeUrlWithMaybeSearchParameters(requestInit);
this.fullUrl = url.toString();
this.origin = url.origin;
this.path = url.pathname;
this.searchParams = Object.fromEntries(url.searchParams);
this.protocol = url.protocol;
this.host = url.host;
this.port = url.port;
this.hash = url.hash;
}
toMap() {
return /* @__PURE__ */ new Map(
[
["protocol", this.protocol],
["host", this.host],
["port", this.port],
["origin", this.origin],
["path", this.path],
["hash", this.hash],
["searchParams", this.searchParams],
["fullUrl", this.fullUrl],
["method", this.method],
["body", this.body],
["headers", this.headers]
]
);
}
toString() {
const options = { betweenKeyValueSeparator: "->", betweenPairSeparator: "|" };
let result = "";
this.toMap().forEach((value, key) => {
if (typeof value === "string" || value === void 0 || value === null) {
result = `${result}${key}${options.betweenKeyValueSeparator}${value}${options.betweenPairSeparator}`;
}
if (typeof value === "object" && value !== null || Array.isArray(value)) {
result = `${result}${key}${options.betweenKeyValueSeparator}${JSON.stringify(value)}${options.betweenPairSeparator}`;
}
});
return result.slice(0, -1);
}
};
var MockCallHistory = class {
logs = [];
calls() {
return this.logs;
}
firstCall() {
return this.logs.at(0);
}
lastCall() {
return this.logs.at(-1);
}
nthCall(number) {
if (typeof number !== "number") {
throw new InvalidArgumentError("nthCall must be called with a number");
}
if (!Number.isInteger(number)) {
throw new InvalidArgumentError("nthCall must be called with an integer");
}
if (Math.sign(number) !== 1) {
throw new InvalidArgumentError("nthCall must be called with a positive value. use firstCall or lastCall instead");
}
return this.logs.at(number - 1);
}
filterCalls(criteria, options) {
if (this.logs.length === 0) {
return this.logs;
}
if (typeof criteria === "function") {
return this.logs.filter(criteria);
}
if (criteria instanceof RegExp) {
return this.logs.filter((log) => {
return criteria.test(log.toString());
});
}
if (typeof criteria === "object" && criteria !== null) {
if (Object.keys(criteria).length === 0) {
return this.logs;
}
const finalOptions = { operator: "OR", ...buildAndValidateFilterCallsOptions(options) };
let maybeDuplicatedLogsFiltered = [];
if ("protocol" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered);
}
if ("host" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered);
}
if ("port" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered);
}
if ("origin" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered);
}
if ("path" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered);
}
if ("hash" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered);
}
if ("fullUrl" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered);
}
if ("method" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered);
}
const uniqLogsFiltered = [...new Set(maybeDuplicatedLogsFiltered)];
return uniqLogsFiltered;
}
throw new InvalidArgumentError("criteria parameter should be one of function, regexp, or object");
}
filterCallsByProtocol = makeFilterCalls.call(this, "protocol");
filterCallsByHost = makeFilterCalls.call(this, "host");
filterCallsByPort = makeFilterCalls.call(this, "port");
filterCallsByOrigin = makeFilterCalls.call(this, "origin");
filterCallsByPath = makeFilterCalls.call(this, "path");
filterCallsByHash = makeFilterCalls.call(this, "hash");
filterCallsByFullUrl = makeFilterCalls.call(this, "fullUrl");
filterCallsByMethod = makeFilterCalls.call(this, "method");
clear() {
this.logs = [];
}
[kMockCallHistoryAddLog](requestInit) {
const log = new MockCallHistoryLog(requestInit);
this.logs.push(log);
return log;
}
*[Symbol.iterator]() {
for (const log of this.calls()) {
yield log;
}
}
};
module2.exports.MockCallHistory = MockCallHistory;
module2.exports.MockCallHistoryLog = MockCallHistoryLog;
}
});
// node_modules/undici/lib/mock/mock-pool.js
var require_mock_pool2 = __commonJS({
"node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) {
@@ -31109,26 +31331,37 @@ var require_mock_agent2 = __commonJS({
kNetConnect,
kGetNetConnect,
kOptions,
kFactory
kFactory,
kMockAgentRegisterCallHistory,
kMockAgentIsCallHistoryEnabled,
kMockAgentAddCallHistoryLog,
kMockAgentMockCallHistoryInstance,
kMockCallHistoryAddLog
} = require_mock_symbols2();
var MockClient = require_mock_client2();
var MockPool = require_mock_pool2();
var { matchValue, buildMockOptions } = require_mock_utils2();
var { matchValue, buildAndValidateMockOptions } = require_mock_utils2();
var { InvalidArgumentError, UndiciError } = require_errors2();
var Dispatcher = require_dispatcher2();
var PendingInterceptorsFormatter = require_pending_interceptors_formatter2();
var { MockCallHistory } = require_mock_call_history();
var MockAgent = class extends Dispatcher {
constructor(opts) {
super(opts);
const mockOptions = buildAndValidateMockOptions(opts);
this[kNetConnect] = true;
this[kIsMockActive] = true;
this[kMockAgentIsCallHistoryEnabled] = mockOptions?.enableCallHistory ?? false;
if (opts?.agent && typeof opts.agent.dispatch !== "function") {
throw new InvalidArgumentError("Argument opts.agent must implement Agent");
}
const agent = opts?.agent ? opts.agent : new Agent(opts);
this[kAgent] = agent;
this[kClients] = agent[kClients];
this[kOptions] = buildMockOptions(opts);
this[kOptions] = mockOptions;
if (this[kMockAgentIsCallHistoryEnabled]) {
this[kMockAgentRegisterCallHistory]();
}
}
get(origin) {
let dispatcher = this[kMockAgentGet](origin);
@@ -31140,9 +31373,11 @@ var require_mock_agent2 = __commonJS({
}
dispatch(opts, handler) {
this.get(opts.origin);
this[kMockAgentAddCallHistoryLog](opts);
return this[kAgent].dispatch(opts, handler);
}
async close() {
this.clearCallHistory();
await this[kAgent].close();
this[kClients].clear();
}
@@ -31168,11 +31403,38 @@ var require_mock_agent2 = __commonJS({
disableNetConnect() {
this[kNetConnect] = false;
}
enableCallHistory() {
this[kMockAgentIsCallHistoryEnabled] = true;
return this;
}
disableCallHistory() {
this[kMockAgentIsCallHistoryEnabled] = false;
return this;
}
getCallHistory() {
return this[kMockAgentMockCallHistoryInstance];
}
clearCallHistory() {
if (this[kMockAgentMockCallHistoryInstance] !== void 0) {
this[kMockAgentMockCallHistoryInstance].clear();
}
}
// This is required to bypass issues caused by using global symbols - see:
// https://github.com/nodejs/undici/issues/1447
get isMockActive() {
return this[kIsMockActive];
}
[kMockAgentRegisterCallHistory]() {
if (this[kMockAgentMockCallHistoryInstance] === void 0) {
this[kMockAgentMockCallHistoryInstance] = new MockCallHistory();
}
}
[kMockAgentAddCallHistoryLog](opts) {
if (this[kMockAgentIsCallHistoryEnabled]) {
this[kMockAgentRegisterCallHistory]();
this[kMockAgentMockCallHistoryInstance][kMockCallHistoryAddLog](opts);
}
}
[kMockAgentSet](origin, dispatcher) {
this[kClients].set(origin, dispatcher);
}
@@ -40035,6 +40297,7 @@ var require_undici2 = __commonJS({
var api = require_api2();
var buildConnector = require_connect2();
var MockClient = require_mock_client2();
var { MockCallHistory, MockCallHistoryLog } = require_mock_call_history();
var MockAgent = require_mock_agent2();
var MockPool = require_mock_pool2();
var mockErrors = require_mock_errors2();
@@ -40157,6 +40420,8 @@ var require_undici2 = __commonJS({
module2.exports.connect = makeDispatcher(api.connect);
module2.exports.upgrade = makeDispatcher(api.upgrade);
module2.exports.MockClient = MockClient;
module2.exports.MockCallHistory = MockCallHistory;
module2.exports.MockCallHistoryLog = MockCallHistoryLog;
module2.exports.MockPool = MockPool;
module2.exports.MockAgent = MockAgent;
module2.exports.mockErrors = mockErrors;
+299 -34
View File
@@ -5255,6 +5255,13 @@ var require_body = __commonJS({
var { isUint8Array, isArrayBuffer } = require("util/types");
var { File: UndiciFile } = require_file();
var { parseMIMEType, serializeAMimeType } = require_dataURL();
var random;
try {
const crypto = require("node:crypto");
random = (max) => crypto.randomInt(0, max);
} catch {
random = (max) => Math.floor(Math.random(max));
}
var ReadableStream2 = globalThis.ReadableStream;
var File = NativeFile ?? UndiciFile;
var textEncoder = new TextEncoder();
@@ -5297,7 +5304,7 @@ var require_body = __commonJS({
} else if (ArrayBuffer.isView(object)) {
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));
} else if (util.isFormDataLike(object)) {
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`;
const prefix = `--${boundary}\r
Content-Disposition: form-data`;
const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
@@ -8853,6 +8860,14 @@ var require_pool = __commonJS({
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
this[kFactory] = factory;
this.on("connectionError", (origin2, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target);
if (idx !== -1) {
this[kClients].splice(idx, 1);
}
}
});
}
[kGetDispatcher]() {
let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]);
@@ -11523,6 +11538,7 @@ var require_headers = __commonJS({
isValidHeaderName,
isValidHeaderValue
} = require_util2();
var util = require("util");
var { webidl } = require_webidl();
var assert = require("assert");
var kHeadersMap = Symbol("headers map");
@@ -11874,6 +11890,9 @@ var require_headers = __commonJS({
[Symbol.toStringTag]: {
value: "Headers",
configurable: true
},
[util.inspect.custom]: {
enumerable: false
}
});
webidl.converters.HeadersInit = function(V) {
@@ -15463,8 +15482,6 @@ var require_constants4 = __commonJS({
var require_util6 = __commonJS({
"node_modules/@actions/http-client/node_modules/undici/lib/cookies/util.js"(exports2, module2) {
"use strict";
var assert = require("assert");
var { kHeadersList } = require_symbols();
function isCTLExcludingHtab(value) {
if (value.length === 0) {
return false;
@@ -15595,25 +15612,13 @@ var require_util6 = __commonJS({
}
return out.join("; ");
}
var kHeadersListNode;
function getHeadersList(headers) {
if (headers[kHeadersList]) {
return headers[kHeadersList];
}
if (!kHeadersListNode) {
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
(symbol) => symbol.description === "headers list"
);
assert(kHeadersListNode, "Headers cannot be parsed");
}
const headersList = headers[kHeadersListNode];
assert(headersList);
return headersList;
}
module2.exports = {
isCTLExcludingHtab,
stringify,
getHeadersList
validateCookieName,
validateCookiePath,
validateCookieValue,
toIMFDate,
stringify
};
}
});
@@ -15763,7 +15768,7 @@ var require_cookies = __commonJS({
"node_modules/@actions/http-client/node_modules/undici/lib/cookies/index.js"(exports2, module2) {
"use strict";
var { parseSetCookie } = require_parse();
var { stringify, getHeadersList } = require_util6();
var { stringify } = require_util6();
var { webidl } = require_webidl();
var { Headers } = require_headers();
function getCookies(headers) {
@@ -15795,11 +15800,11 @@ var require_cookies = __commonJS({
function getSetCookies(headers) {
webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" });
webidl.brandCheck(headers, Headers, { strict: false });
const cookies = getHeadersList(headers).cookies;
const cookies = headers.getSetCookie();
if (!cookies) {
return [];
}
return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair));
return cookies.map((pair) => parseSetCookie(pair));
}
function setCookie(headers, cookie) {
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
@@ -27521,7 +27526,7 @@ var require_client2 = __commonJS({
allowH2,
socketPath,
timeout: connectTimeout,
...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...connect2
});
}
@@ -28157,7 +28162,7 @@ var require_pool2 = __commonJS({
allowH2,
socketPath,
timeout: connectTimeout,
...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
...connect
});
}
@@ -28166,6 +28171,14 @@ var require_pool2 = __commonJS({
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
this[kFactory] = factory;
this.on("connectionError", (origin2, targets, error) => {
for (const target of targets) {
const idx = this[kClients].indexOf(target);
if (idx !== -1) {
this[kClients].splice(idx, 1);
}
}
});
}
[kGetDispatcher]() {
for (const client of this[kClients]) {
@@ -28713,8 +28726,8 @@ var require_retry_handler = __commonJS({
wrapRequestBody
} = require_util8();
function calculateRetryAfterHeader(retryAfter) {
const current = Date.now();
return new Date(retryAfter).getTime() - current;
const retryTime = new Date(retryAfter).getTime();
return isNaN(retryTime) ? 0 : retryTime - Date.now();
}
var RetryHandler = class _RetryHandler {
constructor(opts, { dispatch, handler }) {
@@ -28808,7 +28821,7 @@ var require_retry_handler = __commonJS({
let retryAfterHeader = headers?.["retry-after"];
if (retryAfterHeader) {
retryAfterHeader = Number(retryAfterHeader);
retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3;
retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(headers["retry-after"]) : retryAfterHeader * 1e3;
}
const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
setTimeout(() => cb(null), retryTimeout);
@@ -30225,7 +30238,12 @@ var require_mock_symbols2 = __commonJS({
kNetConnect: Symbol("net connect"),
kGetNetConnect: Symbol("get net connect"),
kConnected: Symbol("connected"),
kIgnoreTrailingSlash: Symbol("ignore trailing slash")
kIgnoreTrailingSlash: Symbol("ignore trailing slash"),
kMockAgentMockCallHistoryInstance: Symbol("mock agent mock call history name"),
kMockAgentRegisterCallHistory: Symbol("mock agent register mock call history"),
kMockAgentAddCallHistoryLog: Symbol("mock agent add call history log"),
kMockAgentIsCallHistoryEnabled: Symbol("mock agent is call history enabled"),
kMockCallHistoryAddLog: Symbol("mock call history add log")
};
}
});
@@ -30249,6 +30267,7 @@ var require_mock_utils2 = __commonJS({
isPromise
}
} = require("node:util");
var { InvalidArgumentError } = require_errors2();
function matchValue(match, value) {
if (typeof match === "string") {
return match === value;
@@ -30514,9 +30533,12 @@ var require_mock_utils2 = __commonJS({
}
return false;
}
function buildMockOptions(opts) {
function buildAndValidateMockOptions(opts) {
if (opts) {
const { agent, ...mockOptions } = opts;
if ("enableCallHistory" in mockOptions && typeof mockOptions.enableCallHistory !== "boolean") {
throw new InvalidArgumentError("options.enableCallHistory must to be a boolean");
}
return mockOptions;
}
}
@@ -30533,7 +30555,7 @@ var require_mock_utils2 = __commonJS({
mockDispatch,
buildMockDispatch,
checkNetConnect,
buildMockOptions,
buildAndValidateMockOptions,
getHeaderByName,
buildHeadersFromArray
};
@@ -30762,6 +30784,206 @@ var require_mock_client2 = __commonJS({
}
});
// node_modules/undici/lib/mock/mock-call-history.js
var require_mock_call_history = __commonJS({
"node_modules/undici/lib/mock/mock-call-history.js"(exports2, module2) {
"use strict";
var { kMockCallHistoryAddLog } = require_mock_symbols2();
var { InvalidArgumentError } = require_errors2();
function handleFilterCallsWithOptions(criteria, options, handler, store) {
switch (options.operator) {
case "OR":
store.push(...handler(criteria));
return store;
case "AND":
return handler.call({ logs: store }, criteria);
default:
throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
}
}
function buildAndValidateFilterCallsOptions(options = {}) {
const finalOptions = {};
if ("operator" in options) {
if (typeof options.operator !== "string" || options.operator.toUpperCase() !== "OR" && options.operator.toUpperCase() !== "AND") {
throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
}
return {
...finalOptions,
operator: options.operator.toUpperCase()
};
}
return finalOptions;
}
function makeFilterCalls(parameterName) {
return (parameterValue) => {
if (typeof parameterValue === "string" || parameterValue == null) {
return this.logs.filter((log) => {
return log[parameterName] === parameterValue;
});
}
if (parameterValue instanceof RegExp) {
return this.logs.filter((log) => {
return parameterValue.test(log[parameterName]);
});
}
throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
};
}
function computeUrlWithMaybeSearchParameters(requestInit) {
try {
const url = new URL(requestInit.path, requestInit.origin);
if (url.search.length !== 0) {
return url;
}
url.search = new URLSearchParams(requestInit.query).toString();
return url;
} catch (error) {
throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error });
}
}
var MockCallHistoryLog = class {
constructor(requestInit = {}) {
this.body = requestInit.body;
this.headers = requestInit.headers;
this.method = requestInit.method;
const url = computeUrlWithMaybeSearchParameters(requestInit);
this.fullUrl = url.toString();
this.origin = url.origin;
this.path = url.pathname;
this.searchParams = Object.fromEntries(url.searchParams);
this.protocol = url.protocol;
this.host = url.host;
this.port = url.port;
this.hash = url.hash;
}
toMap() {
return /* @__PURE__ */ new Map(
[
["protocol", this.protocol],
["host", this.host],
["port", this.port],
["origin", this.origin],
["path", this.path],
["hash", this.hash],
["searchParams", this.searchParams],
["fullUrl", this.fullUrl],
["method", this.method],
["body", this.body],
["headers", this.headers]
]
);
}
toString() {
const options = { betweenKeyValueSeparator: "->", betweenPairSeparator: "|" };
let result = "";
this.toMap().forEach((value, key) => {
if (typeof value === "string" || value === void 0 || value === null) {
result = `${result}${key}${options.betweenKeyValueSeparator}${value}${options.betweenPairSeparator}`;
}
if (typeof value === "object" && value !== null || Array.isArray(value)) {
result = `${result}${key}${options.betweenKeyValueSeparator}${JSON.stringify(value)}${options.betweenPairSeparator}`;
}
});
return result.slice(0, -1);
}
};
var MockCallHistory = class {
logs = [];
calls() {
return this.logs;
}
firstCall() {
return this.logs.at(0);
}
lastCall() {
return this.logs.at(-1);
}
nthCall(number) {
if (typeof number !== "number") {
throw new InvalidArgumentError("nthCall must be called with a number");
}
if (!Number.isInteger(number)) {
throw new InvalidArgumentError("nthCall must be called with an integer");
}
if (Math.sign(number) !== 1) {
throw new InvalidArgumentError("nthCall must be called with a positive value. use firstCall or lastCall instead");
}
return this.logs.at(number - 1);
}
filterCalls(criteria, options) {
if (this.logs.length === 0) {
return this.logs;
}
if (typeof criteria === "function") {
return this.logs.filter(criteria);
}
if (criteria instanceof RegExp) {
return this.logs.filter((log) => {
return criteria.test(log.toString());
});
}
if (typeof criteria === "object" && criteria !== null) {
if (Object.keys(criteria).length === 0) {
return this.logs;
}
const finalOptions = { operator: "OR", ...buildAndValidateFilterCallsOptions(options) };
let maybeDuplicatedLogsFiltered = [];
if ("protocol" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered);
}
if ("host" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered);
}
if ("port" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered);
}
if ("origin" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered);
}
if ("path" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered);
}
if ("hash" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered);
}
if ("fullUrl" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered);
}
if ("method" in criteria) {
maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered);
}
const uniqLogsFiltered = [...new Set(maybeDuplicatedLogsFiltered)];
return uniqLogsFiltered;
}
throw new InvalidArgumentError("criteria parameter should be one of function, regexp, or object");
}
filterCallsByProtocol = makeFilterCalls.call(this, "protocol");
filterCallsByHost = makeFilterCalls.call(this, "host");
filterCallsByPort = makeFilterCalls.call(this, "port");
filterCallsByOrigin = makeFilterCalls.call(this, "origin");
filterCallsByPath = makeFilterCalls.call(this, "path");
filterCallsByHash = makeFilterCalls.call(this, "hash");
filterCallsByFullUrl = makeFilterCalls.call(this, "fullUrl");
filterCallsByMethod = makeFilterCalls.call(this, "method");
clear() {
this.logs = [];
}
[kMockCallHistoryAddLog](requestInit) {
const log = new MockCallHistoryLog(requestInit);
this.logs.push(log);
return log;
}
*[Symbol.iterator]() {
for (const log of this.calls()) {
yield log;
}
}
};
module2.exports.MockCallHistory = MockCallHistory;
module2.exports.MockCallHistoryLog = MockCallHistoryLog;
}
});
// node_modules/undici/lib/mock/mock-pool.js
var require_mock_pool2 = __commonJS({
"node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) {
@@ -30876,26 +31098,37 @@ var require_mock_agent2 = __commonJS({
kNetConnect,
kGetNetConnect,
kOptions,
kFactory
kFactory,
kMockAgentRegisterCallHistory,
kMockAgentIsCallHistoryEnabled,
kMockAgentAddCallHistoryLog,
kMockAgentMockCallHistoryInstance,
kMockCallHistoryAddLog
} = require_mock_symbols2();
var MockClient = require_mock_client2();
var MockPool = require_mock_pool2();
var { matchValue, buildMockOptions } = require_mock_utils2();
var { matchValue, buildAndValidateMockOptions } = require_mock_utils2();
var { InvalidArgumentError, UndiciError } = require_errors2();
var Dispatcher = require_dispatcher2();
var PendingInterceptorsFormatter = require_pending_interceptors_formatter2();
var { MockCallHistory } = require_mock_call_history();
var MockAgent = class extends Dispatcher {
constructor(opts) {
super(opts);
const mockOptions = buildAndValidateMockOptions(opts);
this[kNetConnect] = true;
this[kIsMockActive] = true;
this[kMockAgentIsCallHistoryEnabled] = mockOptions?.enableCallHistory ?? false;
if (opts?.agent && typeof opts.agent.dispatch !== "function") {
throw new InvalidArgumentError("Argument opts.agent must implement Agent");
}
const agent = opts?.agent ? opts.agent : new Agent(opts);
this[kAgent] = agent;
this[kClients] = agent[kClients];
this[kOptions] = buildMockOptions(opts);
this[kOptions] = mockOptions;
if (this[kMockAgentIsCallHistoryEnabled]) {
this[kMockAgentRegisterCallHistory]();
}
}
get(origin) {
let dispatcher = this[kMockAgentGet](origin);
@@ -30907,9 +31140,11 @@ var require_mock_agent2 = __commonJS({
}
dispatch(opts, handler) {
this.get(opts.origin);
this[kMockAgentAddCallHistoryLog](opts);
return this[kAgent].dispatch(opts, handler);
}
async close() {
this.clearCallHistory();
await this[kAgent].close();
this[kClients].clear();
}
@@ -30935,11 +31170,38 @@ var require_mock_agent2 = __commonJS({
disableNetConnect() {
this[kNetConnect] = false;
}
enableCallHistory() {
this[kMockAgentIsCallHistoryEnabled] = true;
return this;
}
disableCallHistory() {
this[kMockAgentIsCallHistoryEnabled] = false;
return this;
}
getCallHistory() {
return this[kMockAgentMockCallHistoryInstance];
}
clearCallHistory() {
if (this[kMockAgentMockCallHistoryInstance] !== void 0) {
this[kMockAgentMockCallHistoryInstance].clear();
}
}
// This is required to bypass issues caused by using global symbols - see:
// https://github.com/nodejs/undici/issues/1447
get isMockActive() {
return this[kIsMockActive];
}
[kMockAgentRegisterCallHistory]() {
if (this[kMockAgentMockCallHistoryInstance] === void 0) {
this[kMockAgentMockCallHistoryInstance] = new MockCallHistory();
}
}
[kMockAgentAddCallHistoryLog](opts) {
if (this[kMockAgentIsCallHistoryEnabled]) {
this[kMockAgentRegisterCallHistory]();
this[kMockAgentMockCallHistoryInstance][kMockCallHistoryAddLog](opts);
}
}
[kMockAgentSet](origin, dispatcher) {
this[kClients].set(origin, dispatcher);
}
@@ -39802,6 +40064,7 @@ var require_undici2 = __commonJS({
var api = require_api2();
var buildConnector = require_connect2();
var MockClient = require_mock_client2();
var { MockCallHistory, MockCallHistoryLog } = require_mock_call_history();
var MockAgent = require_mock_agent2();
var MockPool = require_mock_pool2();
var mockErrors = require_mock_errors2();
@@ -39924,6 +40187,8 @@ var require_undici2 = __commonJS({
module2.exports.connect = makeDispatcher(api.connect);
module2.exports.upgrade = makeDispatcher(api.upgrade);
module2.exports.MockClient = MockClient;
module2.exports.MockCallHistory = MockCallHistory;
module2.exports.MockCallHistoryLog = MockCallHistoryLog;
module2.exports.MockPool = MockPool;
module2.exports.MockAgent = MockAgent;
module2.exports.mockErrors = mockErrors;
+9 -8
View File
@@ -1,12 +1,12 @@
{
"name": "create-github-app-token",
"version": "1.11.5",
"version": "1.11.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "create-github-app-token",
"version": "1.11.5",
"version": "1.11.6",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.11.1",
@@ -53,9 +53,10 @@
}
},
"node_modules/@actions/http-client/node_modules/undici": {
"version": "5.28.4",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
"version": "5.29.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
"integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
"license": "MIT",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
@@ -3639,9 +3640,9 @@
}
},
"node_modules/undici": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-7.4.0.tgz",
"integrity": "sha512-PUQM3/es3noM24oUn10u3kNNap0AbxESOmnssmW+dOi9yGwlUSi5nTNYl3bNbTkWOF8YZDkx2tCmj9OtQ3iGGw==",
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-7.5.0.tgz",
"integrity": "sha512-NFQG741e8mJ0fLQk90xKxFdaSM7z4+IQpAgsFI36bCDY9Z2+aXXZjVy2uUksMouWfMI9+w5ejOq5zYYTBCQJDQ==",
"license": "MIT",
"engines": {
"node": ">=20.18.1"
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "1.11.6",
"version": "1.11.7",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0 --packages=bundle",