mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-06-05 03:16:29 +00:00
Add quiet input to suppress info-level log output (#898)
## Summary Adds a new `quiet` input (default: `false`) that suppresses `info`-level log output when set to `true`. Only warnings and errors are shown. Contributes to: #868
This commit is contained in:
committed by
GitHub
parent
e07f2ac4b7
commit
a92cb43098
@@ -125,6 +125,9 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
|||||||
|
|
||||||
# Add problem matchers
|
# Add problem matchers
|
||||||
add-problem-matchers: "true"
|
add-problem-matchers: "true"
|
||||||
|
|
||||||
|
# Suppress info-level log output. Only warnings and errors are shown
|
||||||
|
quiet: "false"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ inputs:
|
|||||||
type: boolean
|
type: boolean
|
||||||
add-problem-matchers:
|
add-problem-matchers:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
quiet:
|
||||||
|
type: boolean
|
||||||
resolution-strategy:
|
resolution-strategy:
|
||||||
type: enum
|
type: enum
|
||||||
allowed-values:
|
allowed-values:
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ inputs:
|
|||||||
add-problem-matchers:
|
add-problem-matchers:
|
||||||
description: "Add problem matchers."
|
description: "Add problem matchers."
|
||||||
default: "true"
|
default: "true"
|
||||||
|
quiet:
|
||||||
|
description: "Suppress info-level log output. Only warnings and errors are shown."
|
||||||
|
default: "false"
|
||||||
resolution-strategy:
|
resolution-strategy:
|
||||||
description: "Resolution strategy to use when resolving version ranges. 'highest' uses the latest compatible version, 'lowest' uses the oldest compatible version."
|
description: "Resolution strategy to use when resolving version ranges. 'highest' uses the latest compatible version, 'lowest' uses the oldest compatible version."
|
||||||
default: "highest"
|
default: "highest"
|
||||||
|
|||||||
307
dist/save-cache/index.cjs
generated
vendored
307
dist/save-cache/index.cjs
generated
vendored
@@ -133,7 +133,7 @@ var require_tunnel = __commonJS({
|
|||||||
connectOptions.headers = connectOptions.headers || {};
|
connectOptions.headers = connectOptions.headers || {};
|
||||||
connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64");
|
connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64");
|
||||||
}
|
}
|
||||||
debug2("making CONNECT request");
|
debug3("making CONNECT request");
|
||||||
var connectReq = self2.request(connectOptions);
|
var connectReq = self2.request(connectOptions);
|
||||||
connectReq.useChunkedEncodingByDefault = false;
|
connectReq.useChunkedEncodingByDefault = false;
|
||||||
connectReq.once("response", onResponse);
|
connectReq.once("response", onResponse);
|
||||||
@@ -153,7 +153,7 @@ var require_tunnel = __commonJS({
|
|||||||
connectReq.removeAllListeners();
|
connectReq.removeAllListeners();
|
||||||
socket.removeAllListeners();
|
socket.removeAllListeners();
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
debug2(
|
debug3(
|
||||||
"tunneling socket could not be established, statusCode=%d",
|
"tunneling socket could not be established, statusCode=%d",
|
||||||
res.statusCode
|
res.statusCode
|
||||||
);
|
);
|
||||||
@@ -165,7 +165,7 @@ var require_tunnel = __commonJS({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (head.length > 0) {
|
if (head.length > 0) {
|
||||||
debug2("got illegal response body from proxy");
|
debug3("got illegal response body from proxy");
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
var error2 = new Error("got illegal response body from proxy");
|
var error2 = new Error("got illegal response body from proxy");
|
||||||
error2.code = "ECONNRESET";
|
error2.code = "ECONNRESET";
|
||||||
@@ -173,13 +173,13 @@ var require_tunnel = __commonJS({
|
|||||||
self2.removeSocket(placeholder);
|
self2.removeSocket(placeholder);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debug2("tunneling connection has established");
|
debug3("tunneling connection has established");
|
||||||
self2.sockets[self2.sockets.indexOf(placeholder)] = socket;
|
self2.sockets[self2.sockets.indexOf(placeholder)] = socket;
|
||||||
return cb(socket);
|
return cb(socket);
|
||||||
}
|
}
|
||||||
function onError(cause) {
|
function onError(cause) {
|
||||||
connectReq.removeAllListeners();
|
connectReq.removeAllListeners();
|
||||||
debug2(
|
debug3(
|
||||||
"tunneling socket could not be established, cause=%s\n",
|
"tunneling socket could not be established, cause=%s\n",
|
||||||
cause.message,
|
cause.message,
|
||||||
cause.stack
|
cause.stack
|
||||||
@@ -241,9 +241,9 @@ var require_tunnel = __commonJS({
|
|||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
var debug2;
|
var debug3;
|
||||||
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
||||||
debug2 = function() {
|
debug3 = function() {
|
||||||
var args = Array.prototype.slice.call(arguments);
|
var args = Array.prototype.slice.call(arguments);
|
||||||
if (typeof args[0] === "string") {
|
if (typeof args[0] === "string") {
|
||||||
args[0] = "TUNNEL: " + args[0];
|
args[0] = "TUNNEL: " + args[0];
|
||||||
@@ -253,10 +253,10 @@ var require_tunnel = __commonJS({
|
|||||||
console.error.apply(console, args);
|
console.error.apply(console, args);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
debug2 = function() {
|
debug3 = function() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports2.debug = debug2;
|
exports2.debug = debug3;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -18936,7 +18936,7 @@ var require_minimatch = __commonJS({
|
|||||||
}
|
}
|
||||||
this.parseNegate();
|
this.parseNegate();
|
||||||
var set = this.globSet = this.braceExpand();
|
var set = this.globSet = this.braceExpand();
|
||||||
if (options.debug) this.debug = function debug2() {
|
if (options.debug) this.debug = function debug3() {
|
||||||
console.error.apply(console, arguments);
|
console.error.apply(console, arguments);
|
||||||
};
|
};
|
||||||
this.debug(this.pattern, set);
|
this.debug(this.pattern, set);
|
||||||
@@ -19414,9 +19414,9 @@ var require_constants6 = __commonJS({
|
|||||||
var require_debug = __commonJS({
|
var require_debug = __commonJS({
|
||||||
"node_modules/@actions/cache/node_modules/semver/internal/debug.js"(exports2, module2) {
|
"node_modules/@actions/cache/node_modules/semver/internal/debug.js"(exports2, module2) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
var debug3 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
||||||
};
|
};
|
||||||
module2.exports = debug2;
|
module2.exports = debug3;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -19429,7 +19429,7 @@ var require_re = __commonJS({
|
|||||||
MAX_SAFE_BUILD_LENGTH,
|
MAX_SAFE_BUILD_LENGTH,
|
||||||
MAX_LENGTH
|
MAX_LENGTH
|
||||||
} = require_constants6();
|
} = require_constants6();
|
||||||
var debug2 = require_debug();
|
var debug3 = require_debug();
|
||||||
exports2 = module2.exports = {};
|
exports2 = module2.exports = {};
|
||||||
var re = exports2.re = [];
|
var re = exports2.re = [];
|
||||||
var safeRe = exports2.safeRe = [];
|
var safeRe = exports2.safeRe = [];
|
||||||
@@ -19452,7 +19452,7 @@ var require_re = __commonJS({
|
|||||||
var createToken = (name, value, isGlobal) => {
|
var createToken = (name, value, isGlobal) => {
|
||||||
const safe = makeSafeRegex(value);
|
const safe = makeSafeRegex(value);
|
||||||
const index = R++;
|
const index = R++;
|
||||||
debug2(name, index, value);
|
debug3(name, index, value);
|
||||||
t[name] = index;
|
t[name] = index;
|
||||||
src[index] = value;
|
src[index] = value;
|
||||||
safeSrc[index] = safe;
|
safeSrc[index] = safe;
|
||||||
@@ -19556,7 +19556,7 @@ var require_identifiers = __commonJS({
|
|||||||
var require_semver = __commonJS({
|
var require_semver = __commonJS({
|
||||||
"node_modules/@actions/cache/node_modules/semver/classes/semver.js"(exports2, module2) {
|
"node_modules/@actions/cache/node_modules/semver/classes/semver.js"(exports2, module2) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var debug2 = require_debug();
|
var debug3 = require_debug();
|
||||||
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
|
||||||
var { safeRe: re, t } = require_re();
|
var { safeRe: re, t } = require_re();
|
||||||
var parseOptions = require_parse_options();
|
var parseOptions = require_parse_options();
|
||||||
@@ -19578,7 +19578,7 @@ var require_semver = __commonJS({
|
|||||||
`version is longer than ${MAX_LENGTH} characters`
|
`version is longer than ${MAX_LENGTH} characters`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
debug2("SemVer", version3, options);
|
debug3("SemVer", version3, options);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.loose = !!options.loose;
|
this.loose = !!options.loose;
|
||||||
this.includePrerelease = !!options.includePrerelease;
|
this.includePrerelease = !!options.includePrerelease;
|
||||||
@@ -19626,7 +19626,7 @@ var require_semver = __commonJS({
|
|||||||
return this.version;
|
return this.version;
|
||||||
}
|
}
|
||||||
compare(other) {
|
compare(other) {
|
||||||
debug2("SemVer.compare", this.version, this.options, other);
|
debug3("SemVer.compare", this.version, this.options, other);
|
||||||
if (!(other instanceof _SemVer)) {
|
if (!(other instanceof _SemVer)) {
|
||||||
if (typeof other === "string" && other === this.version) {
|
if (typeof other === "string" && other === this.version) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -19677,7 +19677,7 @@ var require_semver = __commonJS({
|
|||||||
do {
|
do {
|
||||||
const a = this.prerelease[i];
|
const a = this.prerelease[i];
|
||||||
const b = other.prerelease[i];
|
const b = other.prerelease[i];
|
||||||
debug2("prerelease compare", i, a, b);
|
debug3("prerelease compare", i, a, b);
|
||||||
if (a === void 0 && b === void 0) {
|
if (a === void 0 && b === void 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (b === void 0) {
|
} else if (b === void 0) {
|
||||||
@@ -19699,7 +19699,7 @@ var require_semver = __commonJS({
|
|||||||
do {
|
do {
|
||||||
const a = this.build[i];
|
const a = this.build[i];
|
||||||
const b = other.build[i];
|
const b = other.build[i];
|
||||||
debug2("build compare", i, a, b);
|
debug3("build compare", i, a, b);
|
||||||
if (a === void 0 && b === void 0) {
|
if (a === void 0 && b === void 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (b === void 0) {
|
} else if (b === void 0) {
|
||||||
@@ -20327,21 +20327,21 @@ var require_range = __commonJS({
|
|||||||
const loose = this.options.loose;
|
const loose = this.options.loose;
|
||||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
||||||
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
|
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
|
||||||
debug2("hyphen replace", range2);
|
debug3("hyphen replace", range2);
|
||||||
range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
||||||
debug2("comparator trim", range2);
|
debug3("comparator trim", range2);
|
||||||
range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
|
range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
|
||||||
debug2("tilde trim", range2);
|
debug3("tilde trim", range2);
|
||||||
range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
|
range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
|
||||||
debug2("caret trim", range2);
|
debug3("caret trim", range2);
|
||||||
let rangeList = range2.split(" ").map((comp26) => parseComparator(comp26, this.options)).join(" ").split(/\s+/).map((comp26) => replaceGTE0(comp26, this.options));
|
let rangeList = range2.split(" ").map((comp26) => parseComparator(comp26, this.options)).join(" ").split(/\s+/).map((comp26) => replaceGTE0(comp26, this.options));
|
||||||
if (loose) {
|
if (loose) {
|
||||||
rangeList = rangeList.filter((comp26) => {
|
rangeList = rangeList.filter((comp26) => {
|
||||||
debug2("loose invalid filter", comp26, this.options);
|
debug3("loose invalid filter", comp26, this.options);
|
||||||
return !!comp26.match(re[t.COMPARATORLOOSE]);
|
return !!comp26.match(re[t.COMPARATORLOOSE]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
debug2("range list", rangeList);
|
debug3("range list", rangeList);
|
||||||
const rangeMap = /* @__PURE__ */ new Map();
|
const rangeMap = /* @__PURE__ */ new Map();
|
||||||
const comparators = rangeList.map((comp26) => new Comparator(comp26, this.options));
|
const comparators = rangeList.map((comp26) => new Comparator(comp26, this.options));
|
||||||
for (const comp26 of comparators) {
|
for (const comp26 of comparators) {
|
||||||
@@ -20396,7 +20396,7 @@ var require_range = __commonJS({
|
|||||||
var cache = new LRU();
|
var cache = new LRU();
|
||||||
var parseOptions = require_parse_options();
|
var parseOptions = require_parse_options();
|
||||||
var Comparator = require_comparator();
|
var Comparator = require_comparator();
|
||||||
var debug2 = require_debug();
|
var debug3 = require_debug();
|
||||||
var SemVer = require_semver();
|
var SemVer = require_semver();
|
||||||
var {
|
var {
|
||||||
safeRe: re,
|
safeRe: re,
|
||||||
@@ -20422,15 +20422,15 @@ var require_range = __commonJS({
|
|||||||
};
|
};
|
||||||
var parseComparator = (comp26, options) => {
|
var parseComparator = (comp26, options) => {
|
||||||
comp26 = comp26.replace(re[t.BUILD], "");
|
comp26 = comp26.replace(re[t.BUILD], "");
|
||||||
debug2("comp", comp26, options);
|
debug3("comp", comp26, options);
|
||||||
comp26 = replaceCarets(comp26, options);
|
comp26 = replaceCarets(comp26, options);
|
||||||
debug2("caret", comp26);
|
debug3("caret", comp26);
|
||||||
comp26 = replaceTildes(comp26, options);
|
comp26 = replaceTildes(comp26, options);
|
||||||
debug2("tildes", comp26);
|
debug3("tildes", comp26);
|
||||||
comp26 = replaceXRanges(comp26, options);
|
comp26 = replaceXRanges(comp26, options);
|
||||||
debug2("xrange", comp26);
|
debug3("xrange", comp26);
|
||||||
comp26 = replaceStars(comp26, options);
|
comp26 = replaceStars(comp26, options);
|
||||||
debug2("stars", comp26);
|
debug3("stars", comp26);
|
||||||
return comp26;
|
return comp26;
|
||||||
};
|
};
|
||||||
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
||||||
@@ -20440,7 +20440,7 @@ var require_range = __commonJS({
|
|||||||
var replaceTilde = (comp26, options) => {
|
var replaceTilde = (comp26, options) => {
|
||||||
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
||||||
return comp26.replace(r, (_, M, m, p, pr) => {
|
return comp26.replace(r, (_, M, m, p, pr) => {
|
||||||
debug2("tilde", comp26, _, M, m, p, pr);
|
debug3("tilde", comp26, _, M, m, p, pr);
|
||||||
let ret;
|
let ret;
|
||||||
if (isX(M)) {
|
if (isX(M)) {
|
||||||
ret = "";
|
ret = "";
|
||||||
@@ -20449,12 +20449,12 @@ var require_range = __commonJS({
|
|||||||
} else if (isX(p)) {
|
} else if (isX(p)) {
|
||||||
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
||||||
} else if (pr) {
|
} else if (pr) {
|
||||||
debug2("replaceTilde pr", pr);
|
debug3("replaceTilde pr", pr);
|
||||||
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
||||||
} else {
|
} else {
|
||||||
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
||||||
}
|
}
|
||||||
debug2("tilde return", ret);
|
debug3("tilde return", ret);
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -20462,11 +20462,11 @@ var require_range = __commonJS({
|
|||||||
return comp26.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
return comp26.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
||||||
};
|
};
|
||||||
var replaceCaret = (comp26, options) => {
|
var replaceCaret = (comp26, options) => {
|
||||||
debug2("caret", comp26, options);
|
debug3("caret", comp26, options);
|
||||||
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
||||||
const z = options.includePrerelease ? "-0" : "";
|
const z = options.includePrerelease ? "-0" : "";
|
||||||
return comp26.replace(r, (_, M, m, p, pr) => {
|
return comp26.replace(r, (_, M, m, p, pr) => {
|
||||||
debug2("caret", comp26, _, M, m, p, pr);
|
debug3("caret", comp26, _, M, m, p, pr);
|
||||||
let ret;
|
let ret;
|
||||||
if (isX(M)) {
|
if (isX(M)) {
|
||||||
ret = "";
|
ret = "";
|
||||||
@@ -20479,7 +20479,7 @@ var require_range = __commonJS({
|
|||||||
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
||||||
}
|
}
|
||||||
} else if (pr) {
|
} else if (pr) {
|
||||||
debug2("replaceCaret pr", pr);
|
debug3("replaceCaret pr", pr);
|
||||||
if (M === "0") {
|
if (M === "0") {
|
||||||
if (m === "0") {
|
if (m === "0") {
|
||||||
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
||||||
@@ -20490,7 +20490,7 @@ var require_range = __commonJS({
|
|||||||
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
debug2("no pr");
|
debug3("no pr");
|
||||||
if (M === "0") {
|
if (M === "0") {
|
||||||
if (m === "0") {
|
if (m === "0") {
|
||||||
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
||||||
@@ -20501,19 +20501,19 @@ var require_range = __commonJS({
|
|||||||
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug2("caret return", ret);
|
debug3("caret return", ret);
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var replaceXRanges = (comp26, options) => {
|
var replaceXRanges = (comp26, options) => {
|
||||||
debug2("replaceXRanges", comp26, options);
|
debug3("replaceXRanges", comp26, options);
|
||||||
return comp26.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
return comp26.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
||||||
};
|
};
|
||||||
var replaceXRange = (comp26, options) => {
|
var replaceXRange = (comp26, options) => {
|
||||||
comp26 = comp26.trim();
|
comp26 = comp26.trim();
|
||||||
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
||||||
return comp26.replace(r, (ret, gtlt, M, m, p, pr) => {
|
return comp26.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||||
debug2("xRange", comp26, ret, gtlt, M, m, p, pr);
|
debug3("xRange", comp26, ret, gtlt, M, m, p, pr);
|
||||||
const xM = isX(M);
|
const xM = isX(M);
|
||||||
const xm = xM || isX(m);
|
const xm = xM || isX(m);
|
||||||
const xp = xm || isX(p);
|
const xp = xm || isX(p);
|
||||||
@@ -20560,16 +20560,16 @@ var require_range = __commonJS({
|
|||||||
} else if (xp) {
|
} else if (xp) {
|
||||||
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
||||||
}
|
}
|
||||||
debug2("xRange return", ret);
|
debug3("xRange return", ret);
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var replaceStars = (comp26, options) => {
|
var replaceStars = (comp26, options) => {
|
||||||
debug2("replaceStars", comp26, options);
|
debug3("replaceStars", comp26, options);
|
||||||
return comp26.trim().replace(re[t.STAR], "");
|
return comp26.trim().replace(re[t.STAR], "");
|
||||||
};
|
};
|
||||||
var replaceGTE0 = (comp26, options) => {
|
var replaceGTE0 = (comp26, options) => {
|
||||||
debug2("replaceGTE0", comp26, options);
|
debug3("replaceGTE0", comp26, options);
|
||||||
return comp26.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
return comp26.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
||||||
};
|
};
|
||||||
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
||||||
@@ -20607,7 +20607,7 @@ var require_range = __commonJS({
|
|||||||
}
|
}
|
||||||
if (version3.prerelease.length && !options.includePrerelease) {
|
if (version3.prerelease.length && !options.includePrerelease) {
|
||||||
for (let i = 0; i < set.length; i++) {
|
for (let i = 0; i < set.length; i++) {
|
||||||
debug2(set[i].semver);
|
debug3(set[i].semver);
|
||||||
if (set[i].semver === Comparator.ANY) {
|
if (set[i].semver === Comparator.ANY) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -20644,7 +20644,7 @@ var require_comparator = __commonJS({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
comp26 = comp26.trim().split(/\s+/).join(" ");
|
comp26 = comp26.trim().split(/\s+/).join(" ");
|
||||||
debug2("comparator", comp26, options);
|
debug3("comparator", comp26, options);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.loose = !!options.loose;
|
this.loose = !!options.loose;
|
||||||
this.parse(comp26);
|
this.parse(comp26);
|
||||||
@@ -20653,7 +20653,7 @@ var require_comparator = __commonJS({
|
|||||||
} else {
|
} else {
|
||||||
this.value = this.operator + this.semver.version;
|
this.value = this.operator + this.semver.version;
|
||||||
}
|
}
|
||||||
debug2("comp", this);
|
debug3("comp", this);
|
||||||
}
|
}
|
||||||
parse(comp26) {
|
parse(comp26) {
|
||||||
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
||||||
@@ -20675,7 +20675,7 @@ var require_comparator = __commonJS({
|
|||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
test(version3) {
|
test(version3) {
|
||||||
debug2("Comparator.test", version3, this.options.loose);
|
debug3("Comparator.test", version3, this.options.loose);
|
||||||
if (this.semver === ANY || version3 === ANY) {
|
if (this.semver === ANY || version3 === ANY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -20732,7 +20732,7 @@ var require_comparator = __commonJS({
|
|||||||
var parseOptions = require_parse_options();
|
var parseOptions = require_parse_options();
|
||||||
var { safeRe: re, t } = require_re();
|
var { safeRe: re, t } = require_re();
|
||||||
var cmp = require_cmp();
|
var cmp = require_cmp();
|
||||||
var debug2 = require_debug();
|
var debug3 = require_debug();
|
||||||
var SemVer = require_semver();
|
var SemVer = require_semver();
|
||||||
var Range = require_range();
|
var Range = require_range();
|
||||||
}
|
}
|
||||||
@@ -21456,11 +21456,11 @@ var require_common = __commonJS({
|
|||||||
let enableOverride = null;
|
let enableOverride = null;
|
||||||
let namespacesCache;
|
let namespacesCache;
|
||||||
let enabledCache;
|
let enabledCache;
|
||||||
function debug2(...args) {
|
function debug3(...args) {
|
||||||
if (!debug2.enabled) {
|
if (!debug3.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const self2 = debug2;
|
const self2 = debug3;
|
||||||
const curr = Number(/* @__PURE__ */ new Date());
|
const curr = Number(/* @__PURE__ */ new Date());
|
||||||
const ms = curr - (prevTime || curr);
|
const ms = curr - (prevTime || curr);
|
||||||
self2.diff = ms;
|
self2.diff = ms;
|
||||||
@@ -21490,12 +21490,12 @@ var require_common = __commonJS({
|
|||||||
const logFn = self2.log || createDebug.log;
|
const logFn = self2.log || createDebug.log;
|
||||||
logFn.apply(self2, args);
|
logFn.apply(self2, args);
|
||||||
}
|
}
|
||||||
debug2.namespace = namespace;
|
debug3.namespace = namespace;
|
||||||
debug2.useColors = createDebug.useColors();
|
debug3.useColors = createDebug.useColors();
|
||||||
debug2.color = createDebug.selectColor(namespace);
|
debug3.color = createDebug.selectColor(namespace);
|
||||||
debug2.extend = extend2;
|
debug3.extend = extend2;
|
||||||
debug2.destroy = createDebug.destroy;
|
debug3.destroy = createDebug.destroy;
|
||||||
Object.defineProperty(debug2, "enabled", {
|
Object.defineProperty(debug3, "enabled", {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
get: () => {
|
get: () => {
|
||||||
@@ -21513,9 +21513,9 @@ var require_common = __commonJS({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (typeof createDebug.init === "function") {
|
if (typeof createDebug.init === "function") {
|
||||||
createDebug.init(debug2);
|
createDebug.init(debug3);
|
||||||
}
|
}
|
||||||
return debug2;
|
return debug3;
|
||||||
}
|
}
|
||||||
function extend2(namespace, delimiter3) {
|
function extend2(namespace, delimiter3) {
|
||||||
const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace);
|
const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace);
|
||||||
@@ -22025,11 +22025,11 @@ var require_node = __commonJS({
|
|||||||
function load() {
|
function load() {
|
||||||
return process.env.DEBUG;
|
return process.env.DEBUG;
|
||||||
}
|
}
|
||||||
function init(debug2) {
|
function init(debug3) {
|
||||||
debug2.inspectOpts = {};
|
debug3.inspectOpts = {};
|
||||||
const keys = Object.keys(exports2.inspectOpts);
|
const keys = Object.keys(exports2.inspectOpts);
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
debug3.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module2.exports = require_common()(exports2);
|
module2.exports = require_common()(exports2);
|
||||||
@@ -22292,7 +22292,7 @@ var require_parse_proxy_response = __commonJS({
|
|||||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||||
exports2.parseProxyResponse = void 0;
|
exports2.parseProxyResponse = void 0;
|
||||||
var debug_1 = __importDefault(require_src());
|
var debug_1 = __importDefault(require_src());
|
||||||
var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
var debug3 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
||||||
function parseProxyResponse(socket) {
|
function parseProxyResponse(socket) {
|
||||||
return new Promise((resolve2, reject) => {
|
return new Promise((resolve2, reject) => {
|
||||||
let buffersLength = 0;
|
let buffersLength = 0;
|
||||||
@@ -22311,12 +22311,12 @@ var require_parse_proxy_response = __commonJS({
|
|||||||
}
|
}
|
||||||
function onend() {
|
function onend() {
|
||||||
cleanup();
|
cleanup();
|
||||||
debug2("onend");
|
debug3("onend");
|
||||||
reject(new Error("Proxy connection ended before receiving CONNECT response"));
|
reject(new Error("Proxy connection ended before receiving CONNECT response"));
|
||||||
}
|
}
|
||||||
function onerror(err) {
|
function onerror(err) {
|
||||||
cleanup();
|
cleanup();
|
||||||
debug2("onerror %o", err);
|
debug3("onerror %o", err);
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
function ondata(b) {
|
function ondata(b) {
|
||||||
@@ -22325,7 +22325,7 @@ var require_parse_proxy_response = __commonJS({
|
|||||||
const buffered = Buffer.concat(buffers, buffersLength);
|
const buffered = Buffer.concat(buffers, buffersLength);
|
||||||
const endOfHeaders = buffered.indexOf("\r\n\r\n");
|
const endOfHeaders = buffered.indexOf("\r\n\r\n");
|
||||||
if (endOfHeaders === -1) {
|
if (endOfHeaders === -1) {
|
||||||
debug2("have not received end of HTTP headers yet...");
|
debug3("have not received end of HTTP headers yet...");
|
||||||
read();
|
read();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -22358,7 +22358,7 @@ var require_parse_proxy_response = __commonJS({
|
|||||||
headers[key] = value;
|
headers[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug2("got proxy server response: %o %o", firstLine, headers);
|
debug3("got proxy server response: %o %o", firstLine, headers);
|
||||||
cleanup();
|
cleanup();
|
||||||
resolve2({
|
resolve2({
|
||||||
connect: {
|
connect: {
|
||||||
@@ -22421,7 +22421,7 @@ var require_dist2 = __commonJS({
|
|||||||
var agent_base_1 = require_dist();
|
var agent_base_1 = require_dist();
|
||||||
var url_1 = require("url");
|
var url_1 = require("url");
|
||||||
var parse_proxy_response_1 = require_parse_proxy_response();
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
||||||
var debug2 = (0, debug_1.default)("https-proxy-agent");
|
var debug3 = (0, debug_1.default)("https-proxy-agent");
|
||||||
var setServernameFromNonIpHost = (options) => {
|
var setServernameFromNonIpHost = (options) => {
|
||||||
if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
|
if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
|
||||||
return {
|
return {
|
||||||
@@ -22437,7 +22437,7 @@ var require_dist2 = __commonJS({
|
|||||||
this.options = { path: void 0 };
|
this.options = { path: void 0 };
|
||||||
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
||||||
this.proxyHeaders = opts?.headers ?? {};
|
this.proxyHeaders = opts?.headers ?? {};
|
||||||
debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
debug3("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
||||||
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
||||||
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
||||||
this.connectOpts = {
|
this.connectOpts = {
|
||||||
@@ -22459,10 +22459,10 @@ var require_dist2 = __commonJS({
|
|||||||
}
|
}
|
||||||
let socket;
|
let socket;
|
||||||
if (proxy.protocol === "https:") {
|
if (proxy.protocol === "https:") {
|
||||||
debug2("Creating `tls.Socket`: %o", this.connectOpts);
|
debug3("Creating `tls.Socket`: %o", this.connectOpts);
|
||||||
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
||||||
} else {
|
} else {
|
||||||
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
debug3("Creating `net.Socket`: %o", this.connectOpts);
|
||||||
socket = net.connect(this.connectOpts);
|
socket = net.connect(this.connectOpts);
|
||||||
}
|
}
|
||||||
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
||||||
@@ -22490,7 +22490,7 @@ var require_dist2 = __commonJS({
|
|||||||
if (connect.statusCode === 200) {
|
if (connect.statusCode === 200) {
|
||||||
req.once("socket", resume);
|
req.once("socket", resume);
|
||||||
if (opts.secureEndpoint) {
|
if (opts.secureEndpoint) {
|
||||||
debug2("Upgrading socket connection to TLS");
|
debug3("Upgrading socket connection to TLS");
|
||||||
return tls.connect({
|
return tls.connect({
|
||||||
...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
||||||
socket
|
socket
|
||||||
@@ -22502,7 +22502,7 @@ var require_dist2 = __commonJS({
|
|||||||
const fakeSocket = new net.Socket({ writable: false });
|
const fakeSocket = new net.Socket({ writable: false });
|
||||||
fakeSocket.readable = true;
|
fakeSocket.readable = true;
|
||||||
req.once("socket", (s) => {
|
req.once("socket", (s) => {
|
||||||
debug2("Replaying proxy buffer for failed request");
|
debug3("Replaying proxy buffer for failed request");
|
||||||
(0, assert_1.default)(s.listenerCount("data") > 0);
|
(0, assert_1.default)(s.listenerCount("data") > 0);
|
||||||
s.push(buffered);
|
s.push(buffered);
|
||||||
s.push(null);
|
s.push(null);
|
||||||
@@ -22570,13 +22570,13 @@ var require_dist3 = __commonJS({
|
|||||||
var events_1 = require("events");
|
var events_1 = require("events");
|
||||||
var agent_base_1 = require_dist();
|
var agent_base_1 = require_dist();
|
||||||
var url_1 = require("url");
|
var url_1 = require("url");
|
||||||
var debug2 = (0, debug_1.default)("http-proxy-agent");
|
var debug3 = (0, debug_1.default)("http-proxy-agent");
|
||||||
var HttpProxyAgent2 = class extends agent_base_1.Agent {
|
var HttpProxyAgent2 = class extends agent_base_1.Agent {
|
||||||
constructor(proxy, opts) {
|
constructor(proxy, opts) {
|
||||||
super(opts);
|
super(opts);
|
||||||
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
||||||
this.proxyHeaders = opts?.headers ?? {};
|
this.proxyHeaders = opts?.headers ?? {};
|
||||||
debug2("Creating new HttpProxyAgent instance: %o", this.proxy.href);
|
debug3("Creating new HttpProxyAgent instance: %o", this.proxy.href);
|
||||||
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
||||||
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
||||||
this.connectOpts = {
|
this.connectOpts = {
|
||||||
@@ -22622,21 +22622,21 @@ var require_dist3 = __commonJS({
|
|||||||
}
|
}
|
||||||
let first;
|
let first;
|
||||||
let endOfHeaders;
|
let endOfHeaders;
|
||||||
debug2("Regenerating stored HTTP header string for request");
|
debug3("Regenerating stored HTTP header string for request");
|
||||||
req._implicitHeader();
|
req._implicitHeader();
|
||||||
if (req.outputData && req.outputData.length > 0) {
|
if (req.outputData && req.outputData.length > 0) {
|
||||||
debug2("Patching connection write() output buffer with updated header");
|
debug3("Patching connection write() output buffer with updated header");
|
||||||
first = req.outputData[0].data;
|
first = req.outputData[0].data;
|
||||||
endOfHeaders = first.indexOf("\r\n\r\n") + 4;
|
endOfHeaders = first.indexOf("\r\n\r\n") + 4;
|
||||||
req.outputData[0].data = req._header + first.substring(endOfHeaders);
|
req.outputData[0].data = req._header + first.substring(endOfHeaders);
|
||||||
debug2("Output buffer: %o", req.outputData[0].data);
|
debug3("Output buffer: %o", req.outputData[0].data);
|
||||||
}
|
}
|
||||||
let socket;
|
let socket;
|
||||||
if (this.proxy.protocol === "https:") {
|
if (this.proxy.protocol === "https:") {
|
||||||
debug2("Creating `tls.Socket`: %o", this.connectOpts);
|
debug3("Creating `tls.Socket`: %o", this.connectOpts);
|
||||||
socket = tls.connect(this.connectOpts);
|
socket = tls.connect(this.connectOpts);
|
||||||
} else {
|
} else {
|
||||||
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
debug3("Creating `net.Socket`: %o", this.connectOpts);
|
||||||
socket = net.connect(this.connectOpts);
|
socket = net.connect(this.connectOpts);
|
||||||
}
|
}
|
||||||
await (0, events_1.once)(socket, "connect");
|
await (0, events_1.once)(socket, "connect");
|
||||||
@@ -24039,9 +24039,9 @@ var require_reflection_type_check = __commonJS({
|
|||||||
var reflection_info_1 = require_reflection_info();
|
var reflection_info_1 = require_reflection_info();
|
||||||
var oneof_1 = require_oneof();
|
var oneof_1 = require_oneof();
|
||||||
var ReflectionTypeCheck = class {
|
var ReflectionTypeCheck = class {
|
||||||
constructor(info2) {
|
constructor(info3) {
|
||||||
var _a;
|
var _a;
|
||||||
this.fields = (_a = info2.fields) !== null && _a !== void 0 ? _a : [];
|
this.fields = (_a = info3.fields) !== null && _a !== void 0 ? _a : [];
|
||||||
}
|
}
|
||||||
prepare() {
|
prepare() {
|
||||||
if (this.data)
|
if (this.data)
|
||||||
@@ -24287,8 +24287,8 @@ var require_reflection_json_reader = __commonJS({
|
|||||||
var assert_1 = require_assert();
|
var assert_1 = require_assert();
|
||||||
var reflection_long_convert_1 = require_reflection_long_convert();
|
var reflection_long_convert_1 = require_reflection_long_convert();
|
||||||
var ReflectionJsonReader = class {
|
var ReflectionJsonReader = class {
|
||||||
constructor(info2) {
|
constructor(info3) {
|
||||||
this.info = info2;
|
this.info = info3;
|
||||||
}
|
}
|
||||||
prepare() {
|
prepare() {
|
||||||
var _a;
|
var _a;
|
||||||
@@ -24584,9 +24584,9 @@ var require_reflection_json_writer = __commonJS({
|
|||||||
var reflection_info_1 = require_reflection_info();
|
var reflection_info_1 = require_reflection_info();
|
||||||
var assert_1 = require_assert();
|
var assert_1 = require_assert();
|
||||||
var ReflectionJsonWriter = class {
|
var ReflectionJsonWriter = class {
|
||||||
constructor(info2) {
|
constructor(info3) {
|
||||||
var _a;
|
var _a;
|
||||||
this.fields = (_a = info2.fields) !== null && _a !== void 0 ? _a : [];
|
this.fields = (_a = info3.fields) !== null && _a !== void 0 ? _a : [];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Converts the message to a JSON object, based on the field descriptors.
|
* Converts the message to a JSON object, based on the field descriptors.
|
||||||
@@ -24839,8 +24839,8 @@ var require_reflection_binary_reader = __commonJS({
|
|||||||
var reflection_long_convert_1 = require_reflection_long_convert();
|
var reflection_long_convert_1 = require_reflection_long_convert();
|
||||||
var reflection_scalar_default_1 = require_reflection_scalar_default();
|
var reflection_scalar_default_1 = require_reflection_scalar_default();
|
||||||
var ReflectionBinaryReader = class {
|
var ReflectionBinaryReader = class {
|
||||||
constructor(info2) {
|
constructor(info3) {
|
||||||
this.info = info2;
|
this.info = info3;
|
||||||
}
|
}
|
||||||
prepare() {
|
prepare() {
|
||||||
var _a;
|
var _a;
|
||||||
@@ -25013,8 +25013,8 @@ var require_reflection_binary_writer = __commonJS({
|
|||||||
var assert_1 = require_assert();
|
var assert_1 = require_assert();
|
||||||
var pb_long_1 = require_pb_long();
|
var pb_long_1 = require_pb_long();
|
||||||
var ReflectionBinaryWriter = class {
|
var ReflectionBinaryWriter = class {
|
||||||
constructor(info2) {
|
constructor(info3) {
|
||||||
this.info = info2;
|
this.info = info3;
|
||||||
}
|
}
|
||||||
prepare() {
|
prepare() {
|
||||||
if (!this.fields) {
|
if (!this.fields) {
|
||||||
@@ -25264,9 +25264,9 @@ var require_reflection_merge_partial = __commonJS({
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||||
exports2.reflectionMergePartial = void 0;
|
exports2.reflectionMergePartial = void 0;
|
||||||
function reflectionMergePartial4(info2, target, source) {
|
function reflectionMergePartial4(info3, target, source) {
|
||||||
let fieldValue, input = source, output;
|
let fieldValue, input = source, output;
|
||||||
for (let field of info2.fields) {
|
for (let field of info3.fields) {
|
||||||
let name = field.localName;
|
let name = field.localName;
|
||||||
if (field.oneof) {
|
if (field.oneof) {
|
||||||
const group = input[field.oneof];
|
const group = input[field.oneof];
|
||||||
@@ -25335,12 +25335,12 @@ var require_reflection_equals = __commonJS({
|
|||||||
Object.defineProperty(exports2, "__esModule", { value: true });
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
||||||
exports2.reflectionEquals = void 0;
|
exports2.reflectionEquals = void 0;
|
||||||
var reflection_info_1 = require_reflection_info();
|
var reflection_info_1 = require_reflection_info();
|
||||||
function reflectionEquals(info2, a, b) {
|
function reflectionEquals(info3, a, b) {
|
||||||
if (a === b)
|
if (a === b)
|
||||||
return true;
|
return true;
|
||||||
if (!a || !b)
|
if (!a || !b)
|
||||||
return false;
|
return false;
|
||||||
for (let field of info2.fields) {
|
for (let field of info3.fields) {
|
||||||
let localName = field.localName;
|
let localName = field.localName;
|
||||||
let val_a = field.oneof ? a[field.oneof][localName] : a[localName];
|
let val_a = field.oneof ? a[field.oneof][localName] : a[localName];
|
||||||
let val_b = field.oneof ? b[field.oneof][localName] : b[localName];
|
let val_b = field.oneof ? b[field.oneof][localName] : b[localName];
|
||||||
@@ -28045,12 +28045,12 @@ var HttpClient = class {
|
|||||||
throw new Error("Client has already been disposed.");
|
throw new Error("Client has already been disposed.");
|
||||||
}
|
}
|
||||||
const parsedUrl = new URL(requestUrl);
|
const parsedUrl = new URL(requestUrl);
|
||||||
let info2 = this._prepareRequest(verb, parsedUrl, headers);
|
let info3 = this._prepareRequest(verb, parsedUrl, headers);
|
||||||
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
|
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
|
||||||
let numTries = 0;
|
let numTries = 0;
|
||||||
let response;
|
let response;
|
||||||
do {
|
do {
|
||||||
response = yield this.requestRaw(info2, data);
|
response = yield this.requestRaw(info3, data);
|
||||||
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
||||||
let authenticationHandler;
|
let authenticationHandler;
|
||||||
for (const handler of this.handlers) {
|
for (const handler of this.handlers) {
|
||||||
@@ -28060,7 +28060,7 @@ var HttpClient = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (authenticationHandler) {
|
if (authenticationHandler) {
|
||||||
return authenticationHandler.handleAuthentication(this, info2, data);
|
return authenticationHandler.handleAuthentication(this, info3, data);
|
||||||
} else {
|
} else {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -28083,8 +28083,8 @@ var HttpClient = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info2 = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
info3 = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||||
response = yield this.requestRaw(info2, data);
|
response = yield this.requestRaw(info3, data);
|
||||||
redirectsRemaining--;
|
redirectsRemaining--;
|
||||||
}
|
}
|
||||||
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
||||||
@@ -28113,7 +28113,7 @@ var HttpClient = class {
|
|||||||
* @param info
|
* @param info
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
requestRaw(info2, data) {
|
requestRaw(info3, data) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
return new Promise((resolve2, reject) => {
|
return new Promise((resolve2, reject) => {
|
||||||
function callbackForResult(err, res) {
|
function callbackForResult(err, res) {
|
||||||
@@ -28125,7 +28125,7 @@ var HttpClient = class {
|
|||||||
resolve2(res);
|
resolve2(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.requestRawWithCallback(info2, data, callbackForResult);
|
this.requestRawWithCallback(info3, data, callbackForResult);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -28135,12 +28135,12 @@ var HttpClient = class {
|
|||||||
* @param data
|
* @param data
|
||||||
* @param onResult
|
* @param onResult
|
||||||
*/
|
*/
|
||||||
requestRawWithCallback(info2, data, onResult) {
|
requestRawWithCallback(info3, data, onResult) {
|
||||||
if (typeof data === "string") {
|
if (typeof data === "string") {
|
||||||
if (!info2.options.headers) {
|
if (!info3.options.headers) {
|
||||||
info2.options.headers = {};
|
info3.options.headers = {};
|
||||||
}
|
}
|
||||||
info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
|
info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
|
||||||
}
|
}
|
||||||
let callbackCalled = false;
|
let callbackCalled = false;
|
||||||
function handleResult(err, res) {
|
function handleResult(err, res) {
|
||||||
@@ -28149,7 +28149,7 @@ var HttpClient = class {
|
|||||||
onResult(err, res);
|
onResult(err, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const req = info2.httpModule.request(info2.options, (msg) => {
|
const req = info3.httpModule.request(info3.options, (msg) => {
|
||||||
const res = new HttpClientResponse(msg);
|
const res = new HttpClientResponse(msg);
|
||||||
handleResult(void 0, res);
|
handleResult(void 0, res);
|
||||||
});
|
});
|
||||||
@@ -28161,7 +28161,7 @@ var HttpClient = class {
|
|||||||
if (socket) {
|
if (socket) {
|
||||||
socket.end();
|
socket.end();
|
||||||
}
|
}
|
||||||
handleResult(new Error(`Request timeout: ${info2.options.path}`));
|
handleResult(new Error(`Request timeout: ${info3.options.path}`));
|
||||||
});
|
});
|
||||||
req.on("error", function(err) {
|
req.on("error", function(err) {
|
||||||
handleResult(err);
|
handleResult(err);
|
||||||
@@ -28197,27 +28197,27 @@ var HttpClient = class {
|
|||||||
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
|
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
|
||||||
}
|
}
|
||||||
_prepareRequest(method, requestUrl, headers) {
|
_prepareRequest(method, requestUrl, headers) {
|
||||||
const info2 = {};
|
const info3 = {};
|
||||||
info2.parsedUrl = requestUrl;
|
info3.parsedUrl = requestUrl;
|
||||||
const usingSsl = info2.parsedUrl.protocol === "https:";
|
const usingSsl = info3.parsedUrl.protocol === "https:";
|
||||||
info2.httpModule = usingSsl ? https : http;
|
info3.httpModule = usingSsl ? https : http;
|
||||||
const defaultPort = usingSsl ? 443 : 80;
|
const defaultPort = usingSsl ? 443 : 80;
|
||||||
info2.options = {};
|
info3.options = {};
|
||||||
info2.options.host = info2.parsedUrl.hostname;
|
info3.options.host = info3.parsedUrl.hostname;
|
||||||
info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort;
|
info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort;
|
||||||
info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || "");
|
info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || "");
|
||||||
info2.options.method = method;
|
info3.options.method = method;
|
||||||
info2.options.headers = this._mergeHeaders(headers);
|
info3.options.headers = this._mergeHeaders(headers);
|
||||||
if (this.userAgent != null) {
|
if (this.userAgent != null) {
|
||||||
info2.options.headers["user-agent"] = this.userAgent;
|
info3.options.headers["user-agent"] = this.userAgent;
|
||||||
}
|
}
|
||||||
info2.options.agent = this._getAgent(info2.parsedUrl);
|
info3.options.agent = this._getAgent(info3.parsedUrl);
|
||||||
if (this.handlers) {
|
if (this.handlers) {
|
||||||
for (const handler of this.handlers) {
|
for (const handler of this.handlers) {
|
||||||
handler.prepareRequest(info2.options);
|
handler.prepareRequest(info3.options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return info2;
|
return info3;
|
||||||
}
|
}
|
||||||
_mergeHeaders(headers) {
|
_mergeHeaders(headers) {
|
||||||
if (this.requestOptions && this.requestOptions.headers) {
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
@@ -30601,14 +30601,14 @@ function disable() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function createDebugger(namespace) {
|
function createDebugger(namespace) {
|
||||||
const newDebugger = Object.assign(debug2, {
|
const newDebugger = Object.assign(debug3, {
|
||||||
enabled: enabled(namespace),
|
enabled: enabled(namespace),
|
||||||
destroy,
|
destroy,
|
||||||
log: debugObj.log,
|
log: debugObj.log,
|
||||||
namespace,
|
namespace,
|
||||||
extend
|
extend
|
||||||
});
|
});
|
||||||
function debug2(...args) {
|
function debug3(...args) {
|
||||||
if (!newDebugger.enabled) {
|
if (!newDebugger.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -34098,12 +34098,12 @@ function getOperationRequestInfo(request) {
|
|||||||
if (hasOriginalRequest(request)) {
|
if (hasOriginalRequest(request)) {
|
||||||
return getOperationRequestInfo(request[originalRequestSymbol]);
|
return getOperationRequestInfo(request[originalRequestSymbol]);
|
||||||
}
|
}
|
||||||
let info2 = state2.operationRequestMap.get(request);
|
let info3 = state2.operationRequestMap.get(request);
|
||||||
if (!info2) {
|
if (!info3) {
|
||||||
info2 = {};
|
info3 = {};
|
||||||
state2.operationRequestMap.set(request, info2);
|
state2.operationRequestMap.set(request, info3);
|
||||||
}
|
}
|
||||||
return info2;
|
return info3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// node_modules/@azure/core-client/dist/esm/deserializationPolicy.js
|
// node_modules/@azure/core-client/dist/esm/deserializationPolicy.js
|
||||||
@@ -62241,6 +62241,21 @@ function saveCacheV2(paths_1, key_1, options_1) {
|
|||||||
// src/save-cache.ts
|
// src/save-cache.ts
|
||||||
var pep440 = __toESM(require_pep440(), 1);
|
var pep440 = __toESM(require_pep440(), 1);
|
||||||
|
|
||||||
|
// src/utils/logging.ts
|
||||||
|
var quiet;
|
||||||
|
function isQuiet() {
|
||||||
|
if (quiet === void 0) {
|
||||||
|
quiet = typeof getInput === "function" && getInput("quiet") === "true";
|
||||||
|
}
|
||||||
|
return quiet;
|
||||||
|
}
|
||||||
|
function info2(msg) {
|
||||||
|
if (!isQuiet()) {
|
||||||
|
info(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var warning2 = warning;
|
||||||
|
|
||||||
// src/cache/restore-cache.ts
|
// src/cache/restore-cache.ts
|
||||||
var STATE_CACHE_KEY = "cache-key";
|
var STATE_CACHE_KEY = "cache-key";
|
||||||
var STATE_CACHE_MATCHED_KEY = "cache-matched-key";
|
var STATE_CACHE_MATCHED_KEY = "cache-matched-key";
|
||||||
@@ -62992,6 +63007,7 @@ function loadInputs() {
|
|||||||
const manifestFile = getManifestFile();
|
const manifestFile = getManifestFile();
|
||||||
const downloadFromAstralMirror = getInput("download-from-astral-mirror") === "true";
|
const downloadFromAstralMirror = getInput("download-from-astral-mirror") === "true";
|
||||||
const addProblemMatchers = getInput("add-problem-matchers") === "true";
|
const addProblemMatchers = getInput("add-problem-matchers") === "true";
|
||||||
|
const quiet2 = getInput("quiet") === "true";
|
||||||
const resolutionStrategy = getResolutionStrategy();
|
const resolutionStrategy = getResolutionStrategy();
|
||||||
return {
|
return {
|
||||||
activateEnvironment,
|
activateEnvironment,
|
||||||
@@ -63011,6 +63027,7 @@ function loadInputs() {
|
|||||||
pruneCache: pruneCache2,
|
pruneCache: pruneCache2,
|
||||||
pythonDir,
|
pythonDir,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
|
quiet: quiet2,
|
||||||
resolutionStrategy,
|
resolutionStrategy,
|
||||||
restoreCache: restoreCache2,
|
restoreCache: restoreCache2,
|
||||||
saveCache: saveCache4,
|
saveCache: saveCache4,
|
||||||
@@ -63034,7 +63051,7 @@ function getVenvPath(workingDirectory, activateEnvironment) {
|
|||||||
const venvPathInput = getInput("venv-path");
|
const venvPathInput = getInput("venv-path");
|
||||||
if (venvPathInput !== "") {
|
if (venvPathInput !== "") {
|
||||||
if (!activateEnvironment) {
|
if (!activateEnvironment) {
|
||||||
warning("venv-path is only used when activate-environment is true");
|
warning2("venv-path is only used when activate-environment is true");
|
||||||
}
|
}
|
||||||
const tildeExpanded = expandTilde(venvPathInput);
|
const tildeExpanded = expandTilde(venvPathInput);
|
||||||
return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded));
|
return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded));
|
||||||
@@ -63097,7 +63114,7 @@ function getCacheLocalPath(workingDirectory, versionFile, enableCache) {
|
|||||||
return { path: cacheDirFromConfig, source: 1 /* Config */ };
|
return { path: cacheDirFromConfig, source: 1 /* Config */ };
|
||||||
}
|
}
|
||||||
if (process.env.UV_CACHE_DIR !== void 0) {
|
if (process.env.UV_CACHE_DIR !== void 0) {
|
||||||
info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`);
|
info2(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`);
|
||||||
return { path: process.env.UV_CACHE_DIR, source: 2 /* Env */ };
|
return { path: process.env.UV_CACHE_DIR, source: 2 /* Env */ };
|
||||||
}
|
}
|
||||||
if (enableCache) {
|
if (enableCache) {
|
||||||
@@ -63130,12 +63147,12 @@ function getCacheDirFromConfig(workingDirectory, versionFile) {
|
|||||||
try {
|
try {
|
||||||
const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir");
|
const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir");
|
||||||
if (cacheDir !== void 0) {
|
if (cacheDir !== void 0) {
|
||||||
info(`Found cache-dir in ${resolvedPath}: ${cacheDir}`);
|
info2(`Found cache-dir in ${resolvedPath}: ${cacheDir}`);
|
||||||
return cacheDir;
|
return cacheDir;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = err.message;
|
const message = err.message;
|
||||||
warning(`Error while parsing ${filePath}: ${message}`);
|
warning2(`Error while parsing ${filePath}: ${message}`);
|
||||||
return void 0;
|
return void 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63143,7 +63160,7 @@ function getCacheDirFromConfig(workingDirectory, versionFile) {
|
|||||||
}
|
}
|
||||||
function getUvPythonDir() {
|
function getUvPythonDir() {
|
||||||
if (process.env.UV_PYTHON_INSTALL_DIR !== void 0) {
|
if (process.env.UV_PYTHON_INSTALL_DIR !== void 0) {
|
||||||
info(
|
info2(
|
||||||
`UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}`
|
`UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}`
|
||||||
);
|
);
|
||||||
return process.env.UV_PYTHON_INSTALL_DIR;
|
return process.env.UV_PYTHON_INSTALL_DIR;
|
||||||
@@ -63236,7 +63253,7 @@ async function run() {
|
|||||||
if (inputs.saveCache) {
|
if (inputs.saveCache) {
|
||||||
await saveCache3(inputs);
|
await saveCache3(inputs);
|
||||||
} else {
|
} else {
|
||||||
info("save-cache is false. Skipping save cache step.");
|
info2("save-cache is false. Skipping save cache step.");
|
||||||
}
|
}
|
||||||
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
@@ -63250,11 +63267,11 @@ async function saveCache3(inputs) {
|
|||||||
const cacheKey = getState(STATE_CACHE_KEY);
|
const cacheKey = getState(STATE_CACHE_KEY);
|
||||||
const matchedKey = getState(STATE_CACHE_MATCHED_KEY);
|
const matchedKey = getState(STATE_CACHE_MATCHED_KEY);
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
warning("Error retrieving cache key from state.");
|
warning2("Error retrieving cache key from state.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchedKey === cacheKey) {
|
if (matchedKey === cacheKey) {
|
||||||
info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
|
info2(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
|
||||||
} else {
|
} else {
|
||||||
if (inputs.pruneCache) {
|
if (inputs.pruneCache) {
|
||||||
await pruneCache();
|
await pruneCache();
|
||||||
@@ -63262,7 +63279,7 @@ async function saveCache3(inputs) {
|
|||||||
const actualCachePath = getUvCachePath(inputs);
|
const actualCachePath = getUvCachePath(inputs);
|
||||||
if (!fs7.existsSync(actualCachePath)) {
|
if (!fs7.existsSync(actualCachePath)) {
|
||||||
if (inputs.ignoreNothingToCache) {
|
if (inputs.ignoreNothingToCache) {
|
||||||
info(
|
info2(
|
||||||
"No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled."
|
"No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -63281,7 +63298,7 @@ async function saveCache3(inputs) {
|
|||||||
}
|
}
|
||||||
if (inputs.cachePython) {
|
if (inputs.cachePython) {
|
||||||
if (!fs7.existsSync(inputs.pythonDir)) {
|
if (!fs7.existsSync(inputs.pythonDir)) {
|
||||||
warning(
|
warning2(
|
||||||
`Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`
|
`Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -63304,7 +63321,7 @@ async function pruneCache() {
|
|||||||
if (forceSupported) {
|
if (forceSupported) {
|
||||||
execArgs.push("--force");
|
execArgs.push("--force");
|
||||||
}
|
}
|
||||||
info("Pruning cache...");
|
info2("Pruning cache...");
|
||||||
const uvPath = getState(STATE_UV_PATH);
|
const uvPath = getState(STATE_UV_PATH);
|
||||||
await exec(uvPath, execArgs, options);
|
await exec(uvPath, execArgs, options);
|
||||||
}
|
}
|
||||||
@@ -63315,7 +63332,7 @@ function getUvCachePath(inputs) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (process.env.UV_CACHE_DIR && process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path) {
|
if (process.env.UV_CACHE_DIR && process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path) {
|
||||||
warning(
|
warning2(
|
||||||
`The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".`
|
`The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".`
|
||||||
);
|
);
|
||||||
return process.env.UV_CACHE_DIR;
|
return process.env.UV_CACHE_DIR;
|
||||||
@@ -63325,14 +63342,12 @@ function getUvCachePath(inputs) {
|
|||||||
async function saveCacheToKey(cacheKey, cachePath, stateKey, cacheName) {
|
async function saveCacheToKey(cacheKey, cachePath, stateKey, cacheName) {
|
||||||
const matchedKey = getState(stateKey);
|
const matchedKey = getState(stateKey);
|
||||||
if (matchedKey === cacheKey) {
|
if (matchedKey === cacheKey) {
|
||||||
info(
|
info2(`${cacheName} hit occurred on key ${cacheKey}, not saving cache.`);
|
||||||
`${cacheName} hit occurred on key ${cacheKey}, not saving cache.`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
info(`Including ${cacheName} path: ${cachePath}`);
|
info2(`Including ${cacheName} path: ${cachePath}`);
|
||||||
await saveCache2([cachePath], cacheKey);
|
await saveCache2([cachePath], cacheKey);
|
||||||
info(`${cacheName} saved with key: ${cacheKey}`);
|
info2(`${cacheName} saved with key: ${cacheKey}`);
|
||||||
}
|
}
|
||||||
run();
|
run();
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|||||||
550
dist/setup/index.cjs
generated
vendored
550
dist/setup/index.cjs
generated
vendored
File diff suppressed because it is too large
Load Diff
298
dist/update-known-checksums/index.cjs
generated
vendored
298
dist/update-known-checksums/index.cjs
generated
vendored
@@ -153,18 +153,18 @@ var require_tunnel = __commonJS({
|
|||||||
res.statusCode
|
res.statusCode
|
||||||
);
|
);
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
|
var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
|
||||||
error.code = "ECONNRESET";
|
error2.code = "ECONNRESET";
|
||||||
options.request.emit("error", error);
|
options.request.emit("error", error2);
|
||||||
self.removeSocket(placeholder);
|
self.removeSocket(placeholder);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (head.length > 0) {
|
if (head.length > 0) {
|
||||||
debug2("got illegal response body from proxy");
|
debug2("got illegal response body from proxy");
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
var error = new Error("got illegal response body from proxy");
|
var error2 = new Error("got illegal response body from proxy");
|
||||||
error.code = "ECONNRESET";
|
error2.code = "ECONNRESET";
|
||||||
options.request.emit("error", error);
|
options.request.emit("error", error2);
|
||||||
self.removeSocket(placeholder);
|
self.removeSocket(placeholder);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -179,9 +179,9 @@ var require_tunnel = __commonJS({
|
|||||||
cause.message,
|
cause.message,
|
||||||
cause.stack
|
cause.stack
|
||||||
);
|
);
|
||||||
var error = new Error("tunneling socket could not be established, cause=" + cause.message);
|
var error2 = new Error("tunneling socket could not be established, cause=" + cause.message);
|
||||||
error.code = "ECONNRESET";
|
error2.code = "ECONNRESET";
|
||||||
options.request.emit("error", error);
|
options.request.emit("error", error2);
|
||||||
self.removeSocket(placeholder);
|
self.removeSocket(placeholder);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1510,14 +1510,14 @@ var require_diagnostics = __commonJS({
|
|||||||
diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
|
diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
|
||||||
const {
|
const {
|
||||||
connectParams: { version, protocol, port, host },
|
connectParams: { version, protocol, port, host },
|
||||||
error
|
error: error2
|
||||||
} = evt;
|
} = evt;
|
||||||
debuglog(
|
debuglog(
|
||||||
"connection to %s using %s%s errored - %s",
|
"connection to %s using %s%s errored - %s",
|
||||||
`${host}${port ? `:${port}` : ""}`,
|
`${host}${port ? `:${port}` : ""}`,
|
||||||
protocol,
|
protocol,
|
||||||
version,
|
version,
|
||||||
error.message
|
error2.message
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
||||||
@@ -1548,14 +1548,14 @@ var require_diagnostics = __commonJS({
|
|||||||
diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
|
diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
|
||||||
const {
|
const {
|
||||||
request: { method, path, origin },
|
request: { method, path, origin },
|
||||||
error
|
error: error2
|
||||||
} = evt;
|
} = evt;
|
||||||
debuglog(
|
debuglog(
|
||||||
"request to %s %s/%s errored - %s",
|
"request to %s %s/%s errored - %s",
|
||||||
method,
|
method,
|
||||||
origin,
|
origin,
|
||||||
path,
|
path,
|
||||||
error.message
|
error2.message
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
isClientSet = true;
|
isClientSet = true;
|
||||||
@@ -1590,7 +1590,7 @@ var require_diagnostics = __commonJS({
|
|||||||
diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
|
diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => {
|
||||||
const {
|
const {
|
||||||
connectParams: { version, protocol, port, host },
|
connectParams: { version, protocol, port, host },
|
||||||
error
|
error: error2
|
||||||
} = evt;
|
} = evt;
|
||||||
debuglog(
|
debuglog(
|
||||||
"connection to %s%s using %s%s errored - %s",
|
"connection to %s%s using %s%s errored - %s",
|
||||||
@@ -1598,7 +1598,7 @@ var require_diagnostics = __commonJS({
|
|||||||
port ? `:${port}` : "",
|
port ? `:${port}` : "",
|
||||||
protocol,
|
protocol,
|
||||||
version,
|
version,
|
||||||
error.message
|
error2.message
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
||||||
@@ -1868,16 +1868,16 @@ var require_request = __commonJS({
|
|||||||
this.onError(err);
|
this.onError(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onError(error) {
|
onError(error2) {
|
||||||
this.onFinally();
|
this.onFinally();
|
||||||
if (channels.error.hasSubscribers) {
|
if (channels.error.hasSubscribers) {
|
||||||
channels.error.publish({ request: this, error });
|
channels.error.publish({ request: this, error: error2 });
|
||||||
}
|
}
|
||||||
if (this.aborted) {
|
if (this.aborted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.aborted = true;
|
this.aborted = true;
|
||||||
return this[kHandler].onError(error);
|
return this[kHandler].onError(error2);
|
||||||
}
|
}
|
||||||
onFinally() {
|
onFinally() {
|
||||||
if (this.errorHandler) {
|
if (this.errorHandler) {
|
||||||
@@ -5600,7 +5600,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|||||||
}
|
}
|
||||||
throwIfAborted(object[kState]);
|
throwIfAborted(object[kState]);
|
||||||
const promise = createDeferredPromise();
|
const promise = createDeferredPromise();
|
||||||
const errorSteps = (error) => promise.reject(error);
|
const errorSteps = (error2) => promise.reject(error2);
|
||||||
const successSteps = (data) => {
|
const successSteps = (data) => {
|
||||||
try {
|
try {
|
||||||
promise.resolve(convertBytesToJSValue(data));
|
promise.resolve(convertBytesToJSValue(data));
|
||||||
@@ -7108,8 +7108,8 @@ var require_client_h2 = __commonJS({
|
|||||||
}
|
}
|
||||||
request.onRequestSent();
|
request.onRequestSent();
|
||||||
client[kResume]();
|
client[kResume]();
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
abort(error);
|
abort(error2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
||||||
@@ -7264,8 +7264,8 @@ var require_redirect_handler = __commonJS({
|
|||||||
onUpgrade(statusCode, headers, socket) {
|
onUpgrade(statusCode, headers, socket) {
|
||||||
this.handler.onUpgrade(statusCode, headers, socket);
|
this.handler.onUpgrade(statusCode, headers, socket);
|
||||||
}
|
}
|
||||||
onError(error) {
|
onError(error2) {
|
||||||
this.handler.onError(error);
|
this.handler.onError(error2);
|
||||||
}
|
}
|
||||||
onHeaders(statusCode, headers, resume, statusText) {
|
onHeaders(statusCode, headers, resume, statusText) {
|
||||||
this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
|
this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
|
||||||
@@ -8193,7 +8193,7 @@ var require_pool = __commonJS({
|
|||||||
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
|
this[kOptions] = { ...util.deepClone(options), connect, allowH2 };
|
||||||
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
|
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;
|
||||||
this[kFactory] = factory;
|
this[kFactory] = factory;
|
||||||
this.on("connectionError", (origin2, targets, error) => {
|
this.on("connectionError", (origin2, targets, error2) => {
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
const idx = this[kClients].indexOf(target);
|
const idx = this[kClients].indexOf(target);
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
@@ -10560,13 +10560,13 @@ var require_mock_utils = __commonJS({
|
|||||||
if (mockDispatch2.data.callback) {
|
if (mockDispatch2.data.callback) {
|
||||||
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
||||||
}
|
}
|
||||||
const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch2;
|
const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2;
|
||||||
const { timesInvoked, times } = mockDispatch2;
|
const { timesInvoked, times } = mockDispatch2;
|
||||||
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
||||||
mockDispatch2.pending = timesInvoked < times;
|
mockDispatch2.pending = timesInvoked < times;
|
||||||
if (error !== null) {
|
if (error2 !== null) {
|
||||||
deleteMockDispatch(this[kDispatches], key);
|
deleteMockDispatch(this[kDispatches], key);
|
||||||
handler.onError(error);
|
handler.onError(error2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (typeof delay === "number" && delay > 0) {
|
if (typeof delay === "number" && delay > 0) {
|
||||||
@@ -10604,19 +10604,19 @@ var require_mock_utils = __commonJS({
|
|||||||
if (agent.isMockActive) {
|
if (agent.isMockActive) {
|
||||||
try {
|
try {
|
||||||
mockDispatch.call(this, opts, handler);
|
mockDispatch.call(this, opts, handler);
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
if (error instanceof MockNotMatchedError) {
|
if (error2 instanceof MockNotMatchedError) {
|
||||||
const netConnect = agent[kGetNetConnect]();
|
const netConnect = agent[kGetNetConnect]();
|
||||||
if (netConnect === false) {
|
if (netConnect === false) {
|
||||||
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
|
throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
|
||||||
}
|
}
|
||||||
if (checkNetConnect(netConnect, origin)) {
|
if (checkNetConnect(netConnect, origin)) {
|
||||||
originalDispatch.call(this, opts, handler);
|
originalDispatch.call(this, opts, handler);
|
||||||
} else {
|
} else {
|
||||||
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
|
throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -10781,11 +10781,11 @@ var require_mock_interceptor = __commonJS({
|
|||||||
/**
|
/**
|
||||||
* Mock an undici request with a defined error.
|
* Mock an undici request with a defined error.
|
||||||
*/
|
*/
|
||||||
replyWithError(error) {
|
replyWithError(error2) {
|
||||||
if (typeof error === "undefined") {
|
if (typeof error2 === "undefined") {
|
||||||
throw new InvalidArgumentError("error must be defined");
|
throw new InvalidArgumentError("error must be defined");
|
||||||
}
|
}
|
||||||
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error });
|
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 });
|
||||||
return new MockScope(newMockDispatch);
|
return new MockScope(newMockDispatch);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -13303,17 +13303,17 @@ var require_fetch = __commonJS({
|
|||||||
this.emit("terminated", reason);
|
this.emit("terminated", reason);
|
||||||
}
|
}
|
||||||
// https://fetch.spec.whatwg.org/#fetch-controller-abort
|
// https://fetch.spec.whatwg.org/#fetch-controller-abort
|
||||||
abort(error) {
|
abort(error2) {
|
||||||
if (this.state !== "ongoing") {
|
if (this.state !== "ongoing") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.state = "aborted";
|
this.state = "aborted";
|
||||||
if (!error) {
|
if (!error2) {
|
||||||
error = new DOMException("The operation was aborted.", "AbortError");
|
error2 = new DOMException("The operation was aborted.", "AbortError");
|
||||||
}
|
}
|
||||||
this.serializedAbortReason = error;
|
this.serializedAbortReason = error2;
|
||||||
this.connection?.destroy(error);
|
this.connection?.destroy(error2);
|
||||||
this.emit("terminated", error);
|
this.emit("terminated", error2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function handleFetchDone(response) {
|
function handleFetchDone(response) {
|
||||||
@@ -13409,12 +13409,12 @@ var require_fetch = __commonJS({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
var markResourceTiming = performance.markResourceTiming;
|
var markResourceTiming = performance.markResourceTiming;
|
||||||
function abortFetch(p, request, responseObject, error) {
|
function abortFetch(p, request, responseObject, error2) {
|
||||||
if (p) {
|
if (p) {
|
||||||
p.reject(error);
|
p.reject(error2);
|
||||||
}
|
}
|
||||||
if (request.body != null && isReadable(request.body?.stream)) {
|
if (request.body != null && isReadable(request.body?.stream)) {
|
||||||
request.body.stream.cancel(error).catch((err) => {
|
request.body.stream.cancel(error2).catch((err) => {
|
||||||
if (err.code === "ERR_INVALID_STATE") {
|
if (err.code === "ERR_INVALID_STATE") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -13426,7 +13426,7 @@ var require_fetch = __commonJS({
|
|||||||
}
|
}
|
||||||
const response = responseObject[kState];
|
const response = responseObject[kState];
|
||||||
if (response.body != null && isReadable(response.body?.stream)) {
|
if (response.body != null && isReadable(response.body?.stream)) {
|
||||||
response.body.stream.cancel(error).catch((err) => {
|
response.body.stream.cancel(error2).catch((err) => {
|
||||||
if (err.code === "ERR_INVALID_STATE") {
|
if (err.code === "ERR_INVALID_STATE") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -14247,13 +14247,13 @@ var require_fetch = __commonJS({
|
|||||||
fetchParams.controller.ended = true;
|
fetchParams.controller.ended = true;
|
||||||
this.body.push(null);
|
this.body.push(null);
|
||||||
},
|
},
|
||||||
onError(error) {
|
onError(error2) {
|
||||||
if (this.abort) {
|
if (this.abort) {
|
||||||
fetchParams.controller.off("terminated", this.abort);
|
fetchParams.controller.off("terminated", this.abort);
|
||||||
}
|
}
|
||||||
this.body?.destroy(error);
|
this.body?.destroy(error2);
|
||||||
fetchParams.controller.terminate(error);
|
fetchParams.controller.terminate(error2);
|
||||||
reject(error);
|
reject(error2);
|
||||||
},
|
},
|
||||||
onUpgrade(status, rawHeaders, socket) {
|
onUpgrade(status, rawHeaders, socket) {
|
||||||
if (status !== 101) {
|
if (status !== 101) {
|
||||||
@@ -14716,8 +14716,8 @@ var require_util4 = __commonJS({
|
|||||||
}
|
}
|
||||||
fr[kResult] = result;
|
fr[kResult] = result;
|
||||||
fireAProgressEvent("load", fr);
|
fireAProgressEvent("load", fr);
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
fr[kError] = error;
|
fr[kError] = error2;
|
||||||
fireAProgressEvent("error", fr);
|
fireAProgressEvent("error", fr);
|
||||||
}
|
}
|
||||||
if (fr[kState] !== "loading") {
|
if (fr[kState] !== "loading") {
|
||||||
@@ -14726,13 +14726,13 @@ var require_util4 = __commonJS({
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
if (fr[kAborted]) {
|
if (fr[kAborted]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
queueMicrotask(() => {
|
queueMicrotask(() => {
|
||||||
fr[kState] = "done";
|
fr[kState] = "done";
|
||||||
fr[kError] = error;
|
fr[kError] = error2;
|
||||||
fireAProgressEvent("error", fr);
|
fireAProgressEvent("error", fr);
|
||||||
if (fr[kState] !== "loading") {
|
if (fr[kState] !== "loading") {
|
||||||
fireAProgressEvent("loadend", fr);
|
fireAProgressEvent("loadend", fr);
|
||||||
@@ -17004,11 +17004,11 @@ var require_connection = __commonJS({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function onSocketError(error) {
|
function onSocketError(error2) {
|
||||||
const { ws } = this;
|
const { ws } = this;
|
||||||
ws[kReadyState] = states.CLOSING;
|
ws[kReadyState] = states.CLOSING;
|
||||||
if (channels.socketError.hasSubscribers) {
|
if (channels.socketError.hasSubscribers) {
|
||||||
channels.socketError.publish(error);
|
channels.socketError.publish(error2);
|
||||||
}
|
}
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
@@ -17275,9 +17275,9 @@ var require_receiver = __commonJS({
|
|||||||
}
|
}
|
||||||
this.#state = parserStates.INFO;
|
this.#state = parserStates.INFO;
|
||||||
} else {
|
} else {
|
||||||
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => {
|
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data) => {
|
||||||
if (error) {
|
if (error2) {
|
||||||
failWebsocketConnection(this.ws, error.message);
|
failWebsocketConnection(this.ws, error2.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.#fragments.push(data);
|
this.#fragments.push(data);
|
||||||
@@ -18309,8 +18309,8 @@ var require_eventsource = __commonJS({
|
|||||||
pipeline(
|
pipeline(
|
||||||
response.body.stream,
|
response.body.stream,
|
||||||
eventSourceStream,
|
eventSourceStream,
|
||||||
(error) => {
|
(error2) => {
|
||||||
if (error?.aborted === false) {
|
if (error2?.aborted === false) {
|
||||||
this.close();
|
this.close();
|
||||||
this.dispatchEvent(new Event("error"));
|
this.dispatchEvent(new Event("error"));
|
||||||
}
|
}
|
||||||
@@ -21649,7 +21649,7 @@ var require_diagnostics2 = __commonJS({
|
|||||||
(evt) => {
|
(evt) => {
|
||||||
const {
|
const {
|
||||||
connectParams: { version, protocol, port, host },
|
connectParams: { version, protocol, port, host },
|
||||||
error
|
error: error2
|
||||||
} = evt;
|
} = evt;
|
||||||
debugLog(
|
debugLog(
|
||||||
"connection to %s%s using %s%s errored - %s",
|
"connection to %s%s using %s%s errored - %s",
|
||||||
@@ -21657,7 +21657,7 @@ var require_diagnostics2 = __commonJS({
|
|||||||
port ? `:${port}` : "",
|
port ? `:${port}` : "",
|
||||||
protocol,
|
protocol,
|
||||||
version,
|
version,
|
||||||
error.message
|
error2.message
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -21711,14 +21711,14 @@ var require_diagnostics2 = __commonJS({
|
|||||||
(evt) => {
|
(evt) => {
|
||||||
const {
|
const {
|
||||||
request: { method, path, origin },
|
request: { method, path, origin },
|
||||||
error
|
error: error2
|
||||||
} = evt;
|
} = evt;
|
||||||
debugLog(
|
debugLog(
|
||||||
"request to %s %s%s errored - %s",
|
"request to %s %s%s errored - %s",
|
||||||
method,
|
method,
|
||||||
origin,
|
origin,
|
||||||
path,
|
path,
|
||||||
error.message
|
error2.message
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -22037,16 +22037,16 @@ var require_request3 = __commonJS({
|
|||||||
this.onError(err);
|
this.onError(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onError(error) {
|
onError(error2) {
|
||||||
this.onFinally();
|
this.onFinally();
|
||||||
if (channels.error.hasSubscribers) {
|
if (channels.error.hasSubscribers) {
|
||||||
channels.error.publish({ request: this, error });
|
channels.error.publish({ request: this, error: error2 });
|
||||||
}
|
}
|
||||||
if (this.aborted) {
|
if (this.aborted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.aborted = true;
|
this.aborted = true;
|
||||||
return this[kHandler].onError(error);
|
return this[kHandler].onError(error2);
|
||||||
}
|
}
|
||||||
onFinally() {
|
onFinally() {
|
||||||
if (this.errorHandler) {
|
if (this.errorHandler) {
|
||||||
@@ -27576,9 +27576,9 @@ var require_client_h22 = __commonJS({
|
|||||||
const client = this[kClient];
|
const client = this[kClient];
|
||||||
const socket = this[kClient];
|
const socket = this[kClient];
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
const error = new InformationalError(`HTTP/2: "PING" errored - type ${err.message}`);
|
const error2 = new InformationalError(`HTTP/2: "PING" errored - type ${err.message}`);
|
||||||
socket[kError] = error;
|
socket[kError] = error2;
|
||||||
client[kOnError](error);
|
client[kOnError](error2);
|
||||||
} else {
|
} else {
|
||||||
client.emit("ping", duration);
|
client.emit("ping", duration);
|
||||||
}
|
}
|
||||||
@@ -27994,8 +27994,8 @@ var require_client_h22 = __commonJS({
|
|||||||
}
|
}
|
||||||
request.onRequestSent();
|
request.onRequestSent();
|
||||||
client[kResume]();
|
client[kResume]();
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
abort(error);
|
abort(error2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) {
|
||||||
@@ -28926,7 +28926,7 @@ var require_pool2 = __commonJS({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.on("connectionError", (origin2, targets, error) => {
|
this.on("connectionError", (origin2, targets, error2) => {
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
const idx = this[kClients].indexOf(target);
|
const idx = this[kClients].indexOf(target);
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
@@ -29178,7 +29178,7 @@ var require_round_robin_pool = __commonJS({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.on("connectionError", (origin2, targets, error) => {
|
this.on("connectionError", (origin2, targets, error2) => {
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
const idx = this[kClients].indexOf(target);
|
const idx = this[kClients].indexOf(target);
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
@@ -29491,9 +29491,9 @@ var require_socks5_utils = __commonJS({
|
|||||||
8: "Address type not supported"
|
8: "Address type not supported"
|
||||||
};
|
};
|
||||||
const message = messages[replyCode] || `Unknown SOCKS5 error code: ${replyCode}`;
|
const message = messages[replyCode] || `Unknown SOCKS5 error code: ${replyCode}`;
|
||||||
const error = new Error(message);
|
const error2 = new Error(message);
|
||||||
error.code = `SOCKS5_${replyCode}`;
|
error2.code = `SOCKS5_${replyCode}`;
|
||||||
return error;
|
return error2;
|
||||||
}
|
}
|
||||||
module2.exports = {
|
module2.exports = {
|
||||||
parseAddress,
|
parseAddress,
|
||||||
@@ -29931,8 +29931,8 @@ var require_socks5_proxy_agent = __commonJS({
|
|||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
reject(new Error("SOCKS5 connection timeout"));
|
reject(new Error("SOCKS5 connection timeout"));
|
||||||
}, 5e3);
|
}, 5e3);
|
||||||
const onConnected = (info2) => {
|
const onConnected = (info3) => {
|
||||||
debug2("SOCKS5 tunnel established to", targetHost, targetPort, "via", info2);
|
debug2("SOCKS5 tunnel established to", targetHost, targetPort, "via", info3);
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
socks5Client.removeListener("error", onError);
|
socks5Client.removeListener("error", onError);
|
||||||
resolve();
|
resolve();
|
||||||
@@ -32269,13 +32269,13 @@ var require_mock_utils2 = __commonJS({
|
|||||||
if (mockDispatch2.data.callback) {
|
if (mockDispatch2.data.callback) {
|
||||||
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
||||||
}
|
}
|
||||||
const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch2;
|
const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2;
|
||||||
const { timesInvoked, times } = mockDispatch2;
|
const { timesInvoked, times } = mockDispatch2;
|
||||||
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
||||||
mockDispatch2.pending = timesInvoked < times;
|
mockDispatch2.pending = timesInvoked < times;
|
||||||
if (error !== null) {
|
if (error2 !== null) {
|
||||||
deleteMockDispatch(this[kDispatches], key);
|
deleteMockDispatch(this[kDispatches], key);
|
||||||
handler.onError(error);
|
handler.onError(error2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
let aborted = false;
|
let aborted = false;
|
||||||
@@ -32332,19 +32332,19 @@ var require_mock_utils2 = __commonJS({
|
|||||||
if (agent.isMockActive) {
|
if (agent.isMockActive) {
|
||||||
try {
|
try {
|
||||||
mockDispatch.call(this, opts, handler);
|
mockDispatch.call(this, opts, handler);
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
if (error.code === "UND_MOCK_ERR_MOCK_NOT_MATCHED") {
|
if (error2.code === "UND_MOCK_ERR_MOCK_NOT_MATCHED") {
|
||||||
const netConnect = agent[kGetNetConnect]();
|
const netConnect = agent[kGetNetConnect]();
|
||||||
if (netConnect === false) {
|
if (netConnect === false) {
|
||||||
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
|
throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
|
||||||
}
|
}
|
||||||
if (checkNetConnect(netConnect, origin)) {
|
if (checkNetConnect(netConnect, origin)) {
|
||||||
originalDispatch.call(this, opts, handler);
|
originalDispatch.call(this, opts, handler);
|
||||||
} else {
|
} else {
|
||||||
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
|
throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -32529,11 +32529,11 @@ var require_mock_interceptor2 = __commonJS({
|
|||||||
/**
|
/**
|
||||||
* Mock an undici request with a defined error.
|
* Mock an undici request with a defined error.
|
||||||
*/
|
*/
|
||||||
replyWithError(error) {
|
replyWithError(error2) {
|
||||||
if (typeof error === "undefined") {
|
if (typeof error2 === "undefined") {
|
||||||
throw new InvalidArgumentError("error must be defined");
|
throw new InvalidArgumentError("error must be defined");
|
||||||
}
|
}
|
||||||
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
|
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
|
||||||
return new MockScope(newMockDispatch);
|
return new MockScope(newMockDispatch);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -32683,8 +32683,8 @@ var require_mock_call_history = __commonJS({
|
|||||||
}
|
}
|
||||||
url.search = new URLSearchParams(requestInit.query).toString();
|
url.search = new URLSearchParams(requestInit.query).toString();
|
||||||
return url;
|
return url;
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error });
|
throw new InvalidArgumentError("An error occurred when computing MockCallHistoryLog.url", { cause: error2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var MockCallHistoryLog = class {
|
var MockCallHistoryLog = class {
|
||||||
@@ -33418,11 +33418,11 @@ var require_snapshot_recorder = __commonJS({
|
|||||||
} else {
|
} else {
|
||||||
this.#snapshots = new Map(Object.entries(parsed));
|
this.#snapshots = new Map(Object.entries(parsed));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
if (error.code === "ENOENT") {
|
if (error2.code === "ENOENT") {
|
||||||
this.#snapshots.clear();
|
this.#snapshots.clear();
|
||||||
} else {
|
} else {
|
||||||
throw new UndiciError(`Failed to load snapshots from ${path}`, { cause: error });
|
throw new UndiciError(`Failed to load snapshots from ${path}`, { cause: error2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33656,12 +33656,12 @@ var require_snapshot_agent = __commonJS({
|
|||||||
} else if (mode === "update") {
|
} else if (mode === "update") {
|
||||||
return this.#recordAndReplay(opts, handler);
|
return this.#recordAndReplay(opts, handler);
|
||||||
} else {
|
} else {
|
||||||
const error = new UndiciError(`No snapshot found for ${opts.method || "GET"} ${opts.path}`);
|
const error2 = new UndiciError(`No snapshot found for ${opts.method || "GET"} ${opts.path}`);
|
||||||
if (handler.onError) {
|
if (handler.onError) {
|
||||||
handler.onError(error);
|
handler.onError(error2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw error;
|
throw error2;
|
||||||
}
|
}
|
||||||
} else if (mode === "record") {
|
} else if (mode === "record") {
|
||||||
return this.#recordAndReplay(opts, handler);
|
return this.#recordAndReplay(opts, handler);
|
||||||
@@ -33709,7 +33709,7 @@ var require_snapshot_agent = __commonJS({
|
|||||||
headers: responseData.headers,
|
headers: responseData.headers,
|
||||||
body: responseBody,
|
body: responseBody,
|
||||||
trailers: responseData.trailers
|
trailers: responseData.trailers
|
||||||
}).then(() => handler.onResponseEnd(controller, trailers)).catch((error) => handler.onResponseError(controller, error));
|
}).then(() => handler.onResponseEnd(controller, trailers)).catch((error2) => handler.onResponseError(controller, error2));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const agent = this[kRealAgent];
|
const agent = this[kRealAgent];
|
||||||
@@ -33742,8 +33742,8 @@ var require_snapshot_agent = __commonJS({
|
|||||||
const body = Buffer.from(response.body, "base64");
|
const body = Buffer.from(response.body, "base64");
|
||||||
handler.onResponseData(controller, body);
|
handler.onResponseData(controller, body);
|
||||||
handler.onResponseEnd(controller, response.trailers);
|
handler.onResponseEnd(controller, response.trailers);
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
handler.onError?.(error);
|
handler.onError?.(error2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -34087,8 +34087,8 @@ var require_redirect_handler2 = __commonJS({
|
|||||||
this.handler.onResponseEnd(controller, trailers);
|
this.handler.onResponseEnd(controller, trailers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onResponseError(controller, error) {
|
onResponseError(controller, error2) {
|
||||||
this.handler.onResponseError?.(controller, error);
|
this.handler.onResponseError?.(controller, error2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function shouldRemoveHeader(header, removeContent, unknownOrigin) {
|
function shouldRemoveHeader(header, removeContent, unknownOrigin) {
|
||||||
@@ -36609,8 +36609,8 @@ var require_decompress = __commonJS({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
decompressor.on("error", (error) => {
|
decompressor.on("error", (error2) => {
|
||||||
super.onResponseError(controller, error);
|
super.onResponseError(controller, error2);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -39404,17 +39404,17 @@ var require_fetch2 = __commonJS({
|
|||||||
this.emit("terminated", reason);
|
this.emit("terminated", reason);
|
||||||
}
|
}
|
||||||
// https://fetch.spec.whatwg.org/#fetch-controller-abort
|
// https://fetch.spec.whatwg.org/#fetch-controller-abort
|
||||||
abort(error) {
|
abort(error2) {
|
||||||
if (this.state !== "ongoing") {
|
if (this.state !== "ongoing") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.state = "aborted";
|
this.state = "aborted";
|
||||||
if (!error) {
|
if (!error2) {
|
||||||
error = new DOMException("The operation was aborted.", "AbortError");
|
error2 = new DOMException("The operation was aborted.", "AbortError");
|
||||||
}
|
}
|
||||||
this.serializedAbortReason = error;
|
this.serializedAbortReason = error2;
|
||||||
this.connection?.destroy(error);
|
this.connection?.destroy(error2);
|
||||||
this.emit("terminated", error);
|
this.emit("terminated", error2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function handleFetchDone(response) {
|
function handleFetchDone(response) {
|
||||||
@@ -39516,12 +39516,12 @@ var require_fetch2 = __commonJS({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
var markResourceTiming = performance.markResourceTiming;
|
var markResourceTiming = performance.markResourceTiming;
|
||||||
function abortFetch(p, request, responseObject, error, controller) {
|
function abortFetch(p, request, responseObject, error2, controller) {
|
||||||
if (p) {
|
if (p) {
|
||||||
p.reject(error);
|
p.reject(error2);
|
||||||
}
|
}
|
||||||
if (request.body?.stream != null && isReadable(request.body.stream)) {
|
if (request.body?.stream != null && isReadable(request.body.stream)) {
|
||||||
request.body.stream.cancel(error).catch((err) => {
|
request.body.stream.cancel(error2).catch((err) => {
|
||||||
if (err.code === "ERR_INVALID_STATE") {
|
if (err.code === "ERR_INVALID_STATE") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -39533,7 +39533,7 @@ var require_fetch2 = __commonJS({
|
|||||||
}
|
}
|
||||||
const response = getResponseState(responseObject);
|
const response = getResponseState(responseObject);
|
||||||
if (response.body?.stream != null && isReadable(response.body.stream)) {
|
if (response.body?.stream != null && isReadable(response.body.stream)) {
|
||||||
controller.error(error);
|
controller.error(error2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function fetching({
|
function fetching({
|
||||||
@@ -40377,13 +40377,13 @@ var require_fetch2 = __commonJS({
|
|||||||
fetchParams.controller.ended = true;
|
fetchParams.controller.ended = true;
|
||||||
this.body.push(null);
|
this.body.push(null);
|
||||||
},
|
},
|
||||||
onError(error) {
|
onError(error2) {
|
||||||
if (this.abort) {
|
if (this.abort) {
|
||||||
fetchParams.controller.off("terminated", this.abort);
|
fetchParams.controller.off("terminated", this.abort);
|
||||||
}
|
}
|
||||||
this.body?.destroy(error);
|
this.body?.destroy(error2);
|
||||||
fetchParams.controller.terminate(error);
|
fetchParams.controller.terminate(error2);
|
||||||
reject(error);
|
reject(error2);
|
||||||
},
|
},
|
||||||
onRequestUpgrade(_controller, status, headers, socket) {
|
onRequestUpgrade(_controller, status, headers, socket) {
|
||||||
if (socket.session != null && status !== 200 || socket.session == null && status !== 101) {
|
if (socket.session != null && status !== 200 || socket.session == null && status !== 101) {
|
||||||
@@ -42605,10 +42605,10 @@ var require_receiver2 = __commonJS({
|
|||||||
}
|
}
|
||||||
this.#state = parserStates.INFO;
|
this.#state = parserStates.INFO;
|
||||||
} else {
|
} else {
|
||||||
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => {
|
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data) => {
|
||||||
if (error) {
|
if (error2) {
|
||||||
const code = error instanceof MessageSizeExceededError ? 1009 : 1007;
|
const code = error2 instanceof MessageSizeExceededError ? 1009 : 1007;
|
||||||
failWebsocketConnection(this.#handler, code, error.message);
|
failWebsocketConnection(this.#handler, code, error2.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.writeFragments(data);
|
this.writeFragments(data);
|
||||||
@@ -43380,10 +43380,10 @@ var require_websocketerror = __commonJS({
|
|||||||
* @param {string} reason
|
* @param {string} reason
|
||||||
*/
|
*/
|
||||||
static createUnvalidatedWebSocketError(message, code, reason) {
|
static createUnvalidatedWebSocketError(message, code, reason) {
|
||||||
const error = new _WebSocketError(message, kConstruct);
|
const error2 = new _WebSocketError(message, kConstruct);
|
||||||
error.#closeCode = code;
|
error2.#closeCode = code;
|
||||||
error.#reason = reason;
|
error2.#reason = reason;
|
||||||
return error;
|
return error2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var { createUnvalidatedWebSocketError } = WebSocketError;
|
var { createUnvalidatedWebSocketError } = WebSocketError;
|
||||||
@@ -43650,10 +43650,10 @@ var require_websocketstream = __commonJS({
|
|||||||
reason
|
reason
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const error = createUnvalidatedWebSocketError("unclean close", code, reason);
|
const error2 = createUnvalidatedWebSocketError("unclean close", code, reason);
|
||||||
this.#readableStreamController?.error(error);
|
this.#readableStreamController?.error(error2);
|
||||||
this.#writableStream?.abort(error);
|
this.#writableStream?.abort(error2);
|
||||||
this.#closedPromise.reject(error);
|
this.#closedPromise.reject(error2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#closeUsingReason(reason) {
|
#closeUsingReason(reason) {
|
||||||
@@ -44132,8 +44132,8 @@ var require_eventsource2 = __commonJS({
|
|||||||
pipeline(
|
pipeline(
|
||||||
response.body.stream,
|
response.body.stream,
|
||||||
eventSourceStream,
|
eventSourceStream,
|
||||||
(error) => {
|
(error2) => {
|
||||||
if (error?.aborted === false) {
|
if (error2?.aborted === false) {
|
||||||
this.close();
|
this.close();
|
||||||
this.dispatchEvent(new Event("error"));
|
this.dispatchEvent(new Event("error"));
|
||||||
}
|
}
|
||||||
@@ -44929,6 +44929,16 @@ var ExitCode;
|
|||||||
ExitCode2[ExitCode2["Success"] = 0] = "Success";
|
ExitCode2[ExitCode2["Success"] = 0] = "Success";
|
||||||
ExitCode2[ExitCode2["Failure"] = 1] = "Failure";
|
ExitCode2[ExitCode2["Failure"] = 1] = "Failure";
|
||||||
})(ExitCode || (ExitCode = {}));
|
})(ExitCode || (ExitCode = {}));
|
||||||
|
function getInput(name, options) {
|
||||||
|
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || "";
|
||||||
|
if (options && options.required && !val) {
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
}
|
||||||
|
if (options && options.trimWhitespace === false) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
return val.trim();
|
||||||
|
}
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
const filePath = process.env["GITHUB_OUTPUT"] || "";
|
const filePath = process.env["GITHUB_OUTPUT"] || "";
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
@@ -49760,6 +49770,20 @@ var fetch = async (url, opts) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// src/utils/logging.ts
|
||||||
|
var quiet;
|
||||||
|
function isQuiet() {
|
||||||
|
if (quiet === void 0) {
|
||||||
|
quiet = typeof getInput === "function" && getInput("quiet") === "true";
|
||||||
|
}
|
||||||
|
return quiet;
|
||||||
|
}
|
||||||
|
function info2(msg) {
|
||||||
|
if (!isQuiet()) {
|
||||||
|
info(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// src/download/manifest.ts
|
// src/download/manifest.ts
|
||||||
var cachedManifestData = /* @__PURE__ */ new Map();
|
var cachedManifestData = /* @__PURE__ */ new Map();
|
||||||
async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) {
|
async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) {
|
||||||
@@ -49768,7 +49792,7 @@ async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) {
|
|||||||
debug(`Using cached manifest data from ${manifestUrl}`);
|
debug(`Using cached manifest data from ${manifestUrl}`);
|
||||||
return cachedVersions;
|
return cachedVersions;
|
||||||
}
|
}
|
||||||
info(`Fetching manifest data from ${manifestUrl} ...`);
|
info2(`Fetching manifest data from ${manifestUrl} ...`);
|
||||||
const response = await fetch(manifestUrl, {});
|
const response = await fetch(manifestUrl, {});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -49799,9 +49823,9 @@ function parseManifest(data, sourceDescription) {
|
|||||||
let parsed;
|
let parsed;
|
||||||
try {
|
try {
|
||||||
parsed = JSON.parse(record);
|
parsed = JSON.parse(record);
|
||||||
} catch (error) {
|
} catch (error2) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${error.message}`
|
`Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${error2.message}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!isManifestVersion(parsed)) {
|
if (!isManifestVersion(parsed)) {
|
||||||
@@ -49856,7 +49880,7 @@ async function run() {
|
|||||||
const latestVersion = await getLatestVersion();
|
const latestVersion = await getLatestVersion();
|
||||||
const latestKnownVersion = getLatestKnownVersionFromChecksums();
|
const latestKnownVersion = getLatestKnownVersionFromChecksums();
|
||||||
if (semver.lte(latestVersion, latestKnownVersion)) {
|
if (semver.lte(latestVersion, latestKnownVersion)) {
|
||||||
info(
|
info2(
|
||||||
`Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`
|
`Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
15
src/cache/restore-cache.ts
vendored
15
src/cache/restore-cache.ts
vendored
@@ -2,6 +2,7 @@ import * as cache from "@actions/cache";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { hashFiles } from "../hash/hash-files";
|
import { hashFiles } from "../hash/hash-files";
|
||||||
import type { SetupInputs } from "../utils/inputs";
|
import type { SetupInputs } from "../utils/inputs";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms";
|
import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms";
|
||||||
|
|
||||||
export const STATE_CACHE_KEY = "cache-key";
|
export const STATE_CACHE_KEY = "cache-key";
|
||||||
@@ -19,7 +20,7 @@ export async function restoreCache(
|
|||||||
core.setOutput("cache-key", cacheKey);
|
core.setOutput("cache-key", cacheKey);
|
||||||
|
|
||||||
if (!inputs.restoreCache) {
|
if (!inputs.restoreCache) {
|
||||||
core.info("restore-cache is false. Skipping restore cache step.");
|
log.info("restore-cache is false. Skipping restore cache step.");
|
||||||
core.setOutput("python-cache-hit", false);
|
core.setOutput("python-cache-hit", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -55,7 +56,7 @@ async function restoreCacheFromKey(
|
|||||||
stateKey: string,
|
stateKey: string,
|
||||||
outputKey: string,
|
outputKey: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
core.info(
|
log.info(
|
||||||
`Trying to restore cache from GitHub Actions cache with key: ${cacheKey}`,
|
`Trying to restore cache from GitHub Actions cache with key: ${cacheKey}`,
|
||||||
);
|
);
|
||||||
let matchedKey: string | undefined;
|
let matchedKey: string | undefined;
|
||||||
@@ -63,7 +64,7 @@ async function restoreCacheFromKey(
|
|||||||
matchedKey = await cache.restoreCache([cachePath], cacheKey);
|
matchedKey = await cache.restoreCache([cachePath], cacheKey);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = (err as Error).message;
|
const message = (err as Error).message;
|
||||||
core.warning(message);
|
log.warning(message);
|
||||||
core.setOutput(outputKey, false);
|
core.setOutput(outputKey, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,7 +78,7 @@ async function computeKeys(
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
let cacheDependencyPathHash = "-";
|
let cacheDependencyPathHash = "-";
|
||||||
if (inputs.cacheDependencyGlob !== "") {
|
if (inputs.cacheDependencyGlob !== "") {
|
||||||
core.info(
|
log.info(
|
||||||
`Searching files using cache dependency glob: ${inputs.cacheDependencyGlob.split("\n").join(",")}`,
|
`Searching files using cache dependency glob: ${inputs.cacheDependencyGlob.split("\n").join(",")}`,
|
||||||
);
|
);
|
||||||
cacheDependencyPathHash += await hashFiles(
|
cacheDependencyPathHash += await hashFiles(
|
||||||
@@ -85,7 +86,7 @@ async function computeKeys(
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
if (cacheDependencyPathHash === "-") {
|
if (cacheDependencyPathHash === "-") {
|
||||||
core.warning(
|
log.warning(
|
||||||
`No file matched to [${inputs.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`,
|
`No file matched to [${inputs.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -109,12 +110,12 @@ function handleMatchResult(
|
|||||||
outputKey: string,
|
outputKey: string,
|
||||||
): void {
|
): void {
|
||||||
if (!matchedKey) {
|
if (!matchedKey) {
|
||||||
core.info(`No GitHub Actions cache found for key: ${primaryKey}`);
|
log.info(`No GitHub Actions cache found for key: ${primaryKey}`);
|
||||||
core.setOutput(outputKey, false);
|
core.setOutput(outputKey, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.saveState(stateKey, matchedKey);
|
core.saveState(stateKey, matchedKey);
|
||||||
core.info(`cache restored from GitHub Actions cache with key: ${matchedKey}`);
|
log.info(`cache restored from GitHub Actions cache with key: ${matchedKey}`);
|
||||||
core.setOutput(outputKey, true);
|
core.setOutput(outputKey, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
TOOL_CACHE_NAME,
|
TOOL_CACHE_NAME,
|
||||||
VERSIONS_MANIFEST_URL,
|
VERSIONS_MANIFEST_URL,
|
||||||
} from "../utils/constants";
|
} from "../utils/constants";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
import type { Architecture, Platform } from "../utils/platforms";
|
import type { Architecture, Platform } from "../utils/platforms";
|
||||||
import { validateChecksum } from "./checksum/checksum";
|
import { validateChecksum } from "./checksum/checksum";
|
||||||
import { getArtifact } from "./manifest";
|
import { getArtifact } from "./manifest";
|
||||||
@@ -73,7 +74,7 @@ export async function downloadVersion(
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.warning(
|
log.warning(
|
||||||
`Failed to download from mirror, falling back to GitHub Releases: ${(err as Error).message}`,
|
`Failed to download from mirror, falling back to GitHub Releases: ${(err as Error).message}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ async function downloadArtifact(
|
|||||||
checksum: string | undefined,
|
checksum: string | undefined,
|
||||||
githubToken: string | undefined,
|
githubToken: string | undefined,
|
||||||
): Promise<{ version: string; cachedToolDir: string }> {
|
): Promise<{ version: string; cachedToolDir: string }> {
|
||||||
core.info(`Downloading uv from "${downloadUrl}" ...`);
|
log.info(`Downloading uv from "${downloadUrl}" ...`);
|
||||||
const downloadPath = await tc.downloadTool(
|
const downloadPath = await tc.downloadTool(
|
||||||
downloadUrl,
|
downloadUrl,
|
||||||
undefined,
|
undefined,
|
||||||
@@ -139,7 +140,7 @@ async function downloadArtifact(
|
|||||||
// so this may fail if another tar, like gnu tar, ends up being used.
|
// so this may fail if another tar, like gnu tar, ends up being used.
|
||||||
uvDir = await tc.extractTar(downloadPath, undefined, "x");
|
uvDir = await tc.extractTar(downloadPath, undefined, "x");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.info(
|
log.info(
|
||||||
`Extracting with tar failed, falling back to zip extraction: ${(err as Error).message}`,
|
`Extracting with tar failed, falling back to zip extraction: ${(err as Error).message}`,
|
||||||
);
|
);
|
||||||
const extension = getExtension(platform);
|
const extension = getExtension(platform);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { VERSIONS_MANIFEST_URL } from "../utils/constants";
|
import { VERSIONS_MANIFEST_URL } from "../utils/constants";
|
||||||
import { fetch } from "../utils/fetch";
|
import { fetch } from "../utils/fetch";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
import { selectDefaultVariant } from "./variant-selection";
|
import { selectDefaultVariant } from "./variant-selection";
|
||||||
|
|
||||||
export interface ManifestArtifact {
|
export interface ManifestArtifact {
|
||||||
@@ -33,7 +34,7 @@ export async function fetchManifest(
|
|||||||
return cachedVersions;
|
return cachedVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Fetching manifest data from ${manifestUrl} ...`);
|
log.info(`Fetching manifest data from ${manifestUrl} ...`);
|
||||||
const response = await fetch(manifestUrl, {});
|
const response = await fetch(manifestUrl, {});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -111,7 +112,7 @@ export async function getLatestVersion(
|
|||||||
export async function getAllVersions(
|
export async function getAllVersions(
|
||||||
manifestUrl: string = VERSIONS_MANIFEST_URL,
|
manifestUrl: string = VERSIONS_MANIFEST_URL,
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
core.info(
|
log.info(
|
||||||
`Getting available versions from ${manifestSource(manifestUrl)} ...`,
|
`Getting available versions from ${manifestSource(manifestUrl)} ...`,
|
||||||
);
|
);
|
||||||
const versions = await fetchManifest(manifestUrl);
|
const versions = await fetchManifest(manifestUrl);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import * as crypto from "node:crypto";
|
|||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
import * as stream from "node:stream";
|
import * as stream from "node:stream";
|
||||||
import * as util from "node:util";
|
import * as util from "node:util";
|
||||||
import * as core from "@actions/core";
|
|
||||||
import { create } from "@actions/glob";
|
import { create } from "@actions/glob";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hashes files matching the given glob pattern.
|
* Hashes files matching the given glob pattern.
|
||||||
@@ -19,7 +19,7 @@ export async function hashFiles(
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const globber = await create(pattern);
|
const globber = await create(pattern);
|
||||||
let hasMatch = false;
|
let hasMatch = false;
|
||||||
const writeDelegate = verbose ? core.info : core.debug;
|
const writeDelegate = verbose ? log.info : log.debug;
|
||||||
const result = crypto.createHash("sha256");
|
const result = crypto.createHash("sha256");
|
||||||
let count = 0;
|
let count = 0;
|
||||||
for await (const file of globber.globGenerator()) {
|
for await (const file of globber.globGenerator()) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
} from "./cache/restore-cache";
|
} from "./cache/restore-cache";
|
||||||
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
||||||
import { loadInputs, type SetupInputs } from "./utils/inputs";
|
import { loadInputs, type SetupInputs } from "./utils/inputs";
|
||||||
|
import * as log from "./utils/logging";
|
||||||
|
|
||||||
function formatUnexpectedFailure(error: unknown): string {
|
function formatUnexpectedFailure(error: unknown): string {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
@@ -38,7 +39,7 @@ export async function run(): Promise<void> {
|
|||||||
if (inputs.saveCache) {
|
if (inputs.saveCache) {
|
||||||
await saveCache(inputs);
|
await saveCache(inputs);
|
||||||
} else {
|
} else {
|
||||||
core.info("save-cache is false. Skipping save cache step.");
|
log.info("save-cache is false. Skipping save cache step.");
|
||||||
}
|
}
|
||||||
// https://github.com/nodejs/node/issues/56645#issuecomment-3924958861
|
// https://github.com/nodejs/node/issues/56645#issuecomment-3924958861
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
@@ -61,11 +62,11 @@ async function saveCache(inputs: SetupInputs): Promise<void> {
|
|||||||
const matchedKey = core.getState(STATE_CACHE_MATCHED_KEY);
|
const matchedKey = core.getState(STATE_CACHE_MATCHED_KEY);
|
||||||
|
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
core.warning("Error retrieving cache key from state.");
|
log.warning("Error retrieving cache key from state.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchedKey === cacheKey) {
|
if (matchedKey === cacheKey) {
|
||||||
core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
|
log.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
|
||||||
} else {
|
} else {
|
||||||
if (inputs.pruneCache) {
|
if (inputs.pruneCache) {
|
||||||
await pruneCache();
|
await pruneCache();
|
||||||
@@ -74,7 +75,7 @@ async function saveCache(inputs: SetupInputs): Promise<void> {
|
|||||||
const actualCachePath = getUvCachePath(inputs);
|
const actualCachePath = getUvCachePath(inputs);
|
||||||
if (!fs.existsSync(actualCachePath)) {
|
if (!fs.existsSync(actualCachePath)) {
|
||||||
if (inputs.ignoreNothingToCache) {
|
if (inputs.ignoreNothingToCache) {
|
||||||
core.info(
|
log.info(
|
||||||
"No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled.",
|
"No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled.",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -94,7 +95,7 @@ async function saveCache(inputs: SetupInputs): Promise<void> {
|
|||||||
|
|
||||||
if (inputs.cachePython) {
|
if (inputs.cachePython) {
|
||||||
if (!fs.existsSync(inputs.pythonDir)) {
|
if (!fs.existsSync(inputs.pythonDir)) {
|
||||||
core.warning(
|
log.warning(
|
||||||
`Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`,
|
`Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -121,7 +122,7 @@ async function pruneCache(): Promise<void> {
|
|||||||
execArgs.push("--force");
|
execArgs.push("--force");
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info("Pruning cache...");
|
log.info("Pruning cache...");
|
||||||
const uvPath = core.getState(STATE_UV_PATH);
|
const uvPath = core.getState(STATE_UV_PATH);
|
||||||
await exec.exec(uvPath, execArgs, options);
|
await exec.exec(uvPath, execArgs, options);
|
||||||
}
|
}
|
||||||
@@ -136,7 +137,7 @@ function getUvCachePath(inputs: SetupInputs): string {
|
|||||||
process.env.UV_CACHE_DIR &&
|
process.env.UV_CACHE_DIR &&
|
||||||
process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path
|
process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path
|
||||||
) {
|
) {
|
||||||
core.warning(
|
log.warning(
|
||||||
`The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".`,
|
`The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".`,
|
||||||
);
|
);
|
||||||
return process.env.UV_CACHE_DIR;
|
return process.env.UV_CACHE_DIR;
|
||||||
@@ -153,15 +154,13 @@ async function saveCacheToKey(
|
|||||||
const matchedKey = core.getState(stateKey);
|
const matchedKey = core.getState(stateKey);
|
||||||
|
|
||||||
if (matchedKey === cacheKey) {
|
if (matchedKey === cacheKey) {
|
||||||
core.info(
|
log.info(`${cacheName} hit occurred on key ${cacheKey}, not saving cache.`);
|
||||||
`${cacheName} hit occurred on key ${cacheKey}, not saving cache.`,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Including ${cacheName} path: ${cachePath}`);
|
log.info(`Including ${cacheName} path: ${cachePath}`);
|
||||||
await cache.saveCache([cachePath], cacheKey);
|
await cache.saveCache([cachePath], cacheKey);
|
||||||
core.info(`${cacheName} saved with key: ${cacheKey}`);
|
log.info(`${cacheName} saved with key: ${cacheKey}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
run();
|
run();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
} from "./download/download-version";
|
} from "./download/download-version";
|
||||||
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
||||||
import { CacheLocalSource, loadInputs, type SetupInputs } from "./utils/inputs";
|
import { CacheLocalSource, loadInputs, type SetupInputs } from "./utils/inputs";
|
||||||
|
import * as log from "./utils/logging";
|
||||||
import {
|
import {
|
||||||
type Architecture,
|
type Architecture,
|
||||||
getArch,
|
getArch,
|
||||||
@@ -96,7 +97,7 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
core.setOutput("uv-version", setupResult.version);
|
core.setOutput("uv-version", setupResult.version);
|
||||||
core.saveState(STATE_UV_VERSION, setupResult.version);
|
core.saveState(STATE_UV_VERSION, setupResult.version);
|
||||||
core.info(`Successfully installed uv version ${setupResult.version}`);
|
log.info(`Successfully installed uv version ${setupResult.version}`);
|
||||||
|
|
||||||
const detectedPythonVersion = await getPythonVersion(inputs);
|
const detectedPythonVersion = await getPythonVersion(inputs);
|
||||||
core.setOutput("python-version", detectedPythonVersion);
|
core.setOutput("python-version", detectedPythonVersion);
|
||||||
@@ -115,11 +116,11 @@ async function run(): Promise<void> {
|
|||||||
function detectEmptyWorkdir(inputs: SetupInputs): void {
|
function detectEmptyWorkdir(inputs: SetupInputs): void {
|
||||||
if (fs.readdirSync(inputs.workingDirectory).length === 0) {
|
if (fs.readdirSync(inputs.workingDirectory).length === 0) {
|
||||||
if (inputs.ignoreEmptyWorkdir) {
|
if (inputs.ignoreEmptyWorkdir) {
|
||||||
core.info(
|
log.info(
|
||||||
"Empty workdir detected. Ignoring because ignore-empty-workdir is enabled",
|
"Empty workdir detected. Ignoring because ignore-empty-workdir is enabled",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
core.warning(
|
log.warning(
|
||||||
"Empty workdir detected. This may cause unexpected behavior. You can enable ignore-empty-workdir to mute this warning.",
|
"Empty workdir detected. This may cause unexpected behavior. You can enable ignore-empty-workdir to mute this warning.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -140,7 +141,7 @@ async function setupUv(
|
|||||||
});
|
});
|
||||||
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
|
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
|
||||||
if (toolCacheResult.installedPath) {
|
if (toolCacheResult.installedPath) {
|
||||||
core.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
|
log.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
|
||||||
return {
|
return {
|
||||||
uvDir: toolCacheResult.installedPath,
|
uvDir: toolCacheResult.installedPath,
|
||||||
version: toolCacheResult.version,
|
version: toolCacheResult.version,
|
||||||
@@ -168,39 +169,39 @@ function addUvToPathAndOutput(cachedPath: string): void {
|
|||||||
core.saveState(STATE_UV_PATH, `${cachedPath}${path.sep}uv`);
|
core.saveState(STATE_UV_PATH, `${cachedPath}${path.sep}uv`);
|
||||||
core.setOutput("uvx-path", `${cachedPath}${path.sep}uvx`);
|
core.setOutput("uvx-path", `${cachedPath}${path.sep}uvx`);
|
||||||
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
||||||
core.info("UV_NO_MODIFY_PATH is set, not modifying PATH");
|
log.info("UV_NO_MODIFY_PATH is set, not modifying PATH");
|
||||||
} else {
|
} else {
|
||||||
core.addPath(cachedPath);
|
core.addPath(cachedPath);
|
||||||
core.info(`Added ${cachedPath} to the path`);
|
log.info(`Added ${cachedPath} to the path`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToolBinToPath(inputs: SetupInputs): void {
|
function addToolBinToPath(inputs: SetupInputs): void {
|
||||||
if (inputs.toolBinDir !== undefined) {
|
if (inputs.toolBinDir !== undefined) {
|
||||||
core.exportVariable("UV_TOOL_BIN_DIR", inputs.toolBinDir);
|
core.exportVariable("UV_TOOL_BIN_DIR", inputs.toolBinDir);
|
||||||
core.info(`Set UV_TOOL_BIN_DIR to ${inputs.toolBinDir}`);
|
log.info(`Set UV_TOOL_BIN_DIR to ${inputs.toolBinDir}`);
|
||||||
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
||||||
core.info(
|
log.info(
|
||||||
`UV_NO_MODIFY_PATH is set, not adding ${inputs.toolBinDir} to path`,
|
`UV_NO_MODIFY_PATH is set, not adding ${inputs.toolBinDir} to path`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
core.addPath(inputs.toolBinDir);
|
core.addPath(inputs.toolBinDir);
|
||||||
core.info(`Added ${inputs.toolBinDir} to the path`);
|
log.info(`Added ${inputs.toolBinDir} to the path`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
||||||
core.info("UV_NO_MODIFY_PATH is set, not adding user local bin to path");
|
log.info("UV_NO_MODIFY_PATH is set, not adding user local bin to path");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (process.env.XDG_BIN_HOME !== undefined) {
|
if (process.env.XDG_BIN_HOME !== undefined) {
|
||||||
core.addPath(process.env.XDG_BIN_HOME);
|
core.addPath(process.env.XDG_BIN_HOME);
|
||||||
core.info(`Added ${process.env.XDG_BIN_HOME} to the path`);
|
log.info(`Added ${process.env.XDG_BIN_HOME} to the path`);
|
||||||
} else if (process.env.XDG_DATA_HOME !== undefined) {
|
} else if (process.env.XDG_DATA_HOME !== undefined) {
|
||||||
core.addPath(`${process.env.XDG_DATA_HOME}/../bin`);
|
core.addPath(`${process.env.XDG_DATA_HOME}/../bin`);
|
||||||
core.info(`Added ${process.env.XDG_DATA_HOME}/../bin to the path`);
|
log.info(`Added ${process.env.XDG_DATA_HOME}/../bin to the path`);
|
||||||
} else {
|
} else {
|
||||||
core.addPath(`${process.env.HOME}/.local/bin`);
|
core.addPath(`${process.env.HOME}/.local/bin`);
|
||||||
core.info(`Added ${process.env.HOME}/.local/bin to the path`);
|
log.info(`Added ${process.env.HOME}/.local/bin to the path`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,25 +209,25 @@ function addToolBinToPath(inputs: SetupInputs): void {
|
|||||||
function setToolDir(inputs: SetupInputs): void {
|
function setToolDir(inputs: SetupInputs): void {
|
||||||
if (inputs.toolDir !== undefined) {
|
if (inputs.toolDir !== undefined) {
|
||||||
core.exportVariable("UV_TOOL_DIR", inputs.toolDir);
|
core.exportVariable("UV_TOOL_DIR", inputs.toolDir);
|
||||||
core.info(`Set UV_TOOL_DIR to ${inputs.toolDir}`);
|
log.info(`Set UV_TOOL_DIR to ${inputs.toolDir}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPythonDirToPath(inputs: SetupInputs): void {
|
function addPythonDirToPath(inputs: SetupInputs): void {
|
||||||
core.exportVariable("UV_PYTHON_INSTALL_DIR", inputs.pythonDir);
|
core.exportVariable("UV_PYTHON_INSTALL_DIR", inputs.pythonDir);
|
||||||
core.info(`Set UV_PYTHON_INSTALL_DIR to ${inputs.pythonDir}`);
|
log.info(`Set UV_PYTHON_INSTALL_DIR to ${inputs.pythonDir}`);
|
||||||
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
|
||||||
core.info("UV_NO_MODIFY_PATH is set, not adding python dir to path");
|
log.info("UV_NO_MODIFY_PATH is set, not adding python dir to path");
|
||||||
} else {
|
} else {
|
||||||
core.addPath(inputs.pythonDir);
|
core.addPath(inputs.pythonDir);
|
||||||
core.info(`Added ${inputs.pythonDir} to the path`);
|
log.info(`Added ${inputs.pythonDir} to the path`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupPython(inputs: SetupInputs): void {
|
function setupPython(inputs: SetupInputs): void {
|
||||||
if (inputs.pythonVersion !== "") {
|
if (inputs.pythonVersion !== "") {
|
||||||
core.exportVariable("UV_PYTHON", inputs.pythonVersion);
|
core.exportVariable("UV_PYTHON", inputs.pythonVersion);
|
||||||
core.info(`Set UV_PYTHON to ${inputs.pythonVersion}`);
|
log.info(`Set UV_PYTHON to ${inputs.pythonVersion}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +239,7 @@ async function activateEnvironment(inputs: SetupInputs): Promise<void> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Creating and activating python venv at ${inputs.venvPath}...`);
|
log.info(`Creating and activating python venv at ${inputs.venvPath}...`);
|
||||||
const venvArgs = [
|
const venvArgs = [
|
||||||
"venv",
|
"venv",
|
||||||
inputs.venvPath,
|
inputs.venvPath,
|
||||||
@@ -264,13 +265,13 @@ async function activateEnvironment(inputs: SetupInputs): Promise<void> {
|
|||||||
function setCacheDir(inputs: SetupInputs): void {
|
function setCacheDir(inputs: SetupInputs): void {
|
||||||
if (inputs.cacheLocalPath !== undefined) {
|
if (inputs.cacheLocalPath !== undefined) {
|
||||||
if (inputs.cacheLocalPath.source === CacheLocalSource.Config) {
|
if (inputs.cacheLocalPath.source === CacheLocalSource.Config) {
|
||||||
core.info(
|
log.info(
|
||||||
"Using cache-dir from uv config file, not modifying UV_CACHE_DIR",
|
"Using cache-dir from uv config file, not modifying UV_CACHE_DIR",
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.exportVariable("UV_CACHE_DIR", inputs.cacheLocalPath.path);
|
core.exportVariable("UV_CACHE_DIR", inputs.cacheLocalPath.path);
|
||||||
core.info(`Set UV_CACHE_DIR to ${inputs.cacheLocalPath.path}`);
|
log.info(`Set UV_CACHE_DIR to ${inputs.cacheLocalPath.path}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
getLatestVersion,
|
getLatestVersion,
|
||||||
type ManifestVersion,
|
type ManifestVersion,
|
||||||
} from "./download/manifest";
|
} from "./download/manifest";
|
||||||
|
import * as log from "./utils/logging";
|
||||||
|
|
||||||
const VERSION_IN_CHECKSUM_KEY_PATTERN =
|
const VERSION_IN_CHECKSUM_KEY_PATTERN =
|
||||||
/-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/;
|
/-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/;
|
||||||
@@ -26,7 +27,7 @@ async function run(): Promise<void> {
|
|||||||
const latestKnownVersion = getLatestKnownVersionFromChecksums();
|
const latestKnownVersion = getLatestKnownVersionFromChecksums();
|
||||||
|
|
||||||
if (semver.lte(latestVersion, latestKnownVersion)) {
|
if (semver.lte(latestVersion, latestKnownVersion)) {
|
||||||
core.info(
|
log.info(
|
||||||
`Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`,
|
`Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.`,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { getConfigValueFromTomlFile } from "./config-file";
|
import { getConfigValueFromTomlFile } from "./config-file";
|
||||||
|
import * as log from "./logging";
|
||||||
|
|
||||||
export enum CacheLocalSource {
|
export enum CacheLocalSource {
|
||||||
Input,
|
Input,
|
||||||
@@ -42,6 +43,7 @@ export interface SetupInputs {
|
|||||||
manifestFile?: string;
|
manifestFile?: string;
|
||||||
downloadFromAstralMirror: boolean;
|
downloadFromAstralMirror: boolean;
|
||||||
addProblemMatchers: boolean;
|
addProblemMatchers: boolean;
|
||||||
|
quiet: boolean;
|
||||||
resolutionStrategy: ResolutionStrategy;
|
resolutionStrategy: ResolutionStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +79,7 @@ export function loadInputs(): SetupInputs {
|
|||||||
const downloadFromAstralMirror =
|
const downloadFromAstralMirror =
|
||||||
core.getInput("download-from-astral-mirror") === "true";
|
core.getInput("download-from-astral-mirror") === "true";
|
||||||
const addProblemMatchers = core.getInput("add-problem-matchers") === "true";
|
const addProblemMatchers = core.getInput("add-problem-matchers") === "true";
|
||||||
|
const quiet = core.getInput("quiet") === "true";
|
||||||
const resolutionStrategy = getResolutionStrategy();
|
const resolutionStrategy = getResolutionStrategy();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -97,6 +100,7 @@ export function loadInputs(): SetupInputs {
|
|||||||
pruneCache,
|
pruneCache,
|
||||||
pythonDir,
|
pythonDir,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
|
quiet,
|
||||||
resolutionStrategy,
|
resolutionStrategy,
|
||||||
restoreCache,
|
restoreCache,
|
||||||
saveCache,
|
saveCache,
|
||||||
@@ -125,7 +129,7 @@ function getVenvPath(
|
|||||||
const venvPathInput = core.getInput("venv-path");
|
const venvPathInput = core.getInput("venv-path");
|
||||||
if (venvPathInput !== "") {
|
if (venvPathInput !== "") {
|
||||||
if (!activateEnvironment) {
|
if (!activateEnvironment) {
|
||||||
core.warning("venv-path is only used when activate-environment is true");
|
log.warning("venv-path is only used when activate-environment is true");
|
||||||
}
|
}
|
||||||
const tildeExpanded = expandTilde(venvPathInput);
|
const tildeExpanded = expandTilde(venvPathInput);
|
||||||
return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded));
|
return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded));
|
||||||
@@ -196,7 +200,7 @@ function getCacheLocalPath(
|
|||||||
return { path: cacheDirFromConfig, source: CacheLocalSource.Config };
|
return { path: cacheDirFromConfig, source: CacheLocalSource.Config };
|
||||||
}
|
}
|
||||||
if (process.env.UV_CACHE_DIR !== undefined) {
|
if (process.env.UV_CACHE_DIR !== undefined) {
|
||||||
core.info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`);
|
log.info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`);
|
||||||
return { path: process.env.UV_CACHE_DIR, source: CacheLocalSource.Env };
|
return { path: process.env.UV_CACHE_DIR, source: CacheLocalSource.Env };
|
||||||
}
|
}
|
||||||
if (enableCache) {
|
if (enableCache) {
|
||||||
@@ -233,12 +237,12 @@ function getCacheDirFromConfig(
|
|||||||
try {
|
try {
|
||||||
const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir");
|
const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir");
|
||||||
if (cacheDir !== undefined) {
|
if (cacheDir !== undefined) {
|
||||||
core.info(`Found cache-dir in ${resolvedPath}: ${cacheDir}`);
|
log.info(`Found cache-dir in ${resolvedPath}: ${cacheDir}`);
|
||||||
return cacheDir;
|
return cacheDir;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = (err as Error).message;
|
const message = (err as Error).message;
|
||||||
core.warning(`Error while parsing ${filePath}: ${message}`);
|
log.warning(`Error while parsing ${filePath}: ${message}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,7 +251,7 @@ function getCacheDirFromConfig(
|
|||||||
|
|
||||||
export function getUvPythonDir(): string {
|
export function getUvPythonDir(): string {
|
||||||
if (process.env.UV_PYTHON_INSTALL_DIR !== undefined) {
|
if (process.env.UV_PYTHON_INSTALL_DIR !== undefined) {
|
||||||
core.info(
|
log.info(
|
||||||
`UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}`,
|
`UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}`,
|
||||||
);
|
);
|
||||||
return process.env.UV_PYTHON_INSTALL_DIR;
|
return process.env.UV_PYTHON_INSTALL_DIR;
|
||||||
|
|||||||
21
src/utils/logging.ts
Normal file
21
src/utils/logging.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
|
let quiet: boolean | undefined;
|
||||||
|
|
||||||
|
function isQuiet(): boolean {
|
||||||
|
if (quiet === undefined) {
|
||||||
|
quiet =
|
||||||
|
typeof core.getInput === "function" && core.getInput("quiet") === "true";
|
||||||
|
}
|
||||||
|
return quiet;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function info(msg: string): void {
|
||||||
|
if (!isQuiet()) {
|
||||||
|
core.info(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const warning = core.warning;
|
||||||
|
export const error = core.error;
|
||||||
|
export const debug = core.debug;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import * as core from "@actions/core";
|
|
||||||
import { getConfigValueFromTomlContent } from "../utils/config-file";
|
import { getConfigValueFromTomlContent } from "../utils/config-file";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
import {
|
import {
|
||||||
getUvVersionFromParsedPyproject,
|
getUvVersionFromParsedPyproject,
|
||||||
getUvVersionFromRequirementsText,
|
getUvVersionFromRequirementsText,
|
||||||
@@ -62,10 +62,10 @@ const VERSION_FILE_PARSERS: VersionFileParser[] = [
|
|||||||
export function getParsedVersionFile(
|
export function getParsedVersionFile(
|
||||||
filePath: string,
|
filePath: string,
|
||||||
): ParsedVersionFile | undefined {
|
): ParsedVersionFile | undefined {
|
||||||
core.info(`Trying to find version for uv in: ${filePath}`);
|
log.info(`Trying to find version for uv in: ${filePath}`);
|
||||||
|
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
core.info(`Could not find file: ${filePath}`);
|
log.info(`Could not find file: ${filePath}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,15 +81,13 @@ export function getParsedVersionFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const normalizedSpecifier = normalizeVersionSpecifier(specifier);
|
const normalizedSpecifier = normalizeVersionSpecifier(specifier);
|
||||||
core.info(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
|
log.info(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
|
||||||
return {
|
return {
|
||||||
format: parser.format,
|
format: parser.format,
|
||||||
specifier: normalizedSpecifier,
|
specifier: normalizedSpecifier,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.warning(
|
log.warning(`Error while parsing ${filePath}: ${(error as Error).message}`);
|
||||||
`Error while parsing ${filePath}: ${(error as Error).message}`,
|
|
||||||
);
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as pep440 from "@renovatebot/pep440";
|
|||||||
import * as semver from "semver";
|
import * as semver from "semver";
|
||||||
import { getAllVersions, getLatestVersion } from "../download/manifest";
|
import { getAllVersions, getLatestVersion } from "../download/manifest";
|
||||||
import type { ResolutionStrategy } from "../utils/inputs";
|
import type { ResolutionStrategy } from "../utils/inputs";
|
||||||
|
import * as log from "../utils/logging";
|
||||||
import {
|
import {
|
||||||
type ParsedVersionSpecifier,
|
type ParsedVersionSpecifier,
|
||||||
parseVersionSpecifier,
|
parseVersionSpecifier,
|
||||||
@@ -56,7 +57,7 @@ class LatestVersionResolver implements ConcreteVersionResolver {
|
|||||||
context.parsedSpecifier.kind === "range" &&
|
context.parsedSpecifier.kind === "range" &&
|
||||||
context.parsedSpecifier.isSimpleMinimumVersionSpecifier
|
context.parsedSpecifier.isSimpleMinimumVersionSpecifier
|
||||||
) {
|
) {
|
||||||
core.info("Found minimum version specifier, using latest version");
|
log.info("Found minimum version specifier, using latest version");
|
||||||
}
|
}
|
||||||
|
|
||||||
const latestVersion = await getLatestVersion(context.manifestUrl);
|
const latestVersion = await getLatestVersion(context.manifestUrl);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import * as core from "@actions/core";
|
import * as log from "../utils/logging";
|
||||||
import { getParsedVersionFile } from "./file-parser";
|
import { getParsedVersionFile } from "./file-parser";
|
||||||
import { normalizeVersionSpecifier } from "./specifier";
|
import { normalizeVersionSpecifier } from "./specifier";
|
||||||
import type {
|
import type {
|
||||||
@@ -111,7 +111,7 @@ export class WorkspaceVersionResolver implements VersionRequestResolver {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info(
|
log.info(
|
||||||
"Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest.",
|
"Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest.",
|
||||||
);
|
);
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user