@@ -25550,7 +25550,7 @@ var require_body2 = __commonJS({
25550
25550
const crypto = require("node:crypto");
25551
25551
random = (max) => crypto.randomInt(0, max);
25552
25552
} catch {
25553
- random = (max) => Math.floor(Math.random(max) );
25553
+ random = (max) => Math.floor(Math.random() * max );
25554
25554
}
25555
25555
var textEncoder = new TextEncoder();
25556
25556
function noop() {
@@ -28815,20 +28815,13 @@ var require_env_http_proxy_agent = __commonJS({
28815
28815
"http:": 80,
28816
28816
"https:": 443
28817
28817
};
28818
- var experimentalWarned = false;
28819
28818
var EnvHttpProxyAgent = class extends DispatcherBase {
28820
28819
#noProxyValue = null;
28821
28820
#noProxyEntries = null;
28822
28821
#opts = null;
28823
28822
constructor(opts = {}) {
28824
28823
super();
28825
28824
this.#opts = opts;
28826
- if (!experimentalWarned) {
28827
- experimentalWarned = true;
28828
- process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.", {
28829
- code: "UNDICI-EHPA"
28830
- });
28831
- }
28832
28825
const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts;
28833
28826
this[kNoProxyAgent] = new Agent(agentOpts);
28834
28827
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
@@ -30579,8 +30572,10 @@ var require_mock_utils2 = __commonJS({
30579
30572
return data;
30580
30573
} else if (typeof data === "object") {
30581
30574
return JSON.stringify(data);
30582
- } else {
30575
+ } else if (data) {
30583
30576
return data.toString();
30577
+ } else {
30578
+ return "";
30584
30579
}
30585
30580
}
30586
30581
function getMockDispatch(mockDispatches, key) {
@@ -32043,10 +32038,13 @@ var require_cache2 = __commonJS({
32043
32038
if (typeof key !== "string" || typeof val !== "string") {
32044
32039
throw new Error("opts.headers is not a valid header map");
32045
32040
}
32046
- headers[key] = val;
32041
+ headers[key.toLowerCase() ] = val;
32047
32042
}
32048
32043
} else if (typeof opts.headers === "object") {
32049
- headers = opts.headers;
32044
+ headers = {};
32045
+ for (const key of Object.keys(opts.headers)) {
32046
+ headers[key.toLowerCase()] = opts.headers[key];
32047
+ }
32050
32048
} else {
32051
32049
throw new Error("opts.headers is not an object");
32052
32050
}
@@ -32201,17 +32199,13 @@ var require_cache2 = __commonJS({
32201
32199
return headers;
32202
32200
}
32203
32201
const output = (
32204
- /** @type {Record<string, string | string[]>} */
32202
+ /** @type {Record<string, string | string[] | null >} */
32205
32203
{}
32206
32204
);
32207
32205
const varyingHeaders = typeof varyHeader === "string" ? varyHeader.split(",") : varyHeader;
32208
32206
for (const header of varyingHeaders) {
32209
32207
const trimmedHeader = header.trim().toLowerCase();
32210
- if (headers[trimmedHeader]) {
32211
- output[trimmedHeader] = headers[trimmedHeader];
32212
- } else {
32213
- return void 0;
32214
- }
32208
+ output[trimmedHeader] = headers[trimmedHeader] ?? null;
32215
32209
}
32216
32210
return output;
32217
32211
}
@@ -32793,7 +32787,12 @@ var require_memory_cache_store = __commonJS({
32793
32787
assertCacheKey(key);
32794
32788
const topLevelKey = `${key.origin}:${key.path}`;
32795
32789
const now = Date.now();
32796
- const entry = this.#entries.get(topLevelKey)?.find((entry2) => entry2.deleteAt > now && entry2.method === key.method && (entry2.vary == null || Object.keys(entry2.vary).every((headerName) => entry2.vary[headerName] === key.headers?.[headerName])));
32790
+ const entry = this.#entries.get(topLevelKey)?.find((entry2) => entry2.deleteAt > now && entry2.method === key.method && (entry2.vary == null || Object.keys(entry2.vary).every((headerName) => {
32791
+ if (entry2.vary[headerName] === null) {
32792
+ return key.headers[headerName] === void 0;
32793
+ }
32794
+ return entry2.vary[headerName] === key.headers[headerName];
32795
+ })));
32797
32796
return entry == null ? void 0 : {
32798
32797
statusMessage: entry.statusMessage,
32799
32798
statusCode: entry.statusCode,
@@ -33379,7 +33378,7 @@ var require_sqlite_cache_store = __commonJS({
33379
33378
assertCacheKey(key);
33380
33379
const value = this.#findValue(key);
33381
33380
return value ? {
33382
- body: value.body ? Buffer.from(value.body.buffer) : void 0,
33381
+ body: value.body ? Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength ) : void 0,
33383
33382
statusCode: value.statusCode,
33384
33383
statusMessage: value.statusMessage,
33385
33384
headers: value.headers ? JSON.parse(value.headers) : void 0,
@@ -33524,9 +33523,6 @@ var require_sqlite_cache_store = __commonJS({
33524
33523
}
33525
33524
let matches = true;
33526
33525
if (value.vary) {
33527
- if (!headers) {
33528
- return void 0;
33529
- }
33530
33526
const vary = JSON.parse(value.vary);
33531
33527
for (const header in vary) {
33532
33528
if (!headerValueEquals(headers[header], vary[header])) {
@@ -33543,16 +33539,17 @@ var require_sqlite_cache_store = __commonJS({
33543
33539
}
33544
33540
};
33545
33541
function headerValueEquals(lhs, rhs) {
33542
+ if (lhs == null && rhs == null) {
33543
+ return true;
33544
+ }
33545
+ if (lhs == null && rhs != null || lhs != null && rhs == null) {
33546
+ return false;
33547
+ }
33546
33548
if (Array.isArray(lhs) && Array.isArray(rhs)) {
33547
33549
if (lhs.length !== rhs.length) {
33548
33550
return false;
33549
33551
}
33550
- for (let i = 0; i < lhs.length; i++) {
33551
- if (rhs.includes(lhs[i])) {
33552
- return false;
33553
- }
33554
- }
33555
- return true;
33552
+ return lhs.every((x, i) => x === rhs[i]);
33556
33553
}
33557
33554
return lhs === rhs;
33558
33555
}
@@ -34518,6 +34515,12 @@ var require_request4 = __commonJS({
34518
34515
signal.removeEventListener("abort", abort);
34519
34516
});
34520
34517
var dependentControllerMap = /* @__PURE__ */ new WeakMap();
34518
+ var abortSignalHasEventHandlerLeakWarning;
34519
+ try {
34520
+ abortSignalHasEventHandlerLeakWarning = getMaxListeners(new AbortController().signal) > 0;
34521
+ } catch {
34522
+ abortSignalHasEventHandlerLeakWarning = false;
34523
+ }
34521
34524
function buildAbort(acRef) {
34522
34525
return abort;
34523
34526
function abort() {
@@ -34745,11 +34748,8 @@ var require_request4 = __commonJS({
34745
34748
this[kAbortController] = ac;
34746
34749
const acRef = new WeakRef(ac);
34747
34750
const abort = buildAbort(acRef);
34748
- try {
34749
- if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) {
34750
- setMaxListeners(1500, signal);
34751
- }
34752
- } catch {
34751
+ if (abortSignalHasEventHandlerLeakWarning && getMaxListeners(signal) === defaultMaxListeners) {
34752
+ setMaxListeners(1500, signal);
34753
34753
}
34754
34754
util.addAbortListener(signal, abort);
34755
34755
requestFinalizer.register(ac, { signal, abort }, abort);
@@ -40739,8 +40739,7 @@ async function oauthRequest(request2, route, parameters) {
40739
40739
return response;
40740
40740
}
40741
40741
async function exchangeWebFlowCode(options) {
40742
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40743
- request;
40742
+ const request2 = options.request || request;
40744
40743
const response = await oauthRequest(
40745
40744
request2,
40746
40745
"POST /login/oauth/access_token",
@@ -40777,8 +40776,7 @@ function toTimestamp(apiTimeInMs, expirationInSeconds) {
40777
40776
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
40778
40777
}
40779
40778
async function createDeviceCode(options) {
40780
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40781
- request;
40779
+ const request2 = options.request || request;
40782
40780
const parameters = {
40783
40781
client_id: options.clientId
40784
40782
};
@@ -40788,8 +40786,7 @@ async function createDeviceCode(options) {
40788
40786
return oauthRequest(request2, "POST /login/device/code", parameters);
40789
40787
}
40790
40788
async function exchangeDeviceCode(options) {
40791
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40792
- request;
40789
+ const request2 = options.request || request;
40793
40790
const response = await oauthRequest(
40794
40791
request2,
40795
40792
"POST /login/oauth/access_token",
@@ -40827,8 +40824,7 @@ function toTimestamp2(apiTimeInMs, expirationInSeconds) {
40827
40824
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
40828
40825
}
40829
40826
async function checkToken(options) {
40830
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40831
- request;
40827
+ const request2 = options.request || request;
40832
40828
const response = await request2("POST /applications/{client_id}/token", {
40833
40829
headers: {
40834
40830
authorization: `basic ${btoa(
@@ -40853,8 +40849,7 @@ async function checkToken(options) {
40853
40849
return { ...response, authentication };
40854
40850
}
40855
40851
async function refreshToken(options) {
40856
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40857
- request;
40852
+ const request2 = options.request || request;
40858
40853
const response = await oauthRequest(
40859
40854
request2,
40860
40855
"POST /login/oauth/access_token",
@@ -40884,8 +40879,7 @@ function toTimestamp3(apiTimeInMs, expirationInSeconds) {
40884
40879
return new Date(apiTimeInMs + expirationInSeconds * 1e3).toISOString();
40885
40880
}
40886
40881
async function resetToken(options) {
40887
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40888
- request;
40882
+ const request2 = options.request || request;
40889
40883
const auth5 = btoa(`${options.clientId}:${options.clientSecret}`);
40890
40884
const response = await request2(
40891
40885
"PATCH /applications/{client_id}/token",
@@ -40912,8 +40906,7 @@ async function resetToken(options) {
40912
40906
return { ...response, authentication };
40913
40907
}
40914
40908
async function deleteToken(options) {
40915
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40916
- request;
40909
+ const request2 = options.request || request;
40917
40910
const auth5 = btoa(`${options.clientId}:${options.clientSecret}`);
40918
40911
return request2(
40919
40912
"DELETE /applications/{client_id}/token",
@@ -40927,8 +40920,7 @@ async function deleteToken(options) {
40927
40920
);
40928
40921
}
40929
40922
async function deleteAuthorization(options) {
40930
- const request2 = options.request || /* istanbul ignore next: we always pass a custom request in tests */
40931
- request;
40923
+ const request2 = options.request || request;
40932
40924
const auth5 = btoa(`${options.clientId}:${options.clientSecret}`);
40933
40925
return request2(
40934
40926
"DELETE /applications/{client_id}/grant",
@@ -41962,7 +41954,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
41962
41954
return sendRequestWithRetries(state, request2, options, createdAt, retries);
41963
41955
}
41964
41956
}
41965
- var VERSION6 = "7.1.4 ";
41957
+ var VERSION6 = "7.1.5 ";
41966
41958
function createAppAuth(options) {
41967
41959
if (!options.appId) {
41968
41960
throw new Error("[@octokit/auth-app] appId option is required");
0 commit comments